resources_js_pages_Sales_Index_vue.js 678KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196
  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/AppSidebar.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/AppSidebar.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 _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  114. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  115. __name: 'AppSidebar',
  116. props: {
  117. menu: Array
  118. },
  119. setup: function setup(__props, _ref) {
  120. var expose = _ref.expose;
  121. expose();
  122. var __returned__ = {
  123. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  124. };
  125. Object.defineProperty(__returned__, '__isScriptSetup', {
  126. enumerable: false,
  127. value: true
  128. });
  129. return __returned__;
  130. }
  131. });
  132. /***/ }),
  133. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  134. /*!******************************************************************************************************************************************************************************************************************!*\
  135. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  136. \******************************************************************************************************************************************************************************************************************/
  137. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  138. "use strict";
  139. __webpack_require__.r(__webpack_exports__);
  140. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  141. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  142. /* harmony export */ });
  143. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  144. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  145. __name: 'AppSubSidebar',
  146. props: {
  147. items: Array,
  148. root: {
  149. type: Boolean,
  150. "default": false
  151. }
  152. },
  153. setup: function setup(__props, _ref) {
  154. var expose = _ref.expose;
  155. expose();
  156. var __returned__ = {
  157. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  158. };
  159. Object.defineProperty(__returned__, '__isScriptSetup', {
  160. enumerable: false,
  161. value: true
  162. });
  163. return __returned__;
  164. }
  165. });
  166. /***/ }),
  167. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  168. /*!**************************************************************************************************************************************************************************************************************!*\
  169. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  170. \**************************************************************************************************************************************************************************************************************/
  171. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  172. "use strict";
  173. __webpack_require__.r(__webpack_exports__);
  174. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  175. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  176. /* harmony export */ });
  177. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  178. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  179. __name: 'AppTopBar',
  180. emits: ['menu-toggle'],
  181. setup: function setup(__props, _ref) {
  182. var expose = _ref.expose;
  183. expose();
  184. var __returned__ = {
  185. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  186. };
  187. Object.defineProperty(__returned__, '__isScriptSetup', {
  188. enumerable: false,
  189. value: true
  190. });
  191. return __returned__;
  192. }
  193. });
  194. /***/ }),
  195. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  196. /*!*****************************************************************************************************************************************************************************************************************!*\
  197. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  198. \*****************************************************************************************************************************************************************************************************************/
  199. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  200. "use strict";
  201. __webpack_require__.r(__webpack_exports__);
  202. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  203. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  204. /* harmony export */ });
  205. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  206. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  207. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  208. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  209. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  210. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  211. __name: 'DashboardLayout',
  212. setup: function setup(__props, _ref) {
  213. var expose = _ref.expose;
  214. expose();
  215. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  218. var isDesktop = function isDesktop() {
  219. return window.innerWidth >= 992;
  220. };
  221. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  222. return ['layout-wrapper', {
  223. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  224. 'layout-mobile-sidebar-active': mobileMenuActive.value
  225. }];
  226. });
  227. var onWrapperClick = function onWrapperClick() {
  228. if (!menuClick.value) {
  229. mobileMenuActive.value = false;
  230. }
  231. menuClick.value = false;
  232. };
  233. var onMenuToggle = function onMenuToggle(event) {
  234. menuClick.value = true;
  235. if (isDesktop()) {
  236. staticMenuInactive.value = !staticMenuInactive.value;
  237. } else {
  238. mobileMenuActive.value = !mobileMenuActive.value;
  239. }
  240. event.preventDefault();
  241. };
  242. var __returned__ = {
  243. mobileMenuActive: mobileMenuActive,
  244. staticMenuInactive: staticMenuInactive,
  245. menuClick: menuClick,
  246. isDesktop: isDesktop,
  247. containerClass: containerClass,
  248. onWrapperClick: onWrapperClick,
  249. onMenuToggle: onMenuToggle,
  250. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  251. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  252. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  253. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_4__["default"]
  256. };
  257. Object.defineProperty(__returned__, '__isScriptSetup', {
  258. enumerable: false,
  259. value: true
  260. });
  261. return __returned__;
  262. }
  263. });
  264. /***/ }),
  265. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js":
  266. /*!***********************************************************************************************************************************************************************************************************!*\
  267. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js ***!
  268. \***********************************************************************************************************************************************************************************************************/
  269. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  270. "use strict";
  271. __webpack_require__.r(__webpack_exports__);
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  276. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  277. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  278. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  279. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  280. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Sales/config.js");
  281. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  282. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  283. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  284. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  285. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  286. __name: 'Index',
  287. props: {
  288. sales: Object,
  289. initialSearch: String
  290. },
  291. setup: function setup(__props, _ref) {
  292. var expose = _ref.expose;
  293. expose();
  294. var props = __props;
  295. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  296. search = _useSearchText.search;
  297. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  298. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/sales', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var __returned__ = {
  305. props: props,
  306. search: search,
  307. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  310. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  311. tableHeader: _config__WEBPACK_IMPORTED_MODULE_4__.tableHeader,
  312. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  313. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  314. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  316. };
  317. Object.defineProperty(__returned__, '__isScriptSetup', {
  318. enumerable: false,
  319. value: true
  320. });
  321. return __returned__;
  322. }
  323. });
  324. /***/ }),
  325. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  326. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  327. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  328. \***********************************************************************************************************************************************************************************************************************************************************************************/
  329. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  330. "use strict";
  331. __webpack_require__.r(__webpack_exports__);
  332. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  333. /* harmony export */ "render": () => (/* binding */ render)
  334. /* harmony export */ });
  335. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  336. var _hoisted_1 = {
  337. key: 1,
  338. "class": "p-button-label"
  339. };
  340. var _hoisted_2 = {
  341. key: 1,
  342. "class": "p-button p-component"
  343. };
  344. var _hoisted_3 = {
  345. key: 1,
  346. "class": "p-button-label"
  347. };
  348. function render(_ctx, _cache, $props, $setup, $data, $options) {
  349. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  350. key: 0,
  351. "class": "p-button p-component",
  352. as: "button",
  353. type: "button"
  354. }, {
  355. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  356. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  357. key: 0,
  358. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  359. }, null, 2
  360. /* CLASS */
  361. )) : (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
  362. /* TEXT */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  364. }),
  365. _: 1
  366. /* STABLE */
  367. })) : ((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", {
  368. key: 0,
  369. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  370. }, null, 2
  371. /* CLASS */
  372. )) : (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
  373. /* TEXT */
  374. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  375. }
  376. /***/ }),
  377. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  378. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  379. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  380. \********************************************************************************************************************************************************************************************************************************************************************************/
  381. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  382. "use strict";
  383. __webpack_require__.r(__webpack_exports__);
  384. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  385. /* harmony export */ "render": () => (/* binding */ render)
  386. /* harmony export */ });
  387. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  388. var _hoisted_1 = {
  389. key: 0
  390. };
  391. var _hoisted_2 = {
  392. key: 1
  393. };
  394. function render(_ctx, _cache, $props, $setup, $data, $options) {
  395. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  396. 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, {
  397. key: 0,
  398. severity: "success",
  399. onClose: $setup.onClose
  400. }, {
  401. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  402. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  403. /* TEXT */
  404. )];
  405. }),
  406. _: 1
  407. /* STABLE */
  408. })) : (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, {
  409. key: 1,
  410. severity: "error",
  411. onClose: $setup.onClose
  412. }, {
  413. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  414. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  415. /* TEXT */
  416. )];
  417. }),
  418. _: 1
  419. /* STABLE */
  420. })) : (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, {
  421. key: 2,
  422. severity: "error",
  423. onClose: $setup.onClose
  424. }, {
  425. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  426. 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
  427. /* TEXT */
  428. ))];
  429. }),
  430. _: 1
  431. /* STABLE */
  432. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  433. /* STABLE_FRAGMENT */
  434. );
  435. }
  436. /***/ }),
  437. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  438. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  439. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  440. \***********************************************************************************************************************************************************************************************************************************************************************************/
  441. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  442. "use strict";
  443. __webpack_require__.r(__webpack_exports__);
  444. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  445. /* harmony export */ "render": () => (/* binding */ render)
  446. /* harmony export */ });
  447. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  448. var _hoisted_1 = {
  449. key: 0,
  450. "class": "p-paginator p-component flex justify-content-start"
  451. };
  452. var _hoisted_2 = {
  453. "class": "p-paginator-pages"
  454. };
  455. var _hoisted_3 = ["innerHTML"];
  456. function render(_ctx, _cache, $props, $setup, $data, $options) {
  457. 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) {
  458. 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", {
  459. key: "link-".concat(key),
  460. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  461. 'p-disabled': link
  462. }]),
  463. innerHTML: link.label
  464. }, null, 10
  465. /* CLASS, PROPS */
  466. , _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"], {
  467. key: "link-".concat(key),
  468. href: link.url,
  469. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  470. 'p-highlight': link.active
  471. }, "p-paginator-page p-paginator-element p-link"]),
  472. innerHTML: link.label
  473. }, null, 8
  474. /* PROPS */
  475. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  476. /* STABLE_FRAGMENT */
  477. );
  478. }), 256
  479. /* UNKEYED_FRAGMENT */
  480. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  481. }
  482. /***/ }),
  483. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  484. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  485. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  486. \********************************************************************************************************************************************************************************************************************************************************************************************/
  487. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  488. "use strict";
  489. __webpack_require__.r(__webpack_exports__);
  490. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  491. /* harmony export */ "render": () => (/* binding */ render)
  492. /* harmony export */ });
  493. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  494. function render(_ctx, _cache, $props, $setup, $data, $options) {
  495. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  496. "class": "layout-menu",
  497. items: $props.menu,
  498. root: true
  499. }, null, 8
  500. /* PROPS */
  501. , ["items"])]);
  502. }
  503. /***/ }),
  504. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  505. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  506. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  507. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  508. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  509. "use strict";
  510. __webpack_require__.r(__webpack_exports__);
  511. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  512. /* harmony export */ "render": () => (/* binding */ render)
  513. /* harmony export */ });
  514. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  515. var _withScopeId = function _withScopeId(n) {
  516. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  517. };
  518. var _hoisted_1 = {
  519. key: 0
  520. };
  521. var _hoisted_2 = ["aria-label"];
  522. var _hoisted_3 = ["aria-label"];
  523. function render(_ctx, _cache, $props, $setup, $data, $options) {
  524. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  525. 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) {
  526. 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", {
  527. key: i,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'layout-menuitem-category': $props.root
  530. }]),
  531. role: "none"
  532. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  533. key: 0
  534. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  535. "class": "layout-menuitem-root-text",
  536. "aria-label": item.label
  537. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  538. /* TEXT, PROPS */
  539. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  540. items: item.items
  541. }, null, 8
  542. /* PROPS */
  543. , ["items"])], 64
  544. /* STABLE_FRAGMENT */
  545. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  546. key: 1
  547. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  548. key: 0,
  549. role: "menuitem",
  550. href: item.to,
  551. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  552. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  553. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  554. }]),
  555. "aria-label": item.label
  556. }, {
  557. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  558. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  559. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  560. }, null, 2
  561. /* CLASS */
  562. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  563. /* TEXT */
  564. )];
  565. }),
  566. _: 2
  567. /* DYNAMIC */
  568. }, 1032
  569. /* PROPS, DYNAMIC_SLOTS */
  570. , ["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", {
  571. key: 1,
  572. href: "#",
  573. role: "menuitem",
  574. "aria-label": item.label
  575. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  576. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  577. }, null, 2
  578. /* CLASS */
  579. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  580. /* TEXT */
  581. )], 8
  582. /* PROPS */
  583. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  584. items: item.items
  585. }, null, 8
  586. /* PROPS */
  587. , ["items"])], 64
  588. /* STABLE_FRAGMENT */
  589. ))], 2
  590. /* CLASS */
  591. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  592. /* STABLE_FRAGMENT */
  593. );
  594. }), 256
  595. /* UNKEYED_FRAGMENT */
  596. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  597. }
  598. /***/ }),
  599. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  600. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  601. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  602. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  603. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  604. "use strict";
  605. __webpack_require__.r(__webpack_exports__);
  606. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  607. /* harmony export */ "render": () => (/* binding */ render)
  608. /* harmony export */ });
  609. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  610. var _withScopeId = function _withScopeId(n) {
  611. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  612. };
  613. var _hoisted_1 = {
  614. "class": "layout-topbar"
  615. };
  616. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  617. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  618. alt: "Brand Logo",
  619. src: "/images/logo.svg",
  620. "class": "md:mr-3"
  621. }, null, -1
  622. /* HOISTED */
  623. );
  624. });
  625. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  626. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  627. /* HOISTED */
  628. );
  629. });
  630. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  631. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  632. "class": "pi pi-bars"
  633. }, null, -1
  634. /* HOISTED */
  635. );
  636. });
  637. var _hoisted_5 = [_hoisted_4];
  638. var _hoisted_6 = {
  639. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  640. };
  641. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  642. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  643. "class": "pi pi-ellipsis-v"
  644. }, null, -1
  645. /* HOISTED */
  646. );
  647. });
  648. var _hoisted_8 = [_hoisted_7];
  649. var _hoisted_9 = {
  650. "class": "layout-topbar-menu hidden lg:flex origin-top"
  651. };
  652. var _hoisted_10 = {
  653. "class": "align-self-center"
  654. };
  655. var _hoisted_11 = {
  656. "class": "hidden lg:inline"
  657. };
  658. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  659. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  660. "class": "pi pi-user"
  661. }, null, -1
  662. /* HOISTED */
  663. );
  664. });
  665. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  666. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  667. /* HOISTED */
  668. );
  669. });
  670. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  671. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  672. "class": "pi pi-sign-out"
  673. }, null, -1
  674. /* HOISTED */
  675. );
  676. });
  677. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  678. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  679. /* HOISTED */
  680. );
  681. });
  682. function render(_ctx, _cache, $props, $setup, $data, $options) {
  683. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  684. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  685. 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"], {
  686. href: "/",
  687. "class": "layout-topbar-logo"
  688. }, {
  689. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  690. return [_hoisted_2, _hoisted_3];
  691. }),
  692. _: 1
  693. /* STABLE */
  694. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  695. "class": "p-link layout-menu-button layout-topbar-button",
  696. onClick: _cache[0] || (_cache[0] = function ($event) {
  697. return _ctx.$emit('menu-toggle', $event);
  698. })
  699. }, _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, {
  700. selector: '@next',
  701. enterClass: 'hidden',
  702. enterActiveClass: 'scalein',
  703. leaveToClass: 'hidden',
  704. leaveActiveClass: 'fadeout',
  705. hideOnOutsideClick: true
  706. }]]), (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
  707. /* TEXT */
  708. )]), (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"], {
  709. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  710. "class": "p-link layout-topbar-button"
  711. }, {
  712. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  713. return [_hoisted_12, _hoisted_13];
  714. }),
  715. _: 1
  716. /* STABLE */
  717. }, 8
  718. /* PROPS */
  719. , ["href"])), [[_directive_tooltip, {
  720. value: 'Ubah Profil',
  721. "class": 'layout-topbar-menu-tooltip'
  722. }, void 0, {
  723. bottom: true
  724. }]])]), (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"], {
  725. href: _ctx.route('logout'),
  726. as: "button",
  727. method: "post",
  728. "class": "p-link layout-topbar-button"
  729. }, {
  730. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  731. return [_hoisted_14, _hoisted_15];
  732. }),
  733. _: 1
  734. /* STABLE */
  735. }, 8
  736. /* PROPS */
  737. , ["href"])), [[_directive_tooltip, {
  738. value: 'Keluar',
  739. "class": 'layout-topbar-menu-tooltip'
  740. }, void 0, {
  741. bottom: true
  742. }]])])])]);
  743. }
  744. /***/ }),
  745. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  746. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  747. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  748. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  749. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  750. "use strict";
  751. __webpack_require__.r(__webpack_exports__);
  752. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  753. /* harmony export */ "render": () => (/* binding */ render)
  754. /* harmony export */ });
  755. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  756. var _withScopeId = function _withScopeId(n) {
  757. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  758. };
  759. var _hoisted_1 = {
  760. "class": "layout-sidebar"
  761. };
  762. var _hoisted_2 = {
  763. "class": "layout-main-container"
  764. };
  765. var _hoisted_3 = {
  766. "class": "layout-main"
  767. };
  768. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  769. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  770. "class": "layout-footer"
  771. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by "), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  772. href: "https://dijitalcode.com",
  773. target: "_blank",
  774. "class": "font-medium ml-2"
  775. }, "DijitalCODE")], -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_5 = {
  780. key: 0,
  781. "class": "layout-mask p-component-overlay"
  782. };
  783. function render(_ctx, _cache, $props, $setup, $data, $options) {
  784. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  785. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  786. onClick: $setup.onWrapperClick
  787. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  788. onMenuToggle: $setup.onMenuToggle
  789. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  790. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  791. }, null, 8
  792. /* PROPS */
  793. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), _hoisted_4]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  794. name: "layout-mask"
  795. }, {
  796. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  797. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  798. }),
  799. _: 1
  800. /* STABLE */
  801. })], 2
  802. /* CLASS */
  803. );
  804. }
  805. /***/ }),
  806. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  807. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  808. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  809. \****************************************************************************************************************************************************************************************************************************************************************************/
  810. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  811. "use strict";
  812. __webpack_require__.r(__webpack_exports__);
  813. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  814. /* harmony export */ "render": () => (/* binding */ render)
  815. /* harmony export */ });
  816. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  817. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Penjualan", -1
  818. /* HOISTED */
  819. );
  820. var _hoisted_2 = {
  821. "class": "grid"
  822. };
  823. var _hoisted_3 = {
  824. "class": "col-12 md:col-8"
  825. };
  826. var _hoisted_4 = {
  827. "class": "flex align-items-center"
  828. };
  829. var _hoisted_5 = {
  830. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  831. };
  832. function render(_ctx, _cache, $props, $setup, $data, $options) {
  833. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  834. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  835. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  836. 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"], {
  837. title: "Daftar Penjualan"
  838. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  839. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  840. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  841. responsiveLayout: "scroll",
  842. columnResizeMode: "expand",
  843. value: $props.sales.data,
  844. rowHover: true,
  845. stripedRows: true
  846. }, {
  847. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  848. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  849. "class": "w-full md:w-27rem",
  850. placeholder: "cari, contoh: P0xx, Pending, Success",
  851. modelValue: $setup.search,
  852. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  853. return $setup.search = $event;
  854. })
  855. }, null, 8
  856. /* PROPS */
  857. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  858. label: "Tambah Penjualan",
  859. icon: "pi pi-pencil",
  860. "class": "p-button-outlined",
  861. href: _ctx.route('sales.create')
  862. }, null, 8
  863. /* PROPS */
  864. , ["href"])])])];
  865. }),
  866. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  867. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  868. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  869. field: value.field,
  870. header: value.header,
  871. key: value.field
  872. }, null, 8
  873. /* PROPS */
  874. , ["field", "header"]);
  875. }), 128
  876. /* KEYED_FRAGMENT */
  877. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  878. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  879. var data = _ref.data;
  880. return [];
  881. }),
  882. _: 1
  883. /* STABLE */
  884. })];
  885. }),
  886. _: 1
  887. /* STABLE */
  888. }, 8
  889. /* PROPS */
  890. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  891. links: $props.sales.links
  892. }, null, 8
  893. /* PROPS */
  894. , ["links"])];
  895. }),
  896. _: 1
  897. /* STABLE */
  898. })], 64
  899. /* STABLE_FRAGMENT */
  900. );
  901. }
  902. /***/ }),
  903. /***/ "./resources/js/components/useSearchText.js":
  904. /*!**************************************************!*\
  905. !*** ./resources/js/components/useSearchText.js ***!
  906. \**************************************************/
  907. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  908. "use strict";
  909. __webpack_require__.r(__webpack_exports__);
  910. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  911. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  912. /* harmony export */ });
  913. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  914. function useSearchText(props) {
  915. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  916. return {
  917. search: search
  918. };
  919. }
  920. /***/ }),
  921. /***/ "./resources/js/pages/Sales/config.js":
  922. /*!********************************************!*\
  923. !*** ./resources/js/pages/Sales/config.js ***!
  924. \********************************************/
  925. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  926. "use strict";
  927. __webpack_require__.r(__webpack_exports__);
  928. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  929. /* harmony export */ "dialogStyle": () => (/* binding */ dialogStyle),
  930. /* harmony export */ "optionStatus": () => (/* binding */ optionStatus),
  931. /* harmony export */ "tableHeader": () => (/* binding */ tableHeader)
  932. /* harmony export */ });
  933. var optionStatus = [{
  934. label: 'Pending',
  935. value: 'pending'
  936. }, {
  937. label: 'Berhasil',
  938. value: 'success'
  939. }];
  940. var tableHeader = [{
  941. field: 'updatedAt',
  942. header: 'Tanggal'
  943. }, {
  944. field: 'number',
  945. header: 'Nomor Penjualan'
  946. }, {
  947. field: 'status',
  948. header: 'Status'
  949. }, {
  950. field: 'price',
  951. header: 'Harga'
  952. }, {
  953. field: 'qty',
  954. header: 'Kuantitas'
  955. }, {
  956. field: 'productName',
  957. header: 'Nama Produk'
  958. }, {
  959. field: 'productNumber',
  960. header: 'Nomor Produk'
  961. }];
  962. var dialogStyle = {
  963. style: {
  964. width: '50vw'
  965. },
  966. breakpoints: {
  967. '960px': '75vw',
  968. '640px': '90vw'
  969. },
  970. modal: true
  971. };
  972. /***/ }),
  973. /***/ "./resources/js/utils/menu.js":
  974. /*!************************************!*\
  975. !*** ./resources/js/utils/menu.js ***!
  976. \************************************/
  977. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  978. "use strict";
  979. __webpack_require__.r(__webpack_exports__);
  980. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  981. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  982. /* harmony export */ });
  983. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  984. // Admin
  985. 1: [{
  986. label: 'Home',
  987. items: [{
  988. label: 'Dashboard',
  989. icon: 'pi pi-chart-bar',
  990. to: '/dashboards',
  991. component: 'Dashboards/Index'
  992. }]
  993. }, {
  994. label: 'Laporan',
  995. items: []
  996. }, {
  997. label: 'Master',
  998. items: [{
  999. label: 'User',
  1000. icon: 'pi pi-user',
  1001. to: '/users',
  1002. component: 'Users/Index'
  1003. }]
  1004. }],
  1005. // Supervisor
  1006. 2: [{
  1007. label: 'Home',
  1008. items: [{
  1009. label: 'Dashboard',
  1010. icon: 'pi pi-chart-bar',
  1011. to: '/dashboards',
  1012. component: 'Dashboards/Index'
  1013. }]
  1014. }, {
  1015. label: 'Master',
  1016. items: [{
  1017. label: 'Pelanggan',
  1018. icon: 'pi pi-users',
  1019. to: '/customers',
  1020. component: 'Customers/Index'
  1021. }, {
  1022. label: 'Pembelian',
  1023. icon: 'pi pi-shopping-cart',
  1024. to: '/purchases',
  1025. component: 'Purchases/Index'
  1026. }, {
  1027. label: 'Penjualan',
  1028. icon: 'pi pi-tag',
  1029. to: '/sales',
  1030. component: 'Sales/Index'
  1031. }, {
  1032. label: 'Produk',
  1033. icon: 'pi pi-th-large',
  1034. to: '/products',
  1035. component: 'Products/Index'
  1036. }]
  1037. }],
  1038. // Operator
  1039. 3: [{
  1040. label: 'Home',
  1041. items: [{
  1042. label: 'Dashboard',
  1043. icon: 'pi pi-chart-bar',
  1044. to: '/dashboards',
  1045. component: 'Dashboards/Index'
  1046. }]
  1047. }, {
  1048. label: 'Master',
  1049. items: [{
  1050. label: 'Supplier',
  1051. icon: 'pi pi-shopping-cart',
  1052. to: '/suppliers',
  1053. component: 'Suppliers/Index'
  1054. }, {
  1055. label: 'Stok Barang',
  1056. icon: 'pi pi-box',
  1057. to: '/stock-products',
  1058. component: 'StockProducts/Index'
  1059. }]
  1060. }]
  1061. });
  1062. /***/ }),
  1063. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1064. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1065. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1066. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1067. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1068. "use strict";
  1069. __webpack_require__.r(__webpack_exports__);
  1070. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1071. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1072. /* harmony export */ });
  1073. /* 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");
  1074. /* 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__);
  1075. // Imports
  1076. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1077. // Module
  1078. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1079. // Exports
  1080. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1081. /***/ }),
  1082. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1083. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1084. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1085. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1086. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1087. "use strict";
  1088. __webpack_require__.r(__webpack_exports__);
  1089. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1090. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1091. /* harmony export */ });
  1092. /* 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");
  1093. /* 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__);
  1094. // Imports
  1095. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1096. // Module
  1097. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1098. // Exports
  1099. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1100. /***/ }),
  1101. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1102. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1103. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1104. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1105. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1106. "use strict";
  1107. __webpack_require__.r(__webpack_exports__);
  1108. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1109. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1110. /* harmony export */ });
  1111. /* 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");
  1112. /* 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__);
  1113. // Imports
  1114. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1115. // Module
  1116. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1117. // Exports
  1118. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1119. /***/ }),
  1120. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1121. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1122. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1123. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1124. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1125. "use strict";
  1126. __webpack_require__.r(__webpack_exports__);
  1127. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1128. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1129. /* harmony export */ });
  1130. /* 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");
  1131. /* 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__);
  1132. // Imports
  1133. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1134. // Module
  1135. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-549bf5ac] {\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-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1136. // Exports
  1137. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1138. /***/ }),
  1139. /***/ "./node_modules/lodash/lodash.js":
  1140. /*!***************************************!*\
  1141. !*** ./node_modules/lodash/lodash.js ***!
  1142. \***************************************/
  1143. /***/ (function(module, exports, __webpack_require__) {
  1144. /* module decorator */ module = __webpack_require__.nmd(module);
  1145. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1146. * @license
  1147. * Lodash <https://lodash.com/>
  1148. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1149. * Released under MIT license <https://lodash.com/license>
  1150. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1151. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1152. */
  1153. ;(function() {
  1154. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1155. var undefined;
  1156. /** Used as the semantic version number. */
  1157. var VERSION = '4.17.21';
  1158. /** Used as the size to enable large array optimizations. */
  1159. var LARGE_ARRAY_SIZE = 200;
  1160. /** Error message constants. */
  1161. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1162. FUNC_ERROR_TEXT = 'Expected a function',
  1163. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1164. /** Used to stand-in for `undefined` hash values. */
  1165. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1166. /** Used as the maximum memoize cache size. */
  1167. var MAX_MEMOIZE_SIZE = 500;
  1168. /** Used as the internal argument placeholder. */
  1169. var PLACEHOLDER = '__lodash_placeholder__';
  1170. /** Used to compose bitmasks for cloning. */
  1171. var CLONE_DEEP_FLAG = 1,
  1172. CLONE_FLAT_FLAG = 2,
  1173. CLONE_SYMBOLS_FLAG = 4;
  1174. /** Used to compose bitmasks for value comparisons. */
  1175. var COMPARE_PARTIAL_FLAG = 1,
  1176. COMPARE_UNORDERED_FLAG = 2;
  1177. /** Used to compose bitmasks for function metadata. */
  1178. var WRAP_BIND_FLAG = 1,
  1179. WRAP_BIND_KEY_FLAG = 2,
  1180. WRAP_CURRY_BOUND_FLAG = 4,
  1181. WRAP_CURRY_FLAG = 8,
  1182. WRAP_CURRY_RIGHT_FLAG = 16,
  1183. WRAP_PARTIAL_FLAG = 32,
  1184. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1185. WRAP_ARY_FLAG = 128,
  1186. WRAP_REARG_FLAG = 256,
  1187. WRAP_FLIP_FLAG = 512;
  1188. /** Used as default options for `_.truncate`. */
  1189. var DEFAULT_TRUNC_LENGTH = 30,
  1190. DEFAULT_TRUNC_OMISSION = '...';
  1191. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1192. var HOT_COUNT = 800,
  1193. HOT_SPAN = 16;
  1194. /** Used to indicate the type of lazy iteratees. */
  1195. var LAZY_FILTER_FLAG = 1,
  1196. LAZY_MAP_FLAG = 2,
  1197. LAZY_WHILE_FLAG = 3;
  1198. /** Used as references for various `Number` constants. */
  1199. var INFINITY = 1 / 0,
  1200. MAX_SAFE_INTEGER = 9007199254740991,
  1201. MAX_INTEGER = 1.7976931348623157e+308,
  1202. NAN = 0 / 0;
  1203. /** Used as references for the maximum length and index of an array. */
  1204. var MAX_ARRAY_LENGTH = 4294967295,
  1205. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1206. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1207. /** Used to associate wrap methods with their bit flags. */
  1208. var wrapFlags = [
  1209. ['ary', WRAP_ARY_FLAG],
  1210. ['bind', WRAP_BIND_FLAG],
  1211. ['bindKey', WRAP_BIND_KEY_FLAG],
  1212. ['curry', WRAP_CURRY_FLAG],
  1213. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1214. ['flip', WRAP_FLIP_FLAG],
  1215. ['partial', WRAP_PARTIAL_FLAG],
  1216. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1217. ['rearg', WRAP_REARG_FLAG]
  1218. ];
  1219. /** `Object#toString` result references. */
  1220. var argsTag = '[object Arguments]',
  1221. arrayTag = '[object Array]',
  1222. asyncTag = '[object AsyncFunction]',
  1223. boolTag = '[object Boolean]',
  1224. dateTag = '[object Date]',
  1225. domExcTag = '[object DOMException]',
  1226. errorTag = '[object Error]',
  1227. funcTag = '[object Function]',
  1228. genTag = '[object GeneratorFunction]',
  1229. mapTag = '[object Map]',
  1230. numberTag = '[object Number]',
  1231. nullTag = '[object Null]',
  1232. objectTag = '[object Object]',
  1233. promiseTag = '[object Promise]',
  1234. proxyTag = '[object Proxy]',
  1235. regexpTag = '[object RegExp]',
  1236. setTag = '[object Set]',
  1237. stringTag = '[object String]',
  1238. symbolTag = '[object Symbol]',
  1239. undefinedTag = '[object Undefined]',
  1240. weakMapTag = '[object WeakMap]',
  1241. weakSetTag = '[object WeakSet]';
  1242. var arrayBufferTag = '[object ArrayBuffer]',
  1243. dataViewTag = '[object DataView]',
  1244. float32Tag = '[object Float32Array]',
  1245. float64Tag = '[object Float64Array]',
  1246. int8Tag = '[object Int8Array]',
  1247. int16Tag = '[object Int16Array]',
  1248. int32Tag = '[object Int32Array]',
  1249. uint8Tag = '[object Uint8Array]',
  1250. uint8ClampedTag = '[object Uint8ClampedArray]',
  1251. uint16Tag = '[object Uint16Array]',
  1252. uint32Tag = '[object Uint32Array]';
  1253. /** Used to match empty string literals in compiled template source. */
  1254. var reEmptyStringLeading = /\b__p \+= '';/g,
  1255. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1256. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1257. /** Used to match HTML entities and HTML characters. */
  1258. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1259. reUnescapedHtml = /[&<>"']/g,
  1260. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1261. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1262. /** Used to match template delimiters. */
  1263. var reEscape = /<%-([\s\S]+?)%>/g,
  1264. reEvaluate = /<%([\s\S]+?)%>/g,
  1265. reInterpolate = /<%=([\s\S]+?)%>/g;
  1266. /** Used to match property names within property paths. */
  1267. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1268. reIsPlainProp = /^\w*$/,
  1269. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1270. /**
  1271. * Used to match `RegExp`
  1272. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1273. */
  1274. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1275. reHasRegExpChar = RegExp(reRegExpChar.source);
  1276. /** Used to match leading whitespace. */
  1277. var reTrimStart = /^\s+/;
  1278. /** Used to match a single whitespace character. */
  1279. var reWhitespace = /\s/;
  1280. /** Used to match wrap detail comments. */
  1281. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1282. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1283. reSplitDetails = /,? & /;
  1284. /** Used to match words composed of alphanumeric characters. */
  1285. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1286. /**
  1287. * Used to validate the `validate` option in `_.template` variable.
  1288. *
  1289. * Forbids characters which could potentially change the meaning of the function argument definition:
  1290. * - "()," (modification of function parameters)
  1291. * - "=" (default value)
  1292. * - "[]{}" (destructuring of function parameters)
  1293. * - "/" (beginning of a comment)
  1294. * - whitespace
  1295. */
  1296. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1297. /** Used to match backslashes in property paths. */
  1298. var reEscapeChar = /\\(\\)?/g;
  1299. /**
  1300. * Used to match
  1301. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1302. */
  1303. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1304. /** Used to match `RegExp` flags from their coerced string values. */
  1305. var reFlags = /\w*$/;
  1306. /** Used to detect bad signed hexadecimal string values. */
  1307. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1308. /** Used to detect binary string values. */
  1309. var reIsBinary = /^0b[01]+$/i;
  1310. /** Used to detect host constructors (Safari). */
  1311. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1312. /** Used to detect octal string values. */
  1313. var reIsOctal = /^0o[0-7]+$/i;
  1314. /** Used to detect unsigned integer values. */
  1315. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1316. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1317. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1318. /** Used to ensure capturing order of template delimiters. */
  1319. var reNoMatch = /($^)/;
  1320. /** Used to match unescaped characters in compiled string literals. */
  1321. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1322. /** Used to compose unicode character classes. */
  1323. var rsAstralRange = '\\ud800-\\udfff',
  1324. rsComboMarksRange = '\\u0300-\\u036f',
  1325. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1326. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1327. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1328. rsDingbatRange = '\\u2700-\\u27bf',
  1329. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1330. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1331. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1332. rsPunctuationRange = '\\u2000-\\u206f',
  1333. 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',
  1334. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1335. rsVarRange = '\\ufe0e\\ufe0f',
  1336. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1337. /** Used to compose unicode capture groups. */
  1338. var rsApos = "['\u2019]",
  1339. rsAstral = '[' + rsAstralRange + ']',
  1340. rsBreak = '[' + rsBreakRange + ']',
  1341. rsCombo = '[' + rsComboRange + ']',
  1342. rsDigits = '\\d+',
  1343. rsDingbat = '[' + rsDingbatRange + ']',
  1344. rsLower = '[' + rsLowerRange + ']',
  1345. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1346. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1347. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1348. rsNonAstral = '[^' + rsAstralRange + ']',
  1349. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1350. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1351. rsUpper = '[' + rsUpperRange + ']',
  1352. rsZWJ = '\\u200d';
  1353. /** Used to compose unicode regexes. */
  1354. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1355. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1356. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1357. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1358. reOptMod = rsModifier + '?',
  1359. rsOptVar = '[' + rsVarRange + ']?',
  1360. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1361. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1362. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1363. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1364. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1365. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1366. /** Used to match apostrophes. */
  1367. var reApos = RegExp(rsApos, 'g');
  1368. /**
  1369. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1370. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1371. */
  1372. var reComboMark = RegExp(rsCombo, 'g');
  1373. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1374. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1375. /** Used to match complex or compound words. */
  1376. var reUnicodeWord = RegExp([
  1377. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1378. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1379. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1380. rsUpper + '+' + rsOptContrUpper,
  1381. rsOrdUpper,
  1382. rsOrdLower,
  1383. rsDigits,
  1384. rsEmoji
  1385. ].join('|'), 'g');
  1386. /** 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/). */
  1387. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1388. /** Used to detect strings that need a more robust regexp to match words. */
  1389. 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 ]/;
  1390. /** Used to assign default `context` object properties. */
  1391. var contextProps = [
  1392. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1393. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1394. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1395. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1396. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1397. ];
  1398. /** Used to make template sourceURLs easier to identify. */
  1399. var templateCounter = -1;
  1400. /** Used to identify `toStringTag` values of typed arrays. */
  1401. var typedArrayTags = {};
  1402. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1403. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1404. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1405. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1406. typedArrayTags[uint32Tag] = true;
  1407. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1408. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1409. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1410. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1411. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1412. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1413. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1414. typedArrayTags[weakMapTag] = false;
  1415. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1416. var cloneableTags = {};
  1417. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1418. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1419. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1420. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1421. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1422. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1423. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1424. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1425. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1426. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1427. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1428. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1429. cloneableTags[weakMapTag] = false;
  1430. /** Used to map Latin Unicode letters to basic Latin letters. */
  1431. var deburredLetters = {
  1432. // Latin-1 Supplement block.
  1433. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1434. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1435. '\xc7': 'C', '\xe7': 'c',
  1436. '\xd0': 'D', '\xf0': 'd',
  1437. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1438. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1439. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1440. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1441. '\xd1': 'N', '\xf1': 'n',
  1442. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1443. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1444. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1445. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1446. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1447. '\xc6': 'Ae', '\xe6': 'ae',
  1448. '\xde': 'Th', '\xfe': 'th',
  1449. '\xdf': 'ss',
  1450. // Latin Extended-A block.
  1451. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1452. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1453. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1454. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1455. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1456. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1457. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1458. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1459. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1460. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1461. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1462. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1463. '\u0134': 'J', '\u0135': 'j',
  1464. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1465. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1466. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1467. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1468. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1469. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1470. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1471. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1472. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1473. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1474. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1475. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1476. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1477. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1478. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1479. '\u0174': 'W', '\u0175': 'w',
  1480. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1481. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1482. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1483. '\u0132': 'IJ', '\u0133': 'ij',
  1484. '\u0152': 'Oe', '\u0153': 'oe',
  1485. '\u0149': "'n", '\u017f': 's'
  1486. };
  1487. /** Used to map characters to HTML entities. */
  1488. var htmlEscapes = {
  1489. '&': '&amp;',
  1490. '<': '&lt;',
  1491. '>': '&gt;',
  1492. '"': '&quot;',
  1493. "'": '&#39;'
  1494. };
  1495. /** Used to map HTML entities to characters. */
  1496. var htmlUnescapes = {
  1497. '&amp;': '&',
  1498. '&lt;': '<',
  1499. '&gt;': '>',
  1500. '&quot;': '"',
  1501. '&#39;': "'"
  1502. };
  1503. /** Used to escape characters for inclusion in compiled string literals. */
  1504. var stringEscapes = {
  1505. '\\': '\\',
  1506. "'": "'",
  1507. '\n': 'n',
  1508. '\r': 'r',
  1509. '\u2028': 'u2028',
  1510. '\u2029': 'u2029'
  1511. };
  1512. /** Built-in method references without a dependency on `root`. */
  1513. var freeParseFloat = parseFloat,
  1514. freeParseInt = parseInt;
  1515. /** Detect free variable `global` from Node.js. */
  1516. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1517. /** Detect free variable `self`. */
  1518. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1519. /** Used as a reference to the global object. */
  1520. var root = freeGlobal || freeSelf || Function('return this')();
  1521. /** Detect free variable `exports`. */
  1522. var freeExports = true && exports && !exports.nodeType && exports;
  1523. /** Detect free variable `module`. */
  1524. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1525. /** Detect the popular CommonJS extension `module.exports`. */
  1526. var moduleExports = freeModule && freeModule.exports === freeExports;
  1527. /** Detect free variable `process` from Node.js. */
  1528. var freeProcess = moduleExports && freeGlobal.process;
  1529. /** Used to access faster Node.js helpers. */
  1530. var nodeUtil = (function() {
  1531. try {
  1532. // Use `util.types` for Node.js 10+.
  1533. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1534. if (types) {
  1535. return types;
  1536. }
  1537. // Legacy `process.binding('util')` for Node.js < 10.
  1538. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1539. } catch (e) {}
  1540. }());
  1541. /* Node.js helper references. */
  1542. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1543. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1544. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1545. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1546. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1547. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1548. /*--------------------------------------------------------------------------*/
  1549. /**
  1550. * A faster alternative to `Function#apply`, this function invokes `func`
  1551. * with the `this` binding of `thisArg` and the arguments of `args`.
  1552. *
  1553. * @private
  1554. * @param {Function} func The function to invoke.
  1555. * @param {*} thisArg The `this` binding of `func`.
  1556. * @param {Array} args The arguments to invoke `func` with.
  1557. * @returns {*} Returns the result of `func`.
  1558. */
  1559. function apply(func, thisArg, args) {
  1560. switch (args.length) {
  1561. case 0: return func.call(thisArg);
  1562. case 1: return func.call(thisArg, args[0]);
  1563. case 2: return func.call(thisArg, args[0], args[1]);
  1564. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1565. }
  1566. return func.apply(thisArg, args);
  1567. }
  1568. /**
  1569. * A specialized version of `baseAggregator` for arrays.
  1570. *
  1571. * @private
  1572. * @param {Array} [array] The array to iterate over.
  1573. * @param {Function} setter The function to set `accumulator` values.
  1574. * @param {Function} iteratee The iteratee to transform keys.
  1575. * @param {Object} accumulator The initial aggregated object.
  1576. * @returns {Function} Returns `accumulator`.
  1577. */
  1578. function arrayAggregator(array, setter, iteratee, accumulator) {
  1579. var index = -1,
  1580. length = array == null ? 0 : array.length;
  1581. while (++index < length) {
  1582. var value = array[index];
  1583. setter(accumulator, value, iteratee(value), array);
  1584. }
  1585. return accumulator;
  1586. }
  1587. /**
  1588. * A specialized version of `_.forEach` for arrays without support for
  1589. * iteratee shorthands.
  1590. *
  1591. * @private
  1592. * @param {Array} [array] The array to iterate over.
  1593. * @param {Function} iteratee The function invoked per iteration.
  1594. * @returns {Array} Returns `array`.
  1595. */
  1596. function arrayEach(array, iteratee) {
  1597. var index = -1,
  1598. length = array == null ? 0 : array.length;
  1599. while (++index < length) {
  1600. if (iteratee(array[index], index, array) === false) {
  1601. break;
  1602. }
  1603. }
  1604. return array;
  1605. }
  1606. /**
  1607. * A specialized version of `_.forEachRight` for arrays without support for
  1608. * iteratee shorthands.
  1609. *
  1610. * @private
  1611. * @param {Array} [array] The array to iterate over.
  1612. * @param {Function} iteratee The function invoked per iteration.
  1613. * @returns {Array} Returns `array`.
  1614. */
  1615. function arrayEachRight(array, iteratee) {
  1616. var length = array == null ? 0 : array.length;
  1617. while (length--) {
  1618. if (iteratee(array[length], length, array) === false) {
  1619. break;
  1620. }
  1621. }
  1622. return array;
  1623. }
  1624. /**
  1625. * A specialized version of `_.every` for arrays without support for
  1626. * iteratee shorthands.
  1627. *
  1628. * @private
  1629. * @param {Array} [array] The array to iterate over.
  1630. * @param {Function} predicate The function invoked per iteration.
  1631. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1632. * else `false`.
  1633. */
  1634. function arrayEvery(array, predicate) {
  1635. var index = -1,
  1636. length = array == null ? 0 : array.length;
  1637. while (++index < length) {
  1638. if (!predicate(array[index], index, array)) {
  1639. return false;
  1640. }
  1641. }
  1642. return true;
  1643. }
  1644. /**
  1645. * A specialized version of `_.filter` for arrays without support for
  1646. * iteratee shorthands.
  1647. *
  1648. * @private
  1649. * @param {Array} [array] The array to iterate over.
  1650. * @param {Function} predicate The function invoked per iteration.
  1651. * @returns {Array} Returns the new filtered array.
  1652. */
  1653. function arrayFilter(array, predicate) {
  1654. var index = -1,
  1655. length = array == null ? 0 : array.length,
  1656. resIndex = 0,
  1657. result = [];
  1658. while (++index < length) {
  1659. var value = array[index];
  1660. if (predicate(value, index, array)) {
  1661. result[resIndex++] = value;
  1662. }
  1663. }
  1664. return result;
  1665. }
  1666. /**
  1667. * A specialized version of `_.includes` for arrays without support for
  1668. * specifying an index to search from.
  1669. *
  1670. * @private
  1671. * @param {Array} [array] The array to inspect.
  1672. * @param {*} target The value to search for.
  1673. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1674. */
  1675. function arrayIncludes(array, value) {
  1676. var length = array == null ? 0 : array.length;
  1677. return !!length && baseIndexOf(array, value, 0) > -1;
  1678. }
  1679. /**
  1680. * This function is like `arrayIncludes` except that it accepts a comparator.
  1681. *
  1682. * @private
  1683. * @param {Array} [array] The array to inspect.
  1684. * @param {*} target The value to search for.
  1685. * @param {Function} comparator The comparator invoked per element.
  1686. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1687. */
  1688. function arrayIncludesWith(array, value, comparator) {
  1689. var index = -1,
  1690. length = array == null ? 0 : array.length;
  1691. while (++index < length) {
  1692. if (comparator(value, array[index])) {
  1693. return true;
  1694. }
  1695. }
  1696. return false;
  1697. }
  1698. /**
  1699. * A specialized version of `_.map` for arrays without support for iteratee
  1700. * shorthands.
  1701. *
  1702. * @private
  1703. * @param {Array} [array] The array to iterate over.
  1704. * @param {Function} iteratee The function invoked per iteration.
  1705. * @returns {Array} Returns the new mapped array.
  1706. */
  1707. function arrayMap(array, iteratee) {
  1708. var index = -1,
  1709. length = array == null ? 0 : array.length,
  1710. result = Array(length);
  1711. while (++index < length) {
  1712. result[index] = iteratee(array[index], index, array);
  1713. }
  1714. return result;
  1715. }
  1716. /**
  1717. * Appends the elements of `values` to `array`.
  1718. *
  1719. * @private
  1720. * @param {Array} array The array to modify.
  1721. * @param {Array} values The values to append.
  1722. * @returns {Array} Returns `array`.
  1723. */
  1724. function arrayPush(array, values) {
  1725. var index = -1,
  1726. length = values.length,
  1727. offset = array.length;
  1728. while (++index < length) {
  1729. array[offset + index] = values[index];
  1730. }
  1731. return array;
  1732. }
  1733. /**
  1734. * A specialized version of `_.reduce` for arrays without support for
  1735. * iteratee shorthands.
  1736. *
  1737. * @private
  1738. * @param {Array} [array] The array to iterate over.
  1739. * @param {Function} iteratee The function invoked per iteration.
  1740. * @param {*} [accumulator] The initial value.
  1741. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1742. * the initial value.
  1743. * @returns {*} Returns the accumulated value.
  1744. */
  1745. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1746. var index = -1,
  1747. length = array == null ? 0 : array.length;
  1748. if (initAccum && length) {
  1749. accumulator = array[++index];
  1750. }
  1751. while (++index < length) {
  1752. accumulator = iteratee(accumulator, array[index], index, array);
  1753. }
  1754. return accumulator;
  1755. }
  1756. /**
  1757. * A specialized version of `_.reduceRight` for arrays without support for
  1758. * iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} [array] The array to iterate over.
  1762. * @param {Function} iteratee The function invoked per iteration.
  1763. * @param {*} [accumulator] The initial value.
  1764. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1765. * the initial value.
  1766. * @returns {*} Returns the accumulated value.
  1767. */
  1768. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1769. var length = array == null ? 0 : array.length;
  1770. if (initAccum && length) {
  1771. accumulator = array[--length];
  1772. }
  1773. while (length--) {
  1774. accumulator = iteratee(accumulator, array[length], length, array);
  1775. }
  1776. return accumulator;
  1777. }
  1778. /**
  1779. * A specialized version of `_.some` for arrays without support for iteratee
  1780. * shorthands.
  1781. *
  1782. * @private
  1783. * @param {Array} [array] The array to iterate over.
  1784. * @param {Function} predicate The function invoked per iteration.
  1785. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1786. * else `false`.
  1787. */
  1788. function arraySome(array, predicate) {
  1789. var index = -1,
  1790. length = array == null ? 0 : array.length;
  1791. while (++index < length) {
  1792. if (predicate(array[index], index, array)) {
  1793. return true;
  1794. }
  1795. }
  1796. return false;
  1797. }
  1798. /**
  1799. * Gets the size of an ASCII `string`.
  1800. *
  1801. * @private
  1802. * @param {string} string The string inspect.
  1803. * @returns {number} Returns the string size.
  1804. */
  1805. var asciiSize = baseProperty('length');
  1806. /**
  1807. * Converts an ASCII `string` to an array.
  1808. *
  1809. * @private
  1810. * @param {string} string The string to convert.
  1811. * @returns {Array} Returns the converted array.
  1812. */
  1813. function asciiToArray(string) {
  1814. return string.split('');
  1815. }
  1816. /**
  1817. * Splits an ASCII `string` into an array of its words.
  1818. *
  1819. * @private
  1820. * @param {string} The string to inspect.
  1821. * @returns {Array} Returns the words of `string`.
  1822. */
  1823. function asciiWords(string) {
  1824. return string.match(reAsciiWord) || [];
  1825. }
  1826. /**
  1827. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1828. * without support for iteratee shorthands, which iterates over `collection`
  1829. * using `eachFunc`.
  1830. *
  1831. * @private
  1832. * @param {Array|Object} collection The collection to inspect.
  1833. * @param {Function} predicate The function invoked per iteration.
  1834. * @param {Function} eachFunc The function to iterate over `collection`.
  1835. * @returns {*} Returns the found element or its key, else `undefined`.
  1836. */
  1837. function baseFindKey(collection, predicate, eachFunc) {
  1838. var result;
  1839. eachFunc(collection, function(value, key, collection) {
  1840. if (predicate(value, key, collection)) {
  1841. result = key;
  1842. return false;
  1843. }
  1844. });
  1845. return result;
  1846. }
  1847. /**
  1848. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1849. * support for iteratee shorthands.
  1850. *
  1851. * @private
  1852. * @param {Array} array The array to inspect.
  1853. * @param {Function} predicate The function invoked per iteration.
  1854. * @param {number} fromIndex The index to search from.
  1855. * @param {boolean} [fromRight] Specify iterating from right to left.
  1856. * @returns {number} Returns the index of the matched value, else `-1`.
  1857. */
  1858. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1859. var length = array.length,
  1860. index = fromIndex + (fromRight ? 1 : -1);
  1861. while ((fromRight ? index-- : ++index < length)) {
  1862. if (predicate(array[index], index, array)) {
  1863. return index;
  1864. }
  1865. }
  1866. return -1;
  1867. }
  1868. /**
  1869. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1870. *
  1871. * @private
  1872. * @param {Array} array The array to inspect.
  1873. * @param {*} value The value to search for.
  1874. * @param {number} fromIndex The index to search from.
  1875. * @returns {number} Returns the index of the matched value, else `-1`.
  1876. */
  1877. function baseIndexOf(array, value, fromIndex) {
  1878. return value === value
  1879. ? strictIndexOf(array, value, fromIndex)
  1880. : baseFindIndex(array, baseIsNaN, fromIndex);
  1881. }
  1882. /**
  1883. * This function is like `baseIndexOf` except that it accepts a comparator.
  1884. *
  1885. * @private
  1886. * @param {Array} array The array to inspect.
  1887. * @param {*} value The value to search for.
  1888. * @param {number} fromIndex The index to search from.
  1889. * @param {Function} comparator The comparator invoked per element.
  1890. * @returns {number} Returns the index of the matched value, else `-1`.
  1891. */
  1892. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1893. var index = fromIndex - 1,
  1894. length = array.length;
  1895. while (++index < length) {
  1896. if (comparator(array[index], value)) {
  1897. return index;
  1898. }
  1899. }
  1900. return -1;
  1901. }
  1902. /**
  1903. * The base implementation of `_.isNaN` without support for number objects.
  1904. *
  1905. * @private
  1906. * @param {*} value The value to check.
  1907. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1908. */
  1909. function baseIsNaN(value) {
  1910. return value !== value;
  1911. }
  1912. /**
  1913. * The base implementation of `_.mean` and `_.meanBy` without support for
  1914. * iteratee shorthands.
  1915. *
  1916. * @private
  1917. * @param {Array} array The array to iterate over.
  1918. * @param {Function} iteratee The function invoked per iteration.
  1919. * @returns {number} Returns the mean.
  1920. */
  1921. function baseMean(array, iteratee) {
  1922. var length = array == null ? 0 : array.length;
  1923. return length ? (baseSum(array, iteratee) / length) : NAN;
  1924. }
  1925. /**
  1926. * The base implementation of `_.property` without support for deep paths.
  1927. *
  1928. * @private
  1929. * @param {string} key The key of the property to get.
  1930. * @returns {Function} Returns the new accessor function.
  1931. */
  1932. function baseProperty(key) {
  1933. return function(object) {
  1934. return object == null ? undefined : object[key];
  1935. };
  1936. }
  1937. /**
  1938. * The base implementation of `_.propertyOf` without support for deep paths.
  1939. *
  1940. * @private
  1941. * @param {Object} object The object to query.
  1942. * @returns {Function} Returns the new accessor function.
  1943. */
  1944. function basePropertyOf(object) {
  1945. return function(key) {
  1946. return object == null ? undefined : object[key];
  1947. };
  1948. }
  1949. /**
  1950. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1951. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1952. *
  1953. * @private
  1954. * @param {Array|Object} collection The collection to iterate over.
  1955. * @param {Function} iteratee The function invoked per iteration.
  1956. * @param {*} accumulator The initial value.
  1957. * @param {boolean} initAccum Specify using the first or last element of
  1958. * `collection` as the initial value.
  1959. * @param {Function} eachFunc The function to iterate over `collection`.
  1960. * @returns {*} Returns the accumulated value.
  1961. */
  1962. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1963. eachFunc(collection, function(value, index, collection) {
  1964. accumulator = initAccum
  1965. ? (initAccum = false, value)
  1966. : iteratee(accumulator, value, index, collection);
  1967. });
  1968. return accumulator;
  1969. }
  1970. /**
  1971. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1972. * sort order of `array` and replaces criteria objects with their corresponding
  1973. * values.
  1974. *
  1975. * @private
  1976. * @param {Array} array The array to sort.
  1977. * @param {Function} comparer The function to define sort order.
  1978. * @returns {Array} Returns `array`.
  1979. */
  1980. function baseSortBy(array, comparer) {
  1981. var length = array.length;
  1982. array.sort(comparer);
  1983. while (length--) {
  1984. array[length] = array[length].value;
  1985. }
  1986. return array;
  1987. }
  1988. /**
  1989. * The base implementation of `_.sum` and `_.sumBy` without support for
  1990. * iteratee shorthands.
  1991. *
  1992. * @private
  1993. * @param {Array} array The array to iterate over.
  1994. * @param {Function} iteratee The function invoked per iteration.
  1995. * @returns {number} Returns the sum.
  1996. */
  1997. function baseSum(array, iteratee) {
  1998. var result,
  1999. index = -1,
  2000. length = array.length;
  2001. while (++index < length) {
  2002. var current = iteratee(array[index]);
  2003. if (current !== undefined) {
  2004. result = result === undefined ? current : (result + current);
  2005. }
  2006. }
  2007. return result;
  2008. }
  2009. /**
  2010. * The base implementation of `_.times` without support for iteratee shorthands
  2011. * or max array length checks.
  2012. *
  2013. * @private
  2014. * @param {number} n The number of times to invoke `iteratee`.
  2015. * @param {Function} iteratee The function invoked per iteration.
  2016. * @returns {Array} Returns the array of results.
  2017. */
  2018. function baseTimes(n, iteratee) {
  2019. var index = -1,
  2020. result = Array(n);
  2021. while (++index < n) {
  2022. result[index] = iteratee(index);
  2023. }
  2024. return result;
  2025. }
  2026. /**
  2027. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2028. * of key-value pairs for `object` corresponding to the property names of `props`.
  2029. *
  2030. * @private
  2031. * @param {Object} object The object to query.
  2032. * @param {Array} props The property names to get values for.
  2033. * @returns {Object} Returns the key-value pairs.
  2034. */
  2035. function baseToPairs(object, props) {
  2036. return arrayMap(props, function(key) {
  2037. return [key, object[key]];
  2038. });
  2039. }
  2040. /**
  2041. * The base implementation of `_.trim`.
  2042. *
  2043. * @private
  2044. * @param {string} string The string to trim.
  2045. * @returns {string} Returns the trimmed string.
  2046. */
  2047. function baseTrim(string) {
  2048. return string
  2049. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2050. : string;
  2051. }
  2052. /**
  2053. * The base implementation of `_.unary` without support for storing metadata.
  2054. *
  2055. * @private
  2056. * @param {Function} func The function to cap arguments for.
  2057. * @returns {Function} Returns the new capped function.
  2058. */
  2059. function baseUnary(func) {
  2060. return function(value) {
  2061. return func(value);
  2062. };
  2063. }
  2064. /**
  2065. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2066. * array of `object` property values corresponding to the property names
  2067. * of `props`.
  2068. *
  2069. * @private
  2070. * @param {Object} object The object to query.
  2071. * @param {Array} props The property names to get values for.
  2072. * @returns {Object} Returns the array of property values.
  2073. */
  2074. function baseValues(object, props) {
  2075. return arrayMap(props, function(key) {
  2076. return object[key];
  2077. });
  2078. }
  2079. /**
  2080. * Checks if a `cache` value for `key` exists.
  2081. *
  2082. * @private
  2083. * @param {Object} cache The cache to query.
  2084. * @param {string} key The key of the entry to check.
  2085. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2086. */
  2087. function cacheHas(cache, key) {
  2088. return cache.has(key);
  2089. }
  2090. /**
  2091. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2092. * that is not found in the character symbols.
  2093. *
  2094. * @private
  2095. * @param {Array} strSymbols The string symbols to inspect.
  2096. * @param {Array} chrSymbols The character symbols to find.
  2097. * @returns {number} Returns the index of the first unmatched string symbol.
  2098. */
  2099. function charsStartIndex(strSymbols, chrSymbols) {
  2100. var index = -1,
  2101. length = strSymbols.length;
  2102. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2103. return index;
  2104. }
  2105. /**
  2106. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2107. * that is not found in the character symbols.
  2108. *
  2109. * @private
  2110. * @param {Array} strSymbols The string symbols to inspect.
  2111. * @param {Array} chrSymbols The character symbols to find.
  2112. * @returns {number} Returns the index of the last unmatched string symbol.
  2113. */
  2114. function charsEndIndex(strSymbols, chrSymbols) {
  2115. var index = strSymbols.length;
  2116. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2117. return index;
  2118. }
  2119. /**
  2120. * Gets the number of `placeholder` occurrences in `array`.
  2121. *
  2122. * @private
  2123. * @param {Array} array The array to inspect.
  2124. * @param {*} placeholder The placeholder to search for.
  2125. * @returns {number} Returns the placeholder count.
  2126. */
  2127. function countHolders(array, placeholder) {
  2128. var length = array.length,
  2129. result = 0;
  2130. while (length--) {
  2131. if (array[length] === placeholder) {
  2132. ++result;
  2133. }
  2134. }
  2135. return result;
  2136. }
  2137. /**
  2138. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2139. * letters to basic Latin letters.
  2140. *
  2141. * @private
  2142. * @param {string} letter The matched letter to deburr.
  2143. * @returns {string} Returns the deburred letter.
  2144. */
  2145. var deburrLetter = basePropertyOf(deburredLetters);
  2146. /**
  2147. * Used by `_.escape` to convert characters to HTML entities.
  2148. *
  2149. * @private
  2150. * @param {string} chr The matched character to escape.
  2151. * @returns {string} Returns the escaped character.
  2152. */
  2153. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2154. /**
  2155. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2156. *
  2157. * @private
  2158. * @param {string} chr The matched character to escape.
  2159. * @returns {string} Returns the escaped character.
  2160. */
  2161. function escapeStringChar(chr) {
  2162. return '\\' + stringEscapes[chr];
  2163. }
  2164. /**
  2165. * Gets the value at `key` of `object`.
  2166. *
  2167. * @private
  2168. * @param {Object} [object] The object to query.
  2169. * @param {string} key The key of the property to get.
  2170. * @returns {*} Returns the property value.
  2171. */
  2172. function getValue(object, key) {
  2173. return object == null ? undefined : object[key];
  2174. }
  2175. /**
  2176. * Checks if `string` contains Unicode symbols.
  2177. *
  2178. * @private
  2179. * @param {string} string The string to inspect.
  2180. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2181. */
  2182. function hasUnicode(string) {
  2183. return reHasUnicode.test(string);
  2184. }
  2185. /**
  2186. * Checks if `string` contains a word composed of Unicode symbols.
  2187. *
  2188. * @private
  2189. * @param {string} string The string to inspect.
  2190. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2191. */
  2192. function hasUnicodeWord(string) {
  2193. return reHasUnicodeWord.test(string);
  2194. }
  2195. /**
  2196. * Converts `iterator` to an array.
  2197. *
  2198. * @private
  2199. * @param {Object} iterator The iterator to convert.
  2200. * @returns {Array} Returns the converted array.
  2201. */
  2202. function iteratorToArray(iterator) {
  2203. var data,
  2204. result = [];
  2205. while (!(data = iterator.next()).done) {
  2206. result.push(data.value);
  2207. }
  2208. return result;
  2209. }
  2210. /**
  2211. * Converts `map` to its key-value pairs.
  2212. *
  2213. * @private
  2214. * @param {Object} map The map to convert.
  2215. * @returns {Array} Returns the key-value pairs.
  2216. */
  2217. function mapToArray(map) {
  2218. var index = -1,
  2219. result = Array(map.size);
  2220. map.forEach(function(value, key) {
  2221. result[++index] = [key, value];
  2222. });
  2223. return result;
  2224. }
  2225. /**
  2226. * Creates a unary function that invokes `func` with its argument transformed.
  2227. *
  2228. * @private
  2229. * @param {Function} func The function to wrap.
  2230. * @param {Function} transform The argument transform.
  2231. * @returns {Function} Returns the new function.
  2232. */
  2233. function overArg(func, transform) {
  2234. return function(arg) {
  2235. return func(transform(arg));
  2236. };
  2237. }
  2238. /**
  2239. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2240. * and returns an array of their indexes.
  2241. *
  2242. * @private
  2243. * @param {Array} array The array to modify.
  2244. * @param {*} placeholder The placeholder to replace.
  2245. * @returns {Array} Returns the new array of placeholder indexes.
  2246. */
  2247. function replaceHolders(array, placeholder) {
  2248. var index = -1,
  2249. length = array.length,
  2250. resIndex = 0,
  2251. result = [];
  2252. while (++index < length) {
  2253. var value = array[index];
  2254. if (value === placeholder || value === PLACEHOLDER) {
  2255. array[index] = PLACEHOLDER;
  2256. result[resIndex++] = index;
  2257. }
  2258. }
  2259. return result;
  2260. }
  2261. /**
  2262. * Converts `set` to an array of its values.
  2263. *
  2264. * @private
  2265. * @param {Object} set The set to convert.
  2266. * @returns {Array} Returns the values.
  2267. */
  2268. function setToArray(set) {
  2269. var index = -1,
  2270. result = Array(set.size);
  2271. set.forEach(function(value) {
  2272. result[++index] = value;
  2273. });
  2274. return result;
  2275. }
  2276. /**
  2277. * Converts `set` to its value-value pairs.
  2278. *
  2279. * @private
  2280. * @param {Object} set The set to convert.
  2281. * @returns {Array} Returns the value-value pairs.
  2282. */
  2283. function setToPairs(set) {
  2284. var index = -1,
  2285. result = Array(set.size);
  2286. set.forEach(function(value) {
  2287. result[++index] = [value, value];
  2288. });
  2289. return result;
  2290. }
  2291. /**
  2292. * A specialized version of `_.indexOf` which performs strict equality
  2293. * comparisons of values, i.e. `===`.
  2294. *
  2295. * @private
  2296. * @param {Array} array The array to inspect.
  2297. * @param {*} value The value to search for.
  2298. * @param {number} fromIndex The index to search from.
  2299. * @returns {number} Returns the index of the matched value, else `-1`.
  2300. */
  2301. function strictIndexOf(array, value, fromIndex) {
  2302. var index = fromIndex - 1,
  2303. length = array.length;
  2304. while (++index < length) {
  2305. if (array[index] === value) {
  2306. return index;
  2307. }
  2308. }
  2309. return -1;
  2310. }
  2311. /**
  2312. * A specialized version of `_.lastIndexOf` which performs strict equality
  2313. * comparisons of values, i.e. `===`.
  2314. *
  2315. * @private
  2316. * @param {Array} array The array to inspect.
  2317. * @param {*} value The value to search for.
  2318. * @param {number} fromIndex The index to search from.
  2319. * @returns {number} Returns the index of the matched value, else `-1`.
  2320. */
  2321. function strictLastIndexOf(array, value, fromIndex) {
  2322. var index = fromIndex + 1;
  2323. while (index--) {
  2324. if (array[index] === value) {
  2325. return index;
  2326. }
  2327. }
  2328. return index;
  2329. }
  2330. /**
  2331. * Gets the number of symbols in `string`.
  2332. *
  2333. * @private
  2334. * @param {string} string The string to inspect.
  2335. * @returns {number} Returns the string size.
  2336. */
  2337. function stringSize(string) {
  2338. return hasUnicode(string)
  2339. ? unicodeSize(string)
  2340. : asciiSize(string);
  2341. }
  2342. /**
  2343. * Converts `string` to an array.
  2344. *
  2345. * @private
  2346. * @param {string} string The string to convert.
  2347. * @returns {Array} Returns the converted array.
  2348. */
  2349. function stringToArray(string) {
  2350. return hasUnicode(string)
  2351. ? unicodeToArray(string)
  2352. : asciiToArray(string);
  2353. }
  2354. /**
  2355. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2356. * character of `string`.
  2357. *
  2358. * @private
  2359. * @param {string} string The string to inspect.
  2360. * @returns {number} Returns the index of the last non-whitespace character.
  2361. */
  2362. function trimmedEndIndex(string) {
  2363. var index = string.length;
  2364. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2365. return index;
  2366. }
  2367. /**
  2368. * Used by `_.unescape` to convert HTML entities to characters.
  2369. *
  2370. * @private
  2371. * @param {string} chr The matched character to unescape.
  2372. * @returns {string} Returns the unescaped character.
  2373. */
  2374. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2375. /**
  2376. * Gets the size of a Unicode `string`.
  2377. *
  2378. * @private
  2379. * @param {string} string The string inspect.
  2380. * @returns {number} Returns the string size.
  2381. */
  2382. function unicodeSize(string) {
  2383. var result = reUnicode.lastIndex = 0;
  2384. while (reUnicode.test(string)) {
  2385. ++result;
  2386. }
  2387. return result;
  2388. }
  2389. /**
  2390. * Converts a Unicode `string` to an array.
  2391. *
  2392. * @private
  2393. * @param {string} string The string to convert.
  2394. * @returns {Array} Returns the converted array.
  2395. */
  2396. function unicodeToArray(string) {
  2397. return string.match(reUnicode) || [];
  2398. }
  2399. /**
  2400. * Splits a Unicode `string` into an array of its words.
  2401. *
  2402. * @private
  2403. * @param {string} The string to inspect.
  2404. * @returns {Array} Returns the words of `string`.
  2405. */
  2406. function unicodeWords(string) {
  2407. return string.match(reUnicodeWord) || [];
  2408. }
  2409. /*--------------------------------------------------------------------------*/
  2410. /**
  2411. * Create a new pristine `lodash` function using the `context` object.
  2412. *
  2413. * @static
  2414. * @memberOf _
  2415. * @since 1.1.0
  2416. * @category Util
  2417. * @param {Object} [context=root] The context object.
  2418. * @returns {Function} Returns a new `lodash` function.
  2419. * @example
  2420. *
  2421. * _.mixin({ 'foo': _.constant('foo') });
  2422. *
  2423. * var lodash = _.runInContext();
  2424. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2425. *
  2426. * _.isFunction(_.foo);
  2427. * // => true
  2428. * _.isFunction(_.bar);
  2429. * // => false
  2430. *
  2431. * lodash.isFunction(lodash.foo);
  2432. * // => false
  2433. * lodash.isFunction(lodash.bar);
  2434. * // => true
  2435. *
  2436. * // Create a suped-up `defer` in Node.js.
  2437. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2438. */
  2439. var runInContext = (function runInContext(context) {
  2440. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2441. /** Built-in constructor references. */
  2442. var Array = context.Array,
  2443. Date = context.Date,
  2444. Error = context.Error,
  2445. Function = context.Function,
  2446. Math = context.Math,
  2447. Object = context.Object,
  2448. RegExp = context.RegExp,
  2449. String = context.String,
  2450. TypeError = context.TypeError;
  2451. /** Used for built-in method references. */
  2452. var arrayProto = Array.prototype,
  2453. funcProto = Function.prototype,
  2454. objectProto = Object.prototype;
  2455. /** Used to detect overreaching core-js shims. */
  2456. var coreJsData = context['__core-js_shared__'];
  2457. /** Used to resolve the decompiled source of functions. */
  2458. var funcToString = funcProto.toString;
  2459. /** Used to check objects for own properties. */
  2460. var hasOwnProperty = objectProto.hasOwnProperty;
  2461. /** Used to generate unique IDs. */
  2462. var idCounter = 0;
  2463. /** Used to detect methods masquerading as native. */
  2464. var maskSrcKey = (function() {
  2465. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2466. return uid ? ('Symbol(src)_1.' + uid) : '';
  2467. }());
  2468. /**
  2469. * Used to resolve the
  2470. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2471. * of values.
  2472. */
  2473. var nativeObjectToString = objectProto.toString;
  2474. /** Used to infer the `Object` constructor. */
  2475. var objectCtorString = funcToString.call(Object);
  2476. /** Used to restore the original `_` reference in `_.noConflict`. */
  2477. var oldDash = root._;
  2478. /** Used to detect if a method is native. */
  2479. var reIsNative = RegExp('^' +
  2480. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2481. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2482. );
  2483. /** Built-in value references. */
  2484. var Buffer = moduleExports ? context.Buffer : undefined,
  2485. Symbol = context.Symbol,
  2486. Uint8Array = context.Uint8Array,
  2487. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2488. getPrototype = overArg(Object.getPrototypeOf, Object),
  2489. objectCreate = Object.create,
  2490. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2491. splice = arrayProto.splice,
  2492. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2493. symIterator = Symbol ? Symbol.iterator : undefined,
  2494. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2495. var defineProperty = (function() {
  2496. try {
  2497. var func = getNative(Object, 'defineProperty');
  2498. func({}, '', {});
  2499. return func;
  2500. } catch (e) {}
  2501. }());
  2502. /** Mocked built-ins. */
  2503. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2504. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2505. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2506. /* Built-in method references for those with the same name as other `lodash` methods. */
  2507. var nativeCeil = Math.ceil,
  2508. nativeFloor = Math.floor,
  2509. nativeGetSymbols = Object.getOwnPropertySymbols,
  2510. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2511. nativeIsFinite = context.isFinite,
  2512. nativeJoin = arrayProto.join,
  2513. nativeKeys = overArg(Object.keys, Object),
  2514. nativeMax = Math.max,
  2515. nativeMin = Math.min,
  2516. nativeNow = Date.now,
  2517. nativeParseInt = context.parseInt,
  2518. nativeRandom = Math.random,
  2519. nativeReverse = arrayProto.reverse;
  2520. /* Built-in method references that are verified to be native. */
  2521. var DataView = getNative(context, 'DataView'),
  2522. Map = getNative(context, 'Map'),
  2523. Promise = getNative(context, 'Promise'),
  2524. Set = getNative(context, 'Set'),
  2525. WeakMap = getNative(context, 'WeakMap'),
  2526. nativeCreate = getNative(Object, 'create');
  2527. /** Used to store function metadata. */
  2528. var metaMap = WeakMap && new WeakMap;
  2529. /** Used to lookup unminified function names. */
  2530. var realNames = {};
  2531. /** Used to detect maps, sets, and weakmaps. */
  2532. var dataViewCtorString = toSource(DataView),
  2533. mapCtorString = toSource(Map),
  2534. promiseCtorString = toSource(Promise),
  2535. setCtorString = toSource(Set),
  2536. weakMapCtorString = toSource(WeakMap);
  2537. /** Used to convert symbols to primitives and strings. */
  2538. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2539. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2540. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2541. /*------------------------------------------------------------------------*/
  2542. /**
  2543. * Creates a `lodash` object which wraps `value` to enable implicit method
  2544. * chain sequences. Methods that operate on and return arrays, collections,
  2545. * and functions can be chained together. Methods that retrieve a single value
  2546. * or may return a primitive value will automatically end the chain sequence
  2547. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2548. * with `_#value`.
  2549. *
  2550. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2551. * enabled using `_.chain`.
  2552. *
  2553. * The execution of chained methods is lazy, that is, it's deferred until
  2554. * `_#value` is implicitly or explicitly called.
  2555. *
  2556. * Lazy evaluation allows several methods to support shortcut fusion.
  2557. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2558. * the creation of intermediate arrays and can greatly reduce the number of
  2559. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2560. * fusion if the section is applied to an array and iteratees accept only
  2561. * one argument. The heuristic for whether a section qualifies for shortcut
  2562. * fusion is subject to change.
  2563. *
  2564. * Chaining is supported in custom builds as long as the `_#value` method is
  2565. * directly or indirectly included in the build.
  2566. *
  2567. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2568. *
  2569. * The wrapper `Array` methods are:
  2570. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2571. *
  2572. * The wrapper `String` methods are:
  2573. * `replace` and `split`
  2574. *
  2575. * The wrapper methods that support shortcut fusion are:
  2576. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2577. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2578. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2579. *
  2580. * The chainable wrapper methods are:
  2581. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2582. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2583. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2584. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2585. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2586. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2587. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2588. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2589. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2590. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2591. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2592. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2593. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2594. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2595. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2596. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2597. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2598. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2599. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2600. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2601. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2602. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2603. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2604. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2605. *
  2606. * The wrapper methods that are **not** chainable by default are:
  2607. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2608. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2609. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2610. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2611. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2612. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2613. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2614. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2615. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2616. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2617. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2618. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2619. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2620. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2621. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2622. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2623. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2624. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2625. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2626. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2627. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2628. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2629. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2630. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2631. * `upperFirst`, `value`, and `words`
  2632. *
  2633. * @name _
  2634. * @constructor
  2635. * @category Seq
  2636. * @param {*} value The value to wrap in a `lodash` instance.
  2637. * @returns {Object} Returns the new `lodash` wrapper instance.
  2638. * @example
  2639. *
  2640. * function square(n) {
  2641. * return n * n;
  2642. * }
  2643. *
  2644. * var wrapped = _([1, 2, 3]);
  2645. *
  2646. * // Returns an unwrapped value.
  2647. * wrapped.reduce(_.add);
  2648. * // => 6
  2649. *
  2650. * // Returns a wrapped value.
  2651. * var squares = wrapped.map(square);
  2652. *
  2653. * _.isArray(squares);
  2654. * // => false
  2655. *
  2656. * _.isArray(squares.value());
  2657. * // => true
  2658. */
  2659. function lodash(value) {
  2660. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2661. if (value instanceof LodashWrapper) {
  2662. return value;
  2663. }
  2664. if (hasOwnProperty.call(value, '__wrapped__')) {
  2665. return wrapperClone(value);
  2666. }
  2667. }
  2668. return new LodashWrapper(value);
  2669. }
  2670. /**
  2671. * The base implementation of `_.create` without support for assigning
  2672. * properties to the created object.
  2673. *
  2674. * @private
  2675. * @param {Object} proto The object to inherit from.
  2676. * @returns {Object} Returns the new object.
  2677. */
  2678. var baseCreate = (function() {
  2679. function object() {}
  2680. return function(proto) {
  2681. if (!isObject(proto)) {
  2682. return {};
  2683. }
  2684. if (objectCreate) {
  2685. return objectCreate(proto);
  2686. }
  2687. object.prototype = proto;
  2688. var result = new object;
  2689. object.prototype = undefined;
  2690. return result;
  2691. };
  2692. }());
  2693. /**
  2694. * The function whose prototype chain sequence wrappers inherit from.
  2695. *
  2696. * @private
  2697. */
  2698. function baseLodash() {
  2699. // No operation performed.
  2700. }
  2701. /**
  2702. * The base constructor for creating `lodash` wrapper objects.
  2703. *
  2704. * @private
  2705. * @param {*} value The value to wrap.
  2706. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2707. */
  2708. function LodashWrapper(value, chainAll) {
  2709. this.__wrapped__ = value;
  2710. this.__actions__ = [];
  2711. this.__chain__ = !!chainAll;
  2712. this.__index__ = 0;
  2713. this.__values__ = undefined;
  2714. }
  2715. /**
  2716. * By default, the template delimiters used by lodash are like those in
  2717. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2718. * following template settings to use alternative delimiters.
  2719. *
  2720. * @static
  2721. * @memberOf _
  2722. * @type {Object}
  2723. */
  2724. lodash.templateSettings = {
  2725. /**
  2726. * Used to detect `data` property values to be HTML-escaped.
  2727. *
  2728. * @memberOf _.templateSettings
  2729. * @type {RegExp}
  2730. */
  2731. 'escape': reEscape,
  2732. /**
  2733. * Used to detect code to be evaluated.
  2734. *
  2735. * @memberOf _.templateSettings
  2736. * @type {RegExp}
  2737. */
  2738. 'evaluate': reEvaluate,
  2739. /**
  2740. * Used to detect `data` property values to inject.
  2741. *
  2742. * @memberOf _.templateSettings
  2743. * @type {RegExp}
  2744. */
  2745. 'interpolate': reInterpolate,
  2746. /**
  2747. * Used to reference the data object in the template text.
  2748. *
  2749. * @memberOf _.templateSettings
  2750. * @type {string}
  2751. */
  2752. 'variable': '',
  2753. /**
  2754. * Used to import variables into the compiled template.
  2755. *
  2756. * @memberOf _.templateSettings
  2757. * @type {Object}
  2758. */
  2759. 'imports': {
  2760. /**
  2761. * A reference to the `lodash` function.
  2762. *
  2763. * @memberOf _.templateSettings.imports
  2764. * @type {Function}
  2765. */
  2766. '_': lodash
  2767. }
  2768. };
  2769. // Ensure wrappers are instances of `baseLodash`.
  2770. lodash.prototype = baseLodash.prototype;
  2771. lodash.prototype.constructor = lodash;
  2772. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2773. LodashWrapper.prototype.constructor = LodashWrapper;
  2774. /*------------------------------------------------------------------------*/
  2775. /**
  2776. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2777. *
  2778. * @private
  2779. * @constructor
  2780. * @param {*} value The value to wrap.
  2781. */
  2782. function LazyWrapper(value) {
  2783. this.__wrapped__ = value;
  2784. this.__actions__ = [];
  2785. this.__dir__ = 1;
  2786. this.__filtered__ = false;
  2787. this.__iteratees__ = [];
  2788. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2789. this.__views__ = [];
  2790. }
  2791. /**
  2792. * Creates a clone of the lazy wrapper object.
  2793. *
  2794. * @private
  2795. * @name clone
  2796. * @memberOf LazyWrapper
  2797. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2798. */
  2799. function lazyClone() {
  2800. var result = new LazyWrapper(this.__wrapped__);
  2801. result.__actions__ = copyArray(this.__actions__);
  2802. result.__dir__ = this.__dir__;
  2803. result.__filtered__ = this.__filtered__;
  2804. result.__iteratees__ = copyArray(this.__iteratees__);
  2805. result.__takeCount__ = this.__takeCount__;
  2806. result.__views__ = copyArray(this.__views__);
  2807. return result;
  2808. }
  2809. /**
  2810. * Reverses the direction of lazy iteration.
  2811. *
  2812. * @private
  2813. * @name reverse
  2814. * @memberOf LazyWrapper
  2815. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2816. */
  2817. function lazyReverse() {
  2818. if (this.__filtered__) {
  2819. var result = new LazyWrapper(this);
  2820. result.__dir__ = -1;
  2821. result.__filtered__ = true;
  2822. } else {
  2823. result = this.clone();
  2824. result.__dir__ *= -1;
  2825. }
  2826. return result;
  2827. }
  2828. /**
  2829. * Extracts the unwrapped value from its lazy wrapper.
  2830. *
  2831. * @private
  2832. * @name value
  2833. * @memberOf LazyWrapper
  2834. * @returns {*} Returns the unwrapped value.
  2835. */
  2836. function lazyValue() {
  2837. var array = this.__wrapped__.value(),
  2838. dir = this.__dir__,
  2839. isArr = isArray(array),
  2840. isRight = dir < 0,
  2841. arrLength = isArr ? array.length : 0,
  2842. view = getView(0, arrLength, this.__views__),
  2843. start = view.start,
  2844. end = view.end,
  2845. length = end - start,
  2846. index = isRight ? end : (start - 1),
  2847. iteratees = this.__iteratees__,
  2848. iterLength = iteratees.length,
  2849. resIndex = 0,
  2850. takeCount = nativeMin(length, this.__takeCount__);
  2851. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2852. return baseWrapperValue(array, this.__actions__);
  2853. }
  2854. var result = [];
  2855. outer:
  2856. while (length-- && resIndex < takeCount) {
  2857. index += dir;
  2858. var iterIndex = -1,
  2859. value = array[index];
  2860. while (++iterIndex < iterLength) {
  2861. var data = iteratees[iterIndex],
  2862. iteratee = data.iteratee,
  2863. type = data.type,
  2864. computed = iteratee(value);
  2865. if (type == LAZY_MAP_FLAG) {
  2866. value = computed;
  2867. } else if (!computed) {
  2868. if (type == LAZY_FILTER_FLAG) {
  2869. continue outer;
  2870. } else {
  2871. break outer;
  2872. }
  2873. }
  2874. }
  2875. result[resIndex++] = value;
  2876. }
  2877. return result;
  2878. }
  2879. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2880. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2881. LazyWrapper.prototype.constructor = LazyWrapper;
  2882. /*------------------------------------------------------------------------*/
  2883. /**
  2884. * Creates a hash object.
  2885. *
  2886. * @private
  2887. * @constructor
  2888. * @param {Array} [entries] The key-value pairs to cache.
  2889. */
  2890. function Hash(entries) {
  2891. var index = -1,
  2892. length = entries == null ? 0 : entries.length;
  2893. this.clear();
  2894. while (++index < length) {
  2895. var entry = entries[index];
  2896. this.set(entry[0], entry[1]);
  2897. }
  2898. }
  2899. /**
  2900. * Removes all key-value entries from the hash.
  2901. *
  2902. * @private
  2903. * @name clear
  2904. * @memberOf Hash
  2905. */
  2906. function hashClear() {
  2907. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2908. this.size = 0;
  2909. }
  2910. /**
  2911. * Removes `key` and its value from the hash.
  2912. *
  2913. * @private
  2914. * @name delete
  2915. * @memberOf Hash
  2916. * @param {Object} hash The hash to modify.
  2917. * @param {string} key The key of the value to remove.
  2918. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2919. */
  2920. function hashDelete(key) {
  2921. var result = this.has(key) && delete this.__data__[key];
  2922. this.size -= result ? 1 : 0;
  2923. return result;
  2924. }
  2925. /**
  2926. * Gets the hash value for `key`.
  2927. *
  2928. * @private
  2929. * @name get
  2930. * @memberOf Hash
  2931. * @param {string} key The key of the value to get.
  2932. * @returns {*} Returns the entry value.
  2933. */
  2934. function hashGet(key) {
  2935. var data = this.__data__;
  2936. if (nativeCreate) {
  2937. var result = data[key];
  2938. return result === HASH_UNDEFINED ? undefined : result;
  2939. }
  2940. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2941. }
  2942. /**
  2943. * Checks if a hash value for `key` exists.
  2944. *
  2945. * @private
  2946. * @name has
  2947. * @memberOf Hash
  2948. * @param {string} key The key of the entry to check.
  2949. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2950. */
  2951. function hashHas(key) {
  2952. var data = this.__data__;
  2953. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2954. }
  2955. /**
  2956. * Sets the hash `key` to `value`.
  2957. *
  2958. * @private
  2959. * @name set
  2960. * @memberOf Hash
  2961. * @param {string} key The key of the value to set.
  2962. * @param {*} value The value to set.
  2963. * @returns {Object} Returns the hash instance.
  2964. */
  2965. function hashSet(key, value) {
  2966. var data = this.__data__;
  2967. this.size += this.has(key) ? 0 : 1;
  2968. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2969. return this;
  2970. }
  2971. // Add methods to `Hash`.
  2972. Hash.prototype.clear = hashClear;
  2973. Hash.prototype['delete'] = hashDelete;
  2974. Hash.prototype.get = hashGet;
  2975. Hash.prototype.has = hashHas;
  2976. Hash.prototype.set = hashSet;
  2977. /*------------------------------------------------------------------------*/
  2978. /**
  2979. * Creates an list cache object.
  2980. *
  2981. * @private
  2982. * @constructor
  2983. * @param {Array} [entries] The key-value pairs to cache.
  2984. */
  2985. function ListCache(entries) {
  2986. var index = -1,
  2987. length = entries == null ? 0 : entries.length;
  2988. this.clear();
  2989. while (++index < length) {
  2990. var entry = entries[index];
  2991. this.set(entry[0], entry[1]);
  2992. }
  2993. }
  2994. /**
  2995. * Removes all key-value entries from the list cache.
  2996. *
  2997. * @private
  2998. * @name clear
  2999. * @memberOf ListCache
  3000. */
  3001. function listCacheClear() {
  3002. this.__data__ = [];
  3003. this.size = 0;
  3004. }
  3005. /**
  3006. * Removes `key` and its value from the list cache.
  3007. *
  3008. * @private
  3009. * @name delete
  3010. * @memberOf ListCache
  3011. * @param {string} key The key of the value to remove.
  3012. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3013. */
  3014. function listCacheDelete(key) {
  3015. var data = this.__data__,
  3016. index = assocIndexOf(data, key);
  3017. if (index < 0) {
  3018. return false;
  3019. }
  3020. var lastIndex = data.length - 1;
  3021. if (index == lastIndex) {
  3022. data.pop();
  3023. } else {
  3024. splice.call(data, index, 1);
  3025. }
  3026. --this.size;
  3027. return true;
  3028. }
  3029. /**
  3030. * Gets the list cache value for `key`.
  3031. *
  3032. * @private
  3033. * @name get
  3034. * @memberOf ListCache
  3035. * @param {string} key The key of the value to get.
  3036. * @returns {*} Returns the entry value.
  3037. */
  3038. function listCacheGet(key) {
  3039. var data = this.__data__,
  3040. index = assocIndexOf(data, key);
  3041. return index < 0 ? undefined : data[index][1];
  3042. }
  3043. /**
  3044. * Checks if a list cache value for `key` exists.
  3045. *
  3046. * @private
  3047. * @name has
  3048. * @memberOf ListCache
  3049. * @param {string} key The key of the entry to check.
  3050. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3051. */
  3052. function listCacheHas(key) {
  3053. return assocIndexOf(this.__data__, key) > -1;
  3054. }
  3055. /**
  3056. * Sets the list cache `key` to `value`.
  3057. *
  3058. * @private
  3059. * @name set
  3060. * @memberOf ListCache
  3061. * @param {string} key The key of the value to set.
  3062. * @param {*} value The value to set.
  3063. * @returns {Object} Returns the list cache instance.
  3064. */
  3065. function listCacheSet(key, value) {
  3066. var data = this.__data__,
  3067. index = assocIndexOf(data, key);
  3068. if (index < 0) {
  3069. ++this.size;
  3070. data.push([key, value]);
  3071. } else {
  3072. data[index][1] = value;
  3073. }
  3074. return this;
  3075. }
  3076. // Add methods to `ListCache`.
  3077. ListCache.prototype.clear = listCacheClear;
  3078. ListCache.prototype['delete'] = listCacheDelete;
  3079. ListCache.prototype.get = listCacheGet;
  3080. ListCache.prototype.has = listCacheHas;
  3081. ListCache.prototype.set = listCacheSet;
  3082. /*------------------------------------------------------------------------*/
  3083. /**
  3084. * Creates a map cache object to store key-value pairs.
  3085. *
  3086. * @private
  3087. * @constructor
  3088. * @param {Array} [entries] The key-value pairs to cache.
  3089. */
  3090. function MapCache(entries) {
  3091. var index = -1,
  3092. length = entries == null ? 0 : entries.length;
  3093. this.clear();
  3094. while (++index < length) {
  3095. var entry = entries[index];
  3096. this.set(entry[0], entry[1]);
  3097. }
  3098. }
  3099. /**
  3100. * Removes all key-value entries from the map.
  3101. *
  3102. * @private
  3103. * @name clear
  3104. * @memberOf MapCache
  3105. */
  3106. function mapCacheClear() {
  3107. this.size = 0;
  3108. this.__data__ = {
  3109. 'hash': new Hash,
  3110. 'map': new (Map || ListCache),
  3111. 'string': new Hash
  3112. };
  3113. }
  3114. /**
  3115. * Removes `key` and its value from the map.
  3116. *
  3117. * @private
  3118. * @name delete
  3119. * @memberOf MapCache
  3120. * @param {string} key The key of the value to remove.
  3121. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3122. */
  3123. function mapCacheDelete(key) {
  3124. var result = getMapData(this, key)['delete'](key);
  3125. this.size -= result ? 1 : 0;
  3126. return result;
  3127. }
  3128. /**
  3129. * Gets the map value for `key`.
  3130. *
  3131. * @private
  3132. * @name get
  3133. * @memberOf MapCache
  3134. * @param {string} key The key of the value to get.
  3135. * @returns {*} Returns the entry value.
  3136. */
  3137. function mapCacheGet(key) {
  3138. return getMapData(this, key).get(key);
  3139. }
  3140. /**
  3141. * Checks if a map value for `key` exists.
  3142. *
  3143. * @private
  3144. * @name has
  3145. * @memberOf MapCache
  3146. * @param {string} key The key of the entry to check.
  3147. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3148. */
  3149. function mapCacheHas(key) {
  3150. return getMapData(this, key).has(key);
  3151. }
  3152. /**
  3153. * Sets the map `key` to `value`.
  3154. *
  3155. * @private
  3156. * @name set
  3157. * @memberOf MapCache
  3158. * @param {string} key The key of the value to set.
  3159. * @param {*} value The value to set.
  3160. * @returns {Object} Returns the map cache instance.
  3161. */
  3162. function mapCacheSet(key, value) {
  3163. var data = getMapData(this, key),
  3164. size = data.size;
  3165. data.set(key, value);
  3166. this.size += data.size == size ? 0 : 1;
  3167. return this;
  3168. }
  3169. // Add methods to `MapCache`.
  3170. MapCache.prototype.clear = mapCacheClear;
  3171. MapCache.prototype['delete'] = mapCacheDelete;
  3172. MapCache.prototype.get = mapCacheGet;
  3173. MapCache.prototype.has = mapCacheHas;
  3174. MapCache.prototype.set = mapCacheSet;
  3175. /*------------------------------------------------------------------------*/
  3176. /**
  3177. *
  3178. * Creates an array cache object to store unique values.
  3179. *
  3180. * @private
  3181. * @constructor
  3182. * @param {Array} [values] The values to cache.
  3183. */
  3184. function SetCache(values) {
  3185. var index = -1,
  3186. length = values == null ? 0 : values.length;
  3187. this.__data__ = new MapCache;
  3188. while (++index < length) {
  3189. this.add(values[index]);
  3190. }
  3191. }
  3192. /**
  3193. * Adds `value` to the array cache.
  3194. *
  3195. * @private
  3196. * @name add
  3197. * @memberOf SetCache
  3198. * @alias push
  3199. * @param {*} value The value to cache.
  3200. * @returns {Object} Returns the cache instance.
  3201. */
  3202. function setCacheAdd(value) {
  3203. this.__data__.set(value, HASH_UNDEFINED);
  3204. return this;
  3205. }
  3206. /**
  3207. * Checks if `value` is in the array cache.
  3208. *
  3209. * @private
  3210. * @name has
  3211. * @memberOf SetCache
  3212. * @param {*} value The value to search for.
  3213. * @returns {number} Returns `true` if `value` is found, else `false`.
  3214. */
  3215. function setCacheHas(value) {
  3216. return this.__data__.has(value);
  3217. }
  3218. // Add methods to `SetCache`.
  3219. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3220. SetCache.prototype.has = setCacheHas;
  3221. /*------------------------------------------------------------------------*/
  3222. /**
  3223. * Creates a stack cache object to store key-value pairs.
  3224. *
  3225. * @private
  3226. * @constructor
  3227. * @param {Array} [entries] The key-value pairs to cache.
  3228. */
  3229. function Stack(entries) {
  3230. var data = this.__data__ = new ListCache(entries);
  3231. this.size = data.size;
  3232. }
  3233. /**
  3234. * Removes all key-value entries from the stack.
  3235. *
  3236. * @private
  3237. * @name clear
  3238. * @memberOf Stack
  3239. */
  3240. function stackClear() {
  3241. this.__data__ = new ListCache;
  3242. this.size = 0;
  3243. }
  3244. /**
  3245. * Removes `key` and its value from the stack.
  3246. *
  3247. * @private
  3248. * @name delete
  3249. * @memberOf Stack
  3250. * @param {string} key The key of the value to remove.
  3251. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3252. */
  3253. function stackDelete(key) {
  3254. var data = this.__data__,
  3255. result = data['delete'](key);
  3256. this.size = data.size;
  3257. return result;
  3258. }
  3259. /**
  3260. * Gets the stack value for `key`.
  3261. *
  3262. * @private
  3263. * @name get
  3264. * @memberOf Stack
  3265. * @param {string} key The key of the value to get.
  3266. * @returns {*} Returns the entry value.
  3267. */
  3268. function stackGet(key) {
  3269. return this.__data__.get(key);
  3270. }
  3271. /**
  3272. * Checks if a stack value for `key` exists.
  3273. *
  3274. * @private
  3275. * @name has
  3276. * @memberOf Stack
  3277. * @param {string} key The key of the entry to check.
  3278. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3279. */
  3280. function stackHas(key) {
  3281. return this.__data__.has(key);
  3282. }
  3283. /**
  3284. * Sets the stack `key` to `value`.
  3285. *
  3286. * @private
  3287. * @name set
  3288. * @memberOf Stack
  3289. * @param {string} key The key of the value to set.
  3290. * @param {*} value The value to set.
  3291. * @returns {Object} Returns the stack cache instance.
  3292. */
  3293. function stackSet(key, value) {
  3294. var data = this.__data__;
  3295. if (data instanceof ListCache) {
  3296. var pairs = data.__data__;
  3297. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3298. pairs.push([key, value]);
  3299. this.size = ++data.size;
  3300. return this;
  3301. }
  3302. data = this.__data__ = new MapCache(pairs);
  3303. }
  3304. data.set(key, value);
  3305. this.size = data.size;
  3306. return this;
  3307. }
  3308. // Add methods to `Stack`.
  3309. Stack.prototype.clear = stackClear;
  3310. Stack.prototype['delete'] = stackDelete;
  3311. Stack.prototype.get = stackGet;
  3312. Stack.prototype.has = stackHas;
  3313. Stack.prototype.set = stackSet;
  3314. /*------------------------------------------------------------------------*/
  3315. /**
  3316. * Creates an array of the enumerable property names of the array-like `value`.
  3317. *
  3318. * @private
  3319. * @param {*} value The value to query.
  3320. * @param {boolean} inherited Specify returning inherited property names.
  3321. * @returns {Array} Returns the array of property names.
  3322. */
  3323. function arrayLikeKeys(value, inherited) {
  3324. var isArr = isArray(value),
  3325. isArg = !isArr && isArguments(value),
  3326. isBuff = !isArr && !isArg && isBuffer(value),
  3327. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3328. skipIndexes = isArr || isArg || isBuff || isType,
  3329. result = skipIndexes ? baseTimes(value.length, String) : [],
  3330. length = result.length;
  3331. for (var key in value) {
  3332. if ((inherited || hasOwnProperty.call(value, key)) &&
  3333. !(skipIndexes && (
  3334. // Safari 9 has enumerable `arguments.length` in strict mode.
  3335. key == 'length' ||
  3336. // Node.js 0.10 has enumerable non-index properties on buffers.
  3337. (isBuff && (key == 'offset' || key == 'parent')) ||
  3338. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3339. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3340. // Skip index properties.
  3341. isIndex(key, length)
  3342. ))) {
  3343. result.push(key);
  3344. }
  3345. }
  3346. return result;
  3347. }
  3348. /**
  3349. * A specialized version of `_.sample` for arrays.
  3350. *
  3351. * @private
  3352. * @param {Array} array The array to sample.
  3353. * @returns {*} Returns the random element.
  3354. */
  3355. function arraySample(array) {
  3356. var length = array.length;
  3357. return length ? array[baseRandom(0, length - 1)] : undefined;
  3358. }
  3359. /**
  3360. * A specialized version of `_.sampleSize` for arrays.
  3361. *
  3362. * @private
  3363. * @param {Array} array The array to sample.
  3364. * @param {number} n The number of elements to sample.
  3365. * @returns {Array} Returns the random elements.
  3366. */
  3367. function arraySampleSize(array, n) {
  3368. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3369. }
  3370. /**
  3371. * A specialized version of `_.shuffle` for arrays.
  3372. *
  3373. * @private
  3374. * @param {Array} array The array to shuffle.
  3375. * @returns {Array} Returns the new shuffled array.
  3376. */
  3377. function arrayShuffle(array) {
  3378. return shuffleSelf(copyArray(array));
  3379. }
  3380. /**
  3381. * This function is like `assignValue` except that it doesn't assign
  3382. * `undefined` values.
  3383. *
  3384. * @private
  3385. * @param {Object} object The object to modify.
  3386. * @param {string} key The key of the property to assign.
  3387. * @param {*} value The value to assign.
  3388. */
  3389. function assignMergeValue(object, key, value) {
  3390. if ((value !== undefined && !eq(object[key], value)) ||
  3391. (value === undefined && !(key in object))) {
  3392. baseAssignValue(object, key, value);
  3393. }
  3394. }
  3395. /**
  3396. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3397. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3398. * for equality comparisons.
  3399. *
  3400. * @private
  3401. * @param {Object} object The object to modify.
  3402. * @param {string} key The key of the property to assign.
  3403. * @param {*} value The value to assign.
  3404. */
  3405. function assignValue(object, key, value) {
  3406. var objValue = object[key];
  3407. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3408. (value === undefined && !(key in object))) {
  3409. baseAssignValue(object, key, value);
  3410. }
  3411. }
  3412. /**
  3413. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3414. *
  3415. * @private
  3416. * @param {Array} array The array to inspect.
  3417. * @param {*} key The key to search for.
  3418. * @returns {number} Returns the index of the matched value, else `-1`.
  3419. */
  3420. function assocIndexOf(array, key) {
  3421. var length = array.length;
  3422. while (length--) {
  3423. if (eq(array[length][0], key)) {
  3424. return length;
  3425. }
  3426. }
  3427. return -1;
  3428. }
  3429. /**
  3430. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3431. * by `iteratee` and values set by `setter`.
  3432. *
  3433. * @private
  3434. * @param {Array|Object} collection The collection to iterate over.
  3435. * @param {Function} setter The function to set `accumulator` values.
  3436. * @param {Function} iteratee The iteratee to transform keys.
  3437. * @param {Object} accumulator The initial aggregated object.
  3438. * @returns {Function} Returns `accumulator`.
  3439. */
  3440. function baseAggregator(collection, setter, iteratee, accumulator) {
  3441. baseEach(collection, function(value, key, collection) {
  3442. setter(accumulator, value, iteratee(value), collection);
  3443. });
  3444. return accumulator;
  3445. }
  3446. /**
  3447. * The base implementation of `_.assign` without support for multiple sources
  3448. * or `customizer` functions.
  3449. *
  3450. * @private
  3451. * @param {Object} object The destination object.
  3452. * @param {Object} source The source object.
  3453. * @returns {Object} Returns `object`.
  3454. */
  3455. function baseAssign(object, source) {
  3456. return object && copyObject(source, keys(source), object);
  3457. }
  3458. /**
  3459. * The base implementation of `_.assignIn` without support for multiple sources
  3460. * or `customizer` functions.
  3461. *
  3462. * @private
  3463. * @param {Object} object The destination object.
  3464. * @param {Object} source The source object.
  3465. * @returns {Object} Returns `object`.
  3466. */
  3467. function baseAssignIn(object, source) {
  3468. return object && copyObject(source, keysIn(source), object);
  3469. }
  3470. /**
  3471. * The base implementation of `assignValue` and `assignMergeValue` without
  3472. * value checks.
  3473. *
  3474. * @private
  3475. * @param {Object} object The object to modify.
  3476. * @param {string} key The key of the property to assign.
  3477. * @param {*} value The value to assign.
  3478. */
  3479. function baseAssignValue(object, key, value) {
  3480. if (key == '__proto__' && defineProperty) {
  3481. defineProperty(object, key, {
  3482. 'configurable': true,
  3483. 'enumerable': true,
  3484. 'value': value,
  3485. 'writable': true
  3486. });
  3487. } else {
  3488. object[key] = value;
  3489. }
  3490. }
  3491. /**
  3492. * The base implementation of `_.at` without support for individual paths.
  3493. *
  3494. * @private
  3495. * @param {Object} object The object to iterate over.
  3496. * @param {string[]} paths The property paths to pick.
  3497. * @returns {Array} Returns the picked elements.
  3498. */
  3499. function baseAt(object, paths) {
  3500. var index = -1,
  3501. length = paths.length,
  3502. result = Array(length),
  3503. skip = object == null;
  3504. while (++index < length) {
  3505. result[index] = skip ? undefined : get(object, paths[index]);
  3506. }
  3507. return result;
  3508. }
  3509. /**
  3510. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3511. *
  3512. * @private
  3513. * @param {number} number The number to clamp.
  3514. * @param {number} [lower] The lower bound.
  3515. * @param {number} upper The upper bound.
  3516. * @returns {number} Returns the clamped number.
  3517. */
  3518. function baseClamp(number, lower, upper) {
  3519. if (number === number) {
  3520. if (upper !== undefined) {
  3521. number = number <= upper ? number : upper;
  3522. }
  3523. if (lower !== undefined) {
  3524. number = number >= lower ? number : lower;
  3525. }
  3526. }
  3527. return number;
  3528. }
  3529. /**
  3530. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3531. * traversed objects.
  3532. *
  3533. * @private
  3534. * @param {*} value The value to clone.
  3535. * @param {boolean} bitmask The bitmask flags.
  3536. * 1 - Deep clone
  3537. * 2 - Flatten inherited properties
  3538. * 4 - Clone symbols
  3539. * @param {Function} [customizer] The function to customize cloning.
  3540. * @param {string} [key] The key of `value`.
  3541. * @param {Object} [object] The parent object of `value`.
  3542. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3543. * @returns {*} Returns the cloned value.
  3544. */
  3545. function baseClone(value, bitmask, customizer, key, object, stack) {
  3546. var result,
  3547. isDeep = bitmask & CLONE_DEEP_FLAG,
  3548. isFlat = bitmask & CLONE_FLAT_FLAG,
  3549. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3550. if (customizer) {
  3551. result = object ? customizer(value, key, object, stack) : customizer(value);
  3552. }
  3553. if (result !== undefined) {
  3554. return result;
  3555. }
  3556. if (!isObject(value)) {
  3557. return value;
  3558. }
  3559. var isArr = isArray(value);
  3560. if (isArr) {
  3561. result = initCloneArray(value);
  3562. if (!isDeep) {
  3563. return copyArray(value, result);
  3564. }
  3565. } else {
  3566. var tag = getTag(value),
  3567. isFunc = tag == funcTag || tag == genTag;
  3568. if (isBuffer(value)) {
  3569. return cloneBuffer(value, isDeep);
  3570. }
  3571. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3572. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3573. if (!isDeep) {
  3574. return isFlat
  3575. ? copySymbolsIn(value, baseAssignIn(result, value))
  3576. : copySymbols(value, baseAssign(result, value));
  3577. }
  3578. } else {
  3579. if (!cloneableTags[tag]) {
  3580. return object ? value : {};
  3581. }
  3582. result = initCloneByTag(value, tag, isDeep);
  3583. }
  3584. }
  3585. // Check for circular references and return its corresponding clone.
  3586. stack || (stack = new Stack);
  3587. var stacked = stack.get(value);
  3588. if (stacked) {
  3589. return stacked;
  3590. }
  3591. stack.set(value, result);
  3592. if (isSet(value)) {
  3593. value.forEach(function(subValue) {
  3594. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3595. });
  3596. } else if (isMap(value)) {
  3597. value.forEach(function(subValue, key) {
  3598. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3599. });
  3600. }
  3601. var keysFunc = isFull
  3602. ? (isFlat ? getAllKeysIn : getAllKeys)
  3603. : (isFlat ? keysIn : keys);
  3604. var props = isArr ? undefined : keysFunc(value);
  3605. arrayEach(props || value, function(subValue, key) {
  3606. if (props) {
  3607. key = subValue;
  3608. subValue = value[key];
  3609. }
  3610. // Recursively populate clone (susceptible to call stack limits).
  3611. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3612. });
  3613. return result;
  3614. }
  3615. /**
  3616. * The base implementation of `_.conforms` which doesn't clone `source`.
  3617. *
  3618. * @private
  3619. * @param {Object} source The object of property predicates to conform to.
  3620. * @returns {Function} Returns the new spec function.
  3621. */
  3622. function baseConforms(source) {
  3623. var props = keys(source);
  3624. return function(object) {
  3625. return baseConformsTo(object, source, props);
  3626. };
  3627. }
  3628. /**
  3629. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3630. *
  3631. * @private
  3632. * @param {Object} object The object to inspect.
  3633. * @param {Object} source The object of property predicates to conform to.
  3634. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3635. */
  3636. function baseConformsTo(object, source, props) {
  3637. var length = props.length;
  3638. if (object == null) {
  3639. return !length;
  3640. }
  3641. object = Object(object);
  3642. while (length--) {
  3643. var key = props[length],
  3644. predicate = source[key],
  3645. value = object[key];
  3646. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3647. return false;
  3648. }
  3649. }
  3650. return true;
  3651. }
  3652. /**
  3653. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3654. * to provide to `func`.
  3655. *
  3656. * @private
  3657. * @param {Function} func The function to delay.
  3658. * @param {number} wait The number of milliseconds to delay invocation.
  3659. * @param {Array} args The arguments to provide to `func`.
  3660. * @returns {number|Object} Returns the timer id or timeout object.
  3661. */
  3662. function baseDelay(func, wait, args) {
  3663. if (typeof func != 'function') {
  3664. throw new TypeError(FUNC_ERROR_TEXT);
  3665. }
  3666. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3667. }
  3668. /**
  3669. * The base implementation of methods like `_.difference` without support
  3670. * for excluding multiple arrays or iteratee shorthands.
  3671. *
  3672. * @private
  3673. * @param {Array} array The array to inspect.
  3674. * @param {Array} values The values to exclude.
  3675. * @param {Function} [iteratee] The iteratee invoked per element.
  3676. * @param {Function} [comparator] The comparator invoked per element.
  3677. * @returns {Array} Returns the new array of filtered values.
  3678. */
  3679. function baseDifference(array, values, iteratee, comparator) {
  3680. var index = -1,
  3681. includes = arrayIncludes,
  3682. isCommon = true,
  3683. length = array.length,
  3684. result = [],
  3685. valuesLength = values.length;
  3686. if (!length) {
  3687. return result;
  3688. }
  3689. if (iteratee) {
  3690. values = arrayMap(values, baseUnary(iteratee));
  3691. }
  3692. if (comparator) {
  3693. includes = arrayIncludesWith;
  3694. isCommon = false;
  3695. }
  3696. else if (values.length >= LARGE_ARRAY_SIZE) {
  3697. includes = cacheHas;
  3698. isCommon = false;
  3699. values = new SetCache(values);
  3700. }
  3701. outer:
  3702. while (++index < length) {
  3703. var value = array[index],
  3704. computed = iteratee == null ? value : iteratee(value);
  3705. value = (comparator || value !== 0) ? value : 0;
  3706. if (isCommon && computed === computed) {
  3707. var valuesIndex = valuesLength;
  3708. while (valuesIndex--) {
  3709. if (values[valuesIndex] === computed) {
  3710. continue outer;
  3711. }
  3712. }
  3713. result.push(value);
  3714. }
  3715. else if (!includes(values, computed, comparator)) {
  3716. result.push(value);
  3717. }
  3718. }
  3719. return result;
  3720. }
  3721. /**
  3722. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3723. *
  3724. * @private
  3725. * @param {Array|Object} collection The collection to iterate over.
  3726. * @param {Function} iteratee The function invoked per iteration.
  3727. * @returns {Array|Object} Returns `collection`.
  3728. */
  3729. var baseEach = createBaseEach(baseForOwn);
  3730. /**
  3731. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3732. *
  3733. * @private
  3734. * @param {Array|Object} collection The collection to iterate over.
  3735. * @param {Function} iteratee The function invoked per iteration.
  3736. * @returns {Array|Object} Returns `collection`.
  3737. */
  3738. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3739. /**
  3740. * The base implementation of `_.every` without support for iteratee shorthands.
  3741. *
  3742. * @private
  3743. * @param {Array|Object} collection The collection to iterate over.
  3744. * @param {Function} predicate The function invoked per iteration.
  3745. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3746. * else `false`
  3747. */
  3748. function baseEvery(collection, predicate) {
  3749. var result = true;
  3750. baseEach(collection, function(value, index, collection) {
  3751. result = !!predicate(value, index, collection);
  3752. return result;
  3753. });
  3754. return result;
  3755. }
  3756. /**
  3757. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3758. * `comparator` to determine the extremum value.
  3759. *
  3760. * @private
  3761. * @param {Array} array The array to iterate over.
  3762. * @param {Function} iteratee The iteratee invoked per iteration.
  3763. * @param {Function} comparator The comparator used to compare values.
  3764. * @returns {*} Returns the extremum value.
  3765. */
  3766. function baseExtremum(array, iteratee, comparator) {
  3767. var index = -1,
  3768. length = array.length;
  3769. while (++index < length) {
  3770. var value = array[index],
  3771. current = iteratee(value);
  3772. if (current != null && (computed === undefined
  3773. ? (current === current && !isSymbol(current))
  3774. : comparator(current, computed)
  3775. )) {
  3776. var computed = current,
  3777. result = value;
  3778. }
  3779. }
  3780. return result;
  3781. }
  3782. /**
  3783. * The base implementation of `_.fill` without an iteratee call guard.
  3784. *
  3785. * @private
  3786. * @param {Array} array The array to fill.
  3787. * @param {*} value The value to fill `array` with.
  3788. * @param {number} [start=0] The start position.
  3789. * @param {number} [end=array.length] The end position.
  3790. * @returns {Array} Returns `array`.
  3791. */
  3792. function baseFill(array, value, start, end) {
  3793. var length = array.length;
  3794. start = toInteger(start);
  3795. if (start < 0) {
  3796. start = -start > length ? 0 : (length + start);
  3797. }
  3798. end = (end === undefined || end > length) ? length : toInteger(end);
  3799. if (end < 0) {
  3800. end += length;
  3801. }
  3802. end = start > end ? 0 : toLength(end);
  3803. while (start < end) {
  3804. array[start++] = value;
  3805. }
  3806. return array;
  3807. }
  3808. /**
  3809. * The base implementation of `_.filter` without support for iteratee shorthands.
  3810. *
  3811. * @private
  3812. * @param {Array|Object} collection The collection to iterate over.
  3813. * @param {Function} predicate The function invoked per iteration.
  3814. * @returns {Array} Returns the new filtered array.
  3815. */
  3816. function baseFilter(collection, predicate) {
  3817. var result = [];
  3818. baseEach(collection, function(value, index, collection) {
  3819. if (predicate(value, index, collection)) {
  3820. result.push(value);
  3821. }
  3822. });
  3823. return result;
  3824. }
  3825. /**
  3826. * The base implementation of `_.flatten` with support for restricting flattening.
  3827. *
  3828. * @private
  3829. * @param {Array} array The array to flatten.
  3830. * @param {number} depth The maximum recursion depth.
  3831. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3832. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3833. * @param {Array} [result=[]] The initial result value.
  3834. * @returns {Array} Returns the new flattened array.
  3835. */
  3836. function baseFlatten(array, depth, predicate, isStrict, result) {
  3837. var index = -1,
  3838. length = array.length;
  3839. predicate || (predicate = isFlattenable);
  3840. result || (result = []);
  3841. while (++index < length) {
  3842. var value = array[index];
  3843. if (depth > 0 && predicate(value)) {
  3844. if (depth > 1) {
  3845. // Recursively flatten arrays (susceptible to call stack limits).
  3846. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3847. } else {
  3848. arrayPush(result, value);
  3849. }
  3850. } else if (!isStrict) {
  3851. result[result.length] = value;
  3852. }
  3853. }
  3854. return result;
  3855. }
  3856. /**
  3857. * The base implementation of `baseForOwn` which iterates over `object`
  3858. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3859. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3860. *
  3861. * @private
  3862. * @param {Object} object The object to iterate over.
  3863. * @param {Function} iteratee The function invoked per iteration.
  3864. * @param {Function} keysFunc The function to get the keys of `object`.
  3865. * @returns {Object} Returns `object`.
  3866. */
  3867. var baseFor = createBaseFor();
  3868. /**
  3869. * This function is like `baseFor` except that it iterates over properties
  3870. * in the opposite order.
  3871. *
  3872. * @private
  3873. * @param {Object} object The object to iterate over.
  3874. * @param {Function} iteratee The function invoked per iteration.
  3875. * @param {Function} keysFunc The function to get the keys of `object`.
  3876. * @returns {Object} Returns `object`.
  3877. */
  3878. var baseForRight = createBaseFor(true);
  3879. /**
  3880. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3881. *
  3882. * @private
  3883. * @param {Object} object The object to iterate over.
  3884. * @param {Function} iteratee The function invoked per iteration.
  3885. * @returns {Object} Returns `object`.
  3886. */
  3887. function baseForOwn(object, iteratee) {
  3888. return object && baseFor(object, iteratee, keys);
  3889. }
  3890. /**
  3891. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3892. *
  3893. * @private
  3894. * @param {Object} object The object to iterate over.
  3895. * @param {Function} iteratee The function invoked per iteration.
  3896. * @returns {Object} Returns `object`.
  3897. */
  3898. function baseForOwnRight(object, iteratee) {
  3899. return object && baseForRight(object, iteratee, keys);
  3900. }
  3901. /**
  3902. * The base implementation of `_.functions` which creates an array of
  3903. * `object` function property names filtered from `props`.
  3904. *
  3905. * @private
  3906. * @param {Object} object The object to inspect.
  3907. * @param {Array} props The property names to filter.
  3908. * @returns {Array} Returns the function names.
  3909. */
  3910. function baseFunctions(object, props) {
  3911. return arrayFilter(props, function(key) {
  3912. return isFunction(object[key]);
  3913. });
  3914. }
  3915. /**
  3916. * The base implementation of `_.get` without support for default values.
  3917. *
  3918. * @private
  3919. * @param {Object} object The object to query.
  3920. * @param {Array|string} path The path of the property to get.
  3921. * @returns {*} Returns the resolved value.
  3922. */
  3923. function baseGet(object, path) {
  3924. path = castPath(path, object);
  3925. var index = 0,
  3926. length = path.length;
  3927. while (object != null && index < length) {
  3928. object = object[toKey(path[index++])];
  3929. }
  3930. return (index && index == length) ? object : undefined;
  3931. }
  3932. /**
  3933. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3934. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3935. * symbols of `object`.
  3936. *
  3937. * @private
  3938. * @param {Object} object The object to query.
  3939. * @param {Function} keysFunc The function to get the keys of `object`.
  3940. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3941. * @returns {Array} Returns the array of property names and symbols.
  3942. */
  3943. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3944. var result = keysFunc(object);
  3945. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3946. }
  3947. /**
  3948. * The base implementation of `getTag` without fallbacks for buggy environments.
  3949. *
  3950. * @private
  3951. * @param {*} value The value to query.
  3952. * @returns {string} Returns the `toStringTag`.
  3953. */
  3954. function baseGetTag(value) {
  3955. if (value == null) {
  3956. return value === undefined ? undefinedTag : nullTag;
  3957. }
  3958. return (symToStringTag && symToStringTag in Object(value))
  3959. ? getRawTag(value)
  3960. : objectToString(value);
  3961. }
  3962. /**
  3963. * The base implementation of `_.gt` which doesn't coerce arguments.
  3964. *
  3965. * @private
  3966. * @param {*} value The value to compare.
  3967. * @param {*} other The other value to compare.
  3968. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3969. * else `false`.
  3970. */
  3971. function baseGt(value, other) {
  3972. return value > other;
  3973. }
  3974. /**
  3975. * The base implementation of `_.has` without support for deep paths.
  3976. *
  3977. * @private
  3978. * @param {Object} [object] The object to query.
  3979. * @param {Array|string} key The key to check.
  3980. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3981. */
  3982. function baseHas(object, key) {
  3983. return object != null && hasOwnProperty.call(object, key);
  3984. }
  3985. /**
  3986. * The base implementation of `_.hasIn` without support for deep paths.
  3987. *
  3988. * @private
  3989. * @param {Object} [object] The object to query.
  3990. * @param {Array|string} key The key to check.
  3991. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3992. */
  3993. function baseHasIn(object, key) {
  3994. return object != null && key in Object(object);
  3995. }
  3996. /**
  3997. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3998. *
  3999. * @private
  4000. * @param {number} number The number to check.
  4001. * @param {number} start The start of the range.
  4002. * @param {number} end The end of the range.
  4003. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4004. */
  4005. function baseInRange(number, start, end) {
  4006. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4007. }
  4008. /**
  4009. * The base implementation of methods like `_.intersection`, without support
  4010. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4011. *
  4012. * @private
  4013. * @param {Array} arrays The arrays to inspect.
  4014. * @param {Function} [iteratee] The iteratee invoked per element.
  4015. * @param {Function} [comparator] The comparator invoked per element.
  4016. * @returns {Array} Returns the new array of shared values.
  4017. */
  4018. function baseIntersection(arrays, iteratee, comparator) {
  4019. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4020. length = arrays[0].length,
  4021. othLength = arrays.length,
  4022. othIndex = othLength,
  4023. caches = Array(othLength),
  4024. maxLength = Infinity,
  4025. result = [];
  4026. while (othIndex--) {
  4027. var array = arrays[othIndex];
  4028. if (othIndex && iteratee) {
  4029. array = arrayMap(array, baseUnary(iteratee));
  4030. }
  4031. maxLength = nativeMin(array.length, maxLength);
  4032. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4033. ? new SetCache(othIndex && array)
  4034. : undefined;
  4035. }
  4036. array = arrays[0];
  4037. var index = -1,
  4038. seen = caches[0];
  4039. outer:
  4040. while (++index < length && result.length < maxLength) {
  4041. var value = array[index],
  4042. computed = iteratee ? iteratee(value) : value;
  4043. value = (comparator || value !== 0) ? value : 0;
  4044. if (!(seen
  4045. ? cacheHas(seen, computed)
  4046. : includes(result, computed, comparator)
  4047. )) {
  4048. othIndex = othLength;
  4049. while (--othIndex) {
  4050. var cache = caches[othIndex];
  4051. if (!(cache
  4052. ? cacheHas(cache, computed)
  4053. : includes(arrays[othIndex], computed, comparator))
  4054. ) {
  4055. continue outer;
  4056. }
  4057. }
  4058. if (seen) {
  4059. seen.push(computed);
  4060. }
  4061. result.push(value);
  4062. }
  4063. }
  4064. return result;
  4065. }
  4066. /**
  4067. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4068. * `object` with values transformed by `iteratee` and set by `setter`.
  4069. *
  4070. * @private
  4071. * @param {Object} object The object to iterate over.
  4072. * @param {Function} setter The function to set `accumulator` values.
  4073. * @param {Function} iteratee The iteratee to transform values.
  4074. * @param {Object} accumulator The initial inverted object.
  4075. * @returns {Function} Returns `accumulator`.
  4076. */
  4077. function baseInverter(object, setter, iteratee, accumulator) {
  4078. baseForOwn(object, function(value, key, object) {
  4079. setter(accumulator, iteratee(value), key, object);
  4080. });
  4081. return accumulator;
  4082. }
  4083. /**
  4084. * The base implementation of `_.invoke` without support for individual
  4085. * method arguments.
  4086. *
  4087. * @private
  4088. * @param {Object} object The object to query.
  4089. * @param {Array|string} path The path of the method to invoke.
  4090. * @param {Array} args The arguments to invoke the method with.
  4091. * @returns {*} Returns the result of the invoked method.
  4092. */
  4093. function baseInvoke(object, path, args) {
  4094. path = castPath(path, object);
  4095. object = parent(object, path);
  4096. var func = object == null ? object : object[toKey(last(path))];
  4097. return func == null ? undefined : apply(func, object, args);
  4098. }
  4099. /**
  4100. * The base implementation of `_.isArguments`.
  4101. *
  4102. * @private
  4103. * @param {*} value The value to check.
  4104. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4105. */
  4106. function baseIsArguments(value) {
  4107. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4108. }
  4109. /**
  4110. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4111. *
  4112. * @private
  4113. * @param {*} value The value to check.
  4114. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4115. */
  4116. function baseIsArrayBuffer(value) {
  4117. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4118. }
  4119. /**
  4120. * The base implementation of `_.isDate` without Node.js optimizations.
  4121. *
  4122. * @private
  4123. * @param {*} value The value to check.
  4124. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4125. */
  4126. function baseIsDate(value) {
  4127. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4128. }
  4129. /**
  4130. * The base implementation of `_.isEqual` which supports partial comparisons
  4131. * and tracks traversed objects.
  4132. *
  4133. * @private
  4134. * @param {*} value The value to compare.
  4135. * @param {*} other The other value to compare.
  4136. * @param {boolean} bitmask The bitmask flags.
  4137. * 1 - Unordered comparison
  4138. * 2 - Partial comparison
  4139. * @param {Function} [customizer] The function to customize comparisons.
  4140. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4141. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4142. */
  4143. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4144. if (value === other) {
  4145. return true;
  4146. }
  4147. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4148. return value !== value && other !== other;
  4149. }
  4150. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4151. }
  4152. /**
  4153. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4154. * deep comparisons and tracks traversed objects enabling objects with circular
  4155. * references to be compared.
  4156. *
  4157. * @private
  4158. * @param {Object} object The object to compare.
  4159. * @param {Object} other The other object to compare.
  4160. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4161. * @param {Function} customizer The function to customize comparisons.
  4162. * @param {Function} equalFunc The function to determine equivalents of values.
  4163. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4164. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4165. */
  4166. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4167. var objIsArr = isArray(object),
  4168. othIsArr = isArray(other),
  4169. objTag = objIsArr ? arrayTag : getTag(object),
  4170. othTag = othIsArr ? arrayTag : getTag(other);
  4171. objTag = objTag == argsTag ? objectTag : objTag;
  4172. othTag = othTag == argsTag ? objectTag : othTag;
  4173. var objIsObj = objTag == objectTag,
  4174. othIsObj = othTag == objectTag,
  4175. isSameTag = objTag == othTag;
  4176. if (isSameTag && isBuffer(object)) {
  4177. if (!isBuffer(other)) {
  4178. return false;
  4179. }
  4180. objIsArr = true;
  4181. objIsObj = false;
  4182. }
  4183. if (isSameTag && !objIsObj) {
  4184. stack || (stack = new Stack);
  4185. return (objIsArr || isTypedArray(object))
  4186. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4187. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4188. }
  4189. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4190. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4191. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4192. if (objIsWrapped || othIsWrapped) {
  4193. var objUnwrapped = objIsWrapped ? object.value() : object,
  4194. othUnwrapped = othIsWrapped ? other.value() : other;
  4195. stack || (stack = new Stack);
  4196. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4197. }
  4198. }
  4199. if (!isSameTag) {
  4200. return false;
  4201. }
  4202. stack || (stack = new Stack);
  4203. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4204. }
  4205. /**
  4206. * The base implementation of `_.isMap` without Node.js optimizations.
  4207. *
  4208. * @private
  4209. * @param {*} value The value to check.
  4210. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4211. */
  4212. function baseIsMap(value) {
  4213. return isObjectLike(value) && getTag(value) == mapTag;
  4214. }
  4215. /**
  4216. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4217. *
  4218. * @private
  4219. * @param {Object} object The object to inspect.
  4220. * @param {Object} source The object of property values to match.
  4221. * @param {Array} matchData The property names, values, and compare flags to match.
  4222. * @param {Function} [customizer] The function to customize comparisons.
  4223. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4224. */
  4225. function baseIsMatch(object, source, matchData, customizer) {
  4226. var index = matchData.length,
  4227. length = index,
  4228. noCustomizer = !customizer;
  4229. if (object == null) {
  4230. return !length;
  4231. }
  4232. object = Object(object);
  4233. while (index--) {
  4234. var data = matchData[index];
  4235. if ((noCustomizer && data[2])
  4236. ? data[1] !== object[data[0]]
  4237. : !(data[0] in object)
  4238. ) {
  4239. return false;
  4240. }
  4241. }
  4242. while (++index < length) {
  4243. data = matchData[index];
  4244. var key = data[0],
  4245. objValue = object[key],
  4246. srcValue = data[1];
  4247. if (noCustomizer && data[2]) {
  4248. if (objValue === undefined && !(key in object)) {
  4249. return false;
  4250. }
  4251. } else {
  4252. var stack = new Stack;
  4253. if (customizer) {
  4254. var result = customizer(objValue, srcValue, key, object, source, stack);
  4255. }
  4256. if (!(result === undefined
  4257. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4258. : result
  4259. )) {
  4260. return false;
  4261. }
  4262. }
  4263. }
  4264. return true;
  4265. }
  4266. /**
  4267. * The base implementation of `_.isNative` without bad shim checks.
  4268. *
  4269. * @private
  4270. * @param {*} value The value to check.
  4271. * @returns {boolean} Returns `true` if `value` is a native function,
  4272. * else `false`.
  4273. */
  4274. function baseIsNative(value) {
  4275. if (!isObject(value) || isMasked(value)) {
  4276. return false;
  4277. }
  4278. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4279. return pattern.test(toSource(value));
  4280. }
  4281. /**
  4282. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4283. *
  4284. * @private
  4285. * @param {*} value The value to check.
  4286. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4287. */
  4288. function baseIsRegExp(value) {
  4289. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4290. }
  4291. /**
  4292. * The base implementation of `_.isSet` without Node.js optimizations.
  4293. *
  4294. * @private
  4295. * @param {*} value The value to check.
  4296. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4297. */
  4298. function baseIsSet(value) {
  4299. return isObjectLike(value) && getTag(value) == setTag;
  4300. }
  4301. /**
  4302. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4303. *
  4304. * @private
  4305. * @param {*} value The value to check.
  4306. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4307. */
  4308. function baseIsTypedArray(value) {
  4309. return isObjectLike(value) &&
  4310. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4311. }
  4312. /**
  4313. * The base implementation of `_.iteratee`.
  4314. *
  4315. * @private
  4316. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4317. * @returns {Function} Returns the iteratee.
  4318. */
  4319. function baseIteratee(value) {
  4320. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4321. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4322. if (typeof value == 'function') {
  4323. return value;
  4324. }
  4325. if (value == null) {
  4326. return identity;
  4327. }
  4328. if (typeof value == 'object') {
  4329. return isArray(value)
  4330. ? baseMatchesProperty(value[0], value[1])
  4331. : baseMatches(value);
  4332. }
  4333. return property(value);
  4334. }
  4335. /**
  4336. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4337. *
  4338. * @private
  4339. * @param {Object} object The object to query.
  4340. * @returns {Array} Returns the array of property names.
  4341. */
  4342. function baseKeys(object) {
  4343. if (!isPrototype(object)) {
  4344. return nativeKeys(object);
  4345. }
  4346. var result = [];
  4347. for (var key in Object(object)) {
  4348. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4349. result.push(key);
  4350. }
  4351. }
  4352. return result;
  4353. }
  4354. /**
  4355. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4356. *
  4357. * @private
  4358. * @param {Object} object The object to query.
  4359. * @returns {Array} Returns the array of property names.
  4360. */
  4361. function baseKeysIn(object) {
  4362. if (!isObject(object)) {
  4363. return nativeKeysIn(object);
  4364. }
  4365. var isProto = isPrototype(object),
  4366. result = [];
  4367. for (var key in object) {
  4368. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4369. result.push(key);
  4370. }
  4371. }
  4372. return result;
  4373. }
  4374. /**
  4375. * The base implementation of `_.lt` which doesn't coerce arguments.
  4376. *
  4377. * @private
  4378. * @param {*} value The value to compare.
  4379. * @param {*} other The other value to compare.
  4380. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4381. * else `false`.
  4382. */
  4383. function baseLt(value, other) {
  4384. return value < other;
  4385. }
  4386. /**
  4387. * The base implementation of `_.map` without support for iteratee shorthands.
  4388. *
  4389. * @private
  4390. * @param {Array|Object} collection The collection to iterate over.
  4391. * @param {Function} iteratee The function invoked per iteration.
  4392. * @returns {Array} Returns the new mapped array.
  4393. */
  4394. function baseMap(collection, iteratee) {
  4395. var index = -1,
  4396. result = isArrayLike(collection) ? Array(collection.length) : [];
  4397. baseEach(collection, function(value, key, collection) {
  4398. result[++index] = iteratee(value, key, collection);
  4399. });
  4400. return result;
  4401. }
  4402. /**
  4403. * The base implementation of `_.matches` which doesn't clone `source`.
  4404. *
  4405. * @private
  4406. * @param {Object} source The object of property values to match.
  4407. * @returns {Function} Returns the new spec function.
  4408. */
  4409. function baseMatches(source) {
  4410. var matchData = getMatchData(source);
  4411. if (matchData.length == 1 && matchData[0][2]) {
  4412. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4413. }
  4414. return function(object) {
  4415. return object === source || baseIsMatch(object, source, matchData);
  4416. };
  4417. }
  4418. /**
  4419. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4420. *
  4421. * @private
  4422. * @param {string} path The path of the property to get.
  4423. * @param {*} srcValue The value to match.
  4424. * @returns {Function} Returns the new spec function.
  4425. */
  4426. function baseMatchesProperty(path, srcValue) {
  4427. if (isKey(path) && isStrictComparable(srcValue)) {
  4428. return matchesStrictComparable(toKey(path), srcValue);
  4429. }
  4430. return function(object) {
  4431. var objValue = get(object, path);
  4432. return (objValue === undefined && objValue === srcValue)
  4433. ? hasIn(object, path)
  4434. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4435. };
  4436. }
  4437. /**
  4438. * The base implementation of `_.merge` without support for multiple sources.
  4439. *
  4440. * @private
  4441. * @param {Object} object The destination object.
  4442. * @param {Object} source The source object.
  4443. * @param {number} srcIndex The index of `source`.
  4444. * @param {Function} [customizer] The function to customize merged values.
  4445. * @param {Object} [stack] Tracks traversed source values and their merged
  4446. * counterparts.
  4447. */
  4448. function baseMerge(object, source, srcIndex, customizer, stack) {
  4449. if (object === source) {
  4450. return;
  4451. }
  4452. baseFor(source, function(srcValue, key) {
  4453. stack || (stack = new Stack);
  4454. if (isObject(srcValue)) {
  4455. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4456. }
  4457. else {
  4458. var newValue = customizer
  4459. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4460. : undefined;
  4461. if (newValue === undefined) {
  4462. newValue = srcValue;
  4463. }
  4464. assignMergeValue(object, key, newValue);
  4465. }
  4466. }, keysIn);
  4467. }
  4468. /**
  4469. * A specialized version of `baseMerge` for arrays and objects which performs
  4470. * deep merges and tracks traversed objects enabling objects with circular
  4471. * references to be merged.
  4472. *
  4473. * @private
  4474. * @param {Object} object The destination object.
  4475. * @param {Object} source The source object.
  4476. * @param {string} key The key of the value to merge.
  4477. * @param {number} srcIndex The index of `source`.
  4478. * @param {Function} mergeFunc The function to merge values.
  4479. * @param {Function} [customizer] The function to customize assigned values.
  4480. * @param {Object} [stack] Tracks traversed source values and their merged
  4481. * counterparts.
  4482. */
  4483. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4484. var objValue = safeGet(object, key),
  4485. srcValue = safeGet(source, key),
  4486. stacked = stack.get(srcValue);
  4487. if (stacked) {
  4488. assignMergeValue(object, key, stacked);
  4489. return;
  4490. }
  4491. var newValue = customizer
  4492. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4493. : undefined;
  4494. var isCommon = newValue === undefined;
  4495. if (isCommon) {
  4496. var isArr = isArray(srcValue),
  4497. isBuff = !isArr && isBuffer(srcValue),
  4498. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4499. newValue = srcValue;
  4500. if (isArr || isBuff || isTyped) {
  4501. if (isArray(objValue)) {
  4502. newValue = objValue;
  4503. }
  4504. else if (isArrayLikeObject(objValue)) {
  4505. newValue = copyArray(objValue);
  4506. }
  4507. else if (isBuff) {
  4508. isCommon = false;
  4509. newValue = cloneBuffer(srcValue, true);
  4510. }
  4511. else if (isTyped) {
  4512. isCommon = false;
  4513. newValue = cloneTypedArray(srcValue, true);
  4514. }
  4515. else {
  4516. newValue = [];
  4517. }
  4518. }
  4519. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4520. newValue = objValue;
  4521. if (isArguments(objValue)) {
  4522. newValue = toPlainObject(objValue);
  4523. }
  4524. else if (!isObject(objValue) || isFunction(objValue)) {
  4525. newValue = initCloneObject(srcValue);
  4526. }
  4527. }
  4528. else {
  4529. isCommon = false;
  4530. }
  4531. }
  4532. if (isCommon) {
  4533. // Recursively merge objects and arrays (susceptible to call stack limits).
  4534. stack.set(srcValue, newValue);
  4535. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4536. stack['delete'](srcValue);
  4537. }
  4538. assignMergeValue(object, key, newValue);
  4539. }
  4540. /**
  4541. * The base implementation of `_.nth` which doesn't coerce arguments.
  4542. *
  4543. * @private
  4544. * @param {Array} array The array to query.
  4545. * @param {number} n The index of the element to return.
  4546. * @returns {*} Returns the nth element of `array`.
  4547. */
  4548. function baseNth(array, n) {
  4549. var length = array.length;
  4550. if (!length) {
  4551. return;
  4552. }
  4553. n += n < 0 ? length : 0;
  4554. return isIndex(n, length) ? array[n] : undefined;
  4555. }
  4556. /**
  4557. * The base implementation of `_.orderBy` without param guards.
  4558. *
  4559. * @private
  4560. * @param {Array|Object} collection The collection to iterate over.
  4561. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4562. * @param {string[]} orders The sort orders of `iteratees`.
  4563. * @returns {Array} Returns the new sorted array.
  4564. */
  4565. function baseOrderBy(collection, iteratees, orders) {
  4566. if (iteratees.length) {
  4567. iteratees = arrayMap(iteratees, function(iteratee) {
  4568. if (isArray(iteratee)) {
  4569. return function(value) {
  4570. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4571. }
  4572. }
  4573. return iteratee;
  4574. });
  4575. } else {
  4576. iteratees = [identity];
  4577. }
  4578. var index = -1;
  4579. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4580. var result = baseMap(collection, function(value, key, collection) {
  4581. var criteria = arrayMap(iteratees, function(iteratee) {
  4582. return iteratee(value);
  4583. });
  4584. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4585. });
  4586. return baseSortBy(result, function(object, other) {
  4587. return compareMultiple(object, other, orders);
  4588. });
  4589. }
  4590. /**
  4591. * The base implementation of `_.pick` without support for individual
  4592. * property identifiers.
  4593. *
  4594. * @private
  4595. * @param {Object} object The source object.
  4596. * @param {string[]} paths The property paths to pick.
  4597. * @returns {Object} Returns the new object.
  4598. */
  4599. function basePick(object, paths) {
  4600. return basePickBy(object, paths, function(value, path) {
  4601. return hasIn(object, path);
  4602. });
  4603. }
  4604. /**
  4605. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4606. *
  4607. * @private
  4608. * @param {Object} object The source object.
  4609. * @param {string[]} paths The property paths to pick.
  4610. * @param {Function} predicate The function invoked per property.
  4611. * @returns {Object} Returns the new object.
  4612. */
  4613. function basePickBy(object, paths, predicate) {
  4614. var index = -1,
  4615. length = paths.length,
  4616. result = {};
  4617. while (++index < length) {
  4618. var path = paths[index],
  4619. value = baseGet(object, path);
  4620. if (predicate(value, path)) {
  4621. baseSet(result, castPath(path, object), value);
  4622. }
  4623. }
  4624. return result;
  4625. }
  4626. /**
  4627. * A specialized version of `baseProperty` which supports deep paths.
  4628. *
  4629. * @private
  4630. * @param {Array|string} path The path of the property to get.
  4631. * @returns {Function} Returns the new accessor function.
  4632. */
  4633. function basePropertyDeep(path) {
  4634. return function(object) {
  4635. return baseGet(object, path);
  4636. };
  4637. }
  4638. /**
  4639. * The base implementation of `_.pullAllBy` without support for iteratee
  4640. * shorthands.
  4641. *
  4642. * @private
  4643. * @param {Array} array The array to modify.
  4644. * @param {Array} values The values to remove.
  4645. * @param {Function} [iteratee] The iteratee invoked per element.
  4646. * @param {Function} [comparator] The comparator invoked per element.
  4647. * @returns {Array} Returns `array`.
  4648. */
  4649. function basePullAll(array, values, iteratee, comparator) {
  4650. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4651. index = -1,
  4652. length = values.length,
  4653. seen = array;
  4654. if (array === values) {
  4655. values = copyArray(values);
  4656. }
  4657. if (iteratee) {
  4658. seen = arrayMap(array, baseUnary(iteratee));
  4659. }
  4660. while (++index < length) {
  4661. var fromIndex = 0,
  4662. value = values[index],
  4663. computed = iteratee ? iteratee(value) : value;
  4664. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4665. if (seen !== array) {
  4666. splice.call(seen, fromIndex, 1);
  4667. }
  4668. splice.call(array, fromIndex, 1);
  4669. }
  4670. }
  4671. return array;
  4672. }
  4673. /**
  4674. * The base implementation of `_.pullAt` without support for individual
  4675. * indexes or capturing the removed elements.
  4676. *
  4677. * @private
  4678. * @param {Array} array The array to modify.
  4679. * @param {number[]} indexes The indexes of elements to remove.
  4680. * @returns {Array} Returns `array`.
  4681. */
  4682. function basePullAt(array, indexes) {
  4683. var length = array ? indexes.length : 0,
  4684. lastIndex = length - 1;
  4685. while (length--) {
  4686. var index = indexes[length];
  4687. if (length == lastIndex || index !== previous) {
  4688. var previous = index;
  4689. if (isIndex(index)) {
  4690. splice.call(array, index, 1);
  4691. } else {
  4692. baseUnset(array, index);
  4693. }
  4694. }
  4695. }
  4696. return array;
  4697. }
  4698. /**
  4699. * The base implementation of `_.random` without support for returning
  4700. * floating-point numbers.
  4701. *
  4702. * @private
  4703. * @param {number} lower The lower bound.
  4704. * @param {number} upper The upper bound.
  4705. * @returns {number} Returns the random number.
  4706. */
  4707. function baseRandom(lower, upper) {
  4708. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4709. }
  4710. /**
  4711. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4712. * coerce arguments.
  4713. *
  4714. * @private
  4715. * @param {number} start The start of the range.
  4716. * @param {number} end The end of the range.
  4717. * @param {number} step The value to increment or decrement by.
  4718. * @param {boolean} [fromRight] Specify iterating from right to left.
  4719. * @returns {Array} Returns the range of numbers.
  4720. */
  4721. function baseRange(start, end, step, fromRight) {
  4722. var index = -1,
  4723. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4724. result = Array(length);
  4725. while (length--) {
  4726. result[fromRight ? length : ++index] = start;
  4727. start += step;
  4728. }
  4729. return result;
  4730. }
  4731. /**
  4732. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4733. *
  4734. * @private
  4735. * @param {string} string The string to repeat.
  4736. * @param {number} n The number of times to repeat the string.
  4737. * @returns {string} Returns the repeated string.
  4738. */
  4739. function baseRepeat(string, n) {
  4740. var result = '';
  4741. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4742. return result;
  4743. }
  4744. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4745. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4746. do {
  4747. if (n % 2) {
  4748. result += string;
  4749. }
  4750. n = nativeFloor(n / 2);
  4751. if (n) {
  4752. string += string;
  4753. }
  4754. } while (n);
  4755. return result;
  4756. }
  4757. /**
  4758. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4759. *
  4760. * @private
  4761. * @param {Function} func The function to apply a rest parameter to.
  4762. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4763. * @returns {Function} Returns the new function.
  4764. */
  4765. function baseRest(func, start) {
  4766. return setToString(overRest(func, start, identity), func + '');
  4767. }
  4768. /**
  4769. * The base implementation of `_.sample`.
  4770. *
  4771. * @private
  4772. * @param {Array|Object} collection The collection to sample.
  4773. * @returns {*} Returns the random element.
  4774. */
  4775. function baseSample(collection) {
  4776. return arraySample(values(collection));
  4777. }
  4778. /**
  4779. * The base implementation of `_.sampleSize` without param guards.
  4780. *
  4781. * @private
  4782. * @param {Array|Object} collection The collection to sample.
  4783. * @param {number} n The number of elements to sample.
  4784. * @returns {Array} Returns the random elements.
  4785. */
  4786. function baseSampleSize(collection, n) {
  4787. var array = values(collection);
  4788. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4789. }
  4790. /**
  4791. * The base implementation of `_.set`.
  4792. *
  4793. * @private
  4794. * @param {Object} object The object to modify.
  4795. * @param {Array|string} path The path of the property to set.
  4796. * @param {*} value The value to set.
  4797. * @param {Function} [customizer] The function to customize path creation.
  4798. * @returns {Object} Returns `object`.
  4799. */
  4800. function baseSet(object, path, value, customizer) {
  4801. if (!isObject(object)) {
  4802. return object;
  4803. }
  4804. path = castPath(path, object);
  4805. var index = -1,
  4806. length = path.length,
  4807. lastIndex = length - 1,
  4808. nested = object;
  4809. while (nested != null && ++index < length) {
  4810. var key = toKey(path[index]),
  4811. newValue = value;
  4812. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4813. return object;
  4814. }
  4815. if (index != lastIndex) {
  4816. var objValue = nested[key];
  4817. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4818. if (newValue === undefined) {
  4819. newValue = isObject(objValue)
  4820. ? objValue
  4821. : (isIndex(path[index + 1]) ? [] : {});
  4822. }
  4823. }
  4824. assignValue(nested, key, newValue);
  4825. nested = nested[key];
  4826. }
  4827. return object;
  4828. }
  4829. /**
  4830. * The base implementation of `setData` without support for hot loop shorting.
  4831. *
  4832. * @private
  4833. * @param {Function} func The function to associate metadata with.
  4834. * @param {*} data The metadata.
  4835. * @returns {Function} Returns `func`.
  4836. */
  4837. var baseSetData = !metaMap ? identity : function(func, data) {
  4838. metaMap.set(func, data);
  4839. return func;
  4840. };
  4841. /**
  4842. * The base implementation of `setToString` without support for hot loop shorting.
  4843. *
  4844. * @private
  4845. * @param {Function} func The function to modify.
  4846. * @param {Function} string The `toString` result.
  4847. * @returns {Function} Returns `func`.
  4848. */
  4849. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4850. return defineProperty(func, 'toString', {
  4851. 'configurable': true,
  4852. 'enumerable': false,
  4853. 'value': constant(string),
  4854. 'writable': true
  4855. });
  4856. };
  4857. /**
  4858. * The base implementation of `_.shuffle`.
  4859. *
  4860. * @private
  4861. * @param {Array|Object} collection The collection to shuffle.
  4862. * @returns {Array} Returns the new shuffled array.
  4863. */
  4864. function baseShuffle(collection) {
  4865. return shuffleSelf(values(collection));
  4866. }
  4867. /**
  4868. * The base implementation of `_.slice` without an iteratee call guard.
  4869. *
  4870. * @private
  4871. * @param {Array} array The array to slice.
  4872. * @param {number} [start=0] The start position.
  4873. * @param {number} [end=array.length] The end position.
  4874. * @returns {Array} Returns the slice of `array`.
  4875. */
  4876. function baseSlice(array, start, end) {
  4877. var index = -1,
  4878. length = array.length;
  4879. if (start < 0) {
  4880. start = -start > length ? 0 : (length + start);
  4881. }
  4882. end = end > length ? length : end;
  4883. if (end < 0) {
  4884. end += length;
  4885. }
  4886. length = start > end ? 0 : ((end - start) >>> 0);
  4887. start >>>= 0;
  4888. var result = Array(length);
  4889. while (++index < length) {
  4890. result[index] = array[index + start];
  4891. }
  4892. return result;
  4893. }
  4894. /**
  4895. * The base implementation of `_.some` without support for iteratee shorthands.
  4896. *
  4897. * @private
  4898. * @param {Array|Object} collection The collection to iterate over.
  4899. * @param {Function} predicate The function invoked per iteration.
  4900. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4901. * else `false`.
  4902. */
  4903. function baseSome(collection, predicate) {
  4904. var result;
  4905. baseEach(collection, function(value, index, collection) {
  4906. result = predicate(value, index, collection);
  4907. return !result;
  4908. });
  4909. return !!result;
  4910. }
  4911. /**
  4912. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4913. * performs a binary search of `array` to determine the index at which `value`
  4914. * should be inserted into `array` in order to maintain its sort order.
  4915. *
  4916. * @private
  4917. * @param {Array} array The sorted array to inspect.
  4918. * @param {*} value The value to evaluate.
  4919. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4920. * @returns {number} Returns the index at which `value` should be inserted
  4921. * into `array`.
  4922. */
  4923. function baseSortedIndex(array, value, retHighest) {
  4924. var low = 0,
  4925. high = array == null ? low : array.length;
  4926. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4927. while (low < high) {
  4928. var mid = (low + high) >>> 1,
  4929. computed = array[mid];
  4930. if (computed !== null && !isSymbol(computed) &&
  4931. (retHighest ? (computed <= value) : (computed < value))) {
  4932. low = mid + 1;
  4933. } else {
  4934. high = mid;
  4935. }
  4936. }
  4937. return high;
  4938. }
  4939. return baseSortedIndexBy(array, value, identity, retHighest);
  4940. }
  4941. /**
  4942. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4943. * which invokes `iteratee` for `value` and each element of `array` to compute
  4944. * their sort ranking. The iteratee is invoked with one argument; (value).
  4945. *
  4946. * @private
  4947. * @param {Array} array The sorted array to inspect.
  4948. * @param {*} value The value to evaluate.
  4949. * @param {Function} iteratee The iteratee invoked per element.
  4950. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4951. * @returns {number} Returns the index at which `value` should be inserted
  4952. * into `array`.
  4953. */
  4954. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4955. var low = 0,
  4956. high = array == null ? 0 : array.length;
  4957. if (high === 0) {
  4958. return 0;
  4959. }
  4960. value = iteratee(value);
  4961. var valIsNaN = value !== value,
  4962. valIsNull = value === null,
  4963. valIsSymbol = isSymbol(value),
  4964. valIsUndefined = value === undefined;
  4965. while (low < high) {
  4966. var mid = nativeFloor((low + high) / 2),
  4967. computed = iteratee(array[mid]),
  4968. othIsDefined = computed !== undefined,
  4969. othIsNull = computed === null,
  4970. othIsReflexive = computed === computed,
  4971. othIsSymbol = isSymbol(computed);
  4972. if (valIsNaN) {
  4973. var setLow = retHighest || othIsReflexive;
  4974. } else if (valIsUndefined) {
  4975. setLow = othIsReflexive && (retHighest || othIsDefined);
  4976. } else if (valIsNull) {
  4977. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4978. } else if (valIsSymbol) {
  4979. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4980. } else if (othIsNull || othIsSymbol) {
  4981. setLow = false;
  4982. } else {
  4983. setLow = retHighest ? (computed <= value) : (computed < value);
  4984. }
  4985. if (setLow) {
  4986. low = mid + 1;
  4987. } else {
  4988. high = mid;
  4989. }
  4990. }
  4991. return nativeMin(high, MAX_ARRAY_INDEX);
  4992. }
  4993. /**
  4994. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4995. * support for iteratee shorthands.
  4996. *
  4997. * @private
  4998. * @param {Array} array The array to inspect.
  4999. * @param {Function} [iteratee] The iteratee invoked per element.
  5000. * @returns {Array} Returns the new duplicate free array.
  5001. */
  5002. function baseSortedUniq(array, iteratee) {
  5003. var index = -1,
  5004. length = array.length,
  5005. resIndex = 0,
  5006. result = [];
  5007. while (++index < length) {
  5008. var value = array[index],
  5009. computed = iteratee ? iteratee(value) : value;
  5010. if (!index || !eq(computed, seen)) {
  5011. var seen = computed;
  5012. result[resIndex++] = value === 0 ? 0 : value;
  5013. }
  5014. }
  5015. return result;
  5016. }
  5017. /**
  5018. * The base implementation of `_.toNumber` which doesn't ensure correct
  5019. * conversions of binary, hexadecimal, or octal string values.
  5020. *
  5021. * @private
  5022. * @param {*} value The value to process.
  5023. * @returns {number} Returns the number.
  5024. */
  5025. function baseToNumber(value) {
  5026. if (typeof value == 'number') {
  5027. return value;
  5028. }
  5029. if (isSymbol(value)) {
  5030. return NAN;
  5031. }
  5032. return +value;
  5033. }
  5034. /**
  5035. * The base implementation of `_.toString` which doesn't convert nullish
  5036. * values to empty strings.
  5037. *
  5038. * @private
  5039. * @param {*} value The value to process.
  5040. * @returns {string} Returns the string.
  5041. */
  5042. function baseToString(value) {
  5043. // Exit early for strings to avoid a performance hit in some environments.
  5044. if (typeof value == 'string') {
  5045. return value;
  5046. }
  5047. if (isArray(value)) {
  5048. // Recursively convert values (susceptible to call stack limits).
  5049. return arrayMap(value, baseToString) + '';
  5050. }
  5051. if (isSymbol(value)) {
  5052. return symbolToString ? symbolToString.call(value) : '';
  5053. }
  5054. var result = (value + '');
  5055. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5056. }
  5057. /**
  5058. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5059. *
  5060. * @private
  5061. * @param {Array} array The array to inspect.
  5062. * @param {Function} [iteratee] The iteratee invoked per element.
  5063. * @param {Function} [comparator] The comparator invoked per element.
  5064. * @returns {Array} Returns the new duplicate free array.
  5065. */
  5066. function baseUniq(array, iteratee, comparator) {
  5067. var index = -1,
  5068. includes = arrayIncludes,
  5069. length = array.length,
  5070. isCommon = true,
  5071. result = [],
  5072. seen = result;
  5073. if (comparator) {
  5074. isCommon = false;
  5075. includes = arrayIncludesWith;
  5076. }
  5077. else if (length >= LARGE_ARRAY_SIZE) {
  5078. var set = iteratee ? null : createSet(array);
  5079. if (set) {
  5080. return setToArray(set);
  5081. }
  5082. isCommon = false;
  5083. includes = cacheHas;
  5084. seen = new SetCache;
  5085. }
  5086. else {
  5087. seen = iteratee ? [] : result;
  5088. }
  5089. outer:
  5090. while (++index < length) {
  5091. var value = array[index],
  5092. computed = iteratee ? iteratee(value) : value;
  5093. value = (comparator || value !== 0) ? value : 0;
  5094. if (isCommon && computed === computed) {
  5095. var seenIndex = seen.length;
  5096. while (seenIndex--) {
  5097. if (seen[seenIndex] === computed) {
  5098. continue outer;
  5099. }
  5100. }
  5101. if (iteratee) {
  5102. seen.push(computed);
  5103. }
  5104. result.push(value);
  5105. }
  5106. else if (!includes(seen, computed, comparator)) {
  5107. if (seen !== result) {
  5108. seen.push(computed);
  5109. }
  5110. result.push(value);
  5111. }
  5112. }
  5113. return result;
  5114. }
  5115. /**
  5116. * The base implementation of `_.unset`.
  5117. *
  5118. * @private
  5119. * @param {Object} object The object to modify.
  5120. * @param {Array|string} path The property path to unset.
  5121. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5122. */
  5123. function baseUnset(object, path) {
  5124. path = castPath(path, object);
  5125. object = parent(object, path);
  5126. return object == null || delete object[toKey(last(path))];
  5127. }
  5128. /**
  5129. * The base implementation of `_.update`.
  5130. *
  5131. * @private
  5132. * @param {Object} object The object to modify.
  5133. * @param {Array|string} path The path of the property to update.
  5134. * @param {Function} updater The function to produce the updated value.
  5135. * @param {Function} [customizer] The function to customize path creation.
  5136. * @returns {Object} Returns `object`.
  5137. */
  5138. function baseUpdate(object, path, updater, customizer) {
  5139. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5140. }
  5141. /**
  5142. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5143. * without support for iteratee shorthands.
  5144. *
  5145. * @private
  5146. * @param {Array} array The array to query.
  5147. * @param {Function} predicate The function invoked per iteration.
  5148. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5149. * @param {boolean} [fromRight] Specify iterating from right to left.
  5150. * @returns {Array} Returns the slice of `array`.
  5151. */
  5152. function baseWhile(array, predicate, isDrop, fromRight) {
  5153. var length = array.length,
  5154. index = fromRight ? length : -1;
  5155. while ((fromRight ? index-- : ++index < length) &&
  5156. predicate(array[index], index, array)) {}
  5157. return isDrop
  5158. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5159. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5160. }
  5161. /**
  5162. * The base implementation of `wrapperValue` which returns the result of
  5163. * performing a sequence of actions on the unwrapped `value`, where each
  5164. * successive action is supplied the return value of the previous.
  5165. *
  5166. * @private
  5167. * @param {*} value The unwrapped value.
  5168. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5169. * @returns {*} Returns the resolved value.
  5170. */
  5171. function baseWrapperValue(value, actions) {
  5172. var result = value;
  5173. if (result instanceof LazyWrapper) {
  5174. result = result.value();
  5175. }
  5176. return arrayReduce(actions, function(result, action) {
  5177. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5178. }, result);
  5179. }
  5180. /**
  5181. * The base implementation of methods like `_.xor`, without support for
  5182. * iteratee shorthands, that accepts an array of arrays to inspect.
  5183. *
  5184. * @private
  5185. * @param {Array} arrays The arrays to inspect.
  5186. * @param {Function} [iteratee] The iteratee invoked per element.
  5187. * @param {Function} [comparator] The comparator invoked per element.
  5188. * @returns {Array} Returns the new array of values.
  5189. */
  5190. function baseXor(arrays, iteratee, comparator) {
  5191. var length = arrays.length;
  5192. if (length < 2) {
  5193. return length ? baseUniq(arrays[0]) : [];
  5194. }
  5195. var index = -1,
  5196. result = Array(length);
  5197. while (++index < length) {
  5198. var array = arrays[index],
  5199. othIndex = -1;
  5200. while (++othIndex < length) {
  5201. if (othIndex != index) {
  5202. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5203. }
  5204. }
  5205. }
  5206. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5207. }
  5208. /**
  5209. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5210. *
  5211. * @private
  5212. * @param {Array} props The property identifiers.
  5213. * @param {Array} values The property values.
  5214. * @param {Function} assignFunc The function to assign values.
  5215. * @returns {Object} Returns the new object.
  5216. */
  5217. function baseZipObject(props, values, assignFunc) {
  5218. var index = -1,
  5219. length = props.length,
  5220. valsLength = values.length,
  5221. result = {};
  5222. while (++index < length) {
  5223. var value = index < valsLength ? values[index] : undefined;
  5224. assignFunc(result, props[index], value);
  5225. }
  5226. return result;
  5227. }
  5228. /**
  5229. * Casts `value` to an empty array if it's not an array like object.
  5230. *
  5231. * @private
  5232. * @param {*} value The value to inspect.
  5233. * @returns {Array|Object} Returns the cast array-like object.
  5234. */
  5235. function castArrayLikeObject(value) {
  5236. return isArrayLikeObject(value) ? value : [];
  5237. }
  5238. /**
  5239. * Casts `value` to `identity` if it's not a function.
  5240. *
  5241. * @private
  5242. * @param {*} value The value to inspect.
  5243. * @returns {Function} Returns cast function.
  5244. */
  5245. function castFunction(value) {
  5246. return typeof value == 'function' ? value : identity;
  5247. }
  5248. /**
  5249. * Casts `value` to a path array if it's not one.
  5250. *
  5251. * @private
  5252. * @param {*} value The value to inspect.
  5253. * @param {Object} [object] The object to query keys on.
  5254. * @returns {Array} Returns the cast property path array.
  5255. */
  5256. function castPath(value, object) {
  5257. if (isArray(value)) {
  5258. return value;
  5259. }
  5260. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5261. }
  5262. /**
  5263. * A `baseRest` alias which can be replaced with `identity` by module
  5264. * replacement plugins.
  5265. *
  5266. * @private
  5267. * @type {Function}
  5268. * @param {Function} func The function to apply a rest parameter to.
  5269. * @returns {Function} Returns the new function.
  5270. */
  5271. var castRest = baseRest;
  5272. /**
  5273. * Casts `array` to a slice if it's needed.
  5274. *
  5275. * @private
  5276. * @param {Array} array The array to inspect.
  5277. * @param {number} start The start position.
  5278. * @param {number} [end=array.length] The end position.
  5279. * @returns {Array} Returns the cast slice.
  5280. */
  5281. function castSlice(array, start, end) {
  5282. var length = array.length;
  5283. end = end === undefined ? length : end;
  5284. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5285. }
  5286. /**
  5287. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5288. *
  5289. * @private
  5290. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5291. */
  5292. var clearTimeout = ctxClearTimeout || function(id) {
  5293. return root.clearTimeout(id);
  5294. };
  5295. /**
  5296. * Creates a clone of `buffer`.
  5297. *
  5298. * @private
  5299. * @param {Buffer} buffer The buffer to clone.
  5300. * @param {boolean} [isDeep] Specify a deep clone.
  5301. * @returns {Buffer} Returns the cloned buffer.
  5302. */
  5303. function cloneBuffer(buffer, isDeep) {
  5304. if (isDeep) {
  5305. return buffer.slice();
  5306. }
  5307. var length = buffer.length,
  5308. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5309. buffer.copy(result);
  5310. return result;
  5311. }
  5312. /**
  5313. * Creates a clone of `arrayBuffer`.
  5314. *
  5315. * @private
  5316. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5317. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5318. */
  5319. function cloneArrayBuffer(arrayBuffer) {
  5320. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5321. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5322. return result;
  5323. }
  5324. /**
  5325. * Creates a clone of `dataView`.
  5326. *
  5327. * @private
  5328. * @param {Object} dataView The data view to clone.
  5329. * @param {boolean} [isDeep] Specify a deep clone.
  5330. * @returns {Object} Returns the cloned data view.
  5331. */
  5332. function cloneDataView(dataView, isDeep) {
  5333. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5334. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5335. }
  5336. /**
  5337. * Creates a clone of `regexp`.
  5338. *
  5339. * @private
  5340. * @param {Object} regexp The regexp to clone.
  5341. * @returns {Object} Returns the cloned regexp.
  5342. */
  5343. function cloneRegExp(regexp) {
  5344. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5345. result.lastIndex = regexp.lastIndex;
  5346. return result;
  5347. }
  5348. /**
  5349. * Creates a clone of the `symbol` object.
  5350. *
  5351. * @private
  5352. * @param {Object} symbol The symbol object to clone.
  5353. * @returns {Object} Returns the cloned symbol object.
  5354. */
  5355. function cloneSymbol(symbol) {
  5356. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5357. }
  5358. /**
  5359. * Creates a clone of `typedArray`.
  5360. *
  5361. * @private
  5362. * @param {Object} typedArray The typed array to clone.
  5363. * @param {boolean} [isDeep] Specify a deep clone.
  5364. * @returns {Object} Returns the cloned typed array.
  5365. */
  5366. function cloneTypedArray(typedArray, isDeep) {
  5367. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5368. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5369. }
  5370. /**
  5371. * Compares values to sort them in ascending order.
  5372. *
  5373. * @private
  5374. * @param {*} value The value to compare.
  5375. * @param {*} other The other value to compare.
  5376. * @returns {number} Returns the sort order indicator for `value`.
  5377. */
  5378. function compareAscending(value, other) {
  5379. if (value !== other) {
  5380. var valIsDefined = value !== undefined,
  5381. valIsNull = value === null,
  5382. valIsReflexive = value === value,
  5383. valIsSymbol = isSymbol(value);
  5384. var othIsDefined = other !== undefined,
  5385. othIsNull = other === null,
  5386. othIsReflexive = other === other,
  5387. othIsSymbol = isSymbol(other);
  5388. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5389. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5390. (valIsNull && othIsDefined && othIsReflexive) ||
  5391. (!valIsDefined && othIsReflexive) ||
  5392. !valIsReflexive) {
  5393. return 1;
  5394. }
  5395. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5396. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5397. (othIsNull && valIsDefined && valIsReflexive) ||
  5398. (!othIsDefined && valIsReflexive) ||
  5399. !othIsReflexive) {
  5400. return -1;
  5401. }
  5402. }
  5403. return 0;
  5404. }
  5405. /**
  5406. * Used by `_.orderBy` to compare multiple properties of a value to another
  5407. * and stable sort them.
  5408. *
  5409. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5410. * specify an order of "desc" for descending or "asc" for ascending sort order
  5411. * of corresponding values.
  5412. *
  5413. * @private
  5414. * @param {Object} object The object to compare.
  5415. * @param {Object} other The other object to compare.
  5416. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5417. * @returns {number} Returns the sort order indicator for `object`.
  5418. */
  5419. function compareMultiple(object, other, orders) {
  5420. var index = -1,
  5421. objCriteria = object.criteria,
  5422. othCriteria = other.criteria,
  5423. length = objCriteria.length,
  5424. ordersLength = orders.length;
  5425. while (++index < length) {
  5426. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5427. if (result) {
  5428. if (index >= ordersLength) {
  5429. return result;
  5430. }
  5431. var order = orders[index];
  5432. return result * (order == 'desc' ? -1 : 1);
  5433. }
  5434. }
  5435. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5436. // that causes it, under certain circumstances, to provide the same value for
  5437. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5438. // for more details.
  5439. //
  5440. // This also ensures a stable sort in V8 and other engines.
  5441. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5442. return object.index - other.index;
  5443. }
  5444. /**
  5445. * Creates an array that is the composition of partially applied arguments,
  5446. * placeholders, and provided arguments into a single array of arguments.
  5447. *
  5448. * @private
  5449. * @param {Array} args The provided arguments.
  5450. * @param {Array} partials The arguments to prepend to those provided.
  5451. * @param {Array} holders The `partials` placeholder indexes.
  5452. * @params {boolean} [isCurried] Specify composing for a curried function.
  5453. * @returns {Array} Returns the new array of composed arguments.
  5454. */
  5455. function composeArgs(args, partials, holders, isCurried) {
  5456. var argsIndex = -1,
  5457. argsLength = args.length,
  5458. holdersLength = holders.length,
  5459. leftIndex = -1,
  5460. leftLength = partials.length,
  5461. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5462. result = Array(leftLength + rangeLength),
  5463. isUncurried = !isCurried;
  5464. while (++leftIndex < leftLength) {
  5465. result[leftIndex] = partials[leftIndex];
  5466. }
  5467. while (++argsIndex < holdersLength) {
  5468. if (isUncurried || argsIndex < argsLength) {
  5469. result[holders[argsIndex]] = args[argsIndex];
  5470. }
  5471. }
  5472. while (rangeLength--) {
  5473. result[leftIndex++] = args[argsIndex++];
  5474. }
  5475. return result;
  5476. }
  5477. /**
  5478. * This function is like `composeArgs` except that the arguments composition
  5479. * is tailored for `_.partialRight`.
  5480. *
  5481. * @private
  5482. * @param {Array} args The provided arguments.
  5483. * @param {Array} partials The arguments to append to those provided.
  5484. * @param {Array} holders The `partials` placeholder indexes.
  5485. * @params {boolean} [isCurried] Specify composing for a curried function.
  5486. * @returns {Array} Returns the new array of composed arguments.
  5487. */
  5488. function composeArgsRight(args, partials, holders, isCurried) {
  5489. var argsIndex = -1,
  5490. argsLength = args.length,
  5491. holdersIndex = -1,
  5492. holdersLength = holders.length,
  5493. rightIndex = -1,
  5494. rightLength = partials.length,
  5495. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5496. result = Array(rangeLength + rightLength),
  5497. isUncurried = !isCurried;
  5498. while (++argsIndex < rangeLength) {
  5499. result[argsIndex] = args[argsIndex];
  5500. }
  5501. var offset = argsIndex;
  5502. while (++rightIndex < rightLength) {
  5503. result[offset + rightIndex] = partials[rightIndex];
  5504. }
  5505. while (++holdersIndex < holdersLength) {
  5506. if (isUncurried || argsIndex < argsLength) {
  5507. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5508. }
  5509. }
  5510. return result;
  5511. }
  5512. /**
  5513. * Copies the values of `source` to `array`.
  5514. *
  5515. * @private
  5516. * @param {Array} source The array to copy values from.
  5517. * @param {Array} [array=[]] The array to copy values to.
  5518. * @returns {Array} Returns `array`.
  5519. */
  5520. function copyArray(source, array) {
  5521. var index = -1,
  5522. length = source.length;
  5523. array || (array = Array(length));
  5524. while (++index < length) {
  5525. array[index] = source[index];
  5526. }
  5527. return array;
  5528. }
  5529. /**
  5530. * Copies properties of `source` to `object`.
  5531. *
  5532. * @private
  5533. * @param {Object} source The object to copy properties from.
  5534. * @param {Array} props The property identifiers to copy.
  5535. * @param {Object} [object={}] The object to copy properties to.
  5536. * @param {Function} [customizer] The function to customize copied values.
  5537. * @returns {Object} Returns `object`.
  5538. */
  5539. function copyObject(source, props, object, customizer) {
  5540. var isNew = !object;
  5541. object || (object = {});
  5542. var index = -1,
  5543. length = props.length;
  5544. while (++index < length) {
  5545. var key = props[index];
  5546. var newValue = customizer
  5547. ? customizer(object[key], source[key], key, object, source)
  5548. : undefined;
  5549. if (newValue === undefined) {
  5550. newValue = source[key];
  5551. }
  5552. if (isNew) {
  5553. baseAssignValue(object, key, newValue);
  5554. } else {
  5555. assignValue(object, key, newValue);
  5556. }
  5557. }
  5558. return object;
  5559. }
  5560. /**
  5561. * Copies own symbols of `source` to `object`.
  5562. *
  5563. * @private
  5564. * @param {Object} source The object to copy symbols from.
  5565. * @param {Object} [object={}] The object to copy symbols to.
  5566. * @returns {Object} Returns `object`.
  5567. */
  5568. function copySymbols(source, object) {
  5569. return copyObject(source, getSymbols(source), object);
  5570. }
  5571. /**
  5572. * Copies own and inherited symbols of `source` to `object`.
  5573. *
  5574. * @private
  5575. * @param {Object} source The object to copy symbols from.
  5576. * @param {Object} [object={}] The object to copy symbols to.
  5577. * @returns {Object} Returns `object`.
  5578. */
  5579. function copySymbolsIn(source, object) {
  5580. return copyObject(source, getSymbolsIn(source), object);
  5581. }
  5582. /**
  5583. * Creates a function like `_.groupBy`.
  5584. *
  5585. * @private
  5586. * @param {Function} setter The function to set accumulator values.
  5587. * @param {Function} [initializer] The accumulator object initializer.
  5588. * @returns {Function} Returns the new aggregator function.
  5589. */
  5590. function createAggregator(setter, initializer) {
  5591. return function(collection, iteratee) {
  5592. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5593. accumulator = initializer ? initializer() : {};
  5594. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5595. };
  5596. }
  5597. /**
  5598. * Creates a function like `_.assign`.
  5599. *
  5600. * @private
  5601. * @param {Function} assigner The function to assign values.
  5602. * @returns {Function} Returns the new assigner function.
  5603. */
  5604. function createAssigner(assigner) {
  5605. return baseRest(function(object, sources) {
  5606. var index = -1,
  5607. length = sources.length,
  5608. customizer = length > 1 ? sources[length - 1] : undefined,
  5609. guard = length > 2 ? sources[2] : undefined;
  5610. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5611. ? (length--, customizer)
  5612. : undefined;
  5613. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5614. customizer = length < 3 ? undefined : customizer;
  5615. length = 1;
  5616. }
  5617. object = Object(object);
  5618. while (++index < length) {
  5619. var source = sources[index];
  5620. if (source) {
  5621. assigner(object, source, index, customizer);
  5622. }
  5623. }
  5624. return object;
  5625. });
  5626. }
  5627. /**
  5628. * Creates a `baseEach` or `baseEachRight` function.
  5629. *
  5630. * @private
  5631. * @param {Function} eachFunc The function to iterate over a collection.
  5632. * @param {boolean} [fromRight] Specify iterating from right to left.
  5633. * @returns {Function} Returns the new base function.
  5634. */
  5635. function createBaseEach(eachFunc, fromRight) {
  5636. return function(collection, iteratee) {
  5637. if (collection == null) {
  5638. return collection;
  5639. }
  5640. if (!isArrayLike(collection)) {
  5641. return eachFunc(collection, iteratee);
  5642. }
  5643. var length = collection.length,
  5644. index = fromRight ? length : -1,
  5645. iterable = Object(collection);
  5646. while ((fromRight ? index-- : ++index < length)) {
  5647. if (iteratee(iterable[index], index, iterable) === false) {
  5648. break;
  5649. }
  5650. }
  5651. return collection;
  5652. };
  5653. }
  5654. /**
  5655. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5656. *
  5657. * @private
  5658. * @param {boolean} [fromRight] Specify iterating from right to left.
  5659. * @returns {Function} Returns the new base function.
  5660. */
  5661. function createBaseFor(fromRight) {
  5662. return function(object, iteratee, keysFunc) {
  5663. var index = -1,
  5664. iterable = Object(object),
  5665. props = keysFunc(object),
  5666. length = props.length;
  5667. while (length--) {
  5668. var key = props[fromRight ? length : ++index];
  5669. if (iteratee(iterable[key], key, iterable) === false) {
  5670. break;
  5671. }
  5672. }
  5673. return object;
  5674. };
  5675. }
  5676. /**
  5677. * Creates a function that wraps `func` to invoke it with the optional `this`
  5678. * binding of `thisArg`.
  5679. *
  5680. * @private
  5681. * @param {Function} func The function to wrap.
  5682. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5683. * @param {*} [thisArg] The `this` binding of `func`.
  5684. * @returns {Function} Returns the new wrapped function.
  5685. */
  5686. function createBind(func, bitmask, thisArg) {
  5687. var isBind = bitmask & WRAP_BIND_FLAG,
  5688. Ctor = createCtor(func);
  5689. function wrapper() {
  5690. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5691. return fn.apply(isBind ? thisArg : this, arguments);
  5692. }
  5693. return wrapper;
  5694. }
  5695. /**
  5696. * Creates a function like `_.lowerFirst`.
  5697. *
  5698. * @private
  5699. * @param {string} methodName The name of the `String` case method to use.
  5700. * @returns {Function} Returns the new case function.
  5701. */
  5702. function createCaseFirst(methodName) {
  5703. return function(string) {
  5704. string = toString(string);
  5705. var strSymbols = hasUnicode(string)
  5706. ? stringToArray(string)
  5707. : undefined;
  5708. var chr = strSymbols
  5709. ? strSymbols[0]
  5710. : string.charAt(0);
  5711. var trailing = strSymbols
  5712. ? castSlice(strSymbols, 1).join('')
  5713. : string.slice(1);
  5714. return chr[methodName]() + trailing;
  5715. };
  5716. }
  5717. /**
  5718. * Creates a function like `_.camelCase`.
  5719. *
  5720. * @private
  5721. * @param {Function} callback The function to combine each word.
  5722. * @returns {Function} Returns the new compounder function.
  5723. */
  5724. function createCompounder(callback) {
  5725. return function(string) {
  5726. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5727. };
  5728. }
  5729. /**
  5730. * Creates a function that produces an instance of `Ctor` regardless of
  5731. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5732. *
  5733. * @private
  5734. * @param {Function} Ctor The constructor to wrap.
  5735. * @returns {Function} Returns the new wrapped function.
  5736. */
  5737. function createCtor(Ctor) {
  5738. return function() {
  5739. // Use a `switch` statement to work with class constructors. See
  5740. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5741. // for more details.
  5742. var args = arguments;
  5743. switch (args.length) {
  5744. case 0: return new Ctor;
  5745. case 1: return new Ctor(args[0]);
  5746. case 2: return new Ctor(args[0], args[1]);
  5747. case 3: return new Ctor(args[0], args[1], args[2]);
  5748. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5749. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5750. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5751. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5752. }
  5753. var thisBinding = baseCreate(Ctor.prototype),
  5754. result = Ctor.apply(thisBinding, args);
  5755. // Mimic the constructor's `return` behavior.
  5756. // See https://es5.github.io/#x13.2.2 for more details.
  5757. return isObject(result) ? result : thisBinding;
  5758. };
  5759. }
  5760. /**
  5761. * Creates a function that wraps `func` to enable currying.
  5762. *
  5763. * @private
  5764. * @param {Function} func The function to wrap.
  5765. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5766. * @param {number} arity The arity of `func`.
  5767. * @returns {Function} Returns the new wrapped function.
  5768. */
  5769. function createCurry(func, bitmask, arity) {
  5770. var Ctor = createCtor(func);
  5771. function wrapper() {
  5772. var length = arguments.length,
  5773. args = Array(length),
  5774. index = length,
  5775. placeholder = getHolder(wrapper);
  5776. while (index--) {
  5777. args[index] = arguments[index];
  5778. }
  5779. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5780. ? []
  5781. : replaceHolders(args, placeholder);
  5782. length -= holders.length;
  5783. if (length < arity) {
  5784. return createRecurry(
  5785. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5786. args, holders, undefined, undefined, arity - length);
  5787. }
  5788. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5789. return apply(fn, this, args);
  5790. }
  5791. return wrapper;
  5792. }
  5793. /**
  5794. * Creates a `_.find` or `_.findLast` function.
  5795. *
  5796. * @private
  5797. * @param {Function} findIndexFunc The function to find the collection index.
  5798. * @returns {Function} Returns the new find function.
  5799. */
  5800. function createFind(findIndexFunc) {
  5801. return function(collection, predicate, fromIndex) {
  5802. var iterable = Object(collection);
  5803. if (!isArrayLike(collection)) {
  5804. var iteratee = getIteratee(predicate, 3);
  5805. collection = keys(collection);
  5806. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5807. }
  5808. var index = findIndexFunc(collection, predicate, fromIndex);
  5809. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5810. };
  5811. }
  5812. /**
  5813. * Creates a `_.flow` or `_.flowRight` function.
  5814. *
  5815. * @private
  5816. * @param {boolean} [fromRight] Specify iterating from right to left.
  5817. * @returns {Function} Returns the new flow function.
  5818. */
  5819. function createFlow(fromRight) {
  5820. return flatRest(function(funcs) {
  5821. var length = funcs.length,
  5822. index = length,
  5823. prereq = LodashWrapper.prototype.thru;
  5824. if (fromRight) {
  5825. funcs.reverse();
  5826. }
  5827. while (index--) {
  5828. var func = funcs[index];
  5829. if (typeof func != 'function') {
  5830. throw new TypeError(FUNC_ERROR_TEXT);
  5831. }
  5832. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5833. var wrapper = new LodashWrapper([], true);
  5834. }
  5835. }
  5836. index = wrapper ? index : length;
  5837. while (++index < length) {
  5838. func = funcs[index];
  5839. var funcName = getFuncName(func),
  5840. data = funcName == 'wrapper' ? getData(func) : undefined;
  5841. if (data && isLaziable(data[0]) &&
  5842. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5843. !data[4].length && data[9] == 1
  5844. ) {
  5845. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5846. } else {
  5847. wrapper = (func.length == 1 && isLaziable(func))
  5848. ? wrapper[funcName]()
  5849. : wrapper.thru(func);
  5850. }
  5851. }
  5852. return function() {
  5853. var args = arguments,
  5854. value = args[0];
  5855. if (wrapper && args.length == 1 && isArray(value)) {
  5856. return wrapper.plant(value).value();
  5857. }
  5858. var index = 0,
  5859. result = length ? funcs[index].apply(this, args) : value;
  5860. while (++index < length) {
  5861. result = funcs[index].call(this, result);
  5862. }
  5863. return result;
  5864. };
  5865. });
  5866. }
  5867. /**
  5868. * Creates a function that wraps `func` to invoke it with optional `this`
  5869. * binding of `thisArg`, partial application, and currying.
  5870. *
  5871. * @private
  5872. * @param {Function|string} func The function or method name to wrap.
  5873. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5874. * @param {*} [thisArg] The `this` binding of `func`.
  5875. * @param {Array} [partials] The arguments to prepend to those provided to
  5876. * the new function.
  5877. * @param {Array} [holders] The `partials` placeholder indexes.
  5878. * @param {Array} [partialsRight] The arguments to append to those provided
  5879. * to the new function.
  5880. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5881. * @param {Array} [argPos] The argument positions of the new function.
  5882. * @param {number} [ary] The arity cap of `func`.
  5883. * @param {number} [arity] The arity of `func`.
  5884. * @returns {Function} Returns the new wrapped function.
  5885. */
  5886. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5887. var isAry = bitmask & WRAP_ARY_FLAG,
  5888. isBind = bitmask & WRAP_BIND_FLAG,
  5889. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5890. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5891. isFlip = bitmask & WRAP_FLIP_FLAG,
  5892. Ctor = isBindKey ? undefined : createCtor(func);
  5893. function wrapper() {
  5894. var length = arguments.length,
  5895. args = Array(length),
  5896. index = length;
  5897. while (index--) {
  5898. args[index] = arguments[index];
  5899. }
  5900. if (isCurried) {
  5901. var placeholder = getHolder(wrapper),
  5902. holdersCount = countHolders(args, placeholder);
  5903. }
  5904. if (partials) {
  5905. args = composeArgs(args, partials, holders, isCurried);
  5906. }
  5907. if (partialsRight) {
  5908. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5909. }
  5910. length -= holdersCount;
  5911. if (isCurried && length < arity) {
  5912. var newHolders = replaceHolders(args, placeholder);
  5913. return createRecurry(
  5914. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5915. args, newHolders, argPos, ary, arity - length
  5916. );
  5917. }
  5918. var thisBinding = isBind ? thisArg : this,
  5919. fn = isBindKey ? thisBinding[func] : func;
  5920. length = args.length;
  5921. if (argPos) {
  5922. args = reorder(args, argPos);
  5923. } else if (isFlip && length > 1) {
  5924. args.reverse();
  5925. }
  5926. if (isAry && ary < length) {
  5927. args.length = ary;
  5928. }
  5929. if (this && this !== root && this instanceof wrapper) {
  5930. fn = Ctor || createCtor(fn);
  5931. }
  5932. return fn.apply(thisBinding, args);
  5933. }
  5934. return wrapper;
  5935. }
  5936. /**
  5937. * Creates a function like `_.invertBy`.
  5938. *
  5939. * @private
  5940. * @param {Function} setter The function to set accumulator values.
  5941. * @param {Function} toIteratee The function to resolve iteratees.
  5942. * @returns {Function} Returns the new inverter function.
  5943. */
  5944. function createInverter(setter, toIteratee) {
  5945. return function(object, iteratee) {
  5946. return baseInverter(object, setter, toIteratee(iteratee), {});
  5947. };
  5948. }
  5949. /**
  5950. * Creates a function that performs a mathematical operation on two values.
  5951. *
  5952. * @private
  5953. * @param {Function} operator The function to perform the operation.
  5954. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5955. * @returns {Function} Returns the new mathematical operation function.
  5956. */
  5957. function createMathOperation(operator, defaultValue) {
  5958. return function(value, other) {
  5959. var result;
  5960. if (value === undefined && other === undefined) {
  5961. return defaultValue;
  5962. }
  5963. if (value !== undefined) {
  5964. result = value;
  5965. }
  5966. if (other !== undefined) {
  5967. if (result === undefined) {
  5968. return other;
  5969. }
  5970. if (typeof value == 'string' || typeof other == 'string') {
  5971. value = baseToString(value);
  5972. other = baseToString(other);
  5973. } else {
  5974. value = baseToNumber(value);
  5975. other = baseToNumber(other);
  5976. }
  5977. result = operator(value, other);
  5978. }
  5979. return result;
  5980. };
  5981. }
  5982. /**
  5983. * Creates a function like `_.over`.
  5984. *
  5985. * @private
  5986. * @param {Function} arrayFunc The function to iterate over iteratees.
  5987. * @returns {Function} Returns the new over function.
  5988. */
  5989. function createOver(arrayFunc) {
  5990. return flatRest(function(iteratees) {
  5991. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5992. return baseRest(function(args) {
  5993. var thisArg = this;
  5994. return arrayFunc(iteratees, function(iteratee) {
  5995. return apply(iteratee, thisArg, args);
  5996. });
  5997. });
  5998. });
  5999. }
  6000. /**
  6001. * Creates the padding for `string` based on `length`. The `chars` string
  6002. * is truncated if the number of characters exceeds `length`.
  6003. *
  6004. * @private
  6005. * @param {number} length The padding length.
  6006. * @param {string} [chars=' '] The string used as padding.
  6007. * @returns {string} Returns the padding for `string`.
  6008. */
  6009. function createPadding(length, chars) {
  6010. chars = chars === undefined ? ' ' : baseToString(chars);
  6011. var charsLength = chars.length;
  6012. if (charsLength < 2) {
  6013. return charsLength ? baseRepeat(chars, length) : chars;
  6014. }
  6015. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6016. return hasUnicode(chars)
  6017. ? castSlice(stringToArray(result), 0, length).join('')
  6018. : result.slice(0, length);
  6019. }
  6020. /**
  6021. * Creates a function that wraps `func` to invoke it with the `this` binding
  6022. * of `thisArg` and `partials` prepended to the arguments it receives.
  6023. *
  6024. * @private
  6025. * @param {Function} func The function to wrap.
  6026. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6027. * @param {*} thisArg The `this` binding of `func`.
  6028. * @param {Array} partials The arguments to prepend to those provided to
  6029. * the new function.
  6030. * @returns {Function} Returns the new wrapped function.
  6031. */
  6032. function createPartial(func, bitmask, thisArg, partials) {
  6033. var isBind = bitmask & WRAP_BIND_FLAG,
  6034. Ctor = createCtor(func);
  6035. function wrapper() {
  6036. var argsIndex = -1,
  6037. argsLength = arguments.length,
  6038. leftIndex = -1,
  6039. leftLength = partials.length,
  6040. args = Array(leftLength + argsLength),
  6041. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6042. while (++leftIndex < leftLength) {
  6043. args[leftIndex] = partials[leftIndex];
  6044. }
  6045. while (argsLength--) {
  6046. args[leftIndex++] = arguments[++argsIndex];
  6047. }
  6048. return apply(fn, isBind ? thisArg : this, args);
  6049. }
  6050. return wrapper;
  6051. }
  6052. /**
  6053. * Creates a `_.range` or `_.rangeRight` function.
  6054. *
  6055. * @private
  6056. * @param {boolean} [fromRight] Specify iterating from right to left.
  6057. * @returns {Function} Returns the new range function.
  6058. */
  6059. function createRange(fromRight) {
  6060. return function(start, end, step) {
  6061. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6062. end = step = undefined;
  6063. }
  6064. // Ensure the sign of `-0` is preserved.
  6065. start = toFinite(start);
  6066. if (end === undefined) {
  6067. end = start;
  6068. start = 0;
  6069. } else {
  6070. end = toFinite(end);
  6071. }
  6072. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6073. return baseRange(start, end, step, fromRight);
  6074. };
  6075. }
  6076. /**
  6077. * Creates a function that performs a relational operation on two values.
  6078. *
  6079. * @private
  6080. * @param {Function} operator The function to perform the operation.
  6081. * @returns {Function} Returns the new relational operation function.
  6082. */
  6083. function createRelationalOperation(operator) {
  6084. return function(value, other) {
  6085. if (!(typeof value == 'string' && typeof other == 'string')) {
  6086. value = toNumber(value);
  6087. other = toNumber(other);
  6088. }
  6089. return operator(value, other);
  6090. };
  6091. }
  6092. /**
  6093. * Creates a function that wraps `func` to continue currying.
  6094. *
  6095. * @private
  6096. * @param {Function} func The function to wrap.
  6097. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6098. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6099. * @param {*} placeholder The placeholder value.
  6100. * @param {*} [thisArg] The `this` binding of `func`.
  6101. * @param {Array} [partials] The arguments to prepend to those provided to
  6102. * the new function.
  6103. * @param {Array} [holders] The `partials` placeholder indexes.
  6104. * @param {Array} [argPos] The argument positions of the new function.
  6105. * @param {number} [ary] The arity cap of `func`.
  6106. * @param {number} [arity] The arity of `func`.
  6107. * @returns {Function} Returns the new wrapped function.
  6108. */
  6109. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6110. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6111. newHolders = isCurry ? holders : undefined,
  6112. newHoldersRight = isCurry ? undefined : holders,
  6113. newPartials = isCurry ? partials : undefined,
  6114. newPartialsRight = isCurry ? undefined : partials;
  6115. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6116. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6117. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6118. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6119. }
  6120. var newData = [
  6121. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6122. newHoldersRight, argPos, ary, arity
  6123. ];
  6124. var result = wrapFunc.apply(undefined, newData);
  6125. if (isLaziable(func)) {
  6126. setData(result, newData);
  6127. }
  6128. result.placeholder = placeholder;
  6129. return setWrapToString(result, func, bitmask);
  6130. }
  6131. /**
  6132. * Creates a function like `_.round`.
  6133. *
  6134. * @private
  6135. * @param {string} methodName The name of the `Math` method to use when rounding.
  6136. * @returns {Function} Returns the new round function.
  6137. */
  6138. function createRound(methodName) {
  6139. var func = Math[methodName];
  6140. return function(number, precision) {
  6141. number = toNumber(number);
  6142. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6143. if (precision && nativeIsFinite(number)) {
  6144. // Shift with exponential notation to avoid floating-point issues.
  6145. // See [MDN](https://mdn.io/round#Examples) for more details.
  6146. var pair = (toString(number) + 'e').split('e'),
  6147. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6148. pair = (toString(value) + 'e').split('e');
  6149. return +(pair[0] + 'e' + (+pair[1] - precision));
  6150. }
  6151. return func(number);
  6152. };
  6153. }
  6154. /**
  6155. * Creates a set object of `values`.
  6156. *
  6157. * @private
  6158. * @param {Array} values The values to add to the set.
  6159. * @returns {Object} Returns the new set.
  6160. */
  6161. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6162. return new Set(values);
  6163. };
  6164. /**
  6165. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6166. *
  6167. * @private
  6168. * @param {Function} keysFunc The function to get the keys of a given object.
  6169. * @returns {Function} Returns the new pairs function.
  6170. */
  6171. function createToPairs(keysFunc) {
  6172. return function(object) {
  6173. var tag = getTag(object);
  6174. if (tag == mapTag) {
  6175. return mapToArray(object);
  6176. }
  6177. if (tag == setTag) {
  6178. return setToPairs(object);
  6179. }
  6180. return baseToPairs(object, keysFunc(object));
  6181. };
  6182. }
  6183. /**
  6184. * Creates a function that either curries or invokes `func` with optional
  6185. * `this` binding and partially applied arguments.
  6186. *
  6187. * @private
  6188. * @param {Function|string} func The function or method name to wrap.
  6189. * @param {number} bitmask The bitmask flags.
  6190. * 1 - `_.bind`
  6191. * 2 - `_.bindKey`
  6192. * 4 - `_.curry` or `_.curryRight` of a bound function
  6193. * 8 - `_.curry`
  6194. * 16 - `_.curryRight`
  6195. * 32 - `_.partial`
  6196. * 64 - `_.partialRight`
  6197. * 128 - `_.rearg`
  6198. * 256 - `_.ary`
  6199. * 512 - `_.flip`
  6200. * @param {*} [thisArg] The `this` binding of `func`.
  6201. * @param {Array} [partials] The arguments to be partially applied.
  6202. * @param {Array} [holders] The `partials` placeholder indexes.
  6203. * @param {Array} [argPos] The argument positions of the new function.
  6204. * @param {number} [ary] The arity cap of `func`.
  6205. * @param {number} [arity] The arity of `func`.
  6206. * @returns {Function} Returns the new wrapped function.
  6207. */
  6208. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6209. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6210. if (!isBindKey && typeof func != 'function') {
  6211. throw new TypeError(FUNC_ERROR_TEXT);
  6212. }
  6213. var length = partials ? partials.length : 0;
  6214. if (!length) {
  6215. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6216. partials = holders = undefined;
  6217. }
  6218. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6219. arity = arity === undefined ? arity : toInteger(arity);
  6220. length -= holders ? holders.length : 0;
  6221. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6222. var partialsRight = partials,
  6223. holdersRight = holders;
  6224. partials = holders = undefined;
  6225. }
  6226. var data = isBindKey ? undefined : getData(func);
  6227. var newData = [
  6228. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6229. argPos, ary, arity
  6230. ];
  6231. if (data) {
  6232. mergeData(newData, data);
  6233. }
  6234. func = newData[0];
  6235. bitmask = newData[1];
  6236. thisArg = newData[2];
  6237. partials = newData[3];
  6238. holders = newData[4];
  6239. arity = newData[9] = newData[9] === undefined
  6240. ? (isBindKey ? 0 : func.length)
  6241. : nativeMax(newData[9] - length, 0);
  6242. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6243. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6244. }
  6245. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6246. var result = createBind(func, bitmask, thisArg);
  6247. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6248. result = createCurry(func, bitmask, arity);
  6249. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6250. result = createPartial(func, bitmask, thisArg, partials);
  6251. } else {
  6252. result = createHybrid.apply(undefined, newData);
  6253. }
  6254. var setter = data ? baseSetData : setData;
  6255. return setWrapToString(setter(result, newData), func, bitmask);
  6256. }
  6257. /**
  6258. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6259. * of source objects to the destination object for all destination properties
  6260. * that resolve to `undefined`.
  6261. *
  6262. * @private
  6263. * @param {*} objValue The destination value.
  6264. * @param {*} srcValue The source value.
  6265. * @param {string} key The key of the property to assign.
  6266. * @param {Object} object The parent object of `objValue`.
  6267. * @returns {*} Returns the value to assign.
  6268. */
  6269. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6270. if (objValue === undefined ||
  6271. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6272. return srcValue;
  6273. }
  6274. return objValue;
  6275. }
  6276. /**
  6277. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6278. * objects into destination objects that are passed thru.
  6279. *
  6280. * @private
  6281. * @param {*} objValue The destination value.
  6282. * @param {*} srcValue The source value.
  6283. * @param {string} key The key of the property to merge.
  6284. * @param {Object} object The parent object of `objValue`.
  6285. * @param {Object} source The parent object of `srcValue`.
  6286. * @param {Object} [stack] Tracks traversed source values and their merged
  6287. * counterparts.
  6288. * @returns {*} Returns the value to assign.
  6289. */
  6290. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6291. if (isObject(objValue) && isObject(srcValue)) {
  6292. // Recursively merge objects and arrays (susceptible to call stack limits).
  6293. stack.set(srcValue, objValue);
  6294. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6295. stack['delete'](srcValue);
  6296. }
  6297. return objValue;
  6298. }
  6299. /**
  6300. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6301. * objects.
  6302. *
  6303. * @private
  6304. * @param {*} value The value to inspect.
  6305. * @param {string} key The key of the property to inspect.
  6306. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6307. */
  6308. function customOmitClone(value) {
  6309. return isPlainObject(value) ? undefined : value;
  6310. }
  6311. /**
  6312. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6313. * partial deep comparisons.
  6314. *
  6315. * @private
  6316. * @param {Array} array The array to compare.
  6317. * @param {Array} other The other array to compare.
  6318. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6319. * @param {Function} customizer The function to customize comparisons.
  6320. * @param {Function} equalFunc The function to determine equivalents of values.
  6321. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6322. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6323. */
  6324. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6325. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6326. arrLength = array.length,
  6327. othLength = other.length;
  6328. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6329. return false;
  6330. }
  6331. // Check that cyclic values are equal.
  6332. var arrStacked = stack.get(array);
  6333. var othStacked = stack.get(other);
  6334. if (arrStacked && othStacked) {
  6335. return arrStacked == other && othStacked == array;
  6336. }
  6337. var index = -1,
  6338. result = true,
  6339. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6340. stack.set(array, other);
  6341. stack.set(other, array);
  6342. // Ignore non-index properties.
  6343. while (++index < arrLength) {
  6344. var arrValue = array[index],
  6345. othValue = other[index];
  6346. if (customizer) {
  6347. var compared = isPartial
  6348. ? customizer(othValue, arrValue, index, other, array, stack)
  6349. : customizer(arrValue, othValue, index, array, other, stack);
  6350. }
  6351. if (compared !== undefined) {
  6352. if (compared) {
  6353. continue;
  6354. }
  6355. result = false;
  6356. break;
  6357. }
  6358. // Recursively compare arrays (susceptible to call stack limits).
  6359. if (seen) {
  6360. if (!arraySome(other, function(othValue, othIndex) {
  6361. if (!cacheHas(seen, othIndex) &&
  6362. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6363. return seen.push(othIndex);
  6364. }
  6365. })) {
  6366. result = false;
  6367. break;
  6368. }
  6369. } else if (!(
  6370. arrValue === othValue ||
  6371. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6372. )) {
  6373. result = false;
  6374. break;
  6375. }
  6376. }
  6377. stack['delete'](array);
  6378. stack['delete'](other);
  6379. return result;
  6380. }
  6381. /**
  6382. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6383. * the same `toStringTag`.
  6384. *
  6385. * **Note:** This function only supports comparing values with tags of
  6386. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6387. *
  6388. * @private
  6389. * @param {Object} object The object to compare.
  6390. * @param {Object} other The other object to compare.
  6391. * @param {string} tag The `toStringTag` of the objects to compare.
  6392. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6393. * @param {Function} customizer The function to customize comparisons.
  6394. * @param {Function} equalFunc The function to determine equivalents of values.
  6395. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6396. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6397. */
  6398. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6399. switch (tag) {
  6400. case dataViewTag:
  6401. if ((object.byteLength != other.byteLength) ||
  6402. (object.byteOffset != other.byteOffset)) {
  6403. return false;
  6404. }
  6405. object = object.buffer;
  6406. other = other.buffer;
  6407. case arrayBufferTag:
  6408. if ((object.byteLength != other.byteLength) ||
  6409. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6410. return false;
  6411. }
  6412. return true;
  6413. case boolTag:
  6414. case dateTag:
  6415. case numberTag:
  6416. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6417. // Invalid dates are coerced to `NaN`.
  6418. return eq(+object, +other);
  6419. case errorTag:
  6420. return object.name == other.name && object.message == other.message;
  6421. case regexpTag:
  6422. case stringTag:
  6423. // Coerce regexes to strings and treat strings, primitives and objects,
  6424. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6425. // for more details.
  6426. return object == (other + '');
  6427. case mapTag:
  6428. var convert = mapToArray;
  6429. case setTag:
  6430. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6431. convert || (convert = setToArray);
  6432. if (object.size != other.size && !isPartial) {
  6433. return false;
  6434. }
  6435. // Assume cyclic values are equal.
  6436. var stacked = stack.get(object);
  6437. if (stacked) {
  6438. return stacked == other;
  6439. }
  6440. bitmask |= COMPARE_UNORDERED_FLAG;
  6441. // Recursively compare objects (susceptible to call stack limits).
  6442. stack.set(object, other);
  6443. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6444. stack['delete'](object);
  6445. return result;
  6446. case symbolTag:
  6447. if (symbolValueOf) {
  6448. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6449. }
  6450. }
  6451. return false;
  6452. }
  6453. /**
  6454. * A specialized version of `baseIsEqualDeep` for objects with support for
  6455. * partial deep comparisons.
  6456. *
  6457. * @private
  6458. * @param {Object} object The object to compare.
  6459. * @param {Object} other The other object to compare.
  6460. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6461. * @param {Function} customizer The function to customize comparisons.
  6462. * @param {Function} equalFunc The function to determine equivalents of values.
  6463. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6464. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6465. */
  6466. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6467. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6468. objProps = getAllKeys(object),
  6469. objLength = objProps.length,
  6470. othProps = getAllKeys(other),
  6471. othLength = othProps.length;
  6472. if (objLength != othLength && !isPartial) {
  6473. return false;
  6474. }
  6475. var index = objLength;
  6476. while (index--) {
  6477. var key = objProps[index];
  6478. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6479. return false;
  6480. }
  6481. }
  6482. // Check that cyclic values are equal.
  6483. var objStacked = stack.get(object);
  6484. var othStacked = stack.get(other);
  6485. if (objStacked && othStacked) {
  6486. return objStacked == other && othStacked == object;
  6487. }
  6488. var result = true;
  6489. stack.set(object, other);
  6490. stack.set(other, object);
  6491. var skipCtor = isPartial;
  6492. while (++index < objLength) {
  6493. key = objProps[index];
  6494. var objValue = object[key],
  6495. othValue = other[key];
  6496. if (customizer) {
  6497. var compared = isPartial
  6498. ? customizer(othValue, objValue, key, other, object, stack)
  6499. : customizer(objValue, othValue, key, object, other, stack);
  6500. }
  6501. // Recursively compare objects (susceptible to call stack limits).
  6502. if (!(compared === undefined
  6503. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6504. : compared
  6505. )) {
  6506. result = false;
  6507. break;
  6508. }
  6509. skipCtor || (skipCtor = key == 'constructor');
  6510. }
  6511. if (result && !skipCtor) {
  6512. var objCtor = object.constructor,
  6513. othCtor = other.constructor;
  6514. // Non `Object` object instances with different constructors are not equal.
  6515. if (objCtor != othCtor &&
  6516. ('constructor' in object && 'constructor' in other) &&
  6517. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6518. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6519. result = false;
  6520. }
  6521. }
  6522. stack['delete'](object);
  6523. stack['delete'](other);
  6524. return result;
  6525. }
  6526. /**
  6527. * A specialized version of `baseRest` which flattens the rest array.
  6528. *
  6529. * @private
  6530. * @param {Function} func The function to apply a rest parameter to.
  6531. * @returns {Function} Returns the new function.
  6532. */
  6533. function flatRest(func) {
  6534. return setToString(overRest(func, undefined, flatten), func + '');
  6535. }
  6536. /**
  6537. * Creates an array of own enumerable property names and symbols of `object`.
  6538. *
  6539. * @private
  6540. * @param {Object} object The object to query.
  6541. * @returns {Array} Returns the array of property names and symbols.
  6542. */
  6543. function getAllKeys(object) {
  6544. return baseGetAllKeys(object, keys, getSymbols);
  6545. }
  6546. /**
  6547. * Creates an array of own and inherited enumerable property names and
  6548. * symbols of `object`.
  6549. *
  6550. * @private
  6551. * @param {Object} object The object to query.
  6552. * @returns {Array} Returns the array of property names and symbols.
  6553. */
  6554. function getAllKeysIn(object) {
  6555. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6556. }
  6557. /**
  6558. * Gets metadata for `func`.
  6559. *
  6560. * @private
  6561. * @param {Function} func The function to query.
  6562. * @returns {*} Returns the metadata for `func`.
  6563. */
  6564. var getData = !metaMap ? noop : function(func) {
  6565. return metaMap.get(func);
  6566. };
  6567. /**
  6568. * Gets the name of `func`.
  6569. *
  6570. * @private
  6571. * @param {Function} func The function to query.
  6572. * @returns {string} Returns the function name.
  6573. */
  6574. function getFuncName(func) {
  6575. var result = (func.name + ''),
  6576. array = realNames[result],
  6577. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6578. while (length--) {
  6579. var data = array[length],
  6580. otherFunc = data.func;
  6581. if (otherFunc == null || otherFunc == func) {
  6582. return data.name;
  6583. }
  6584. }
  6585. return result;
  6586. }
  6587. /**
  6588. * Gets the argument placeholder value for `func`.
  6589. *
  6590. * @private
  6591. * @param {Function} func The function to inspect.
  6592. * @returns {*} Returns the placeholder value.
  6593. */
  6594. function getHolder(func) {
  6595. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6596. return object.placeholder;
  6597. }
  6598. /**
  6599. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6600. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6601. * If arguments are provided, the chosen function is invoked with them and
  6602. * its result is returned.
  6603. *
  6604. * @private
  6605. * @param {*} [value] The value to convert to an iteratee.
  6606. * @param {number} [arity] The arity of the created iteratee.
  6607. * @returns {Function} Returns the chosen function or its result.
  6608. */
  6609. function getIteratee() {
  6610. var result = lodash.iteratee || iteratee;
  6611. result = result === iteratee ? baseIteratee : result;
  6612. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6613. }
  6614. /**
  6615. * Gets the data for `map`.
  6616. *
  6617. * @private
  6618. * @param {Object} map The map to query.
  6619. * @param {string} key The reference key.
  6620. * @returns {*} Returns the map data.
  6621. */
  6622. function getMapData(map, key) {
  6623. var data = map.__data__;
  6624. return isKeyable(key)
  6625. ? data[typeof key == 'string' ? 'string' : 'hash']
  6626. : data.map;
  6627. }
  6628. /**
  6629. * Gets the property names, values, and compare flags of `object`.
  6630. *
  6631. * @private
  6632. * @param {Object} object The object to query.
  6633. * @returns {Array} Returns the match data of `object`.
  6634. */
  6635. function getMatchData(object) {
  6636. var result = keys(object),
  6637. length = result.length;
  6638. while (length--) {
  6639. var key = result[length],
  6640. value = object[key];
  6641. result[length] = [key, value, isStrictComparable(value)];
  6642. }
  6643. return result;
  6644. }
  6645. /**
  6646. * Gets the native function at `key` of `object`.
  6647. *
  6648. * @private
  6649. * @param {Object} object The object to query.
  6650. * @param {string} key The key of the method to get.
  6651. * @returns {*} Returns the function if it's native, else `undefined`.
  6652. */
  6653. function getNative(object, key) {
  6654. var value = getValue(object, key);
  6655. return baseIsNative(value) ? value : undefined;
  6656. }
  6657. /**
  6658. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6659. *
  6660. * @private
  6661. * @param {*} value The value to query.
  6662. * @returns {string} Returns the raw `toStringTag`.
  6663. */
  6664. function getRawTag(value) {
  6665. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6666. tag = value[symToStringTag];
  6667. try {
  6668. value[symToStringTag] = undefined;
  6669. var unmasked = true;
  6670. } catch (e) {}
  6671. var result = nativeObjectToString.call(value);
  6672. if (unmasked) {
  6673. if (isOwn) {
  6674. value[symToStringTag] = tag;
  6675. } else {
  6676. delete value[symToStringTag];
  6677. }
  6678. }
  6679. return result;
  6680. }
  6681. /**
  6682. * Creates an array of the own enumerable symbols of `object`.
  6683. *
  6684. * @private
  6685. * @param {Object} object The object to query.
  6686. * @returns {Array} Returns the array of symbols.
  6687. */
  6688. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6689. if (object == null) {
  6690. return [];
  6691. }
  6692. object = Object(object);
  6693. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6694. return propertyIsEnumerable.call(object, symbol);
  6695. });
  6696. };
  6697. /**
  6698. * Creates an array of the own and inherited enumerable symbols of `object`.
  6699. *
  6700. * @private
  6701. * @param {Object} object The object to query.
  6702. * @returns {Array} Returns the array of symbols.
  6703. */
  6704. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6705. var result = [];
  6706. while (object) {
  6707. arrayPush(result, getSymbols(object));
  6708. object = getPrototype(object);
  6709. }
  6710. return result;
  6711. };
  6712. /**
  6713. * Gets the `toStringTag` of `value`.
  6714. *
  6715. * @private
  6716. * @param {*} value The value to query.
  6717. * @returns {string} Returns the `toStringTag`.
  6718. */
  6719. var getTag = baseGetTag;
  6720. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6721. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6722. (Map && getTag(new Map) != mapTag) ||
  6723. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6724. (Set && getTag(new Set) != setTag) ||
  6725. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6726. getTag = function(value) {
  6727. var result = baseGetTag(value),
  6728. Ctor = result == objectTag ? value.constructor : undefined,
  6729. ctorString = Ctor ? toSource(Ctor) : '';
  6730. if (ctorString) {
  6731. switch (ctorString) {
  6732. case dataViewCtorString: return dataViewTag;
  6733. case mapCtorString: return mapTag;
  6734. case promiseCtorString: return promiseTag;
  6735. case setCtorString: return setTag;
  6736. case weakMapCtorString: return weakMapTag;
  6737. }
  6738. }
  6739. return result;
  6740. };
  6741. }
  6742. /**
  6743. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6744. *
  6745. * @private
  6746. * @param {number} start The start of the view.
  6747. * @param {number} end The end of the view.
  6748. * @param {Array} transforms The transformations to apply to the view.
  6749. * @returns {Object} Returns an object containing the `start` and `end`
  6750. * positions of the view.
  6751. */
  6752. function getView(start, end, transforms) {
  6753. var index = -1,
  6754. length = transforms.length;
  6755. while (++index < length) {
  6756. var data = transforms[index],
  6757. size = data.size;
  6758. switch (data.type) {
  6759. case 'drop': start += size; break;
  6760. case 'dropRight': end -= size; break;
  6761. case 'take': end = nativeMin(end, start + size); break;
  6762. case 'takeRight': start = nativeMax(start, end - size); break;
  6763. }
  6764. }
  6765. return { 'start': start, 'end': end };
  6766. }
  6767. /**
  6768. * Extracts wrapper details from the `source` body comment.
  6769. *
  6770. * @private
  6771. * @param {string} source The source to inspect.
  6772. * @returns {Array} Returns the wrapper details.
  6773. */
  6774. function getWrapDetails(source) {
  6775. var match = source.match(reWrapDetails);
  6776. return match ? match[1].split(reSplitDetails) : [];
  6777. }
  6778. /**
  6779. * Checks if `path` exists on `object`.
  6780. *
  6781. * @private
  6782. * @param {Object} object The object to query.
  6783. * @param {Array|string} path The path to check.
  6784. * @param {Function} hasFunc The function to check properties.
  6785. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6786. */
  6787. function hasPath(object, path, hasFunc) {
  6788. path = castPath(path, object);
  6789. var index = -1,
  6790. length = path.length,
  6791. result = false;
  6792. while (++index < length) {
  6793. var key = toKey(path[index]);
  6794. if (!(result = object != null && hasFunc(object, key))) {
  6795. break;
  6796. }
  6797. object = object[key];
  6798. }
  6799. if (result || ++index != length) {
  6800. return result;
  6801. }
  6802. length = object == null ? 0 : object.length;
  6803. return !!length && isLength(length) && isIndex(key, length) &&
  6804. (isArray(object) || isArguments(object));
  6805. }
  6806. /**
  6807. * Initializes an array clone.
  6808. *
  6809. * @private
  6810. * @param {Array} array The array to clone.
  6811. * @returns {Array} Returns the initialized clone.
  6812. */
  6813. function initCloneArray(array) {
  6814. var length = array.length,
  6815. result = new array.constructor(length);
  6816. // Add properties assigned by `RegExp#exec`.
  6817. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6818. result.index = array.index;
  6819. result.input = array.input;
  6820. }
  6821. return result;
  6822. }
  6823. /**
  6824. * Initializes an object clone.
  6825. *
  6826. * @private
  6827. * @param {Object} object The object to clone.
  6828. * @returns {Object} Returns the initialized clone.
  6829. */
  6830. function initCloneObject(object) {
  6831. return (typeof object.constructor == 'function' && !isPrototype(object))
  6832. ? baseCreate(getPrototype(object))
  6833. : {};
  6834. }
  6835. /**
  6836. * Initializes an object clone based on its `toStringTag`.
  6837. *
  6838. * **Note:** This function only supports cloning values with tags of
  6839. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6840. *
  6841. * @private
  6842. * @param {Object} object The object to clone.
  6843. * @param {string} tag The `toStringTag` of the object to clone.
  6844. * @param {boolean} [isDeep] Specify a deep clone.
  6845. * @returns {Object} Returns the initialized clone.
  6846. */
  6847. function initCloneByTag(object, tag, isDeep) {
  6848. var Ctor = object.constructor;
  6849. switch (tag) {
  6850. case arrayBufferTag:
  6851. return cloneArrayBuffer(object);
  6852. case boolTag:
  6853. case dateTag:
  6854. return new Ctor(+object);
  6855. case dataViewTag:
  6856. return cloneDataView(object, isDeep);
  6857. case float32Tag: case float64Tag:
  6858. case int8Tag: case int16Tag: case int32Tag:
  6859. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6860. return cloneTypedArray(object, isDeep);
  6861. case mapTag:
  6862. return new Ctor;
  6863. case numberTag:
  6864. case stringTag:
  6865. return new Ctor(object);
  6866. case regexpTag:
  6867. return cloneRegExp(object);
  6868. case setTag:
  6869. return new Ctor;
  6870. case symbolTag:
  6871. return cloneSymbol(object);
  6872. }
  6873. }
  6874. /**
  6875. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6876. *
  6877. * @private
  6878. * @param {string} source The source to modify.
  6879. * @returns {Array} details The details to insert.
  6880. * @returns {string} Returns the modified source.
  6881. */
  6882. function insertWrapDetails(source, details) {
  6883. var length = details.length;
  6884. if (!length) {
  6885. return source;
  6886. }
  6887. var lastIndex = length - 1;
  6888. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6889. details = details.join(length > 2 ? ', ' : ' ');
  6890. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6891. }
  6892. /**
  6893. * Checks if `value` is a flattenable `arguments` object or array.
  6894. *
  6895. * @private
  6896. * @param {*} value The value to check.
  6897. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6898. */
  6899. function isFlattenable(value) {
  6900. return isArray(value) || isArguments(value) ||
  6901. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6902. }
  6903. /**
  6904. * Checks if `value` is a valid array-like index.
  6905. *
  6906. * @private
  6907. * @param {*} value The value to check.
  6908. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6909. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6910. */
  6911. function isIndex(value, length) {
  6912. var type = typeof value;
  6913. length = length == null ? MAX_SAFE_INTEGER : length;
  6914. return !!length &&
  6915. (type == 'number' ||
  6916. (type != 'symbol' && reIsUint.test(value))) &&
  6917. (value > -1 && value % 1 == 0 && value < length);
  6918. }
  6919. /**
  6920. * Checks if the given arguments are from an iteratee call.
  6921. *
  6922. * @private
  6923. * @param {*} value The potential iteratee value argument.
  6924. * @param {*} index The potential iteratee index or key argument.
  6925. * @param {*} object The potential iteratee object argument.
  6926. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6927. * else `false`.
  6928. */
  6929. function isIterateeCall(value, index, object) {
  6930. if (!isObject(object)) {
  6931. return false;
  6932. }
  6933. var type = typeof index;
  6934. if (type == 'number'
  6935. ? (isArrayLike(object) && isIndex(index, object.length))
  6936. : (type == 'string' && index in object)
  6937. ) {
  6938. return eq(object[index], value);
  6939. }
  6940. return false;
  6941. }
  6942. /**
  6943. * Checks if `value` is a property name and not a property path.
  6944. *
  6945. * @private
  6946. * @param {*} value The value to check.
  6947. * @param {Object} [object] The object to query keys on.
  6948. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6949. */
  6950. function isKey(value, object) {
  6951. if (isArray(value)) {
  6952. return false;
  6953. }
  6954. var type = typeof value;
  6955. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6956. value == null || isSymbol(value)) {
  6957. return true;
  6958. }
  6959. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6960. (object != null && value in Object(object));
  6961. }
  6962. /**
  6963. * Checks if `value` is suitable for use as unique object key.
  6964. *
  6965. * @private
  6966. * @param {*} value The value to check.
  6967. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6968. */
  6969. function isKeyable(value) {
  6970. var type = typeof value;
  6971. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6972. ? (value !== '__proto__')
  6973. : (value === null);
  6974. }
  6975. /**
  6976. * Checks if `func` has a lazy counterpart.
  6977. *
  6978. * @private
  6979. * @param {Function} func The function to check.
  6980. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6981. * else `false`.
  6982. */
  6983. function isLaziable(func) {
  6984. var funcName = getFuncName(func),
  6985. other = lodash[funcName];
  6986. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6987. return false;
  6988. }
  6989. if (func === other) {
  6990. return true;
  6991. }
  6992. var data = getData(other);
  6993. return !!data && func === data[0];
  6994. }
  6995. /**
  6996. * Checks if `func` has its source masked.
  6997. *
  6998. * @private
  6999. * @param {Function} func The function to check.
  7000. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7001. */
  7002. function isMasked(func) {
  7003. return !!maskSrcKey && (maskSrcKey in func);
  7004. }
  7005. /**
  7006. * Checks if `func` is capable of being masked.
  7007. *
  7008. * @private
  7009. * @param {*} value The value to check.
  7010. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7011. */
  7012. var isMaskable = coreJsData ? isFunction : stubFalse;
  7013. /**
  7014. * Checks if `value` is likely a prototype object.
  7015. *
  7016. * @private
  7017. * @param {*} value The value to check.
  7018. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7019. */
  7020. function isPrototype(value) {
  7021. var Ctor = value && value.constructor,
  7022. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7023. return value === proto;
  7024. }
  7025. /**
  7026. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7027. *
  7028. * @private
  7029. * @param {*} value The value to check.
  7030. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7031. * equality comparisons, else `false`.
  7032. */
  7033. function isStrictComparable(value) {
  7034. return value === value && !isObject(value);
  7035. }
  7036. /**
  7037. * A specialized version of `matchesProperty` for source values suitable
  7038. * for strict equality comparisons, i.e. `===`.
  7039. *
  7040. * @private
  7041. * @param {string} key The key of the property to get.
  7042. * @param {*} srcValue The value to match.
  7043. * @returns {Function} Returns the new spec function.
  7044. */
  7045. function matchesStrictComparable(key, srcValue) {
  7046. return function(object) {
  7047. if (object == null) {
  7048. return false;
  7049. }
  7050. return object[key] === srcValue &&
  7051. (srcValue !== undefined || (key in Object(object)));
  7052. };
  7053. }
  7054. /**
  7055. * A specialized version of `_.memoize` which clears the memoized function's
  7056. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7057. *
  7058. * @private
  7059. * @param {Function} func The function to have its output memoized.
  7060. * @returns {Function} Returns the new memoized function.
  7061. */
  7062. function memoizeCapped(func) {
  7063. var result = memoize(func, function(key) {
  7064. if (cache.size === MAX_MEMOIZE_SIZE) {
  7065. cache.clear();
  7066. }
  7067. return key;
  7068. });
  7069. var cache = result.cache;
  7070. return result;
  7071. }
  7072. /**
  7073. * Merges the function metadata of `source` into `data`.
  7074. *
  7075. * Merging metadata reduces the number of wrappers used to invoke a function.
  7076. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7077. * may be applied regardless of execution order. Methods like `_.ary` and
  7078. * `_.rearg` modify function arguments, making the order in which they are
  7079. * executed important, preventing the merging of metadata. However, we make
  7080. * an exception for a safe combined case where curried functions have `_.ary`
  7081. * and or `_.rearg` applied.
  7082. *
  7083. * @private
  7084. * @param {Array} data The destination metadata.
  7085. * @param {Array} source The source metadata.
  7086. * @returns {Array} Returns `data`.
  7087. */
  7088. function mergeData(data, source) {
  7089. var bitmask = data[1],
  7090. srcBitmask = source[1],
  7091. newBitmask = bitmask | srcBitmask,
  7092. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7093. var isCombo =
  7094. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7095. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7096. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7097. // Exit early if metadata can't be merged.
  7098. if (!(isCommon || isCombo)) {
  7099. return data;
  7100. }
  7101. // Use source `thisArg` if available.
  7102. if (srcBitmask & WRAP_BIND_FLAG) {
  7103. data[2] = source[2];
  7104. // Set when currying a bound function.
  7105. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7106. }
  7107. // Compose partial arguments.
  7108. var value = source[3];
  7109. if (value) {
  7110. var partials = data[3];
  7111. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7112. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7113. }
  7114. // Compose partial right arguments.
  7115. value = source[5];
  7116. if (value) {
  7117. partials = data[5];
  7118. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7119. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7120. }
  7121. // Use source `argPos` if available.
  7122. value = source[7];
  7123. if (value) {
  7124. data[7] = value;
  7125. }
  7126. // Use source `ary` if it's smaller.
  7127. if (srcBitmask & WRAP_ARY_FLAG) {
  7128. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7129. }
  7130. // Use source `arity` if one is not provided.
  7131. if (data[9] == null) {
  7132. data[9] = source[9];
  7133. }
  7134. // Use source `func` and merge bitmasks.
  7135. data[0] = source[0];
  7136. data[1] = newBitmask;
  7137. return data;
  7138. }
  7139. /**
  7140. * This function is like
  7141. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7142. * except that it includes inherited enumerable properties.
  7143. *
  7144. * @private
  7145. * @param {Object} object The object to query.
  7146. * @returns {Array} Returns the array of property names.
  7147. */
  7148. function nativeKeysIn(object) {
  7149. var result = [];
  7150. if (object != null) {
  7151. for (var key in Object(object)) {
  7152. result.push(key);
  7153. }
  7154. }
  7155. return result;
  7156. }
  7157. /**
  7158. * Converts `value` to a string using `Object.prototype.toString`.
  7159. *
  7160. * @private
  7161. * @param {*} value The value to convert.
  7162. * @returns {string} Returns the converted string.
  7163. */
  7164. function objectToString(value) {
  7165. return nativeObjectToString.call(value);
  7166. }
  7167. /**
  7168. * A specialized version of `baseRest` which transforms the rest array.
  7169. *
  7170. * @private
  7171. * @param {Function} func The function to apply a rest parameter to.
  7172. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7173. * @param {Function} transform The rest array transform.
  7174. * @returns {Function} Returns the new function.
  7175. */
  7176. function overRest(func, start, transform) {
  7177. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7178. return function() {
  7179. var args = arguments,
  7180. index = -1,
  7181. length = nativeMax(args.length - start, 0),
  7182. array = Array(length);
  7183. while (++index < length) {
  7184. array[index] = args[start + index];
  7185. }
  7186. index = -1;
  7187. var otherArgs = Array(start + 1);
  7188. while (++index < start) {
  7189. otherArgs[index] = args[index];
  7190. }
  7191. otherArgs[start] = transform(array);
  7192. return apply(func, this, otherArgs);
  7193. };
  7194. }
  7195. /**
  7196. * Gets the parent value at `path` of `object`.
  7197. *
  7198. * @private
  7199. * @param {Object} object The object to query.
  7200. * @param {Array} path The path to get the parent value of.
  7201. * @returns {*} Returns the parent value.
  7202. */
  7203. function parent(object, path) {
  7204. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7205. }
  7206. /**
  7207. * Reorder `array` according to the specified indexes where the element at
  7208. * the first index is assigned as the first element, the element at
  7209. * the second index is assigned as the second element, and so on.
  7210. *
  7211. * @private
  7212. * @param {Array} array The array to reorder.
  7213. * @param {Array} indexes The arranged array indexes.
  7214. * @returns {Array} Returns `array`.
  7215. */
  7216. function reorder(array, indexes) {
  7217. var arrLength = array.length,
  7218. length = nativeMin(indexes.length, arrLength),
  7219. oldArray = copyArray(array);
  7220. while (length--) {
  7221. var index = indexes[length];
  7222. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7223. }
  7224. return array;
  7225. }
  7226. /**
  7227. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7228. *
  7229. * @private
  7230. * @param {Object} object The object to query.
  7231. * @param {string} key The key of the property to get.
  7232. * @returns {*} Returns the property value.
  7233. */
  7234. function safeGet(object, key) {
  7235. if (key === 'constructor' && typeof object[key] === 'function') {
  7236. return;
  7237. }
  7238. if (key == '__proto__') {
  7239. return;
  7240. }
  7241. return object[key];
  7242. }
  7243. /**
  7244. * Sets metadata for `func`.
  7245. *
  7246. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7247. * period of time, it will trip its breaker and transition to an identity
  7248. * function to avoid garbage collection pauses in V8. See
  7249. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7250. * for more details.
  7251. *
  7252. * @private
  7253. * @param {Function} func The function to associate metadata with.
  7254. * @param {*} data The metadata.
  7255. * @returns {Function} Returns `func`.
  7256. */
  7257. var setData = shortOut(baseSetData);
  7258. /**
  7259. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7260. *
  7261. * @private
  7262. * @param {Function} func The function to delay.
  7263. * @param {number} wait The number of milliseconds to delay invocation.
  7264. * @returns {number|Object} Returns the timer id or timeout object.
  7265. */
  7266. var setTimeout = ctxSetTimeout || function(func, wait) {
  7267. return root.setTimeout(func, wait);
  7268. };
  7269. /**
  7270. * Sets the `toString` method of `func` to return `string`.
  7271. *
  7272. * @private
  7273. * @param {Function} func The function to modify.
  7274. * @param {Function} string The `toString` result.
  7275. * @returns {Function} Returns `func`.
  7276. */
  7277. var setToString = shortOut(baseSetToString);
  7278. /**
  7279. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7280. * with wrapper details in a comment at the top of the source body.
  7281. *
  7282. * @private
  7283. * @param {Function} wrapper The function to modify.
  7284. * @param {Function} reference The reference function.
  7285. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7286. * @returns {Function} Returns `wrapper`.
  7287. */
  7288. function setWrapToString(wrapper, reference, bitmask) {
  7289. var source = (reference + '');
  7290. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7291. }
  7292. /**
  7293. * Creates a function that'll short out and invoke `identity` instead
  7294. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7295. * milliseconds.
  7296. *
  7297. * @private
  7298. * @param {Function} func The function to restrict.
  7299. * @returns {Function} Returns the new shortable function.
  7300. */
  7301. function shortOut(func) {
  7302. var count = 0,
  7303. lastCalled = 0;
  7304. return function() {
  7305. var stamp = nativeNow(),
  7306. remaining = HOT_SPAN - (stamp - lastCalled);
  7307. lastCalled = stamp;
  7308. if (remaining > 0) {
  7309. if (++count >= HOT_COUNT) {
  7310. return arguments[0];
  7311. }
  7312. } else {
  7313. count = 0;
  7314. }
  7315. return func.apply(undefined, arguments);
  7316. };
  7317. }
  7318. /**
  7319. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7320. *
  7321. * @private
  7322. * @param {Array} array The array to shuffle.
  7323. * @param {number} [size=array.length] The size of `array`.
  7324. * @returns {Array} Returns `array`.
  7325. */
  7326. function shuffleSelf(array, size) {
  7327. var index = -1,
  7328. length = array.length,
  7329. lastIndex = length - 1;
  7330. size = size === undefined ? length : size;
  7331. while (++index < size) {
  7332. var rand = baseRandom(index, lastIndex),
  7333. value = array[rand];
  7334. array[rand] = array[index];
  7335. array[index] = value;
  7336. }
  7337. array.length = size;
  7338. return array;
  7339. }
  7340. /**
  7341. * Converts `string` to a property path array.
  7342. *
  7343. * @private
  7344. * @param {string} string The string to convert.
  7345. * @returns {Array} Returns the property path array.
  7346. */
  7347. var stringToPath = memoizeCapped(function(string) {
  7348. var result = [];
  7349. if (string.charCodeAt(0) === 46 /* . */) {
  7350. result.push('');
  7351. }
  7352. string.replace(rePropName, function(match, number, quote, subString) {
  7353. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7354. });
  7355. return result;
  7356. });
  7357. /**
  7358. * Converts `value` to a string key if it's not a string or symbol.
  7359. *
  7360. * @private
  7361. * @param {*} value The value to inspect.
  7362. * @returns {string|symbol} Returns the key.
  7363. */
  7364. function toKey(value) {
  7365. if (typeof value == 'string' || isSymbol(value)) {
  7366. return value;
  7367. }
  7368. var result = (value + '');
  7369. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7370. }
  7371. /**
  7372. * Converts `func` to its source code.
  7373. *
  7374. * @private
  7375. * @param {Function} func The function to convert.
  7376. * @returns {string} Returns the source code.
  7377. */
  7378. function toSource(func) {
  7379. if (func != null) {
  7380. try {
  7381. return funcToString.call(func);
  7382. } catch (e) {}
  7383. try {
  7384. return (func + '');
  7385. } catch (e) {}
  7386. }
  7387. return '';
  7388. }
  7389. /**
  7390. * Updates wrapper `details` based on `bitmask` flags.
  7391. *
  7392. * @private
  7393. * @returns {Array} details The details to modify.
  7394. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7395. * @returns {Array} Returns `details`.
  7396. */
  7397. function updateWrapDetails(details, bitmask) {
  7398. arrayEach(wrapFlags, function(pair) {
  7399. var value = '_.' + pair[0];
  7400. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7401. details.push(value);
  7402. }
  7403. });
  7404. return details.sort();
  7405. }
  7406. /**
  7407. * Creates a clone of `wrapper`.
  7408. *
  7409. * @private
  7410. * @param {Object} wrapper The wrapper to clone.
  7411. * @returns {Object} Returns the cloned wrapper.
  7412. */
  7413. function wrapperClone(wrapper) {
  7414. if (wrapper instanceof LazyWrapper) {
  7415. return wrapper.clone();
  7416. }
  7417. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7418. result.__actions__ = copyArray(wrapper.__actions__);
  7419. result.__index__ = wrapper.__index__;
  7420. result.__values__ = wrapper.__values__;
  7421. return result;
  7422. }
  7423. /*------------------------------------------------------------------------*/
  7424. /**
  7425. * Creates an array of elements split into groups the length of `size`.
  7426. * If `array` can't be split evenly, the final chunk will be the remaining
  7427. * elements.
  7428. *
  7429. * @static
  7430. * @memberOf _
  7431. * @since 3.0.0
  7432. * @category Array
  7433. * @param {Array} array The array to process.
  7434. * @param {number} [size=1] The length of each chunk
  7435. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7436. * @returns {Array} Returns the new array of chunks.
  7437. * @example
  7438. *
  7439. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7440. * // => [['a', 'b'], ['c', 'd']]
  7441. *
  7442. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7443. * // => [['a', 'b', 'c'], ['d']]
  7444. */
  7445. function chunk(array, size, guard) {
  7446. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7447. size = 1;
  7448. } else {
  7449. size = nativeMax(toInteger(size), 0);
  7450. }
  7451. var length = array == null ? 0 : array.length;
  7452. if (!length || size < 1) {
  7453. return [];
  7454. }
  7455. var index = 0,
  7456. resIndex = 0,
  7457. result = Array(nativeCeil(length / size));
  7458. while (index < length) {
  7459. result[resIndex++] = baseSlice(array, index, (index += size));
  7460. }
  7461. return result;
  7462. }
  7463. /**
  7464. * Creates an array with all falsey values removed. The values `false`, `null`,
  7465. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7466. *
  7467. * @static
  7468. * @memberOf _
  7469. * @since 0.1.0
  7470. * @category Array
  7471. * @param {Array} array The array to compact.
  7472. * @returns {Array} Returns the new array of filtered values.
  7473. * @example
  7474. *
  7475. * _.compact([0, 1, false, 2, '', 3]);
  7476. * // => [1, 2, 3]
  7477. */
  7478. function compact(array) {
  7479. var index = -1,
  7480. length = array == null ? 0 : array.length,
  7481. resIndex = 0,
  7482. result = [];
  7483. while (++index < length) {
  7484. var value = array[index];
  7485. if (value) {
  7486. result[resIndex++] = value;
  7487. }
  7488. }
  7489. return result;
  7490. }
  7491. /**
  7492. * Creates a new array concatenating `array` with any additional arrays
  7493. * and/or values.
  7494. *
  7495. * @static
  7496. * @memberOf _
  7497. * @since 4.0.0
  7498. * @category Array
  7499. * @param {Array} array The array to concatenate.
  7500. * @param {...*} [values] The values to concatenate.
  7501. * @returns {Array} Returns the new concatenated array.
  7502. * @example
  7503. *
  7504. * var array = [1];
  7505. * var other = _.concat(array, 2, [3], [[4]]);
  7506. *
  7507. * console.log(other);
  7508. * // => [1, 2, 3, [4]]
  7509. *
  7510. * console.log(array);
  7511. * // => [1]
  7512. */
  7513. function concat() {
  7514. var length = arguments.length;
  7515. if (!length) {
  7516. return [];
  7517. }
  7518. var args = Array(length - 1),
  7519. array = arguments[0],
  7520. index = length;
  7521. while (index--) {
  7522. args[index - 1] = arguments[index];
  7523. }
  7524. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7525. }
  7526. /**
  7527. * Creates an array of `array` values not included in the other given arrays
  7528. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7529. * for equality comparisons. The order and references of result values are
  7530. * determined by the first array.
  7531. *
  7532. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7533. *
  7534. * @static
  7535. * @memberOf _
  7536. * @since 0.1.0
  7537. * @category Array
  7538. * @param {Array} array The array to inspect.
  7539. * @param {...Array} [values] The values to exclude.
  7540. * @returns {Array} Returns the new array of filtered values.
  7541. * @see _.without, _.xor
  7542. * @example
  7543. *
  7544. * _.difference([2, 1], [2, 3]);
  7545. * // => [1]
  7546. */
  7547. var difference = baseRest(function(array, values) {
  7548. return isArrayLikeObject(array)
  7549. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7550. : [];
  7551. });
  7552. /**
  7553. * This method is like `_.difference` except that it accepts `iteratee` which
  7554. * is invoked for each element of `array` and `values` to generate the criterion
  7555. * by which they're compared. The order and references of result values are
  7556. * determined by the first array. The iteratee is invoked with one argument:
  7557. * (value).
  7558. *
  7559. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7560. *
  7561. * @static
  7562. * @memberOf _
  7563. * @since 4.0.0
  7564. * @category Array
  7565. * @param {Array} array The array to inspect.
  7566. * @param {...Array} [values] The values to exclude.
  7567. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7568. * @returns {Array} Returns the new array of filtered values.
  7569. * @example
  7570. *
  7571. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7572. * // => [1.2]
  7573. *
  7574. * // The `_.property` iteratee shorthand.
  7575. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7576. * // => [{ 'x': 2 }]
  7577. */
  7578. var differenceBy = baseRest(function(array, values) {
  7579. var iteratee = last(values);
  7580. if (isArrayLikeObject(iteratee)) {
  7581. iteratee = undefined;
  7582. }
  7583. return isArrayLikeObject(array)
  7584. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7585. : [];
  7586. });
  7587. /**
  7588. * This method is like `_.difference` except that it accepts `comparator`
  7589. * which is invoked to compare elements of `array` to `values`. The order and
  7590. * references of result values are determined by the first array. The comparator
  7591. * is invoked with two arguments: (arrVal, othVal).
  7592. *
  7593. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7594. *
  7595. * @static
  7596. * @memberOf _
  7597. * @since 4.0.0
  7598. * @category Array
  7599. * @param {Array} array The array to inspect.
  7600. * @param {...Array} [values] The values to exclude.
  7601. * @param {Function} [comparator] The comparator invoked per element.
  7602. * @returns {Array} Returns the new array of filtered values.
  7603. * @example
  7604. *
  7605. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7606. *
  7607. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7608. * // => [{ 'x': 2, 'y': 1 }]
  7609. */
  7610. var differenceWith = baseRest(function(array, values) {
  7611. var comparator = last(values);
  7612. if (isArrayLikeObject(comparator)) {
  7613. comparator = undefined;
  7614. }
  7615. return isArrayLikeObject(array)
  7616. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7617. : [];
  7618. });
  7619. /**
  7620. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7621. *
  7622. * @static
  7623. * @memberOf _
  7624. * @since 0.5.0
  7625. * @category Array
  7626. * @param {Array} array The array to query.
  7627. * @param {number} [n=1] The number of elements to drop.
  7628. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7629. * @returns {Array} Returns the slice of `array`.
  7630. * @example
  7631. *
  7632. * _.drop([1, 2, 3]);
  7633. * // => [2, 3]
  7634. *
  7635. * _.drop([1, 2, 3], 2);
  7636. * // => [3]
  7637. *
  7638. * _.drop([1, 2, 3], 5);
  7639. * // => []
  7640. *
  7641. * _.drop([1, 2, 3], 0);
  7642. * // => [1, 2, 3]
  7643. */
  7644. function drop(array, n, guard) {
  7645. var length = array == null ? 0 : array.length;
  7646. if (!length) {
  7647. return [];
  7648. }
  7649. n = (guard || n === undefined) ? 1 : toInteger(n);
  7650. return baseSlice(array, n < 0 ? 0 : n, length);
  7651. }
  7652. /**
  7653. * Creates a slice of `array` with `n` elements dropped from the end.
  7654. *
  7655. * @static
  7656. * @memberOf _
  7657. * @since 3.0.0
  7658. * @category Array
  7659. * @param {Array} array The array to query.
  7660. * @param {number} [n=1] The number of elements to drop.
  7661. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7662. * @returns {Array} Returns the slice of `array`.
  7663. * @example
  7664. *
  7665. * _.dropRight([1, 2, 3]);
  7666. * // => [1, 2]
  7667. *
  7668. * _.dropRight([1, 2, 3], 2);
  7669. * // => [1]
  7670. *
  7671. * _.dropRight([1, 2, 3], 5);
  7672. * // => []
  7673. *
  7674. * _.dropRight([1, 2, 3], 0);
  7675. * // => [1, 2, 3]
  7676. */
  7677. function dropRight(array, n, guard) {
  7678. var length = array == null ? 0 : array.length;
  7679. if (!length) {
  7680. return [];
  7681. }
  7682. n = (guard || n === undefined) ? 1 : toInteger(n);
  7683. n = length - n;
  7684. return baseSlice(array, 0, n < 0 ? 0 : n);
  7685. }
  7686. /**
  7687. * Creates a slice of `array` excluding elements dropped from the end.
  7688. * Elements are dropped until `predicate` returns falsey. The predicate is
  7689. * invoked with three arguments: (value, index, array).
  7690. *
  7691. * @static
  7692. * @memberOf _
  7693. * @since 3.0.0
  7694. * @category Array
  7695. * @param {Array} array The array to query.
  7696. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7697. * @returns {Array} Returns the slice of `array`.
  7698. * @example
  7699. *
  7700. * var users = [
  7701. * { 'user': 'barney', 'active': true },
  7702. * { 'user': 'fred', 'active': false },
  7703. * { 'user': 'pebbles', 'active': false }
  7704. * ];
  7705. *
  7706. * _.dropRightWhile(users, function(o) { return !o.active; });
  7707. * // => objects for ['barney']
  7708. *
  7709. * // The `_.matches` iteratee shorthand.
  7710. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7711. * // => objects for ['barney', 'fred']
  7712. *
  7713. * // The `_.matchesProperty` iteratee shorthand.
  7714. * _.dropRightWhile(users, ['active', false]);
  7715. * // => objects for ['barney']
  7716. *
  7717. * // The `_.property` iteratee shorthand.
  7718. * _.dropRightWhile(users, 'active');
  7719. * // => objects for ['barney', 'fred', 'pebbles']
  7720. */
  7721. function dropRightWhile(array, predicate) {
  7722. return (array && array.length)
  7723. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7724. : [];
  7725. }
  7726. /**
  7727. * Creates a slice of `array` excluding elements dropped from the beginning.
  7728. * Elements are dropped until `predicate` returns falsey. The predicate is
  7729. * invoked with three arguments: (value, index, array).
  7730. *
  7731. * @static
  7732. * @memberOf _
  7733. * @since 3.0.0
  7734. * @category Array
  7735. * @param {Array} array The array to query.
  7736. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7737. * @returns {Array} Returns the slice of `array`.
  7738. * @example
  7739. *
  7740. * var users = [
  7741. * { 'user': 'barney', 'active': false },
  7742. * { 'user': 'fred', 'active': false },
  7743. * { 'user': 'pebbles', 'active': true }
  7744. * ];
  7745. *
  7746. * _.dropWhile(users, function(o) { return !o.active; });
  7747. * // => objects for ['pebbles']
  7748. *
  7749. * // The `_.matches` iteratee shorthand.
  7750. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7751. * // => objects for ['fred', 'pebbles']
  7752. *
  7753. * // The `_.matchesProperty` iteratee shorthand.
  7754. * _.dropWhile(users, ['active', false]);
  7755. * // => objects for ['pebbles']
  7756. *
  7757. * // The `_.property` iteratee shorthand.
  7758. * _.dropWhile(users, 'active');
  7759. * // => objects for ['barney', 'fred', 'pebbles']
  7760. */
  7761. function dropWhile(array, predicate) {
  7762. return (array && array.length)
  7763. ? baseWhile(array, getIteratee(predicate, 3), true)
  7764. : [];
  7765. }
  7766. /**
  7767. * Fills elements of `array` with `value` from `start` up to, but not
  7768. * including, `end`.
  7769. *
  7770. * **Note:** This method mutates `array`.
  7771. *
  7772. * @static
  7773. * @memberOf _
  7774. * @since 3.2.0
  7775. * @category Array
  7776. * @param {Array} array The array to fill.
  7777. * @param {*} value The value to fill `array` with.
  7778. * @param {number} [start=0] The start position.
  7779. * @param {number} [end=array.length] The end position.
  7780. * @returns {Array} Returns `array`.
  7781. * @example
  7782. *
  7783. * var array = [1, 2, 3];
  7784. *
  7785. * _.fill(array, 'a');
  7786. * console.log(array);
  7787. * // => ['a', 'a', 'a']
  7788. *
  7789. * _.fill(Array(3), 2);
  7790. * // => [2, 2, 2]
  7791. *
  7792. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7793. * // => [4, '*', '*', 10]
  7794. */
  7795. function fill(array, value, start, end) {
  7796. var length = array == null ? 0 : array.length;
  7797. if (!length) {
  7798. return [];
  7799. }
  7800. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7801. start = 0;
  7802. end = length;
  7803. }
  7804. return baseFill(array, value, start, end);
  7805. }
  7806. /**
  7807. * This method is like `_.find` except that it returns the index of the first
  7808. * element `predicate` returns truthy for instead of the element itself.
  7809. *
  7810. * @static
  7811. * @memberOf _
  7812. * @since 1.1.0
  7813. * @category Array
  7814. * @param {Array} array The array to inspect.
  7815. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7816. * @param {number} [fromIndex=0] The index to search from.
  7817. * @returns {number} Returns the index of the found element, else `-1`.
  7818. * @example
  7819. *
  7820. * var users = [
  7821. * { 'user': 'barney', 'active': false },
  7822. * { 'user': 'fred', 'active': false },
  7823. * { 'user': 'pebbles', 'active': true }
  7824. * ];
  7825. *
  7826. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7827. * // => 0
  7828. *
  7829. * // The `_.matches` iteratee shorthand.
  7830. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7831. * // => 1
  7832. *
  7833. * // The `_.matchesProperty` iteratee shorthand.
  7834. * _.findIndex(users, ['active', false]);
  7835. * // => 0
  7836. *
  7837. * // The `_.property` iteratee shorthand.
  7838. * _.findIndex(users, 'active');
  7839. * // => 2
  7840. */
  7841. function findIndex(array, predicate, fromIndex) {
  7842. var length = array == null ? 0 : array.length;
  7843. if (!length) {
  7844. return -1;
  7845. }
  7846. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7847. if (index < 0) {
  7848. index = nativeMax(length + index, 0);
  7849. }
  7850. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7851. }
  7852. /**
  7853. * This method is like `_.findIndex` except that it iterates over elements
  7854. * of `collection` from right to left.
  7855. *
  7856. * @static
  7857. * @memberOf _
  7858. * @since 2.0.0
  7859. * @category Array
  7860. * @param {Array} array The array to inspect.
  7861. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7862. * @param {number} [fromIndex=array.length-1] The index to search from.
  7863. * @returns {number} Returns the index of the found element, else `-1`.
  7864. * @example
  7865. *
  7866. * var users = [
  7867. * { 'user': 'barney', 'active': true },
  7868. * { 'user': 'fred', 'active': false },
  7869. * { 'user': 'pebbles', 'active': false }
  7870. * ];
  7871. *
  7872. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7873. * // => 2
  7874. *
  7875. * // The `_.matches` iteratee shorthand.
  7876. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7877. * // => 0
  7878. *
  7879. * // The `_.matchesProperty` iteratee shorthand.
  7880. * _.findLastIndex(users, ['active', false]);
  7881. * // => 2
  7882. *
  7883. * // The `_.property` iteratee shorthand.
  7884. * _.findLastIndex(users, 'active');
  7885. * // => 0
  7886. */
  7887. function findLastIndex(array, predicate, fromIndex) {
  7888. var length = array == null ? 0 : array.length;
  7889. if (!length) {
  7890. return -1;
  7891. }
  7892. var index = length - 1;
  7893. if (fromIndex !== undefined) {
  7894. index = toInteger(fromIndex);
  7895. index = fromIndex < 0
  7896. ? nativeMax(length + index, 0)
  7897. : nativeMin(index, length - 1);
  7898. }
  7899. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7900. }
  7901. /**
  7902. * Flattens `array` a single level deep.
  7903. *
  7904. * @static
  7905. * @memberOf _
  7906. * @since 0.1.0
  7907. * @category Array
  7908. * @param {Array} array The array to flatten.
  7909. * @returns {Array} Returns the new flattened array.
  7910. * @example
  7911. *
  7912. * _.flatten([1, [2, [3, [4]], 5]]);
  7913. * // => [1, 2, [3, [4]], 5]
  7914. */
  7915. function flatten(array) {
  7916. var length = array == null ? 0 : array.length;
  7917. return length ? baseFlatten(array, 1) : [];
  7918. }
  7919. /**
  7920. * Recursively flattens `array`.
  7921. *
  7922. * @static
  7923. * @memberOf _
  7924. * @since 3.0.0
  7925. * @category Array
  7926. * @param {Array} array The array to flatten.
  7927. * @returns {Array} Returns the new flattened array.
  7928. * @example
  7929. *
  7930. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7931. * // => [1, 2, 3, 4, 5]
  7932. */
  7933. function flattenDeep(array) {
  7934. var length = array == null ? 0 : array.length;
  7935. return length ? baseFlatten(array, INFINITY) : [];
  7936. }
  7937. /**
  7938. * Recursively flatten `array` up to `depth` times.
  7939. *
  7940. * @static
  7941. * @memberOf _
  7942. * @since 4.4.0
  7943. * @category Array
  7944. * @param {Array} array The array to flatten.
  7945. * @param {number} [depth=1] The maximum recursion depth.
  7946. * @returns {Array} Returns the new flattened array.
  7947. * @example
  7948. *
  7949. * var array = [1, [2, [3, [4]], 5]];
  7950. *
  7951. * _.flattenDepth(array, 1);
  7952. * // => [1, 2, [3, [4]], 5]
  7953. *
  7954. * _.flattenDepth(array, 2);
  7955. * // => [1, 2, 3, [4], 5]
  7956. */
  7957. function flattenDepth(array, depth) {
  7958. var length = array == null ? 0 : array.length;
  7959. if (!length) {
  7960. return [];
  7961. }
  7962. depth = depth === undefined ? 1 : toInteger(depth);
  7963. return baseFlatten(array, depth);
  7964. }
  7965. /**
  7966. * The inverse of `_.toPairs`; this method returns an object composed
  7967. * from key-value `pairs`.
  7968. *
  7969. * @static
  7970. * @memberOf _
  7971. * @since 4.0.0
  7972. * @category Array
  7973. * @param {Array} pairs The key-value pairs.
  7974. * @returns {Object} Returns the new object.
  7975. * @example
  7976. *
  7977. * _.fromPairs([['a', 1], ['b', 2]]);
  7978. * // => { 'a': 1, 'b': 2 }
  7979. */
  7980. function fromPairs(pairs) {
  7981. var index = -1,
  7982. length = pairs == null ? 0 : pairs.length,
  7983. result = {};
  7984. while (++index < length) {
  7985. var pair = pairs[index];
  7986. result[pair[0]] = pair[1];
  7987. }
  7988. return result;
  7989. }
  7990. /**
  7991. * Gets the first element of `array`.
  7992. *
  7993. * @static
  7994. * @memberOf _
  7995. * @since 0.1.0
  7996. * @alias first
  7997. * @category Array
  7998. * @param {Array} array The array to query.
  7999. * @returns {*} Returns the first element of `array`.
  8000. * @example
  8001. *
  8002. * _.head([1, 2, 3]);
  8003. * // => 1
  8004. *
  8005. * _.head([]);
  8006. * // => undefined
  8007. */
  8008. function head(array) {
  8009. return (array && array.length) ? array[0] : undefined;
  8010. }
  8011. /**
  8012. * Gets the index at which the first occurrence of `value` is found in `array`
  8013. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8014. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8015. * offset from the end of `array`.
  8016. *
  8017. * @static
  8018. * @memberOf _
  8019. * @since 0.1.0
  8020. * @category Array
  8021. * @param {Array} array The array to inspect.
  8022. * @param {*} value The value to search for.
  8023. * @param {number} [fromIndex=0] The index to search from.
  8024. * @returns {number} Returns the index of the matched value, else `-1`.
  8025. * @example
  8026. *
  8027. * _.indexOf([1, 2, 1, 2], 2);
  8028. * // => 1
  8029. *
  8030. * // Search from the `fromIndex`.
  8031. * _.indexOf([1, 2, 1, 2], 2, 2);
  8032. * // => 3
  8033. */
  8034. function indexOf(array, value, fromIndex) {
  8035. var length = array == null ? 0 : array.length;
  8036. if (!length) {
  8037. return -1;
  8038. }
  8039. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8040. if (index < 0) {
  8041. index = nativeMax(length + index, 0);
  8042. }
  8043. return baseIndexOf(array, value, index);
  8044. }
  8045. /**
  8046. * Gets all but the last element of `array`.
  8047. *
  8048. * @static
  8049. * @memberOf _
  8050. * @since 0.1.0
  8051. * @category Array
  8052. * @param {Array} array The array to query.
  8053. * @returns {Array} Returns the slice of `array`.
  8054. * @example
  8055. *
  8056. * _.initial([1, 2, 3]);
  8057. * // => [1, 2]
  8058. */
  8059. function initial(array) {
  8060. var length = array == null ? 0 : array.length;
  8061. return length ? baseSlice(array, 0, -1) : [];
  8062. }
  8063. /**
  8064. * Creates an array of unique values that are included in all given arrays
  8065. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8066. * for equality comparisons. The order and references of result values are
  8067. * determined by the first array.
  8068. *
  8069. * @static
  8070. * @memberOf _
  8071. * @since 0.1.0
  8072. * @category Array
  8073. * @param {...Array} [arrays] The arrays to inspect.
  8074. * @returns {Array} Returns the new array of intersecting values.
  8075. * @example
  8076. *
  8077. * _.intersection([2, 1], [2, 3]);
  8078. * // => [2]
  8079. */
  8080. var intersection = baseRest(function(arrays) {
  8081. var mapped = arrayMap(arrays, castArrayLikeObject);
  8082. return (mapped.length && mapped[0] === arrays[0])
  8083. ? baseIntersection(mapped)
  8084. : [];
  8085. });
  8086. /**
  8087. * This method is like `_.intersection` except that it accepts `iteratee`
  8088. * which is invoked for each element of each `arrays` to generate the criterion
  8089. * by which they're compared. The order and references of result values are
  8090. * determined by the first array. The iteratee is invoked with one argument:
  8091. * (value).
  8092. *
  8093. * @static
  8094. * @memberOf _
  8095. * @since 4.0.0
  8096. * @category Array
  8097. * @param {...Array} [arrays] The arrays to inspect.
  8098. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8099. * @returns {Array} Returns the new array of intersecting values.
  8100. * @example
  8101. *
  8102. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8103. * // => [2.1]
  8104. *
  8105. * // The `_.property` iteratee shorthand.
  8106. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8107. * // => [{ 'x': 1 }]
  8108. */
  8109. var intersectionBy = baseRest(function(arrays) {
  8110. var iteratee = last(arrays),
  8111. mapped = arrayMap(arrays, castArrayLikeObject);
  8112. if (iteratee === last(mapped)) {
  8113. iteratee = undefined;
  8114. } else {
  8115. mapped.pop();
  8116. }
  8117. return (mapped.length && mapped[0] === arrays[0])
  8118. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8119. : [];
  8120. });
  8121. /**
  8122. * This method is like `_.intersection` except that it accepts `comparator`
  8123. * which is invoked to compare elements of `arrays`. The order and references
  8124. * of result values are determined by the first array. The comparator is
  8125. * invoked with two arguments: (arrVal, othVal).
  8126. *
  8127. * @static
  8128. * @memberOf _
  8129. * @since 4.0.0
  8130. * @category Array
  8131. * @param {...Array} [arrays] The arrays to inspect.
  8132. * @param {Function} [comparator] The comparator invoked per element.
  8133. * @returns {Array} Returns the new array of intersecting values.
  8134. * @example
  8135. *
  8136. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8137. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8138. *
  8139. * _.intersectionWith(objects, others, _.isEqual);
  8140. * // => [{ 'x': 1, 'y': 2 }]
  8141. */
  8142. var intersectionWith = baseRest(function(arrays) {
  8143. var comparator = last(arrays),
  8144. mapped = arrayMap(arrays, castArrayLikeObject);
  8145. comparator = typeof comparator == 'function' ? comparator : undefined;
  8146. if (comparator) {
  8147. mapped.pop();
  8148. }
  8149. return (mapped.length && mapped[0] === arrays[0])
  8150. ? baseIntersection(mapped, undefined, comparator)
  8151. : [];
  8152. });
  8153. /**
  8154. * Converts all elements in `array` into a string separated by `separator`.
  8155. *
  8156. * @static
  8157. * @memberOf _
  8158. * @since 4.0.0
  8159. * @category Array
  8160. * @param {Array} array The array to convert.
  8161. * @param {string} [separator=','] The element separator.
  8162. * @returns {string} Returns the joined string.
  8163. * @example
  8164. *
  8165. * _.join(['a', 'b', 'c'], '~');
  8166. * // => 'a~b~c'
  8167. */
  8168. function join(array, separator) {
  8169. return array == null ? '' : nativeJoin.call(array, separator);
  8170. }
  8171. /**
  8172. * Gets the last element of `array`.
  8173. *
  8174. * @static
  8175. * @memberOf _
  8176. * @since 0.1.0
  8177. * @category Array
  8178. * @param {Array} array The array to query.
  8179. * @returns {*} Returns the last element of `array`.
  8180. * @example
  8181. *
  8182. * _.last([1, 2, 3]);
  8183. * // => 3
  8184. */
  8185. function last(array) {
  8186. var length = array == null ? 0 : array.length;
  8187. return length ? array[length - 1] : undefined;
  8188. }
  8189. /**
  8190. * This method is like `_.indexOf` except that it iterates over elements of
  8191. * `array` from right to left.
  8192. *
  8193. * @static
  8194. * @memberOf _
  8195. * @since 0.1.0
  8196. * @category Array
  8197. * @param {Array} array The array to inspect.
  8198. * @param {*} value The value to search for.
  8199. * @param {number} [fromIndex=array.length-1] The index to search from.
  8200. * @returns {number} Returns the index of the matched value, else `-1`.
  8201. * @example
  8202. *
  8203. * _.lastIndexOf([1, 2, 1, 2], 2);
  8204. * // => 3
  8205. *
  8206. * // Search from the `fromIndex`.
  8207. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8208. * // => 1
  8209. */
  8210. function lastIndexOf(array, value, fromIndex) {
  8211. var length = array == null ? 0 : array.length;
  8212. if (!length) {
  8213. return -1;
  8214. }
  8215. var index = length;
  8216. if (fromIndex !== undefined) {
  8217. index = toInteger(fromIndex);
  8218. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8219. }
  8220. return value === value
  8221. ? strictLastIndexOf(array, value, index)
  8222. : baseFindIndex(array, baseIsNaN, index, true);
  8223. }
  8224. /**
  8225. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8226. * element from the end is returned.
  8227. *
  8228. * @static
  8229. * @memberOf _
  8230. * @since 4.11.0
  8231. * @category Array
  8232. * @param {Array} array The array to query.
  8233. * @param {number} [n=0] The index of the element to return.
  8234. * @returns {*} Returns the nth element of `array`.
  8235. * @example
  8236. *
  8237. * var array = ['a', 'b', 'c', 'd'];
  8238. *
  8239. * _.nth(array, 1);
  8240. * // => 'b'
  8241. *
  8242. * _.nth(array, -2);
  8243. * // => 'c';
  8244. */
  8245. function nth(array, n) {
  8246. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8247. }
  8248. /**
  8249. * Removes all given values from `array` using
  8250. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8251. * for equality comparisons.
  8252. *
  8253. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8254. * to remove elements from an array by predicate.
  8255. *
  8256. * @static
  8257. * @memberOf _
  8258. * @since 2.0.0
  8259. * @category Array
  8260. * @param {Array} array The array to modify.
  8261. * @param {...*} [values] The values to remove.
  8262. * @returns {Array} Returns `array`.
  8263. * @example
  8264. *
  8265. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8266. *
  8267. * _.pull(array, 'a', 'c');
  8268. * console.log(array);
  8269. * // => ['b', 'b']
  8270. */
  8271. var pull = baseRest(pullAll);
  8272. /**
  8273. * This method is like `_.pull` except that it accepts an array of values to remove.
  8274. *
  8275. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8276. *
  8277. * @static
  8278. * @memberOf _
  8279. * @since 4.0.0
  8280. * @category Array
  8281. * @param {Array} array The array to modify.
  8282. * @param {Array} values The values to remove.
  8283. * @returns {Array} Returns `array`.
  8284. * @example
  8285. *
  8286. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8287. *
  8288. * _.pullAll(array, ['a', 'c']);
  8289. * console.log(array);
  8290. * // => ['b', 'b']
  8291. */
  8292. function pullAll(array, values) {
  8293. return (array && array.length && values && values.length)
  8294. ? basePullAll(array, values)
  8295. : array;
  8296. }
  8297. /**
  8298. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8299. * invoked for each element of `array` and `values` to generate the criterion
  8300. * by which they're compared. The iteratee is invoked with one argument: (value).
  8301. *
  8302. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8303. *
  8304. * @static
  8305. * @memberOf _
  8306. * @since 4.0.0
  8307. * @category Array
  8308. * @param {Array} array The array to modify.
  8309. * @param {Array} values The values to remove.
  8310. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8311. * @returns {Array} Returns `array`.
  8312. * @example
  8313. *
  8314. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8315. *
  8316. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8317. * console.log(array);
  8318. * // => [{ 'x': 2 }]
  8319. */
  8320. function pullAllBy(array, values, iteratee) {
  8321. return (array && array.length && values && values.length)
  8322. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8323. : array;
  8324. }
  8325. /**
  8326. * This method is like `_.pullAll` except that it accepts `comparator` which
  8327. * is invoked to compare elements of `array` to `values`. The comparator is
  8328. * invoked with two arguments: (arrVal, othVal).
  8329. *
  8330. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8331. *
  8332. * @static
  8333. * @memberOf _
  8334. * @since 4.6.0
  8335. * @category Array
  8336. * @param {Array} array The array to modify.
  8337. * @param {Array} values The values to remove.
  8338. * @param {Function} [comparator] The comparator invoked per element.
  8339. * @returns {Array} Returns `array`.
  8340. * @example
  8341. *
  8342. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8343. *
  8344. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8345. * console.log(array);
  8346. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8347. */
  8348. function pullAllWith(array, values, comparator) {
  8349. return (array && array.length && values && values.length)
  8350. ? basePullAll(array, values, undefined, comparator)
  8351. : array;
  8352. }
  8353. /**
  8354. * Removes elements from `array` corresponding to `indexes` and returns an
  8355. * array of removed elements.
  8356. *
  8357. * **Note:** Unlike `_.at`, this method mutates `array`.
  8358. *
  8359. * @static
  8360. * @memberOf _
  8361. * @since 3.0.0
  8362. * @category Array
  8363. * @param {Array} array The array to modify.
  8364. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8365. * @returns {Array} Returns the new array of removed elements.
  8366. * @example
  8367. *
  8368. * var array = ['a', 'b', 'c', 'd'];
  8369. * var pulled = _.pullAt(array, [1, 3]);
  8370. *
  8371. * console.log(array);
  8372. * // => ['a', 'c']
  8373. *
  8374. * console.log(pulled);
  8375. * // => ['b', 'd']
  8376. */
  8377. var pullAt = flatRest(function(array, indexes) {
  8378. var length = array == null ? 0 : array.length,
  8379. result = baseAt(array, indexes);
  8380. basePullAt(array, arrayMap(indexes, function(index) {
  8381. return isIndex(index, length) ? +index : index;
  8382. }).sort(compareAscending));
  8383. return result;
  8384. });
  8385. /**
  8386. * Removes all elements from `array` that `predicate` returns truthy for
  8387. * and returns an array of the removed elements. The predicate is invoked
  8388. * with three arguments: (value, index, array).
  8389. *
  8390. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8391. * to pull elements from an array by value.
  8392. *
  8393. * @static
  8394. * @memberOf _
  8395. * @since 2.0.0
  8396. * @category Array
  8397. * @param {Array} array The array to modify.
  8398. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8399. * @returns {Array} Returns the new array of removed elements.
  8400. * @example
  8401. *
  8402. * var array = [1, 2, 3, 4];
  8403. * var evens = _.remove(array, function(n) {
  8404. * return n % 2 == 0;
  8405. * });
  8406. *
  8407. * console.log(array);
  8408. * // => [1, 3]
  8409. *
  8410. * console.log(evens);
  8411. * // => [2, 4]
  8412. */
  8413. function remove(array, predicate) {
  8414. var result = [];
  8415. if (!(array && array.length)) {
  8416. return result;
  8417. }
  8418. var index = -1,
  8419. indexes = [],
  8420. length = array.length;
  8421. predicate = getIteratee(predicate, 3);
  8422. while (++index < length) {
  8423. var value = array[index];
  8424. if (predicate(value, index, array)) {
  8425. result.push(value);
  8426. indexes.push(index);
  8427. }
  8428. }
  8429. basePullAt(array, indexes);
  8430. return result;
  8431. }
  8432. /**
  8433. * Reverses `array` so that the first element becomes the last, the second
  8434. * element becomes the second to last, and so on.
  8435. *
  8436. * **Note:** This method mutates `array` and is based on
  8437. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8438. *
  8439. * @static
  8440. * @memberOf _
  8441. * @since 4.0.0
  8442. * @category Array
  8443. * @param {Array} array The array to modify.
  8444. * @returns {Array} Returns `array`.
  8445. * @example
  8446. *
  8447. * var array = [1, 2, 3];
  8448. *
  8449. * _.reverse(array);
  8450. * // => [3, 2, 1]
  8451. *
  8452. * console.log(array);
  8453. * // => [3, 2, 1]
  8454. */
  8455. function reverse(array) {
  8456. return array == null ? array : nativeReverse.call(array);
  8457. }
  8458. /**
  8459. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8460. *
  8461. * **Note:** This method is used instead of
  8462. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8463. * returned.
  8464. *
  8465. * @static
  8466. * @memberOf _
  8467. * @since 3.0.0
  8468. * @category Array
  8469. * @param {Array} array The array to slice.
  8470. * @param {number} [start=0] The start position.
  8471. * @param {number} [end=array.length] The end position.
  8472. * @returns {Array} Returns the slice of `array`.
  8473. */
  8474. function slice(array, start, end) {
  8475. var length = array == null ? 0 : array.length;
  8476. if (!length) {
  8477. return [];
  8478. }
  8479. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8480. start = 0;
  8481. end = length;
  8482. }
  8483. else {
  8484. start = start == null ? 0 : toInteger(start);
  8485. end = end === undefined ? length : toInteger(end);
  8486. }
  8487. return baseSlice(array, start, end);
  8488. }
  8489. /**
  8490. * Uses a binary search to determine the lowest index at which `value`
  8491. * should be inserted into `array` in order to maintain its sort order.
  8492. *
  8493. * @static
  8494. * @memberOf _
  8495. * @since 0.1.0
  8496. * @category Array
  8497. * @param {Array} array The sorted array to inspect.
  8498. * @param {*} value The value to evaluate.
  8499. * @returns {number} Returns the index at which `value` should be inserted
  8500. * into `array`.
  8501. * @example
  8502. *
  8503. * _.sortedIndex([30, 50], 40);
  8504. * // => 1
  8505. */
  8506. function sortedIndex(array, value) {
  8507. return baseSortedIndex(array, value);
  8508. }
  8509. /**
  8510. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8511. * which is invoked for `value` and each element of `array` to compute their
  8512. * sort ranking. The iteratee is invoked with one argument: (value).
  8513. *
  8514. * @static
  8515. * @memberOf _
  8516. * @since 4.0.0
  8517. * @category Array
  8518. * @param {Array} array The sorted array to inspect.
  8519. * @param {*} value The value to evaluate.
  8520. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8521. * @returns {number} Returns the index at which `value` should be inserted
  8522. * into `array`.
  8523. * @example
  8524. *
  8525. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8526. *
  8527. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8528. * // => 0
  8529. *
  8530. * // The `_.property` iteratee shorthand.
  8531. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8532. * // => 0
  8533. */
  8534. function sortedIndexBy(array, value, iteratee) {
  8535. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8536. }
  8537. /**
  8538. * This method is like `_.indexOf` except that it performs a binary
  8539. * search on a sorted `array`.
  8540. *
  8541. * @static
  8542. * @memberOf _
  8543. * @since 4.0.0
  8544. * @category Array
  8545. * @param {Array} array The array to inspect.
  8546. * @param {*} value The value to search for.
  8547. * @returns {number} Returns the index of the matched value, else `-1`.
  8548. * @example
  8549. *
  8550. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8551. * // => 1
  8552. */
  8553. function sortedIndexOf(array, value) {
  8554. var length = array == null ? 0 : array.length;
  8555. if (length) {
  8556. var index = baseSortedIndex(array, value);
  8557. if (index < length && eq(array[index], value)) {
  8558. return index;
  8559. }
  8560. }
  8561. return -1;
  8562. }
  8563. /**
  8564. * This method is like `_.sortedIndex` except that it returns the highest
  8565. * index at which `value` should be inserted into `array` in order to
  8566. * maintain its sort order.
  8567. *
  8568. * @static
  8569. * @memberOf _
  8570. * @since 3.0.0
  8571. * @category Array
  8572. * @param {Array} array The sorted array to inspect.
  8573. * @param {*} value The value to evaluate.
  8574. * @returns {number} Returns the index at which `value` should be inserted
  8575. * into `array`.
  8576. * @example
  8577. *
  8578. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8579. * // => 4
  8580. */
  8581. function sortedLastIndex(array, value) {
  8582. return baseSortedIndex(array, value, true);
  8583. }
  8584. /**
  8585. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8586. * which is invoked for `value` and each element of `array` to compute their
  8587. * sort ranking. The iteratee is invoked with one argument: (value).
  8588. *
  8589. * @static
  8590. * @memberOf _
  8591. * @since 4.0.0
  8592. * @category Array
  8593. * @param {Array} array The sorted array to inspect.
  8594. * @param {*} value The value to evaluate.
  8595. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8596. * @returns {number} Returns the index at which `value` should be inserted
  8597. * into `array`.
  8598. * @example
  8599. *
  8600. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8601. *
  8602. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8603. * // => 1
  8604. *
  8605. * // The `_.property` iteratee shorthand.
  8606. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8607. * // => 1
  8608. */
  8609. function sortedLastIndexBy(array, value, iteratee) {
  8610. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8611. }
  8612. /**
  8613. * This method is like `_.lastIndexOf` except that it performs a binary
  8614. * search on a sorted `array`.
  8615. *
  8616. * @static
  8617. * @memberOf _
  8618. * @since 4.0.0
  8619. * @category Array
  8620. * @param {Array} array The array to inspect.
  8621. * @param {*} value The value to search for.
  8622. * @returns {number} Returns the index of the matched value, else `-1`.
  8623. * @example
  8624. *
  8625. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8626. * // => 3
  8627. */
  8628. function sortedLastIndexOf(array, value) {
  8629. var length = array == null ? 0 : array.length;
  8630. if (length) {
  8631. var index = baseSortedIndex(array, value, true) - 1;
  8632. if (eq(array[index], value)) {
  8633. return index;
  8634. }
  8635. }
  8636. return -1;
  8637. }
  8638. /**
  8639. * This method is like `_.uniq` except that it's designed and optimized
  8640. * for sorted arrays.
  8641. *
  8642. * @static
  8643. * @memberOf _
  8644. * @since 4.0.0
  8645. * @category Array
  8646. * @param {Array} array The array to inspect.
  8647. * @returns {Array} Returns the new duplicate free array.
  8648. * @example
  8649. *
  8650. * _.sortedUniq([1, 1, 2]);
  8651. * // => [1, 2]
  8652. */
  8653. function sortedUniq(array) {
  8654. return (array && array.length)
  8655. ? baseSortedUniq(array)
  8656. : [];
  8657. }
  8658. /**
  8659. * This method is like `_.uniqBy` except that it's designed and optimized
  8660. * for sorted arrays.
  8661. *
  8662. * @static
  8663. * @memberOf _
  8664. * @since 4.0.0
  8665. * @category Array
  8666. * @param {Array} array The array to inspect.
  8667. * @param {Function} [iteratee] The iteratee invoked per element.
  8668. * @returns {Array} Returns the new duplicate free array.
  8669. * @example
  8670. *
  8671. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8672. * // => [1.1, 2.3]
  8673. */
  8674. function sortedUniqBy(array, iteratee) {
  8675. return (array && array.length)
  8676. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8677. : [];
  8678. }
  8679. /**
  8680. * Gets all but the first element of `array`.
  8681. *
  8682. * @static
  8683. * @memberOf _
  8684. * @since 4.0.0
  8685. * @category Array
  8686. * @param {Array} array The array to query.
  8687. * @returns {Array} Returns the slice of `array`.
  8688. * @example
  8689. *
  8690. * _.tail([1, 2, 3]);
  8691. * // => [2, 3]
  8692. */
  8693. function tail(array) {
  8694. var length = array == null ? 0 : array.length;
  8695. return length ? baseSlice(array, 1, length) : [];
  8696. }
  8697. /**
  8698. * Creates a slice of `array` with `n` elements taken from the beginning.
  8699. *
  8700. * @static
  8701. * @memberOf _
  8702. * @since 0.1.0
  8703. * @category Array
  8704. * @param {Array} array The array to query.
  8705. * @param {number} [n=1] The number of elements to take.
  8706. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8707. * @returns {Array} Returns the slice of `array`.
  8708. * @example
  8709. *
  8710. * _.take([1, 2, 3]);
  8711. * // => [1]
  8712. *
  8713. * _.take([1, 2, 3], 2);
  8714. * // => [1, 2]
  8715. *
  8716. * _.take([1, 2, 3], 5);
  8717. * // => [1, 2, 3]
  8718. *
  8719. * _.take([1, 2, 3], 0);
  8720. * // => []
  8721. */
  8722. function take(array, n, guard) {
  8723. if (!(array && array.length)) {
  8724. return [];
  8725. }
  8726. n = (guard || n === undefined) ? 1 : toInteger(n);
  8727. return baseSlice(array, 0, n < 0 ? 0 : n);
  8728. }
  8729. /**
  8730. * Creates a slice of `array` with `n` elements taken from the end.
  8731. *
  8732. * @static
  8733. * @memberOf _
  8734. * @since 3.0.0
  8735. * @category Array
  8736. * @param {Array} array The array to query.
  8737. * @param {number} [n=1] The number of elements to take.
  8738. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8739. * @returns {Array} Returns the slice of `array`.
  8740. * @example
  8741. *
  8742. * _.takeRight([1, 2, 3]);
  8743. * // => [3]
  8744. *
  8745. * _.takeRight([1, 2, 3], 2);
  8746. * // => [2, 3]
  8747. *
  8748. * _.takeRight([1, 2, 3], 5);
  8749. * // => [1, 2, 3]
  8750. *
  8751. * _.takeRight([1, 2, 3], 0);
  8752. * // => []
  8753. */
  8754. function takeRight(array, n, guard) {
  8755. var length = array == null ? 0 : array.length;
  8756. if (!length) {
  8757. return [];
  8758. }
  8759. n = (guard || n === undefined) ? 1 : toInteger(n);
  8760. n = length - n;
  8761. return baseSlice(array, n < 0 ? 0 : n, length);
  8762. }
  8763. /**
  8764. * Creates a slice of `array` with elements taken from the end. Elements are
  8765. * taken until `predicate` returns falsey. The predicate is invoked with
  8766. * three arguments: (value, index, array).
  8767. *
  8768. * @static
  8769. * @memberOf _
  8770. * @since 3.0.0
  8771. * @category Array
  8772. * @param {Array} array The array to query.
  8773. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8774. * @returns {Array} Returns the slice of `array`.
  8775. * @example
  8776. *
  8777. * var users = [
  8778. * { 'user': 'barney', 'active': true },
  8779. * { 'user': 'fred', 'active': false },
  8780. * { 'user': 'pebbles', 'active': false }
  8781. * ];
  8782. *
  8783. * _.takeRightWhile(users, function(o) { return !o.active; });
  8784. * // => objects for ['fred', 'pebbles']
  8785. *
  8786. * // The `_.matches` iteratee shorthand.
  8787. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8788. * // => objects for ['pebbles']
  8789. *
  8790. * // The `_.matchesProperty` iteratee shorthand.
  8791. * _.takeRightWhile(users, ['active', false]);
  8792. * // => objects for ['fred', 'pebbles']
  8793. *
  8794. * // The `_.property` iteratee shorthand.
  8795. * _.takeRightWhile(users, 'active');
  8796. * // => []
  8797. */
  8798. function takeRightWhile(array, predicate) {
  8799. return (array && array.length)
  8800. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8801. : [];
  8802. }
  8803. /**
  8804. * Creates a slice of `array` with elements taken from the beginning. Elements
  8805. * are taken until `predicate` returns falsey. The predicate is invoked with
  8806. * three arguments: (value, index, array).
  8807. *
  8808. * @static
  8809. * @memberOf _
  8810. * @since 3.0.0
  8811. * @category Array
  8812. * @param {Array} array The array to query.
  8813. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8814. * @returns {Array} Returns the slice of `array`.
  8815. * @example
  8816. *
  8817. * var users = [
  8818. * { 'user': 'barney', 'active': false },
  8819. * { 'user': 'fred', 'active': false },
  8820. * { 'user': 'pebbles', 'active': true }
  8821. * ];
  8822. *
  8823. * _.takeWhile(users, function(o) { return !o.active; });
  8824. * // => objects for ['barney', 'fred']
  8825. *
  8826. * // The `_.matches` iteratee shorthand.
  8827. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8828. * // => objects for ['barney']
  8829. *
  8830. * // The `_.matchesProperty` iteratee shorthand.
  8831. * _.takeWhile(users, ['active', false]);
  8832. * // => objects for ['barney', 'fred']
  8833. *
  8834. * // The `_.property` iteratee shorthand.
  8835. * _.takeWhile(users, 'active');
  8836. * // => []
  8837. */
  8838. function takeWhile(array, predicate) {
  8839. return (array && array.length)
  8840. ? baseWhile(array, getIteratee(predicate, 3))
  8841. : [];
  8842. }
  8843. /**
  8844. * Creates an array of unique values, in order, from all given arrays using
  8845. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8846. * for equality comparisons.
  8847. *
  8848. * @static
  8849. * @memberOf _
  8850. * @since 0.1.0
  8851. * @category Array
  8852. * @param {...Array} [arrays] The arrays to inspect.
  8853. * @returns {Array} Returns the new array of combined values.
  8854. * @example
  8855. *
  8856. * _.union([2], [1, 2]);
  8857. * // => [2, 1]
  8858. */
  8859. var union = baseRest(function(arrays) {
  8860. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8861. });
  8862. /**
  8863. * This method is like `_.union` except that it accepts `iteratee` which is
  8864. * invoked for each element of each `arrays` to generate the criterion by
  8865. * which uniqueness is computed. Result values are chosen from the first
  8866. * array in which the value occurs. The iteratee is invoked with one argument:
  8867. * (value).
  8868. *
  8869. * @static
  8870. * @memberOf _
  8871. * @since 4.0.0
  8872. * @category Array
  8873. * @param {...Array} [arrays] The arrays to inspect.
  8874. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8875. * @returns {Array} Returns the new array of combined values.
  8876. * @example
  8877. *
  8878. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8879. * // => [2.1, 1.2]
  8880. *
  8881. * // The `_.property` iteratee shorthand.
  8882. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8883. * // => [{ 'x': 1 }, { 'x': 2 }]
  8884. */
  8885. var unionBy = baseRest(function(arrays) {
  8886. var iteratee = last(arrays);
  8887. if (isArrayLikeObject(iteratee)) {
  8888. iteratee = undefined;
  8889. }
  8890. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8891. });
  8892. /**
  8893. * This method is like `_.union` except that it accepts `comparator` which
  8894. * is invoked to compare elements of `arrays`. Result values are chosen from
  8895. * the first array in which the value occurs. The comparator is invoked
  8896. * with two arguments: (arrVal, othVal).
  8897. *
  8898. * @static
  8899. * @memberOf _
  8900. * @since 4.0.0
  8901. * @category Array
  8902. * @param {...Array} [arrays] The arrays to inspect.
  8903. * @param {Function} [comparator] The comparator invoked per element.
  8904. * @returns {Array} Returns the new array of combined values.
  8905. * @example
  8906. *
  8907. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8908. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8909. *
  8910. * _.unionWith(objects, others, _.isEqual);
  8911. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8912. */
  8913. var unionWith = baseRest(function(arrays) {
  8914. var comparator = last(arrays);
  8915. comparator = typeof comparator == 'function' ? comparator : undefined;
  8916. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8917. });
  8918. /**
  8919. * Creates a duplicate-free version of an array, using
  8920. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8921. * for equality comparisons, in which only the first occurrence of each element
  8922. * is kept. The order of result values is determined by the order they occur
  8923. * in the array.
  8924. *
  8925. * @static
  8926. * @memberOf _
  8927. * @since 0.1.0
  8928. * @category Array
  8929. * @param {Array} array The array to inspect.
  8930. * @returns {Array} Returns the new duplicate free array.
  8931. * @example
  8932. *
  8933. * _.uniq([2, 1, 2]);
  8934. * // => [2, 1]
  8935. */
  8936. function uniq(array) {
  8937. return (array && array.length) ? baseUniq(array) : [];
  8938. }
  8939. /**
  8940. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8941. * invoked for each element in `array` to generate the criterion by which
  8942. * uniqueness is computed. The order of result values is determined by the
  8943. * order they occur in the array. The iteratee is invoked with one argument:
  8944. * (value).
  8945. *
  8946. * @static
  8947. * @memberOf _
  8948. * @since 4.0.0
  8949. * @category Array
  8950. * @param {Array} array The array to inspect.
  8951. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8952. * @returns {Array} Returns the new duplicate free array.
  8953. * @example
  8954. *
  8955. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8956. * // => [2.1, 1.2]
  8957. *
  8958. * // The `_.property` iteratee shorthand.
  8959. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8960. * // => [{ 'x': 1 }, { 'x': 2 }]
  8961. */
  8962. function uniqBy(array, iteratee) {
  8963. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8964. }
  8965. /**
  8966. * This method is like `_.uniq` except that it accepts `comparator` which
  8967. * is invoked to compare elements of `array`. The order of result values is
  8968. * determined by the order they occur in the array.The comparator is invoked
  8969. * with two arguments: (arrVal, othVal).
  8970. *
  8971. * @static
  8972. * @memberOf _
  8973. * @since 4.0.0
  8974. * @category Array
  8975. * @param {Array} array The array to inspect.
  8976. * @param {Function} [comparator] The comparator invoked per element.
  8977. * @returns {Array} Returns the new duplicate free array.
  8978. * @example
  8979. *
  8980. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8981. *
  8982. * _.uniqWith(objects, _.isEqual);
  8983. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8984. */
  8985. function uniqWith(array, comparator) {
  8986. comparator = typeof comparator == 'function' ? comparator : undefined;
  8987. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8988. }
  8989. /**
  8990. * This method is like `_.zip` except that it accepts an array of grouped
  8991. * elements and creates an array regrouping the elements to their pre-zip
  8992. * configuration.
  8993. *
  8994. * @static
  8995. * @memberOf _
  8996. * @since 1.2.0
  8997. * @category Array
  8998. * @param {Array} array The array of grouped elements to process.
  8999. * @returns {Array} Returns the new array of regrouped elements.
  9000. * @example
  9001. *
  9002. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9003. * // => [['a', 1, true], ['b', 2, false]]
  9004. *
  9005. * _.unzip(zipped);
  9006. * // => [['a', 'b'], [1, 2], [true, false]]
  9007. */
  9008. function unzip(array) {
  9009. if (!(array && array.length)) {
  9010. return [];
  9011. }
  9012. var length = 0;
  9013. array = arrayFilter(array, function(group) {
  9014. if (isArrayLikeObject(group)) {
  9015. length = nativeMax(group.length, length);
  9016. return true;
  9017. }
  9018. });
  9019. return baseTimes(length, function(index) {
  9020. return arrayMap(array, baseProperty(index));
  9021. });
  9022. }
  9023. /**
  9024. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9025. * how regrouped values should be combined. The iteratee is invoked with the
  9026. * elements of each group: (...group).
  9027. *
  9028. * @static
  9029. * @memberOf _
  9030. * @since 3.8.0
  9031. * @category Array
  9032. * @param {Array} array The array of grouped elements to process.
  9033. * @param {Function} [iteratee=_.identity] The function to combine
  9034. * regrouped values.
  9035. * @returns {Array} Returns the new array of regrouped elements.
  9036. * @example
  9037. *
  9038. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9039. * // => [[1, 10, 100], [2, 20, 200]]
  9040. *
  9041. * _.unzipWith(zipped, _.add);
  9042. * // => [3, 30, 300]
  9043. */
  9044. function unzipWith(array, iteratee) {
  9045. if (!(array && array.length)) {
  9046. return [];
  9047. }
  9048. var result = unzip(array);
  9049. if (iteratee == null) {
  9050. return result;
  9051. }
  9052. return arrayMap(result, function(group) {
  9053. return apply(iteratee, undefined, group);
  9054. });
  9055. }
  9056. /**
  9057. * Creates an array excluding all given values using
  9058. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9059. * for equality comparisons.
  9060. *
  9061. * **Note:** Unlike `_.pull`, this method returns a new array.
  9062. *
  9063. * @static
  9064. * @memberOf _
  9065. * @since 0.1.0
  9066. * @category Array
  9067. * @param {Array} array The array to inspect.
  9068. * @param {...*} [values] The values to exclude.
  9069. * @returns {Array} Returns the new array of filtered values.
  9070. * @see _.difference, _.xor
  9071. * @example
  9072. *
  9073. * _.without([2, 1, 2, 3], 1, 2);
  9074. * // => [3]
  9075. */
  9076. var without = baseRest(function(array, values) {
  9077. return isArrayLikeObject(array)
  9078. ? baseDifference(array, values)
  9079. : [];
  9080. });
  9081. /**
  9082. * Creates an array of unique values that is the
  9083. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9084. * of the given arrays. The order of result values is determined by the order
  9085. * they occur in the arrays.
  9086. *
  9087. * @static
  9088. * @memberOf _
  9089. * @since 2.4.0
  9090. * @category Array
  9091. * @param {...Array} [arrays] The arrays to inspect.
  9092. * @returns {Array} Returns the new array of filtered values.
  9093. * @see _.difference, _.without
  9094. * @example
  9095. *
  9096. * _.xor([2, 1], [2, 3]);
  9097. * // => [1, 3]
  9098. */
  9099. var xor = baseRest(function(arrays) {
  9100. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9101. });
  9102. /**
  9103. * This method is like `_.xor` except that it accepts `iteratee` which is
  9104. * invoked for each element of each `arrays` to generate the criterion by
  9105. * which by which they're compared. The order of result values is determined
  9106. * by the order they occur in the arrays. The iteratee is invoked with one
  9107. * argument: (value).
  9108. *
  9109. * @static
  9110. * @memberOf _
  9111. * @since 4.0.0
  9112. * @category Array
  9113. * @param {...Array} [arrays] The arrays to inspect.
  9114. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9115. * @returns {Array} Returns the new array of filtered values.
  9116. * @example
  9117. *
  9118. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9119. * // => [1.2, 3.4]
  9120. *
  9121. * // The `_.property` iteratee shorthand.
  9122. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9123. * // => [{ 'x': 2 }]
  9124. */
  9125. var xorBy = baseRest(function(arrays) {
  9126. var iteratee = last(arrays);
  9127. if (isArrayLikeObject(iteratee)) {
  9128. iteratee = undefined;
  9129. }
  9130. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9131. });
  9132. /**
  9133. * This method is like `_.xor` except that it accepts `comparator` which is
  9134. * invoked to compare elements of `arrays`. The order of result values is
  9135. * determined by the order they occur in the arrays. The comparator is invoked
  9136. * with two arguments: (arrVal, othVal).
  9137. *
  9138. * @static
  9139. * @memberOf _
  9140. * @since 4.0.0
  9141. * @category Array
  9142. * @param {...Array} [arrays] The arrays to inspect.
  9143. * @param {Function} [comparator] The comparator invoked per element.
  9144. * @returns {Array} Returns the new array of filtered values.
  9145. * @example
  9146. *
  9147. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9148. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9149. *
  9150. * _.xorWith(objects, others, _.isEqual);
  9151. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9152. */
  9153. var xorWith = baseRest(function(arrays) {
  9154. var comparator = last(arrays);
  9155. comparator = typeof comparator == 'function' ? comparator : undefined;
  9156. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9157. });
  9158. /**
  9159. * Creates an array of grouped elements, the first of which contains the
  9160. * first elements of the given arrays, the second of which contains the
  9161. * second elements of the given arrays, and so on.
  9162. *
  9163. * @static
  9164. * @memberOf _
  9165. * @since 0.1.0
  9166. * @category Array
  9167. * @param {...Array} [arrays] The arrays to process.
  9168. * @returns {Array} Returns the new array of grouped elements.
  9169. * @example
  9170. *
  9171. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9172. * // => [['a', 1, true], ['b', 2, false]]
  9173. */
  9174. var zip = baseRest(unzip);
  9175. /**
  9176. * This method is like `_.fromPairs` except that it accepts two arrays,
  9177. * one of property identifiers and one of corresponding values.
  9178. *
  9179. * @static
  9180. * @memberOf _
  9181. * @since 0.4.0
  9182. * @category Array
  9183. * @param {Array} [props=[]] The property identifiers.
  9184. * @param {Array} [values=[]] The property values.
  9185. * @returns {Object} Returns the new object.
  9186. * @example
  9187. *
  9188. * _.zipObject(['a', 'b'], [1, 2]);
  9189. * // => { 'a': 1, 'b': 2 }
  9190. */
  9191. function zipObject(props, values) {
  9192. return baseZipObject(props || [], values || [], assignValue);
  9193. }
  9194. /**
  9195. * This method is like `_.zipObject` except that it supports property paths.
  9196. *
  9197. * @static
  9198. * @memberOf _
  9199. * @since 4.1.0
  9200. * @category Array
  9201. * @param {Array} [props=[]] The property identifiers.
  9202. * @param {Array} [values=[]] The property values.
  9203. * @returns {Object} Returns the new object.
  9204. * @example
  9205. *
  9206. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9207. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9208. */
  9209. function zipObjectDeep(props, values) {
  9210. return baseZipObject(props || [], values || [], baseSet);
  9211. }
  9212. /**
  9213. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9214. * how grouped values should be combined. The iteratee is invoked with the
  9215. * elements of each group: (...group).
  9216. *
  9217. * @static
  9218. * @memberOf _
  9219. * @since 3.8.0
  9220. * @category Array
  9221. * @param {...Array} [arrays] The arrays to process.
  9222. * @param {Function} [iteratee=_.identity] The function to combine
  9223. * grouped values.
  9224. * @returns {Array} Returns the new array of grouped elements.
  9225. * @example
  9226. *
  9227. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9228. * return a + b + c;
  9229. * });
  9230. * // => [111, 222]
  9231. */
  9232. var zipWith = baseRest(function(arrays) {
  9233. var length = arrays.length,
  9234. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9235. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9236. return unzipWith(arrays, iteratee);
  9237. });
  9238. /*------------------------------------------------------------------------*/
  9239. /**
  9240. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9241. * chain sequences enabled. The result of such sequences must be unwrapped
  9242. * with `_#value`.
  9243. *
  9244. * @static
  9245. * @memberOf _
  9246. * @since 1.3.0
  9247. * @category Seq
  9248. * @param {*} value The value to wrap.
  9249. * @returns {Object} Returns the new `lodash` wrapper instance.
  9250. * @example
  9251. *
  9252. * var users = [
  9253. * { 'user': 'barney', 'age': 36 },
  9254. * { 'user': 'fred', 'age': 40 },
  9255. * { 'user': 'pebbles', 'age': 1 }
  9256. * ];
  9257. *
  9258. * var youngest = _
  9259. * .chain(users)
  9260. * .sortBy('age')
  9261. * .map(function(o) {
  9262. * return o.user + ' is ' + o.age;
  9263. * })
  9264. * .head()
  9265. * .value();
  9266. * // => 'pebbles is 1'
  9267. */
  9268. function chain(value) {
  9269. var result = lodash(value);
  9270. result.__chain__ = true;
  9271. return result;
  9272. }
  9273. /**
  9274. * This method invokes `interceptor` and returns `value`. The interceptor
  9275. * is invoked with one argument; (value). The purpose of this method is to
  9276. * "tap into" a method chain sequence in order to modify intermediate results.
  9277. *
  9278. * @static
  9279. * @memberOf _
  9280. * @since 0.1.0
  9281. * @category Seq
  9282. * @param {*} value The value to provide to `interceptor`.
  9283. * @param {Function} interceptor The function to invoke.
  9284. * @returns {*} Returns `value`.
  9285. * @example
  9286. *
  9287. * _([1, 2, 3])
  9288. * .tap(function(array) {
  9289. * // Mutate input array.
  9290. * array.pop();
  9291. * })
  9292. * .reverse()
  9293. * .value();
  9294. * // => [2, 1]
  9295. */
  9296. function tap(value, interceptor) {
  9297. interceptor(value);
  9298. return value;
  9299. }
  9300. /**
  9301. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9302. * The purpose of this method is to "pass thru" values replacing intermediate
  9303. * results in a method chain sequence.
  9304. *
  9305. * @static
  9306. * @memberOf _
  9307. * @since 3.0.0
  9308. * @category Seq
  9309. * @param {*} value The value to provide to `interceptor`.
  9310. * @param {Function} interceptor The function to invoke.
  9311. * @returns {*} Returns the result of `interceptor`.
  9312. * @example
  9313. *
  9314. * _(' abc ')
  9315. * .chain()
  9316. * .trim()
  9317. * .thru(function(value) {
  9318. * return [value];
  9319. * })
  9320. * .value();
  9321. * // => ['abc']
  9322. */
  9323. function thru(value, interceptor) {
  9324. return interceptor(value);
  9325. }
  9326. /**
  9327. * This method is the wrapper version of `_.at`.
  9328. *
  9329. * @name at
  9330. * @memberOf _
  9331. * @since 1.0.0
  9332. * @category Seq
  9333. * @param {...(string|string[])} [paths] The property paths to pick.
  9334. * @returns {Object} Returns the new `lodash` wrapper instance.
  9335. * @example
  9336. *
  9337. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9338. *
  9339. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9340. * // => [3, 4]
  9341. */
  9342. var wrapperAt = flatRest(function(paths) {
  9343. var length = paths.length,
  9344. start = length ? paths[0] : 0,
  9345. value = this.__wrapped__,
  9346. interceptor = function(object) { return baseAt(object, paths); };
  9347. if (length > 1 || this.__actions__.length ||
  9348. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9349. return this.thru(interceptor);
  9350. }
  9351. value = value.slice(start, +start + (length ? 1 : 0));
  9352. value.__actions__.push({
  9353. 'func': thru,
  9354. 'args': [interceptor],
  9355. 'thisArg': undefined
  9356. });
  9357. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9358. if (length && !array.length) {
  9359. array.push(undefined);
  9360. }
  9361. return array;
  9362. });
  9363. });
  9364. /**
  9365. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9366. *
  9367. * @name chain
  9368. * @memberOf _
  9369. * @since 0.1.0
  9370. * @category Seq
  9371. * @returns {Object} Returns the new `lodash` wrapper instance.
  9372. * @example
  9373. *
  9374. * var users = [
  9375. * { 'user': 'barney', 'age': 36 },
  9376. * { 'user': 'fred', 'age': 40 }
  9377. * ];
  9378. *
  9379. * // A sequence without explicit chaining.
  9380. * _(users).head();
  9381. * // => { 'user': 'barney', 'age': 36 }
  9382. *
  9383. * // A sequence with explicit chaining.
  9384. * _(users)
  9385. * .chain()
  9386. * .head()
  9387. * .pick('user')
  9388. * .value();
  9389. * // => { 'user': 'barney' }
  9390. */
  9391. function wrapperChain() {
  9392. return chain(this);
  9393. }
  9394. /**
  9395. * Executes the chain sequence and returns the wrapped result.
  9396. *
  9397. * @name commit
  9398. * @memberOf _
  9399. * @since 3.2.0
  9400. * @category Seq
  9401. * @returns {Object} Returns the new `lodash` wrapper instance.
  9402. * @example
  9403. *
  9404. * var array = [1, 2];
  9405. * var wrapped = _(array).push(3);
  9406. *
  9407. * console.log(array);
  9408. * // => [1, 2]
  9409. *
  9410. * wrapped = wrapped.commit();
  9411. * console.log(array);
  9412. * // => [1, 2, 3]
  9413. *
  9414. * wrapped.last();
  9415. * // => 3
  9416. *
  9417. * console.log(array);
  9418. * // => [1, 2, 3]
  9419. */
  9420. function wrapperCommit() {
  9421. return new LodashWrapper(this.value(), this.__chain__);
  9422. }
  9423. /**
  9424. * Gets the next value on a wrapped object following the
  9425. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9426. *
  9427. * @name next
  9428. * @memberOf _
  9429. * @since 4.0.0
  9430. * @category Seq
  9431. * @returns {Object} Returns the next iterator value.
  9432. * @example
  9433. *
  9434. * var wrapped = _([1, 2]);
  9435. *
  9436. * wrapped.next();
  9437. * // => { 'done': false, 'value': 1 }
  9438. *
  9439. * wrapped.next();
  9440. * // => { 'done': false, 'value': 2 }
  9441. *
  9442. * wrapped.next();
  9443. * // => { 'done': true, 'value': undefined }
  9444. */
  9445. function wrapperNext() {
  9446. if (this.__values__ === undefined) {
  9447. this.__values__ = toArray(this.value());
  9448. }
  9449. var done = this.__index__ >= this.__values__.length,
  9450. value = done ? undefined : this.__values__[this.__index__++];
  9451. return { 'done': done, 'value': value };
  9452. }
  9453. /**
  9454. * Enables the wrapper to be iterable.
  9455. *
  9456. * @name Symbol.iterator
  9457. * @memberOf _
  9458. * @since 4.0.0
  9459. * @category Seq
  9460. * @returns {Object} Returns the wrapper object.
  9461. * @example
  9462. *
  9463. * var wrapped = _([1, 2]);
  9464. *
  9465. * wrapped[Symbol.iterator]() === wrapped;
  9466. * // => true
  9467. *
  9468. * Array.from(wrapped);
  9469. * // => [1, 2]
  9470. */
  9471. function wrapperToIterator() {
  9472. return this;
  9473. }
  9474. /**
  9475. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9476. *
  9477. * @name plant
  9478. * @memberOf _
  9479. * @since 3.2.0
  9480. * @category Seq
  9481. * @param {*} value The value to plant.
  9482. * @returns {Object} Returns the new `lodash` wrapper instance.
  9483. * @example
  9484. *
  9485. * function square(n) {
  9486. * return n * n;
  9487. * }
  9488. *
  9489. * var wrapped = _([1, 2]).map(square);
  9490. * var other = wrapped.plant([3, 4]);
  9491. *
  9492. * other.value();
  9493. * // => [9, 16]
  9494. *
  9495. * wrapped.value();
  9496. * // => [1, 4]
  9497. */
  9498. function wrapperPlant(value) {
  9499. var result,
  9500. parent = this;
  9501. while (parent instanceof baseLodash) {
  9502. var clone = wrapperClone(parent);
  9503. clone.__index__ = 0;
  9504. clone.__values__ = undefined;
  9505. if (result) {
  9506. previous.__wrapped__ = clone;
  9507. } else {
  9508. result = clone;
  9509. }
  9510. var previous = clone;
  9511. parent = parent.__wrapped__;
  9512. }
  9513. previous.__wrapped__ = value;
  9514. return result;
  9515. }
  9516. /**
  9517. * This method is the wrapper version of `_.reverse`.
  9518. *
  9519. * **Note:** This method mutates the wrapped array.
  9520. *
  9521. * @name reverse
  9522. * @memberOf _
  9523. * @since 0.1.0
  9524. * @category Seq
  9525. * @returns {Object} Returns the new `lodash` wrapper instance.
  9526. * @example
  9527. *
  9528. * var array = [1, 2, 3];
  9529. *
  9530. * _(array).reverse().value()
  9531. * // => [3, 2, 1]
  9532. *
  9533. * console.log(array);
  9534. * // => [3, 2, 1]
  9535. */
  9536. function wrapperReverse() {
  9537. var value = this.__wrapped__;
  9538. if (value instanceof LazyWrapper) {
  9539. var wrapped = value;
  9540. if (this.__actions__.length) {
  9541. wrapped = new LazyWrapper(this);
  9542. }
  9543. wrapped = wrapped.reverse();
  9544. wrapped.__actions__.push({
  9545. 'func': thru,
  9546. 'args': [reverse],
  9547. 'thisArg': undefined
  9548. });
  9549. return new LodashWrapper(wrapped, this.__chain__);
  9550. }
  9551. return this.thru(reverse);
  9552. }
  9553. /**
  9554. * Executes the chain sequence to resolve the unwrapped value.
  9555. *
  9556. * @name value
  9557. * @memberOf _
  9558. * @since 0.1.0
  9559. * @alias toJSON, valueOf
  9560. * @category Seq
  9561. * @returns {*} Returns the resolved unwrapped value.
  9562. * @example
  9563. *
  9564. * _([1, 2, 3]).value();
  9565. * // => [1, 2, 3]
  9566. */
  9567. function wrapperValue() {
  9568. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9569. }
  9570. /*------------------------------------------------------------------------*/
  9571. /**
  9572. * Creates an object composed of keys generated from the results of running
  9573. * each element of `collection` thru `iteratee`. The corresponding value of
  9574. * each key is the number of times the key was returned by `iteratee`. The
  9575. * iteratee is invoked with one argument: (value).
  9576. *
  9577. * @static
  9578. * @memberOf _
  9579. * @since 0.5.0
  9580. * @category Collection
  9581. * @param {Array|Object} collection The collection to iterate over.
  9582. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9583. * @returns {Object} Returns the composed aggregate object.
  9584. * @example
  9585. *
  9586. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9587. * // => { '4': 1, '6': 2 }
  9588. *
  9589. * // The `_.property` iteratee shorthand.
  9590. * _.countBy(['one', 'two', 'three'], 'length');
  9591. * // => { '3': 2, '5': 1 }
  9592. */
  9593. var countBy = createAggregator(function(result, value, key) {
  9594. if (hasOwnProperty.call(result, key)) {
  9595. ++result[key];
  9596. } else {
  9597. baseAssignValue(result, key, 1);
  9598. }
  9599. });
  9600. /**
  9601. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9602. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9603. * invoked with three arguments: (value, index|key, collection).
  9604. *
  9605. * **Note:** This method returns `true` for
  9606. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9607. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9608. * elements of empty collections.
  9609. *
  9610. * @static
  9611. * @memberOf _
  9612. * @since 0.1.0
  9613. * @category Collection
  9614. * @param {Array|Object} collection The collection to iterate over.
  9615. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9616. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9617. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9618. * else `false`.
  9619. * @example
  9620. *
  9621. * _.every([true, 1, null, 'yes'], Boolean);
  9622. * // => false
  9623. *
  9624. * var users = [
  9625. * { 'user': 'barney', 'age': 36, 'active': false },
  9626. * { 'user': 'fred', 'age': 40, 'active': false }
  9627. * ];
  9628. *
  9629. * // The `_.matches` iteratee shorthand.
  9630. * _.every(users, { 'user': 'barney', 'active': false });
  9631. * // => false
  9632. *
  9633. * // The `_.matchesProperty` iteratee shorthand.
  9634. * _.every(users, ['active', false]);
  9635. * // => true
  9636. *
  9637. * // The `_.property` iteratee shorthand.
  9638. * _.every(users, 'active');
  9639. * // => false
  9640. */
  9641. function every(collection, predicate, guard) {
  9642. var func = isArray(collection) ? arrayEvery : baseEvery;
  9643. if (guard && isIterateeCall(collection, predicate, guard)) {
  9644. predicate = undefined;
  9645. }
  9646. return func(collection, getIteratee(predicate, 3));
  9647. }
  9648. /**
  9649. * Iterates over elements of `collection`, returning an array of all elements
  9650. * `predicate` returns truthy for. The predicate is invoked with three
  9651. * arguments: (value, index|key, collection).
  9652. *
  9653. * **Note:** Unlike `_.remove`, this method returns a new array.
  9654. *
  9655. * @static
  9656. * @memberOf _
  9657. * @since 0.1.0
  9658. * @category Collection
  9659. * @param {Array|Object} collection The collection to iterate over.
  9660. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9661. * @returns {Array} Returns the new filtered array.
  9662. * @see _.reject
  9663. * @example
  9664. *
  9665. * var users = [
  9666. * { 'user': 'barney', 'age': 36, 'active': true },
  9667. * { 'user': 'fred', 'age': 40, 'active': false }
  9668. * ];
  9669. *
  9670. * _.filter(users, function(o) { return !o.active; });
  9671. * // => objects for ['fred']
  9672. *
  9673. * // The `_.matches` iteratee shorthand.
  9674. * _.filter(users, { 'age': 36, 'active': true });
  9675. * // => objects for ['barney']
  9676. *
  9677. * // The `_.matchesProperty` iteratee shorthand.
  9678. * _.filter(users, ['active', false]);
  9679. * // => objects for ['fred']
  9680. *
  9681. * // The `_.property` iteratee shorthand.
  9682. * _.filter(users, 'active');
  9683. * // => objects for ['barney']
  9684. *
  9685. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9686. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9687. * // => objects for ['fred', 'barney']
  9688. */
  9689. function filter(collection, predicate) {
  9690. var func = isArray(collection) ? arrayFilter : baseFilter;
  9691. return func(collection, getIteratee(predicate, 3));
  9692. }
  9693. /**
  9694. * Iterates over elements of `collection`, returning the first element
  9695. * `predicate` returns truthy for. The predicate is invoked with three
  9696. * arguments: (value, index|key, collection).
  9697. *
  9698. * @static
  9699. * @memberOf _
  9700. * @since 0.1.0
  9701. * @category Collection
  9702. * @param {Array|Object} collection The collection to inspect.
  9703. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9704. * @param {number} [fromIndex=0] The index to search from.
  9705. * @returns {*} Returns the matched element, else `undefined`.
  9706. * @example
  9707. *
  9708. * var users = [
  9709. * { 'user': 'barney', 'age': 36, 'active': true },
  9710. * { 'user': 'fred', 'age': 40, 'active': false },
  9711. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9712. * ];
  9713. *
  9714. * _.find(users, function(o) { return o.age < 40; });
  9715. * // => object for 'barney'
  9716. *
  9717. * // The `_.matches` iteratee shorthand.
  9718. * _.find(users, { 'age': 1, 'active': true });
  9719. * // => object for 'pebbles'
  9720. *
  9721. * // The `_.matchesProperty` iteratee shorthand.
  9722. * _.find(users, ['active', false]);
  9723. * // => object for 'fred'
  9724. *
  9725. * // The `_.property` iteratee shorthand.
  9726. * _.find(users, 'active');
  9727. * // => object for 'barney'
  9728. */
  9729. var find = createFind(findIndex);
  9730. /**
  9731. * This method is like `_.find` except that it iterates over elements of
  9732. * `collection` from right to left.
  9733. *
  9734. * @static
  9735. * @memberOf _
  9736. * @since 2.0.0
  9737. * @category Collection
  9738. * @param {Array|Object} collection The collection to inspect.
  9739. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9740. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9741. * @returns {*} Returns the matched element, else `undefined`.
  9742. * @example
  9743. *
  9744. * _.findLast([1, 2, 3, 4], function(n) {
  9745. * return n % 2 == 1;
  9746. * });
  9747. * // => 3
  9748. */
  9749. var findLast = createFind(findLastIndex);
  9750. /**
  9751. * Creates a flattened array of values by running each element in `collection`
  9752. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9753. * with three arguments: (value, index|key, collection).
  9754. *
  9755. * @static
  9756. * @memberOf _
  9757. * @since 4.0.0
  9758. * @category Collection
  9759. * @param {Array|Object} collection The collection to iterate over.
  9760. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9761. * @returns {Array} Returns the new flattened array.
  9762. * @example
  9763. *
  9764. * function duplicate(n) {
  9765. * return [n, n];
  9766. * }
  9767. *
  9768. * _.flatMap([1, 2], duplicate);
  9769. * // => [1, 1, 2, 2]
  9770. */
  9771. function flatMap(collection, iteratee) {
  9772. return baseFlatten(map(collection, iteratee), 1);
  9773. }
  9774. /**
  9775. * This method is like `_.flatMap` except that it recursively flattens the
  9776. * mapped results.
  9777. *
  9778. * @static
  9779. * @memberOf _
  9780. * @since 4.7.0
  9781. * @category Collection
  9782. * @param {Array|Object} collection The collection to iterate over.
  9783. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9784. * @returns {Array} Returns the new flattened array.
  9785. * @example
  9786. *
  9787. * function duplicate(n) {
  9788. * return [[[n, n]]];
  9789. * }
  9790. *
  9791. * _.flatMapDeep([1, 2], duplicate);
  9792. * // => [1, 1, 2, 2]
  9793. */
  9794. function flatMapDeep(collection, iteratee) {
  9795. return baseFlatten(map(collection, iteratee), INFINITY);
  9796. }
  9797. /**
  9798. * This method is like `_.flatMap` except that it recursively flattens the
  9799. * mapped results up to `depth` times.
  9800. *
  9801. * @static
  9802. * @memberOf _
  9803. * @since 4.7.0
  9804. * @category Collection
  9805. * @param {Array|Object} collection The collection to iterate over.
  9806. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9807. * @param {number} [depth=1] The maximum recursion depth.
  9808. * @returns {Array} Returns the new flattened array.
  9809. * @example
  9810. *
  9811. * function duplicate(n) {
  9812. * return [[[n, n]]];
  9813. * }
  9814. *
  9815. * _.flatMapDepth([1, 2], duplicate, 2);
  9816. * // => [[1, 1], [2, 2]]
  9817. */
  9818. function flatMapDepth(collection, iteratee, depth) {
  9819. depth = depth === undefined ? 1 : toInteger(depth);
  9820. return baseFlatten(map(collection, iteratee), depth);
  9821. }
  9822. /**
  9823. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9824. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9825. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9826. *
  9827. * **Note:** As with other "Collections" methods, objects with a "length"
  9828. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9829. * or `_.forOwn` for object iteration.
  9830. *
  9831. * @static
  9832. * @memberOf _
  9833. * @since 0.1.0
  9834. * @alias each
  9835. * @category Collection
  9836. * @param {Array|Object} collection The collection to iterate over.
  9837. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9838. * @returns {Array|Object} Returns `collection`.
  9839. * @see _.forEachRight
  9840. * @example
  9841. *
  9842. * _.forEach([1, 2], function(value) {
  9843. * console.log(value);
  9844. * });
  9845. * // => Logs `1` then `2`.
  9846. *
  9847. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9848. * console.log(key);
  9849. * });
  9850. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9851. */
  9852. function forEach(collection, iteratee) {
  9853. var func = isArray(collection) ? arrayEach : baseEach;
  9854. return func(collection, getIteratee(iteratee, 3));
  9855. }
  9856. /**
  9857. * This method is like `_.forEach` except that it iterates over elements of
  9858. * `collection` from right to left.
  9859. *
  9860. * @static
  9861. * @memberOf _
  9862. * @since 2.0.0
  9863. * @alias eachRight
  9864. * @category Collection
  9865. * @param {Array|Object} collection The collection to iterate over.
  9866. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9867. * @returns {Array|Object} Returns `collection`.
  9868. * @see _.forEach
  9869. * @example
  9870. *
  9871. * _.forEachRight([1, 2], function(value) {
  9872. * console.log(value);
  9873. * });
  9874. * // => Logs `2` then `1`.
  9875. */
  9876. function forEachRight(collection, iteratee) {
  9877. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9878. return func(collection, getIteratee(iteratee, 3));
  9879. }
  9880. /**
  9881. * Creates an object composed of keys generated from the results of running
  9882. * each element of `collection` thru `iteratee`. The order of grouped values
  9883. * is determined by the order they occur in `collection`. The corresponding
  9884. * value of each key is an array of elements responsible for generating the
  9885. * key. The iteratee is invoked with one argument: (value).
  9886. *
  9887. * @static
  9888. * @memberOf _
  9889. * @since 0.1.0
  9890. * @category Collection
  9891. * @param {Array|Object} collection The collection to iterate over.
  9892. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9893. * @returns {Object} Returns the composed aggregate object.
  9894. * @example
  9895. *
  9896. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9897. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9898. *
  9899. * // The `_.property` iteratee shorthand.
  9900. * _.groupBy(['one', 'two', 'three'], 'length');
  9901. * // => { '3': ['one', 'two'], '5': ['three'] }
  9902. */
  9903. var groupBy = createAggregator(function(result, value, key) {
  9904. if (hasOwnProperty.call(result, key)) {
  9905. result[key].push(value);
  9906. } else {
  9907. baseAssignValue(result, key, [value]);
  9908. }
  9909. });
  9910. /**
  9911. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9912. * checked for a substring of `value`, otherwise
  9913. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9914. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9915. * the offset from the end of `collection`.
  9916. *
  9917. * @static
  9918. * @memberOf _
  9919. * @since 0.1.0
  9920. * @category Collection
  9921. * @param {Array|Object|string} collection The collection to inspect.
  9922. * @param {*} value The value to search for.
  9923. * @param {number} [fromIndex=0] The index to search from.
  9924. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9925. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9926. * @example
  9927. *
  9928. * _.includes([1, 2, 3], 1);
  9929. * // => true
  9930. *
  9931. * _.includes([1, 2, 3], 1, 2);
  9932. * // => false
  9933. *
  9934. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9935. * // => true
  9936. *
  9937. * _.includes('abcd', 'bc');
  9938. * // => true
  9939. */
  9940. function includes(collection, value, fromIndex, guard) {
  9941. collection = isArrayLike(collection) ? collection : values(collection);
  9942. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9943. var length = collection.length;
  9944. if (fromIndex < 0) {
  9945. fromIndex = nativeMax(length + fromIndex, 0);
  9946. }
  9947. return isString(collection)
  9948. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9949. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9950. }
  9951. /**
  9952. * Invokes the method at `path` of each element in `collection`, returning
  9953. * an array of the results of each invoked method. Any additional arguments
  9954. * are provided to each invoked method. If `path` is a function, it's invoked
  9955. * for, and `this` bound to, each element in `collection`.
  9956. *
  9957. * @static
  9958. * @memberOf _
  9959. * @since 4.0.0
  9960. * @category Collection
  9961. * @param {Array|Object} collection The collection to iterate over.
  9962. * @param {Array|Function|string} path The path of the method to invoke or
  9963. * the function invoked per iteration.
  9964. * @param {...*} [args] The arguments to invoke each method with.
  9965. * @returns {Array} Returns the array of results.
  9966. * @example
  9967. *
  9968. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9969. * // => [[1, 5, 7], [1, 2, 3]]
  9970. *
  9971. * _.invokeMap([123, 456], String.prototype.split, '');
  9972. * // => [['1', '2', '3'], ['4', '5', '6']]
  9973. */
  9974. var invokeMap = baseRest(function(collection, path, args) {
  9975. var index = -1,
  9976. isFunc = typeof path == 'function',
  9977. result = isArrayLike(collection) ? Array(collection.length) : [];
  9978. baseEach(collection, function(value) {
  9979. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9980. });
  9981. return result;
  9982. });
  9983. /**
  9984. * Creates an object composed of keys generated from the results of running
  9985. * each element of `collection` thru `iteratee`. The corresponding value of
  9986. * each key is the last element responsible for generating the key. The
  9987. * iteratee is invoked with one argument: (value).
  9988. *
  9989. * @static
  9990. * @memberOf _
  9991. * @since 4.0.0
  9992. * @category Collection
  9993. * @param {Array|Object} collection The collection to iterate over.
  9994. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9995. * @returns {Object} Returns the composed aggregate object.
  9996. * @example
  9997. *
  9998. * var array = [
  9999. * { 'dir': 'left', 'code': 97 },
  10000. * { 'dir': 'right', 'code': 100 }
  10001. * ];
  10002. *
  10003. * _.keyBy(array, function(o) {
  10004. * return String.fromCharCode(o.code);
  10005. * });
  10006. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10007. *
  10008. * _.keyBy(array, 'dir');
  10009. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10010. */
  10011. var keyBy = createAggregator(function(result, value, key) {
  10012. baseAssignValue(result, key, value);
  10013. });
  10014. /**
  10015. * Creates an array of values by running each element in `collection` thru
  10016. * `iteratee`. The iteratee is invoked with three arguments:
  10017. * (value, index|key, collection).
  10018. *
  10019. * Many lodash methods are guarded to work as iteratees for methods like
  10020. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10021. *
  10022. * The guarded methods are:
  10023. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10024. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10025. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10026. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10027. *
  10028. * @static
  10029. * @memberOf _
  10030. * @since 0.1.0
  10031. * @category Collection
  10032. * @param {Array|Object} collection The collection to iterate over.
  10033. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10034. * @returns {Array} Returns the new mapped array.
  10035. * @example
  10036. *
  10037. * function square(n) {
  10038. * return n * n;
  10039. * }
  10040. *
  10041. * _.map([4, 8], square);
  10042. * // => [16, 64]
  10043. *
  10044. * _.map({ 'a': 4, 'b': 8 }, square);
  10045. * // => [16, 64] (iteration order is not guaranteed)
  10046. *
  10047. * var users = [
  10048. * { 'user': 'barney' },
  10049. * { 'user': 'fred' }
  10050. * ];
  10051. *
  10052. * // The `_.property` iteratee shorthand.
  10053. * _.map(users, 'user');
  10054. * // => ['barney', 'fred']
  10055. */
  10056. function map(collection, iteratee) {
  10057. var func = isArray(collection) ? arrayMap : baseMap;
  10058. return func(collection, getIteratee(iteratee, 3));
  10059. }
  10060. /**
  10061. * This method is like `_.sortBy` except that it allows specifying the sort
  10062. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10063. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10064. * descending or "asc" for ascending sort order of corresponding values.
  10065. *
  10066. * @static
  10067. * @memberOf _
  10068. * @since 4.0.0
  10069. * @category Collection
  10070. * @param {Array|Object} collection The collection to iterate over.
  10071. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10072. * The iteratees to sort by.
  10073. * @param {string[]} [orders] The sort orders of `iteratees`.
  10074. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10075. * @returns {Array} Returns the new sorted array.
  10076. * @example
  10077. *
  10078. * var users = [
  10079. * { 'user': 'fred', 'age': 48 },
  10080. * { 'user': 'barney', 'age': 34 },
  10081. * { 'user': 'fred', 'age': 40 },
  10082. * { 'user': 'barney', 'age': 36 }
  10083. * ];
  10084. *
  10085. * // Sort by `user` in ascending order and by `age` in descending order.
  10086. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10087. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10088. */
  10089. function orderBy(collection, iteratees, orders, guard) {
  10090. if (collection == null) {
  10091. return [];
  10092. }
  10093. if (!isArray(iteratees)) {
  10094. iteratees = iteratees == null ? [] : [iteratees];
  10095. }
  10096. orders = guard ? undefined : orders;
  10097. if (!isArray(orders)) {
  10098. orders = orders == null ? [] : [orders];
  10099. }
  10100. return baseOrderBy(collection, iteratees, orders);
  10101. }
  10102. /**
  10103. * Creates an array of elements split into two groups, the first of which
  10104. * contains elements `predicate` returns truthy for, the second of which
  10105. * contains elements `predicate` returns falsey for. The predicate is
  10106. * invoked with one argument: (value).
  10107. *
  10108. * @static
  10109. * @memberOf _
  10110. * @since 3.0.0
  10111. * @category Collection
  10112. * @param {Array|Object} collection The collection to iterate over.
  10113. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10114. * @returns {Array} Returns the array of grouped elements.
  10115. * @example
  10116. *
  10117. * var users = [
  10118. * { 'user': 'barney', 'age': 36, 'active': false },
  10119. * { 'user': 'fred', 'age': 40, 'active': true },
  10120. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10121. * ];
  10122. *
  10123. * _.partition(users, function(o) { return o.active; });
  10124. * // => objects for [['fred'], ['barney', 'pebbles']]
  10125. *
  10126. * // The `_.matches` iteratee shorthand.
  10127. * _.partition(users, { 'age': 1, 'active': false });
  10128. * // => objects for [['pebbles'], ['barney', 'fred']]
  10129. *
  10130. * // The `_.matchesProperty` iteratee shorthand.
  10131. * _.partition(users, ['active', false]);
  10132. * // => objects for [['barney', 'pebbles'], ['fred']]
  10133. *
  10134. * // The `_.property` iteratee shorthand.
  10135. * _.partition(users, 'active');
  10136. * // => objects for [['fred'], ['barney', 'pebbles']]
  10137. */
  10138. var partition = createAggregator(function(result, value, key) {
  10139. result[key ? 0 : 1].push(value);
  10140. }, function() { return [[], []]; });
  10141. /**
  10142. * Reduces `collection` to a value which is the accumulated result of running
  10143. * each element in `collection` thru `iteratee`, where each successive
  10144. * invocation is supplied the return value of the previous. If `accumulator`
  10145. * is not given, the first element of `collection` is used as the initial
  10146. * value. The iteratee is invoked with four arguments:
  10147. * (accumulator, value, index|key, collection).
  10148. *
  10149. * Many lodash methods are guarded to work as iteratees for methods like
  10150. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10151. *
  10152. * The guarded methods are:
  10153. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10154. * and `sortBy`
  10155. *
  10156. * @static
  10157. * @memberOf _
  10158. * @since 0.1.0
  10159. * @category Collection
  10160. * @param {Array|Object} collection The collection to iterate over.
  10161. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10162. * @param {*} [accumulator] The initial value.
  10163. * @returns {*} Returns the accumulated value.
  10164. * @see _.reduceRight
  10165. * @example
  10166. *
  10167. * _.reduce([1, 2], function(sum, n) {
  10168. * return sum + n;
  10169. * }, 0);
  10170. * // => 3
  10171. *
  10172. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10173. * (result[value] || (result[value] = [])).push(key);
  10174. * return result;
  10175. * }, {});
  10176. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10177. */
  10178. function reduce(collection, iteratee, accumulator) {
  10179. var func = isArray(collection) ? arrayReduce : baseReduce,
  10180. initAccum = arguments.length < 3;
  10181. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10182. }
  10183. /**
  10184. * This method is like `_.reduce` except that it iterates over elements of
  10185. * `collection` from right to left.
  10186. *
  10187. * @static
  10188. * @memberOf _
  10189. * @since 0.1.0
  10190. * @category Collection
  10191. * @param {Array|Object} collection The collection to iterate over.
  10192. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10193. * @param {*} [accumulator] The initial value.
  10194. * @returns {*} Returns the accumulated value.
  10195. * @see _.reduce
  10196. * @example
  10197. *
  10198. * var array = [[0, 1], [2, 3], [4, 5]];
  10199. *
  10200. * _.reduceRight(array, function(flattened, other) {
  10201. * return flattened.concat(other);
  10202. * }, []);
  10203. * // => [4, 5, 2, 3, 0, 1]
  10204. */
  10205. function reduceRight(collection, iteratee, accumulator) {
  10206. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10207. initAccum = arguments.length < 3;
  10208. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10209. }
  10210. /**
  10211. * The opposite of `_.filter`; this method returns the elements of `collection`
  10212. * that `predicate` does **not** return truthy for.
  10213. *
  10214. * @static
  10215. * @memberOf _
  10216. * @since 0.1.0
  10217. * @category Collection
  10218. * @param {Array|Object} collection The collection to iterate over.
  10219. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10220. * @returns {Array} Returns the new filtered array.
  10221. * @see _.filter
  10222. * @example
  10223. *
  10224. * var users = [
  10225. * { 'user': 'barney', 'age': 36, 'active': false },
  10226. * { 'user': 'fred', 'age': 40, 'active': true }
  10227. * ];
  10228. *
  10229. * _.reject(users, function(o) { return !o.active; });
  10230. * // => objects for ['fred']
  10231. *
  10232. * // The `_.matches` iteratee shorthand.
  10233. * _.reject(users, { 'age': 40, 'active': true });
  10234. * // => objects for ['barney']
  10235. *
  10236. * // The `_.matchesProperty` iteratee shorthand.
  10237. * _.reject(users, ['active', false]);
  10238. * // => objects for ['fred']
  10239. *
  10240. * // The `_.property` iteratee shorthand.
  10241. * _.reject(users, 'active');
  10242. * // => objects for ['barney']
  10243. */
  10244. function reject(collection, predicate) {
  10245. var func = isArray(collection) ? arrayFilter : baseFilter;
  10246. return func(collection, negate(getIteratee(predicate, 3)));
  10247. }
  10248. /**
  10249. * Gets a random element from `collection`.
  10250. *
  10251. * @static
  10252. * @memberOf _
  10253. * @since 2.0.0
  10254. * @category Collection
  10255. * @param {Array|Object} collection The collection to sample.
  10256. * @returns {*} Returns the random element.
  10257. * @example
  10258. *
  10259. * _.sample([1, 2, 3, 4]);
  10260. * // => 2
  10261. */
  10262. function sample(collection) {
  10263. var func = isArray(collection) ? arraySample : baseSample;
  10264. return func(collection);
  10265. }
  10266. /**
  10267. * Gets `n` random elements at unique keys from `collection` up to the
  10268. * size of `collection`.
  10269. *
  10270. * @static
  10271. * @memberOf _
  10272. * @since 4.0.0
  10273. * @category Collection
  10274. * @param {Array|Object} collection The collection to sample.
  10275. * @param {number} [n=1] The number of elements to sample.
  10276. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10277. * @returns {Array} Returns the random elements.
  10278. * @example
  10279. *
  10280. * _.sampleSize([1, 2, 3], 2);
  10281. * // => [3, 1]
  10282. *
  10283. * _.sampleSize([1, 2, 3], 4);
  10284. * // => [2, 3, 1]
  10285. */
  10286. function sampleSize(collection, n, guard) {
  10287. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10288. n = 1;
  10289. } else {
  10290. n = toInteger(n);
  10291. }
  10292. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10293. return func(collection, n);
  10294. }
  10295. /**
  10296. * Creates an array of shuffled values, using a version of the
  10297. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10298. *
  10299. * @static
  10300. * @memberOf _
  10301. * @since 0.1.0
  10302. * @category Collection
  10303. * @param {Array|Object} collection The collection to shuffle.
  10304. * @returns {Array} Returns the new shuffled array.
  10305. * @example
  10306. *
  10307. * _.shuffle([1, 2, 3, 4]);
  10308. * // => [4, 1, 3, 2]
  10309. */
  10310. function shuffle(collection) {
  10311. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10312. return func(collection);
  10313. }
  10314. /**
  10315. * Gets the size of `collection` by returning its length for array-like
  10316. * values or the number of own enumerable string keyed properties for objects.
  10317. *
  10318. * @static
  10319. * @memberOf _
  10320. * @since 0.1.0
  10321. * @category Collection
  10322. * @param {Array|Object|string} collection The collection to inspect.
  10323. * @returns {number} Returns the collection size.
  10324. * @example
  10325. *
  10326. * _.size([1, 2, 3]);
  10327. * // => 3
  10328. *
  10329. * _.size({ 'a': 1, 'b': 2 });
  10330. * // => 2
  10331. *
  10332. * _.size('pebbles');
  10333. * // => 7
  10334. */
  10335. function size(collection) {
  10336. if (collection == null) {
  10337. return 0;
  10338. }
  10339. if (isArrayLike(collection)) {
  10340. return isString(collection) ? stringSize(collection) : collection.length;
  10341. }
  10342. var tag = getTag(collection);
  10343. if (tag == mapTag || tag == setTag) {
  10344. return collection.size;
  10345. }
  10346. return baseKeys(collection).length;
  10347. }
  10348. /**
  10349. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10350. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10351. * invoked with three arguments: (value, index|key, collection).
  10352. *
  10353. * @static
  10354. * @memberOf _
  10355. * @since 0.1.0
  10356. * @category Collection
  10357. * @param {Array|Object} collection The collection to iterate over.
  10358. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10359. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10360. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10361. * else `false`.
  10362. * @example
  10363. *
  10364. * _.some([null, 0, 'yes', false], Boolean);
  10365. * // => true
  10366. *
  10367. * var users = [
  10368. * { 'user': 'barney', 'active': true },
  10369. * { 'user': 'fred', 'active': false }
  10370. * ];
  10371. *
  10372. * // The `_.matches` iteratee shorthand.
  10373. * _.some(users, { 'user': 'barney', 'active': false });
  10374. * // => false
  10375. *
  10376. * // The `_.matchesProperty` iteratee shorthand.
  10377. * _.some(users, ['active', false]);
  10378. * // => true
  10379. *
  10380. * // The `_.property` iteratee shorthand.
  10381. * _.some(users, 'active');
  10382. * // => true
  10383. */
  10384. function some(collection, predicate, guard) {
  10385. var func = isArray(collection) ? arraySome : baseSome;
  10386. if (guard && isIterateeCall(collection, predicate, guard)) {
  10387. predicate = undefined;
  10388. }
  10389. return func(collection, getIteratee(predicate, 3));
  10390. }
  10391. /**
  10392. * Creates an array of elements, sorted in ascending order by the results of
  10393. * running each element in a collection thru each iteratee. This method
  10394. * performs a stable sort, that is, it preserves the original sort order of
  10395. * equal elements. The iteratees are invoked with one argument: (value).
  10396. *
  10397. * @static
  10398. * @memberOf _
  10399. * @since 0.1.0
  10400. * @category Collection
  10401. * @param {Array|Object} collection The collection to iterate over.
  10402. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10403. * The iteratees to sort by.
  10404. * @returns {Array} Returns the new sorted array.
  10405. * @example
  10406. *
  10407. * var users = [
  10408. * { 'user': 'fred', 'age': 48 },
  10409. * { 'user': 'barney', 'age': 36 },
  10410. * { 'user': 'fred', 'age': 30 },
  10411. * { 'user': 'barney', 'age': 34 }
  10412. * ];
  10413. *
  10414. * _.sortBy(users, [function(o) { return o.user; }]);
  10415. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10416. *
  10417. * _.sortBy(users, ['user', 'age']);
  10418. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10419. */
  10420. var sortBy = baseRest(function(collection, iteratees) {
  10421. if (collection == null) {
  10422. return [];
  10423. }
  10424. var length = iteratees.length;
  10425. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10426. iteratees = [];
  10427. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10428. iteratees = [iteratees[0]];
  10429. }
  10430. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10431. });
  10432. /*------------------------------------------------------------------------*/
  10433. /**
  10434. * Gets the timestamp of the number of milliseconds that have elapsed since
  10435. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10436. *
  10437. * @static
  10438. * @memberOf _
  10439. * @since 2.4.0
  10440. * @category Date
  10441. * @returns {number} Returns the timestamp.
  10442. * @example
  10443. *
  10444. * _.defer(function(stamp) {
  10445. * console.log(_.now() - stamp);
  10446. * }, _.now());
  10447. * // => Logs the number of milliseconds it took for the deferred invocation.
  10448. */
  10449. var now = ctxNow || function() {
  10450. return root.Date.now();
  10451. };
  10452. /*------------------------------------------------------------------------*/
  10453. /**
  10454. * The opposite of `_.before`; this method creates a function that invokes
  10455. * `func` once it's called `n` or more times.
  10456. *
  10457. * @static
  10458. * @memberOf _
  10459. * @since 0.1.0
  10460. * @category Function
  10461. * @param {number} n The number of calls before `func` is invoked.
  10462. * @param {Function} func The function to restrict.
  10463. * @returns {Function} Returns the new restricted function.
  10464. * @example
  10465. *
  10466. * var saves = ['profile', 'settings'];
  10467. *
  10468. * var done = _.after(saves.length, function() {
  10469. * console.log('done saving!');
  10470. * });
  10471. *
  10472. * _.forEach(saves, function(type) {
  10473. * asyncSave({ 'type': type, 'complete': done });
  10474. * });
  10475. * // => Logs 'done saving!' after the two async saves have completed.
  10476. */
  10477. function after(n, func) {
  10478. if (typeof func != 'function') {
  10479. throw new TypeError(FUNC_ERROR_TEXT);
  10480. }
  10481. n = toInteger(n);
  10482. return function() {
  10483. if (--n < 1) {
  10484. return func.apply(this, arguments);
  10485. }
  10486. };
  10487. }
  10488. /**
  10489. * Creates a function that invokes `func`, with up to `n` arguments,
  10490. * ignoring any additional arguments.
  10491. *
  10492. * @static
  10493. * @memberOf _
  10494. * @since 3.0.0
  10495. * @category Function
  10496. * @param {Function} func The function to cap arguments for.
  10497. * @param {number} [n=func.length] The arity cap.
  10498. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10499. * @returns {Function} Returns the new capped function.
  10500. * @example
  10501. *
  10502. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10503. * // => [6, 8, 10]
  10504. */
  10505. function ary(func, n, guard) {
  10506. n = guard ? undefined : n;
  10507. n = (func && n == null) ? func.length : n;
  10508. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10509. }
  10510. /**
  10511. * Creates a function that invokes `func`, with the `this` binding and arguments
  10512. * of the created function, while it's called less than `n` times. Subsequent
  10513. * calls to the created function return the result of the last `func` invocation.
  10514. *
  10515. * @static
  10516. * @memberOf _
  10517. * @since 3.0.0
  10518. * @category Function
  10519. * @param {number} n The number of calls at which `func` is no longer invoked.
  10520. * @param {Function} func The function to restrict.
  10521. * @returns {Function} Returns the new restricted function.
  10522. * @example
  10523. *
  10524. * jQuery(element).on('click', _.before(5, addContactToList));
  10525. * // => Allows adding up to 4 contacts to the list.
  10526. */
  10527. function before(n, func) {
  10528. var result;
  10529. if (typeof func != 'function') {
  10530. throw new TypeError(FUNC_ERROR_TEXT);
  10531. }
  10532. n = toInteger(n);
  10533. return function() {
  10534. if (--n > 0) {
  10535. result = func.apply(this, arguments);
  10536. }
  10537. if (n <= 1) {
  10538. func = undefined;
  10539. }
  10540. return result;
  10541. };
  10542. }
  10543. /**
  10544. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10545. * and `partials` prepended to the arguments it receives.
  10546. *
  10547. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10548. * may be used as a placeholder for partially applied arguments.
  10549. *
  10550. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10551. * property of bound functions.
  10552. *
  10553. * @static
  10554. * @memberOf _
  10555. * @since 0.1.0
  10556. * @category Function
  10557. * @param {Function} func The function to bind.
  10558. * @param {*} thisArg The `this` binding of `func`.
  10559. * @param {...*} [partials] The arguments to be partially applied.
  10560. * @returns {Function} Returns the new bound function.
  10561. * @example
  10562. *
  10563. * function greet(greeting, punctuation) {
  10564. * return greeting + ' ' + this.user + punctuation;
  10565. * }
  10566. *
  10567. * var object = { 'user': 'fred' };
  10568. *
  10569. * var bound = _.bind(greet, object, 'hi');
  10570. * bound('!');
  10571. * // => 'hi fred!'
  10572. *
  10573. * // Bound with placeholders.
  10574. * var bound = _.bind(greet, object, _, '!');
  10575. * bound('hi');
  10576. * // => 'hi fred!'
  10577. */
  10578. var bind = baseRest(function(func, thisArg, partials) {
  10579. var bitmask = WRAP_BIND_FLAG;
  10580. if (partials.length) {
  10581. var holders = replaceHolders(partials, getHolder(bind));
  10582. bitmask |= WRAP_PARTIAL_FLAG;
  10583. }
  10584. return createWrap(func, bitmask, thisArg, partials, holders);
  10585. });
  10586. /**
  10587. * Creates a function that invokes the method at `object[key]` with `partials`
  10588. * prepended to the arguments it receives.
  10589. *
  10590. * This method differs from `_.bind` by allowing bound functions to reference
  10591. * methods that may be redefined or don't yet exist. See
  10592. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10593. * for more details.
  10594. *
  10595. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10596. * builds, may be used as a placeholder for partially applied arguments.
  10597. *
  10598. * @static
  10599. * @memberOf _
  10600. * @since 0.10.0
  10601. * @category Function
  10602. * @param {Object} object The object to invoke the method on.
  10603. * @param {string} key The key of the method.
  10604. * @param {...*} [partials] The arguments to be partially applied.
  10605. * @returns {Function} Returns the new bound function.
  10606. * @example
  10607. *
  10608. * var object = {
  10609. * 'user': 'fred',
  10610. * 'greet': function(greeting, punctuation) {
  10611. * return greeting + ' ' + this.user + punctuation;
  10612. * }
  10613. * };
  10614. *
  10615. * var bound = _.bindKey(object, 'greet', 'hi');
  10616. * bound('!');
  10617. * // => 'hi fred!'
  10618. *
  10619. * object.greet = function(greeting, punctuation) {
  10620. * return greeting + 'ya ' + this.user + punctuation;
  10621. * };
  10622. *
  10623. * bound('!');
  10624. * // => 'hiya fred!'
  10625. *
  10626. * // Bound with placeholders.
  10627. * var bound = _.bindKey(object, 'greet', _, '!');
  10628. * bound('hi');
  10629. * // => 'hiya fred!'
  10630. */
  10631. var bindKey = baseRest(function(object, key, partials) {
  10632. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10633. if (partials.length) {
  10634. var holders = replaceHolders(partials, getHolder(bindKey));
  10635. bitmask |= WRAP_PARTIAL_FLAG;
  10636. }
  10637. return createWrap(key, bitmask, object, partials, holders);
  10638. });
  10639. /**
  10640. * Creates a function that accepts arguments of `func` and either invokes
  10641. * `func` returning its result, if at least `arity` number of arguments have
  10642. * been provided, or returns a function that accepts the remaining `func`
  10643. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10644. * is not sufficient.
  10645. *
  10646. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10647. * may be used as a placeholder for provided arguments.
  10648. *
  10649. * **Note:** This method doesn't set the "length" property of curried functions.
  10650. *
  10651. * @static
  10652. * @memberOf _
  10653. * @since 2.0.0
  10654. * @category Function
  10655. * @param {Function} func The function to curry.
  10656. * @param {number} [arity=func.length] The arity of `func`.
  10657. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10658. * @returns {Function} Returns the new curried function.
  10659. * @example
  10660. *
  10661. * var abc = function(a, b, c) {
  10662. * return [a, b, c];
  10663. * };
  10664. *
  10665. * var curried = _.curry(abc);
  10666. *
  10667. * curried(1)(2)(3);
  10668. * // => [1, 2, 3]
  10669. *
  10670. * curried(1, 2)(3);
  10671. * // => [1, 2, 3]
  10672. *
  10673. * curried(1, 2, 3);
  10674. * // => [1, 2, 3]
  10675. *
  10676. * // Curried with placeholders.
  10677. * curried(1)(_, 3)(2);
  10678. * // => [1, 2, 3]
  10679. */
  10680. function curry(func, arity, guard) {
  10681. arity = guard ? undefined : arity;
  10682. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10683. result.placeholder = curry.placeholder;
  10684. return result;
  10685. }
  10686. /**
  10687. * This method is like `_.curry` except that arguments are applied to `func`
  10688. * in the manner of `_.partialRight` instead of `_.partial`.
  10689. *
  10690. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10691. * builds, may be used as a placeholder for provided arguments.
  10692. *
  10693. * **Note:** This method doesn't set the "length" property of curried functions.
  10694. *
  10695. * @static
  10696. * @memberOf _
  10697. * @since 3.0.0
  10698. * @category Function
  10699. * @param {Function} func The function to curry.
  10700. * @param {number} [arity=func.length] The arity of `func`.
  10701. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10702. * @returns {Function} Returns the new curried function.
  10703. * @example
  10704. *
  10705. * var abc = function(a, b, c) {
  10706. * return [a, b, c];
  10707. * };
  10708. *
  10709. * var curried = _.curryRight(abc);
  10710. *
  10711. * curried(3)(2)(1);
  10712. * // => [1, 2, 3]
  10713. *
  10714. * curried(2, 3)(1);
  10715. * // => [1, 2, 3]
  10716. *
  10717. * curried(1, 2, 3);
  10718. * // => [1, 2, 3]
  10719. *
  10720. * // Curried with placeholders.
  10721. * curried(3)(1, _)(2);
  10722. * // => [1, 2, 3]
  10723. */
  10724. function curryRight(func, arity, guard) {
  10725. arity = guard ? undefined : arity;
  10726. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10727. result.placeholder = curryRight.placeholder;
  10728. return result;
  10729. }
  10730. /**
  10731. * Creates a debounced function that delays invoking `func` until after `wait`
  10732. * milliseconds have elapsed since the last time the debounced function was
  10733. * invoked. The debounced function comes with a `cancel` method to cancel
  10734. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10735. * Provide `options` to indicate whether `func` should be invoked on the
  10736. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10737. * with the last arguments provided to the debounced function. Subsequent
  10738. * calls to the debounced function return the result of the last `func`
  10739. * invocation.
  10740. *
  10741. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10742. * invoked on the trailing edge of the timeout only if the debounced function
  10743. * is invoked more than once during the `wait` timeout.
  10744. *
  10745. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10746. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10747. *
  10748. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10749. * for details over the differences between `_.debounce` and `_.throttle`.
  10750. *
  10751. * @static
  10752. * @memberOf _
  10753. * @since 0.1.0
  10754. * @category Function
  10755. * @param {Function} func The function to debounce.
  10756. * @param {number} [wait=0] The number of milliseconds to delay.
  10757. * @param {Object} [options={}] The options object.
  10758. * @param {boolean} [options.leading=false]
  10759. * Specify invoking on the leading edge of the timeout.
  10760. * @param {number} [options.maxWait]
  10761. * The maximum time `func` is allowed to be delayed before it's invoked.
  10762. * @param {boolean} [options.trailing=true]
  10763. * Specify invoking on the trailing edge of the timeout.
  10764. * @returns {Function} Returns the new debounced function.
  10765. * @example
  10766. *
  10767. * // Avoid costly calculations while the window size is in flux.
  10768. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10769. *
  10770. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10771. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10772. * 'leading': true,
  10773. * 'trailing': false
  10774. * }));
  10775. *
  10776. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10777. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10778. * var source = new EventSource('/stream');
  10779. * jQuery(source).on('message', debounced);
  10780. *
  10781. * // Cancel the trailing debounced invocation.
  10782. * jQuery(window).on('popstate', debounced.cancel);
  10783. */
  10784. function debounce(func, wait, options) {
  10785. var lastArgs,
  10786. lastThis,
  10787. maxWait,
  10788. result,
  10789. timerId,
  10790. lastCallTime,
  10791. lastInvokeTime = 0,
  10792. leading = false,
  10793. maxing = false,
  10794. trailing = true;
  10795. if (typeof func != 'function') {
  10796. throw new TypeError(FUNC_ERROR_TEXT);
  10797. }
  10798. wait = toNumber(wait) || 0;
  10799. if (isObject(options)) {
  10800. leading = !!options.leading;
  10801. maxing = 'maxWait' in options;
  10802. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10803. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10804. }
  10805. function invokeFunc(time) {
  10806. var args = lastArgs,
  10807. thisArg = lastThis;
  10808. lastArgs = lastThis = undefined;
  10809. lastInvokeTime = time;
  10810. result = func.apply(thisArg, args);
  10811. return result;
  10812. }
  10813. function leadingEdge(time) {
  10814. // Reset any `maxWait` timer.
  10815. lastInvokeTime = time;
  10816. // Start the timer for the trailing edge.
  10817. timerId = setTimeout(timerExpired, wait);
  10818. // Invoke the leading edge.
  10819. return leading ? invokeFunc(time) : result;
  10820. }
  10821. function remainingWait(time) {
  10822. var timeSinceLastCall = time - lastCallTime,
  10823. timeSinceLastInvoke = time - lastInvokeTime,
  10824. timeWaiting = wait - timeSinceLastCall;
  10825. return maxing
  10826. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10827. : timeWaiting;
  10828. }
  10829. function shouldInvoke(time) {
  10830. var timeSinceLastCall = time - lastCallTime,
  10831. timeSinceLastInvoke = time - lastInvokeTime;
  10832. // Either this is the first call, activity has stopped and we're at the
  10833. // trailing edge, the system time has gone backwards and we're treating
  10834. // it as the trailing edge, or we've hit the `maxWait` limit.
  10835. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10836. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10837. }
  10838. function timerExpired() {
  10839. var time = now();
  10840. if (shouldInvoke(time)) {
  10841. return trailingEdge(time);
  10842. }
  10843. // Restart the timer.
  10844. timerId = setTimeout(timerExpired, remainingWait(time));
  10845. }
  10846. function trailingEdge(time) {
  10847. timerId = undefined;
  10848. // Only invoke if we have `lastArgs` which means `func` has been
  10849. // debounced at least once.
  10850. if (trailing && lastArgs) {
  10851. return invokeFunc(time);
  10852. }
  10853. lastArgs = lastThis = undefined;
  10854. return result;
  10855. }
  10856. function cancel() {
  10857. if (timerId !== undefined) {
  10858. clearTimeout(timerId);
  10859. }
  10860. lastInvokeTime = 0;
  10861. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10862. }
  10863. function flush() {
  10864. return timerId === undefined ? result : trailingEdge(now());
  10865. }
  10866. function debounced() {
  10867. var time = now(),
  10868. isInvoking = shouldInvoke(time);
  10869. lastArgs = arguments;
  10870. lastThis = this;
  10871. lastCallTime = time;
  10872. if (isInvoking) {
  10873. if (timerId === undefined) {
  10874. return leadingEdge(lastCallTime);
  10875. }
  10876. if (maxing) {
  10877. // Handle invocations in a tight loop.
  10878. clearTimeout(timerId);
  10879. timerId = setTimeout(timerExpired, wait);
  10880. return invokeFunc(lastCallTime);
  10881. }
  10882. }
  10883. if (timerId === undefined) {
  10884. timerId = setTimeout(timerExpired, wait);
  10885. }
  10886. return result;
  10887. }
  10888. debounced.cancel = cancel;
  10889. debounced.flush = flush;
  10890. return debounced;
  10891. }
  10892. /**
  10893. * Defers invoking the `func` until the current call stack has cleared. Any
  10894. * additional arguments are provided to `func` when it's invoked.
  10895. *
  10896. * @static
  10897. * @memberOf _
  10898. * @since 0.1.0
  10899. * @category Function
  10900. * @param {Function} func The function to defer.
  10901. * @param {...*} [args] The arguments to invoke `func` with.
  10902. * @returns {number} Returns the timer id.
  10903. * @example
  10904. *
  10905. * _.defer(function(text) {
  10906. * console.log(text);
  10907. * }, 'deferred');
  10908. * // => Logs 'deferred' after one millisecond.
  10909. */
  10910. var defer = baseRest(function(func, args) {
  10911. return baseDelay(func, 1, args);
  10912. });
  10913. /**
  10914. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10915. * provided to `func` when it's invoked.
  10916. *
  10917. * @static
  10918. * @memberOf _
  10919. * @since 0.1.0
  10920. * @category Function
  10921. * @param {Function} func The function to delay.
  10922. * @param {number} wait The number of milliseconds to delay invocation.
  10923. * @param {...*} [args] The arguments to invoke `func` with.
  10924. * @returns {number} Returns the timer id.
  10925. * @example
  10926. *
  10927. * _.delay(function(text) {
  10928. * console.log(text);
  10929. * }, 1000, 'later');
  10930. * // => Logs 'later' after one second.
  10931. */
  10932. var delay = baseRest(function(func, wait, args) {
  10933. return baseDelay(func, toNumber(wait) || 0, args);
  10934. });
  10935. /**
  10936. * Creates a function that invokes `func` with arguments reversed.
  10937. *
  10938. * @static
  10939. * @memberOf _
  10940. * @since 4.0.0
  10941. * @category Function
  10942. * @param {Function} func The function to flip arguments for.
  10943. * @returns {Function} Returns the new flipped function.
  10944. * @example
  10945. *
  10946. * var flipped = _.flip(function() {
  10947. * return _.toArray(arguments);
  10948. * });
  10949. *
  10950. * flipped('a', 'b', 'c', 'd');
  10951. * // => ['d', 'c', 'b', 'a']
  10952. */
  10953. function flip(func) {
  10954. return createWrap(func, WRAP_FLIP_FLAG);
  10955. }
  10956. /**
  10957. * Creates a function that memoizes the result of `func`. If `resolver` is
  10958. * provided, it determines the cache key for storing the result based on the
  10959. * arguments provided to the memoized function. By default, the first argument
  10960. * provided to the memoized function is used as the map cache key. The `func`
  10961. * is invoked with the `this` binding of the memoized function.
  10962. *
  10963. * **Note:** The cache is exposed as the `cache` property on the memoized
  10964. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10965. * constructor with one whose instances implement the
  10966. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10967. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10968. *
  10969. * @static
  10970. * @memberOf _
  10971. * @since 0.1.0
  10972. * @category Function
  10973. * @param {Function} func The function to have its output memoized.
  10974. * @param {Function} [resolver] The function to resolve the cache key.
  10975. * @returns {Function} Returns the new memoized function.
  10976. * @example
  10977. *
  10978. * var object = { 'a': 1, 'b': 2 };
  10979. * var other = { 'c': 3, 'd': 4 };
  10980. *
  10981. * var values = _.memoize(_.values);
  10982. * values(object);
  10983. * // => [1, 2]
  10984. *
  10985. * values(other);
  10986. * // => [3, 4]
  10987. *
  10988. * object.a = 2;
  10989. * values(object);
  10990. * // => [1, 2]
  10991. *
  10992. * // Modify the result cache.
  10993. * values.cache.set(object, ['a', 'b']);
  10994. * values(object);
  10995. * // => ['a', 'b']
  10996. *
  10997. * // Replace `_.memoize.Cache`.
  10998. * _.memoize.Cache = WeakMap;
  10999. */
  11000. function memoize(func, resolver) {
  11001. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11002. throw new TypeError(FUNC_ERROR_TEXT);
  11003. }
  11004. var memoized = function() {
  11005. var args = arguments,
  11006. key = resolver ? resolver.apply(this, args) : args[0],
  11007. cache = memoized.cache;
  11008. if (cache.has(key)) {
  11009. return cache.get(key);
  11010. }
  11011. var result = func.apply(this, args);
  11012. memoized.cache = cache.set(key, result) || cache;
  11013. return result;
  11014. };
  11015. memoized.cache = new (memoize.Cache || MapCache);
  11016. return memoized;
  11017. }
  11018. // Expose `MapCache`.
  11019. memoize.Cache = MapCache;
  11020. /**
  11021. * Creates a function that negates the result of the predicate `func`. The
  11022. * `func` predicate is invoked with the `this` binding and arguments of the
  11023. * created function.
  11024. *
  11025. * @static
  11026. * @memberOf _
  11027. * @since 3.0.0
  11028. * @category Function
  11029. * @param {Function} predicate The predicate to negate.
  11030. * @returns {Function} Returns the new negated function.
  11031. * @example
  11032. *
  11033. * function isEven(n) {
  11034. * return n % 2 == 0;
  11035. * }
  11036. *
  11037. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11038. * // => [1, 3, 5]
  11039. */
  11040. function negate(predicate) {
  11041. if (typeof predicate != 'function') {
  11042. throw new TypeError(FUNC_ERROR_TEXT);
  11043. }
  11044. return function() {
  11045. var args = arguments;
  11046. switch (args.length) {
  11047. case 0: return !predicate.call(this);
  11048. case 1: return !predicate.call(this, args[0]);
  11049. case 2: return !predicate.call(this, args[0], args[1]);
  11050. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11051. }
  11052. return !predicate.apply(this, args);
  11053. };
  11054. }
  11055. /**
  11056. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11057. * to the function return the value of the first invocation. The `func` is
  11058. * invoked with the `this` binding and arguments of the created function.
  11059. *
  11060. * @static
  11061. * @memberOf _
  11062. * @since 0.1.0
  11063. * @category Function
  11064. * @param {Function} func The function to restrict.
  11065. * @returns {Function} Returns the new restricted function.
  11066. * @example
  11067. *
  11068. * var initialize = _.once(createApplication);
  11069. * initialize();
  11070. * initialize();
  11071. * // => `createApplication` is invoked once
  11072. */
  11073. function once(func) {
  11074. return before(2, func);
  11075. }
  11076. /**
  11077. * Creates a function that invokes `func` with its arguments transformed.
  11078. *
  11079. * @static
  11080. * @since 4.0.0
  11081. * @memberOf _
  11082. * @category Function
  11083. * @param {Function} func The function to wrap.
  11084. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11085. * The argument transforms.
  11086. * @returns {Function} Returns the new function.
  11087. * @example
  11088. *
  11089. * function doubled(n) {
  11090. * return n * 2;
  11091. * }
  11092. *
  11093. * function square(n) {
  11094. * return n * n;
  11095. * }
  11096. *
  11097. * var func = _.overArgs(function(x, y) {
  11098. * return [x, y];
  11099. * }, [square, doubled]);
  11100. *
  11101. * func(9, 3);
  11102. * // => [81, 6]
  11103. *
  11104. * func(10, 5);
  11105. * // => [100, 10]
  11106. */
  11107. var overArgs = castRest(function(func, transforms) {
  11108. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11109. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11110. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11111. var funcsLength = transforms.length;
  11112. return baseRest(function(args) {
  11113. var index = -1,
  11114. length = nativeMin(args.length, funcsLength);
  11115. while (++index < length) {
  11116. args[index] = transforms[index].call(this, args[index]);
  11117. }
  11118. return apply(func, this, args);
  11119. });
  11120. });
  11121. /**
  11122. * Creates a function that invokes `func` with `partials` prepended to the
  11123. * arguments it receives. This method is like `_.bind` except it does **not**
  11124. * alter the `this` binding.
  11125. *
  11126. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11127. * builds, may be used as a placeholder for partially applied arguments.
  11128. *
  11129. * **Note:** This method doesn't set the "length" property of partially
  11130. * applied functions.
  11131. *
  11132. * @static
  11133. * @memberOf _
  11134. * @since 0.2.0
  11135. * @category Function
  11136. * @param {Function} func The function to partially apply arguments to.
  11137. * @param {...*} [partials] The arguments to be partially applied.
  11138. * @returns {Function} Returns the new partially applied function.
  11139. * @example
  11140. *
  11141. * function greet(greeting, name) {
  11142. * return greeting + ' ' + name;
  11143. * }
  11144. *
  11145. * var sayHelloTo = _.partial(greet, 'hello');
  11146. * sayHelloTo('fred');
  11147. * // => 'hello fred'
  11148. *
  11149. * // Partially applied with placeholders.
  11150. * var greetFred = _.partial(greet, _, 'fred');
  11151. * greetFred('hi');
  11152. * // => 'hi fred'
  11153. */
  11154. var partial = baseRest(function(func, partials) {
  11155. var holders = replaceHolders(partials, getHolder(partial));
  11156. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11157. });
  11158. /**
  11159. * This method is like `_.partial` except that partially applied arguments
  11160. * are appended to the arguments it receives.
  11161. *
  11162. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11163. * builds, may be used as a placeholder for partially applied arguments.
  11164. *
  11165. * **Note:** This method doesn't set the "length" property of partially
  11166. * applied functions.
  11167. *
  11168. * @static
  11169. * @memberOf _
  11170. * @since 1.0.0
  11171. * @category Function
  11172. * @param {Function} func The function to partially apply arguments to.
  11173. * @param {...*} [partials] The arguments to be partially applied.
  11174. * @returns {Function} Returns the new partially applied function.
  11175. * @example
  11176. *
  11177. * function greet(greeting, name) {
  11178. * return greeting + ' ' + name;
  11179. * }
  11180. *
  11181. * var greetFred = _.partialRight(greet, 'fred');
  11182. * greetFred('hi');
  11183. * // => 'hi fred'
  11184. *
  11185. * // Partially applied with placeholders.
  11186. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11187. * sayHelloTo('fred');
  11188. * // => 'hello fred'
  11189. */
  11190. var partialRight = baseRest(function(func, partials) {
  11191. var holders = replaceHolders(partials, getHolder(partialRight));
  11192. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11193. });
  11194. /**
  11195. * Creates a function that invokes `func` with arguments arranged according
  11196. * to the specified `indexes` where the argument value at the first index is
  11197. * provided as the first argument, the argument value at the second index is
  11198. * provided as the second argument, and so on.
  11199. *
  11200. * @static
  11201. * @memberOf _
  11202. * @since 3.0.0
  11203. * @category Function
  11204. * @param {Function} func The function to rearrange arguments for.
  11205. * @param {...(number|number[])} indexes The arranged argument indexes.
  11206. * @returns {Function} Returns the new function.
  11207. * @example
  11208. *
  11209. * var rearged = _.rearg(function(a, b, c) {
  11210. * return [a, b, c];
  11211. * }, [2, 0, 1]);
  11212. *
  11213. * rearged('b', 'c', 'a')
  11214. * // => ['a', 'b', 'c']
  11215. */
  11216. var rearg = flatRest(function(func, indexes) {
  11217. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11218. });
  11219. /**
  11220. * Creates a function that invokes `func` with the `this` binding of the
  11221. * created function and arguments from `start` and beyond provided as
  11222. * an array.
  11223. *
  11224. * **Note:** This method is based on the
  11225. * [rest parameter](https://mdn.io/rest_parameters).
  11226. *
  11227. * @static
  11228. * @memberOf _
  11229. * @since 4.0.0
  11230. * @category Function
  11231. * @param {Function} func The function to apply a rest parameter to.
  11232. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11233. * @returns {Function} Returns the new function.
  11234. * @example
  11235. *
  11236. * var say = _.rest(function(what, names) {
  11237. * return what + ' ' + _.initial(names).join(', ') +
  11238. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11239. * });
  11240. *
  11241. * say('hello', 'fred', 'barney', 'pebbles');
  11242. * // => 'hello fred, barney, & pebbles'
  11243. */
  11244. function rest(func, start) {
  11245. if (typeof func != 'function') {
  11246. throw new TypeError(FUNC_ERROR_TEXT);
  11247. }
  11248. start = start === undefined ? start : toInteger(start);
  11249. return baseRest(func, start);
  11250. }
  11251. /**
  11252. * Creates a function that invokes `func` with the `this` binding of the
  11253. * create function and an array of arguments much like
  11254. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11255. *
  11256. * **Note:** This method is based on the
  11257. * [spread operator](https://mdn.io/spread_operator).
  11258. *
  11259. * @static
  11260. * @memberOf _
  11261. * @since 3.2.0
  11262. * @category Function
  11263. * @param {Function} func The function to spread arguments over.
  11264. * @param {number} [start=0] The start position of the spread.
  11265. * @returns {Function} Returns the new function.
  11266. * @example
  11267. *
  11268. * var say = _.spread(function(who, what) {
  11269. * return who + ' says ' + what;
  11270. * });
  11271. *
  11272. * say(['fred', 'hello']);
  11273. * // => 'fred says hello'
  11274. *
  11275. * var numbers = Promise.all([
  11276. * Promise.resolve(40),
  11277. * Promise.resolve(36)
  11278. * ]);
  11279. *
  11280. * numbers.then(_.spread(function(x, y) {
  11281. * return x + y;
  11282. * }));
  11283. * // => a Promise of 76
  11284. */
  11285. function spread(func, start) {
  11286. if (typeof func != 'function') {
  11287. throw new TypeError(FUNC_ERROR_TEXT);
  11288. }
  11289. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11290. return baseRest(function(args) {
  11291. var array = args[start],
  11292. otherArgs = castSlice(args, 0, start);
  11293. if (array) {
  11294. arrayPush(otherArgs, array);
  11295. }
  11296. return apply(func, this, otherArgs);
  11297. });
  11298. }
  11299. /**
  11300. * Creates a throttled function that only invokes `func` at most once per
  11301. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11302. * method to cancel delayed `func` invocations and a `flush` method to
  11303. * immediately invoke them. Provide `options` to indicate whether `func`
  11304. * should be invoked on the leading and/or trailing edge of the `wait`
  11305. * timeout. The `func` is invoked with the last arguments provided to the
  11306. * throttled function. Subsequent calls to the throttled function return the
  11307. * result of the last `func` invocation.
  11308. *
  11309. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11310. * invoked on the trailing edge of the timeout only if the throttled function
  11311. * is invoked more than once during the `wait` timeout.
  11312. *
  11313. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11314. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11315. *
  11316. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11317. * for details over the differences between `_.throttle` and `_.debounce`.
  11318. *
  11319. * @static
  11320. * @memberOf _
  11321. * @since 0.1.0
  11322. * @category Function
  11323. * @param {Function} func The function to throttle.
  11324. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11325. * @param {Object} [options={}] The options object.
  11326. * @param {boolean} [options.leading=true]
  11327. * Specify invoking on the leading edge of the timeout.
  11328. * @param {boolean} [options.trailing=true]
  11329. * Specify invoking on the trailing edge of the timeout.
  11330. * @returns {Function} Returns the new throttled function.
  11331. * @example
  11332. *
  11333. * // Avoid excessively updating the position while scrolling.
  11334. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11335. *
  11336. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11337. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11338. * jQuery(element).on('click', throttled);
  11339. *
  11340. * // Cancel the trailing throttled invocation.
  11341. * jQuery(window).on('popstate', throttled.cancel);
  11342. */
  11343. function throttle(func, wait, options) {
  11344. var leading = true,
  11345. trailing = true;
  11346. if (typeof func != 'function') {
  11347. throw new TypeError(FUNC_ERROR_TEXT);
  11348. }
  11349. if (isObject(options)) {
  11350. leading = 'leading' in options ? !!options.leading : leading;
  11351. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11352. }
  11353. return debounce(func, wait, {
  11354. 'leading': leading,
  11355. 'maxWait': wait,
  11356. 'trailing': trailing
  11357. });
  11358. }
  11359. /**
  11360. * Creates a function that accepts up to one argument, ignoring any
  11361. * additional arguments.
  11362. *
  11363. * @static
  11364. * @memberOf _
  11365. * @since 4.0.0
  11366. * @category Function
  11367. * @param {Function} func The function to cap arguments for.
  11368. * @returns {Function} Returns the new capped function.
  11369. * @example
  11370. *
  11371. * _.map(['6', '8', '10'], _.unary(parseInt));
  11372. * // => [6, 8, 10]
  11373. */
  11374. function unary(func) {
  11375. return ary(func, 1);
  11376. }
  11377. /**
  11378. * Creates a function that provides `value` to `wrapper` as its first
  11379. * argument. Any additional arguments provided to the function are appended
  11380. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11381. * binding of the created function.
  11382. *
  11383. * @static
  11384. * @memberOf _
  11385. * @since 0.1.0
  11386. * @category Function
  11387. * @param {*} value The value to wrap.
  11388. * @param {Function} [wrapper=identity] The wrapper function.
  11389. * @returns {Function} Returns the new function.
  11390. * @example
  11391. *
  11392. * var p = _.wrap(_.escape, function(func, text) {
  11393. * return '<p>' + func(text) + '</p>';
  11394. * });
  11395. *
  11396. * p('fred, barney, & pebbles');
  11397. * // => '<p>fred, barney, &amp; pebbles</p>'
  11398. */
  11399. function wrap(value, wrapper) {
  11400. return partial(castFunction(wrapper), value);
  11401. }
  11402. /*------------------------------------------------------------------------*/
  11403. /**
  11404. * Casts `value` as an array if it's not one.
  11405. *
  11406. * @static
  11407. * @memberOf _
  11408. * @since 4.4.0
  11409. * @category Lang
  11410. * @param {*} value The value to inspect.
  11411. * @returns {Array} Returns the cast array.
  11412. * @example
  11413. *
  11414. * _.castArray(1);
  11415. * // => [1]
  11416. *
  11417. * _.castArray({ 'a': 1 });
  11418. * // => [{ 'a': 1 }]
  11419. *
  11420. * _.castArray('abc');
  11421. * // => ['abc']
  11422. *
  11423. * _.castArray(null);
  11424. * // => [null]
  11425. *
  11426. * _.castArray(undefined);
  11427. * // => [undefined]
  11428. *
  11429. * _.castArray();
  11430. * // => []
  11431. *
  11432. * var array = [1, 2, 3];
  11433. * console.log(_.castArray(array) === array);
  11434. * // => true
  11435. */
  11436. function castArray() {
  11437. if (!arguments.length) {
  11438. return [];
  11439. }
  11440. var value = arguments[0];
  11441. return isArray(value) ? value : [value];
  11442. }
  11443. /**
  11444. * Creates a shallow clone of `value`.
  11445. *
  11446. * **Note:** This method is loosely based on the
  11447. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11448. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11449. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11450. * arrays. The own enumerable properties of `arguments` objects are cloned
  11451. * as plain objects. An empty object is returned for uncloneable values such
  11452. * as error objects, functions, DOM nodes, and WeakMaps.
  11453. *
  11454. * @static
  11455. * @memberOf _
  11456. * @since 0.1.0
  11457. * @category Lang
  11458. * @param {*} value The value to clone.
  11459. * @returns {*} Returns the cloned value.
  11460. * @see _.cloneDeep
  11461. * @example
  11462. *
  11463. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11464. *
  11465. * var shallow = _.clone(objects);
  11466. * console.log(shallow[0] === objects[0]);
  11467. * // => true
  11468. */
  11469. function clone(value) {
  11470. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11471. }
  11472. /**
  11473. * This method is like `_.clone` except that it accepts `customizer` which
  11474. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11475. * cloning is handled by the method instead. The `customizer` is invoked with
  11476. * up to four arguments; (value [, index|key, object, stack]).
  11477. *
  11478. * @static
  11479. * @memberOf _
  11480. * @since 4.0.0
  11481. * @category Lang
  11482. * @param {*} value The value to clone.
  11483. * @param {Function} [customizer] The function to customize cloning.
  11484. * @returns {*} Returns the cloned value.
  11485. * @see _.cloneDeepWith
  11486. * @example
  11487. *
  11488. * function customizer(value) {
  11489. * if (_.isElement(value)) {
  11490. * return value.cloneNode(false);
  11491. * }
  11492. * }
  11493. *
  11494. * var el = _.cloneWith(document.body, customizer);
  11495. *
  11496. * console.log(el === document.body);
  11497. * // => false
  11498. * console.log(el.nodeName);
  11499. * // => 'BODY'
  11500. * console.log(el.childNodes.length);
  11501. * // => 0
  11502. */
  11503. function cloneWith(value, customizer) {
  11504. customizer = typeof customizer == 'function' ? customizer : undefined;
  11505. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11506. }
  11507. /**
  11508. * This method is like `_.clone` except that it recursively clones `value`.
  11509. *
  11510. * @static
  11511. * @memberOf _
  11512. * @since 1.0.0
  11513. * @category Lang
  11514. * @param {*} value The value to recursively clone.
  11515. * @returns {*} Returns the deep cloned value.
  11516. * @see _.clone
  11517. * @example
  11518. *
  11519. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11520. *
  11521. * var deep = _.cloneDeep(objects);
  11522. * console.log(deep[0] === objects[0]);
  11523. * // => false
  11524. */
  11525. function cloneDeep(value) {
  11526. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11527. }
  11528. /**
  11529. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11530. *
  11531. * @static
  11532. * @memberOf _
  11533. * @since 4.0.0
  11534. * @category Lang
  11535. * @param {*} value The value to recursively clone.
  11536. * @param {Function} [customizer] The function to customize cloning.
  11537. * @returns {*} Returns the deep cloned value.
  11538. * @see _.cloneWith
  11539. * @example
  11540. *
  11541. * function customizer(value) {
  11542. * if (_.isElement(value)) {
  11543. * return value.cloneNode(true);
  11544. * }
  11545. * }
  11546. *
  11547. * var el = _.cloneDeepWith(document.body, customizer);
  11548. *
  11549. * console.log(el === document.body);
  11550. * // => false
  11551. * console.log(el.nodeName);
  11552. * // => 'BODY'
  11553. * console.log(el.childNodes.length);
  11554. * // => 20
  11555. */
  11556. function cloneDeepWith(value, customizer) {
  11557. customizer = typeof customizer == 'function' ? customizer : undefined;
  11558. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11559. }
  11560. /**
  11561. * Checks if `object` conforms to `source` by invoking the predicate
  11562. * properties of `source` with the corresponding property values of `object`.
  11563. *
  11564. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11565. * partially applied.
  11566. *
  11567. * @static
  11568. * @memberOf _
  11569. * @since 4.14.0
  11570. * @category Lang
  11571. * @param {Object} object The object to inspect.
  11572. * @param {Object} source The object of property predicates to conform to.
  11573. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11574. * @example
  11575. *
  11576. * var object = { 'a': 1, 'b': 2 };
  11577. *
  11578. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11579. * // => true
  11580. *
  11581. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11582. * // => false
  11583. */
  11584. function conformsTo(object, source) {
  11585. return source == null || baseConformsTo(object, source, keys(source));
  11586. }
  11587. /**
  11588. * Performs a
  11589. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11590. * comparison between two values to determine if they are equivalent.
  11591. *
  11592. * @static
  11593. * @memberOf _
  11594. * @since 4.0.0
  11595. * @category Lang
  11596. * @param {*} value The value to compare.
  11597. * @param {*} other The other value to compare.
  11598. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11599. * @example
  11600. *
  11601. * var object = { 'a': 1 };
  11602. * var other = { 'a': 1 };
  11603. *
  11604. * _.eq(object, object);
  11605. * // => true
  11606. *
  11607. * _.eq(object, other);
  11608. * // => false
  11609. *
  11610. * _.eq('a', 'a');
  11611. * // => true
  11612. *
  11613. * _.eq('a', Object('a'));
  11614. * // => false
  11615. *
  11616. * _.eq(NaN, NaN);
  11617. * // => true
  11618. */
  11619. function eq(value, other) {
  11620. return value === other || (value !== value && other !== other);
  11621. }
  11622. /**
  11623. * Checks if `value` is greater than `other`.
  11624. *
  11625. * @static
  11626. * @memberOf _
  11627. * @since 3.9.0
  11628. * @category Lang
  11629. * @param {*} value The value to compare.
  11630. * @param {*} other The other value to compare.
  11631. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11632. * else `false`.
  11633. * @see _.lt
  11634. * @example
  11635. *
  11636. * _.gt(3, 1);
  11637. * // => true
  11638. *
  11639. * _.gt(3, 3);
  11640. * // => false
  11641. *
  11642. * _.gt(1, 3);
  11643. * // => false
  11644. */
  11645. var gt = createRelationalOperation(baseGt);
  11646. /**
  11647. * Checks if `value` is greater than or equal to `other`.
  11648. *
  11649. * @static
  11650. * @memberOf _
  11651. * @since 3.9.0
  11652. * @category Lang
  11653. * @param {*} value The value to compare.
  11654. * @param {*} other The other value to compare.
  11655. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11656. * `other`, else `false`.
  11657. * @see _.lte
  11658. * @example
  11659. *
  11660. * _.gte(3, 1);
  11661. * // => true
  11662. *
  11663. * _.gte(3, 3);
  11664. * // => true
  11665. *
  11666. * _.gte(1, 3);
  11667. * // => false
  11668. */
  11669. var gte = createRelationalOperation(function(value, other) {
  11670. return value >= other;
  11671. });
  11672. /**
  11673. * Checks if `value` is likely an `arguments` object.
  11674. *
  11675. * @static
  11676. * @memberOf _
  11677. * @since 0.1.0
  11678. * @category Lang
  11679. * @param {*} value The value to check.
  11680. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11681. * else `false`.
  11682. * @example
  11683. *
  11684. * _.isArguments(function() { return arguments; }());
  11685. * // => true
  11686. *
  11687. * _.isArguments([1, 2, 3]);
  11688. * // => false
  11689. */
  11690. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11691. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11692. !propertyIsEnumerable.call(value, 'callee');
  11693. };
  11694. /**
  11695. * Checks if `value` is classified as an `Array` object.
  11696. *
  11697. * @static
  11698. * @memberOf _
  11699. * @since 0.1.0
  11700. * @category Lang
  11701. * @param {*} value The value to check.
  11702. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11703. * @example
  11704. *
  11705. * _.isArray([1, 2, 3]);
  11706. * // => true
  11707. *
  11708. * _.isArray(document.body.children);
  11709. * // => false
  11710. *
  11711. * _.isArray('abc');
  11712. * // => false
  11713. *
  11714. * _.isArray(_.noop);
  11715. * // => false
  11716. */
  11717. var isArray = Array.isArray;
  11718. /**
  11719. * Checks if `value` is classified as an `ArrayBuffer` object.
  11720. *
  11721. * @static
  11722. * @memberOf _
  11723. * @since 4.3.0
  11724. * @category Lang
  11725. * @param {*} value The value to check.
  11726. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11727. * @example
  11728. *
  11729. * _.isArrayBuffer(new ArrayBuffer(2));
  11730. * // => true
  11731. *
  11732. * _.isArrayBuffer(new Array(2));
  11733. * // => false
  11734. */
  11735. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11736. /**
  11737. * Checks if `value` is array-like. A value is considered array-like if it's
  11738. * not a function and has a `value.length` that's an integer greater than or
  11739. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11740. *
  11741. * @static
  11742. * @memberOf _
  11743. * @since 4.0.0
  11744. * @category Lang
  11745. * @param {*} value The value to check.
  11746. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11747. * @example
  11748. *
  11749. * _.isArrayLike([1, 2, 3]);
  11750. * // => true
  11751. *
  11752. * _.isArrayLike(document.body.children);
  11753. * // => true
  11754. *
  11755. * _.isArrayLike('abc');
  11756. * // => true
  11757. *
  11758. * _.isArrayLike(_.noop);
  11759. * // => false
  11760. */
  11761. function isArrayLike(value) {
  11762. return value != null && isLength(value.length) && !isFunction(value);
  11763. }
  11764. /**
  11765. * This method is like `_.isArrayLike` except that it also checks if `value`
  11766. * is an object.
  11767. *
  11768. * @static
  11769. * @memberOf _
  11770. * @since 4.0.0
  11771. * @category Lang
  11772. * @param {*} value The value to check.
  11773. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11774. * else `false`.
  11775. * @example
  11776. *
  11777. * _.isArrayLikeObject([1, 2, 3]);
  11778. * // => true
  11779. *
  11780. * _.isArrayLikeObject(document.body.children);
  11781. * // => true
  11782. *
  11783. * _.isArrayLikeObject('abc');
  11784. * // => false
  11785. *
  11786. * _.isArrayLikeObject(_.noop);
  11787. * // => false
  11788. */
  11789. function isArrayLikeObject(value) {
  11790. return isObjectLike(value) && isArrayLike(value);
  11791. }
  11792. /**
  11793. * Checks if `value` is classified as a boolean primitive or object.
  11794. *
  11795. * @static
  11796. * @memberOf _
  11797. * @since 0.1.0
  11798. * @category Lang
  11799. * @param {*} value The value to check.
  11800. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11801. * @example
  11802. *
  11803. * _.isBoolean(false);
  11804. * // => true
  11805. *
  11806. * _.isBoolean(null);
  11807. * // => false
  11808. */
  11809. function isBoolean(value) {
  11810. return value === true || value === false ||
  11811. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11812. }
  11813. /**
  11814. * Checks if `value` is a buffer.
  11815. *
  11816. * @static
  11817. * @memberOf _
  11818. * @since 4.3.0
  11819. * @category Lang
  11820. * @param {*} value The value to check.
  11821. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11822. * @example
  11823. *
  11824. * _.isBuffer(new Buffer(2));
  11825. * // => true
  11826. *
  11827. * _.isBuffer(new Uint8Array(2));
  11828. * // => false
  11829. */
  11830. var isBuffer = nativeIsBuffer || stubFalse;
  11831. /**
  11832. * Checks if `value` is classified as a `Date` object.
  11833. *
  11834. * @static
  11835. * @memberOf _
  11836. * @since 0.1.0
  11837. * @category Lang
  11838. * @param {*} value The value to check.
  11839. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11840. * @example
  11841. *
  11842. * _.isDate(new Date);
  11843. * // => true
  11844. *
  11845. * _.isDate('Mon April 23 2012');
  11846. * // => false
  11847. */
  11848. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11849. /**
  11850. * Checks if `value` is likely a DOM element.
  11851. *
  11852. * @static
  11853. * @memberOf _
  11854. * @since 0.1.0
  11855. * @category Lang
  11856. * @param {*} value The value to check.
  11857. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11858. * @example
  11859. *
  11860. * _.isElement(document.body);
  11861. * // => true
  11862. *
  11863. * _.isElement('<body>');
  11864. * // => false
  11865. */
  11866. function isElement(value) {
  11867. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11868. }
  11869. /**
  11870. * Checks if `value` is an empty object, collection, map, or set.
  11871. *
  11872. * Objects are considered empty if they have no own enumerable string keyed
  11873. * properties.
  11874. *
  11875. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11876. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11877. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11878. *
  11879. * @static
  11880. * @memberOf _
  11881. * @since 0.1.0
  11882. * @category Lang
  11883. * @param {*} value The value to check.
  11884. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11885. * @example
  11886. *
  11887. * _.isEmpty(null);
  11888. * // => true
  11889. *
  11890. * _.isEmpty(true);
  11891. * // => true
  11892. *
  11893. * _.isEmpty(1);
  11894. * // => true
  11895. *
  11896. * _.isEmpty([1, 2, 3]);
  11897. * // => false
  11898. *
  11899. * _.isEmpty({ 'a': 1 });
  11900. * // => false
  11901. */
  11902. function isEmpty(value) {
  11903. if (value == null) {
  11904. return true;
  11905. }
  11906. if (isArrayLike(value) &&
  11907. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11908. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11909. return !value.length;
  11910. }
  11911. var tag = getTag(value);
  11912. if (tag == mapTag || tag == setTag) {
  11913. return !value.size;
  11914. }
  11915. if (isPrototype(value)) {
  11916. return !baseKeys(value).length;
  11917. }
  11918. for (var key in value) {
  11919. if (hasOwnProperty.call(value, key)) {
  11920. return false;
  11921. }
  11922. }
  11923. return true;
  11924. }
  11925. /**
  11926. * Performs a deep comparison between two values to determine if they are
  11927. * equivalent.
  11928. *
  11929. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11930. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11931. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11932. * by their own, not inherited, enumerable properties. Functions and DOM
  11933. * nodes are compared by strict equality, i.e. `===`.
  11934. *
  11935. * @static
  11936. * @memberOf _
  11937. * @since 0.1.0
  11938. * @category Lang
  11939. * @param {*} value The value to compare.
  11940. * @param {*} other The other value to compare.
  11941. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11942. * @example
  11943. *
  11944. * var object = { 'a': 1 };
  11945. * var other = { 'a': 1 };
  11946. *
  11947. * _.isEqual(object, other);
  11948. * // => true
  11949. *
  11950. * object === other;
  11951. * // => false
  11952. */
  11953. function isEqual(value, other) {
  11954. return baseIsEqual(value, other);
  11955. }
  11956. /**
  11957. * This method is like `_.isEqual` except that it accepts `customizer` which
  11958. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11959. * are handled by the method instead. The `customizer` is invoked with up to
  11960. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11961. *
  11962. * @static
  11963. * @memberOf _
  11964. * @since 4.0.0
  11965. * @category Lang
  11966. * @param {*} value The value to compare.
  11967. * @param {*} other The other value to compare.
  11968. * @param {Function} [customizer] The function to customize comparisons.
  11969. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11970. * @example
  11971. *
  11972. * function isGreeting(value) {
  11973. * return /^h(?:i|ello)$/.test(value);
  11974. * }
  11975. *
  11976. * function customizer(objValue, othValue) {
  11977. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11978. * return true;
  11979. * }
  11980. * }
  11981. *
  11982. * var array = ['hello', 'goodbye'];
  11983. * var other = ['hi', 'goodbye'];
  11984. *
  11985. * _.isEqualWith(array, other, customizer);
  11986. * // => true
  11987. */
  11988. function isEqualWith(value, other, customizer) {
  11989. customizer = typeof customizer == 'function' ? customizer : undefined;
  11990. var result = customizer ? customizer(value, other) : undefined;
  11991. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11992. }
  11993. /**
  11994. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11995. * `SyntaxError`, `TypeError`, or `URIError` object.
  11996. *
  11997. * @static
  11998. * @memberOf _
  11999. * @since 3.0.0
  12000. * @category Lang
  12001. * @param {*} value The value to check.
  12002. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12003. * @example
  12004. *
  12005. * _.isError(new Error);
  12006. * // => true
  12007. *
  12008. * _.isError(Error);
  12009. * // => false
  12010. */
  12011. function isError(value) {
  12012. if (!isObjectLike(value)) {
  12013. return false;
  12014. }
  12015. var tag = baseGetTag(value);
  12016. return tag == errorTag || tag == domExcTag ||
  12017. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12018. }
  12019. /**
  12020. * Checks if `value` is a finite primitive number.
  12021. *
  12022. * **Note:** This method is based on
  12023. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12024. *
  12025. * @static
  12026. * @memberOf _
  12027. * @since 0.1.0
  12028. * @category Lang
  12029. * @param {*} value The value to check.
  12030. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12031. * @example
  12032. *
  12033. * _.isFinite(3);
  12034. * // => true
  12035. *
  12036. * _.isFinite(Number.MIN_VALUE);
  12037. * // => true
  12038. *
  12039. * _.isFinite(Infinity);
  12040. * // => false
  12041. *
  12042. * _.isFinite('3');
  12043. * // => false
  12044. */
  12045. function isFinite(value) {
  12046. return typeof value == 'number' && nativeIsFinite(value);
  12047. }
  12048. /**
  12049. * Checks if `value` is classified as a `Function` object.
  12050. *
  12051. * @static
  12052. * @memberOf _
  12053. * @since 0.1.0
  12054. * @category Lang
  12055. * @param {*} value The value to check.
  12056. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12057. * @example
  12058. *
  12059. * _.isFunction(_);
  12060. * // => true
  12061. *
  12062. * _.isFunction(/abc/);
  12063. * // => false
  12064. */
  12065. function isFunction(value) {
  12066. if (!isObject(value)) {
  12067. return false;
  12068. }
  12069. // The use of `Object#toString` avoids issues with the `typeof` operator
  12070. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12071. var tag = baseGetTag(value);
  12072. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12073. }
  12074. /**
  12075. * Checks if `value` is an integer.
  12076. *
  12077. * **Note:** This method is based on
  12078. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12079. *
  12080. * @static
  12081. * @memberOf _
  12082. * @since 4.0.0
  12083. * @category Lang
  12084. * @param {*} value The value to check.
  12085. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12086. * @example
  12087. *
  12088. * _.isInteger(3);
  12089. * // => true
  12090. *
  12091. * _.isInteger(Number.MIN_VALUE);
  12092. * // => false
  12093. *
  12094. * _.isInteger(Infinity);
  12095. * // => false
  12096. *
  12097. * _.isInteger('3');
  12098. * // => false
  12099. */
  12100. function isInteger(value) {
  12101. return typeof value == 'number' && value == toInteger(value);
  12102. }
  12103. /**
  12104. * Checks if `value` is a valid array-like length.
  12105. *
  12106. * **Note:** This method is loosely based on
  12107. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12108. *
  12109. * @static
  12110. * @memberOf _
  12111. * @since 4.0.0
  12112. * @category Lang
  12113. * @param {*} value The value to check.
  12114. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12115. * @example
  12116. *
  12117. * _.isLength(3);
  12118. * // => true
  12119. *
  12120. * _.isLength(Number.MIN_VALUE);
  12121. * // => false
  12122. *
  12123. * _.isLength(Infinity);
  12124. * // => false
  12125. *
  12126. * _.isLength('3');
  12127. * // => false
  12128. */
  12129. function isLength(value) {
  12130. return typeof value == 'number' &&
  12131. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12132. }
  12133. /**
  12134. * Checks if `value` is the
  12135. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12136. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12137. *
  12138. * @static
  12139. * @memberOf _
  12140. * @since 0.1.0
  12141. * @category Lang
  12142. * @param {*} value The value to check.
  12143. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12144. * @example
  12145. *
  12146. * _.isObject({});
  12147. * // => true
  12148. *
  12149. * _.isObject([1, 2, 3]);
  12150. * // => true
  12151. *
  12152. * _.isObject(_.noop);
  12153. * // => true
  12154. *
  12155. * _.isObject(null);
  12156. * // => false
  12157. */
  12158. function isObject(value) {
  12159. var type = typeof value;
  12160. return value != null && (type == 'object' || type == 'function');
  12161. }
  12162. /**
  12163. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12164. * and has a `typeof` result of "object".
  12165. *
  12166. * @static
  12167. * @memberOf _
  12168. * @since 4.0.0
  12169. * @category Lang
  12170. * @param {*} value The value to check.
  12171. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12172. * @example
  12173. *
  12174. * _.isObjectLike({});
  12175. * // => true
  12176. *
  12177. * _.isObjectLike([1, 2, 3]);
  12178. * // => true
  12179. *
  12180. * _.isObjectLike(_.noop);
  12181. * // => false
  12182. *
  12183. * _.isObjectLike(null);
  12184. * // => false
  12185. */
  12186. function isObjectLike(value) {
  12187. return value != null && typeof value == 'object';
  12188. }
  12189. /**
  12190. * Checks if `value` is classified as a `Map` object.
  12191. *
  12192. * @static
  12193. * @memberOf _
  12194. * @since 4.3.0
  12195. * @category Lang
  12196. * @param {*} value The value to check.
  12197. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12198. * @example
  12199. *
  12200. * _.isMap(new Map);
  12201. * // => true
  12202. *
  12203. * _.isMap(new WeakMap);
  12204. * // => false
  12205. */
  12206. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12207. /**
  12208. * Performs a partial deep comparison between `object` and `source` to
  12209. * determine if `object` contains equivalent property values.
  12210. *
  12211. * **Note:** This method is equivalent to `_.matches` when `source` is
  12212. * partially applied.
  12213. *
  12214. * Partial comparisons will match empty array and empty object `source`
  12215. * values against any array or object value, respectively. See `_.isEqual`
  12216. * for a list of supported value comparisons.
  12217. *
  12218. * @static
  12219. * @memberOf _
  12220. * @since 3.0.0
  12221. * @category Lang
  12222. * @param {Object} object The object to inspect.
  12223. * @param {Object} source The object of property values to match.
  12224. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12225. * @example
  12226. *
  12227. * var object = { 'a': 1, 'b': 2 };
  12228. *
  12229. * _.isMatch(object, { 'b': 2 });
  12230. * // => true
  12231. *
  12232. * _.isMatch(object, { 'b': 1 });
  12233. * // => false
  12234. */
  12235. function isMatch(object, source) {
  12236. return object === source || baseIsMatch(object, source, getMatchData(source));
  12237. }
  12238. /**
  12239. * This method is like `_.isMatch` except that it accepts `customizer` which
  12240. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12241. * are handled by the method instead. The `customizer` is invoked with five
  12242. * arguments: (objValue, srcValue, index|key, object, source).
  12243. *
  12244. * @static
  12245. * @memberOf _
  12246. * @since 4.0.0
  12247. * @category Lang
  12248. * @param {Object} object The object to inspect.
  12249. * @param {Object} source The object of property values to match.
  12250. * @param {Function} [customizer] The function to customize comparisons.
  12251. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12252. * @example
  12253. *
  12254. * function isGreeting(value) {
  12255. * return /^h(?:i|ello)$/.test(value);
  12256. * }
  12257. *
  12258. * function customizer(objValue, srcValue) {
  12259. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12260. * return true;
  12261. * }
  12262. * }
  12263. *
  12264. * var object = { 'greeting': 'hello' };
  12265. * var source = { 'greeting': 'hi' };
  12266. *
  12267. * _.isMatchWith(object, source, customizer);
  12268. * // => true
  12269. */
  12270. function isMatchWith(object, source, customizer) {
  12271. customizer = typeof customizer == 'function' ? customizer : undefined;
  12272. return baseIsMatch(object, source, getMatchData(source), customizer);
  12273. }
  12274. /**
  12275. * Checks if `value` is `NaN`.
  12276. *
  12277. * **Note:** This method is based on
  12278. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12279. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12280. * `undefined` and other non-number values.
  12281. *
  12282. * @static
  12283. * @memberOf _
  12284. * @since 0.1.0
  12285. * @category Lang
  12286. * @param {*} value The value to check.
  12287. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12288. * @example
  12289. *
  12290. * _.isNaN(NaN);
  12291. * // => true
  12292. *
  12293. * _.isNaN(new Number(NaN));
  12294. * // => true
  12295. *
  12296. * isNaN(undefined);
  12297. * // => true
  12298. *
  12299. * _.isNaN(undefined);
  12300. * // => false
  12301. */
  12302. function isNaN(value) {
  12303. // An `NaN` primitive is the only value that is not equal to itself.
  12304. // Perform the `toStringTag` check first to avoid errors with some
  12305. // ActiveX objects in IE.
  12306. return isNumber(value) && value != +value;
  12307. }
  12308. /**
  12309. * Checks if `value` is a pristine native function.
  12310. *
  12311. * **Note:** This method can't reliably detect native functions in the presence
  12312. * of the core-js package because core-js circumvents this kind of detection.
  12313. * Despite multiple requests, the core-js maintainer has made it clear: any
  12314. * attempt to fix the detection will be obstructed. As a result, we're left
  12315. * with little choice but to throw an error. Unfortunately, this also affects
  12316. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12317. * which rely on core-js.
  12318. *
  12319. * @static
  12320. * @memberOf _
  12321. * @since 3.0.0
  12322. * @category Lang
  12323. * @param {*} value The value to check.
  12324. * @returns {boolean} Returns `true` if `value` is a native function,
  12325. * else `false`.
  12326. * @example
  12327. *
  12328. * _.isNative(Array.prototype.push);
  12329. * // => true
  12330. *
  12331. * _.isNative(_);
  12332. * // => false
  12333. */
  12334. function isNative(value) {
  12335. if (isMaskable(value)) {
  12336. throw new Error(CORE_ERROR_TEXT);
  12337. }
  12338. return baseIsNative(value);
  12339. }
  12340. /**
  12341. * Checks if `value` is `null`.
  12342. *
  12343. * @static
  12344. * @memberOf _
  12345. * @since 0.1.0
  12346. * @category Lang
  12347. * @param {*} value The value to check.
  12348. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12349. * @example
  12350. *
  12351. * _.isNull(null);
  12352. * // => true
  12353. *
  12354. * _.isNull(void 0);
  12355. * // => false
  12356. */
  12357. function isNull(value) {
  12358. return value === null;
  12359. }
  12360. /**
  12361. * Checks if `value` is `null` or `undefined`.
  12362. *
  12363. * @static
  12364. * @memberOf _
  12365. * @since 4.0.0
  12366. * @category Lang
  12367. * @param {*} value The value to check.
  12368. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12369. * @example
  12370. *
  12371. * _.isNil(null);
  12372. * // => true
  12373. *
  12374. * _.isNil(void 0);
  12375. * // => true
  12376. *
  12377. * _.isNil(NaN);
  12378. * // => false
  12379. */
  12380. function isNil(value) {
  12381. return value == null;
  12382. }
  12383. /**
  12384. * Checks if `value` is classified as a `Number` primitive or object.
  12385. *
  12386. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12387. * classified as numbers, use the `_.isFinite` method.
  12388. *
  12389. * @static
  12390. * @memberOf _
  12391. * @since 0.1.0
  12392. * @category Lang
  12393. * @param {*} value The value to check.
  12394. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12395. * @example
  12396. *
  12397. * _.isNumber(3);
  12398. * // => true
  12399. *
  12400. * _.isNumber(Number.MIN_VALUE);
  12401. * // => true
  12402. *
  12403. * _.isNumber(Infinity);
  12404. * // => true
  12405. *
  12406. * _.isNumber('3');
  12407. * // => false
  12408. */
  12409. function isNumber(value) {
  12410. return typeof value == 'number' ||
  12411. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12412. }
  12413. /**
  12414. * Checks if `value` is a plain object, that is, an object created by the
  12415. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12416. *
  12417. * @static
  12418. * @memberOf _
  12419. * @since 0.8.0
  12420. * @category Lang
  12421. * @param {*} value The value to check.
  12422. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12423. * @example
  12424. *
  12425. * function Foo() {
  12426. * this.a = 1;
  12427. * }
  12428. *
  12429. * _.isPlainObject(new Foo);
  12430. * // => false
  12431. *
  12432. * _.isPlainObject([1, 2, 3]);
  12433. * // => false
  12434. *
  12435. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12436. * // => true
  12437. *
  12438. * _.isPlainObject(Object.create(null));
  12439. * // => true
  12440. */
  12441. function isPlainObject(value) {
  12442. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12443. return false;
  12444. }
  12445. var proto = getPrototype(value);
  12446. if (proto === null) {
  12447. return true;
  12448. }
  12449. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12450. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12451. funcToString.call(Ctor) == objectCtorString;
  12452. }
  12453. /**
  12454. * Checks if `value` is classified as a `RegExp` object.
  12455. *
  12456. * @static
  12457. * @memberOf _
  12458. * @since 0.1.0
  12459. * @category Lang
  12460. * @param {*} value The value to check.
  12461. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12462. * @example
  12463. *
  12464. * _.isRegExp(/abc/);
  12465. * // => true
  12466. *
  12467. * _.isRegExp('/abc/');
  12468. * // => false
  12469. */
  12470. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12471. /**
  12472. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12473. * double precision number which isn't the result of a rounded unsafe integer.
  12474. *
  12475. * **Note:** This method is based on
  12476. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12477. *
  12478. * @static
  12479. * @memberOf _
  12480. * @since 4.0.0
  12481. * @category Lang
  12482. * @param {*} value The value to check.
  12483. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12484. * @example
  12485. *
  12486. * _.isSafeInteger(3);
  12487. * // => true
  12488. *
  12489. * _.isSafeInteger(Number.MIN_VALUE);
  12490. * // => false
  12491. *
  12492. * _.isSafeInteger(Infinity);
  12493. * // => false
  12494. *
  12495. * _.isSafeInteger('3');
  12496. * // => false
  12497. */
  12498. function isSafeInteger(value) {
  12499. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12500. }
  12501. /**
  12502. * Checks if `value` is classified as a `Set` object.
  12503. *
  12504. * @static
  12505. * @memberOf _
  12506. * @since 4.3.0
  12507. * @category Lang
  12508. * @param {*} value The value to check.
  12509. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12510. * @example
  12511. *
  12512. * _.isSet(new Set);
  12513. * // => true
  12514. *
  12515. * _.isSet(new WeakSet);
  12516. * // => false
  12517. */
  12518. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12519. /**
  12520. * Checks if `value` is classified as a `String` primitive or object.
  12521. *
  12522. * @static
  12523. * @since 0.1.0
  12524. * @memberOf _
  12525. * @category Lang
  12526. * @param {*} value The value to check.
  12527. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12528. * @example
  12529. *
  12530. * _.isString('abc');
  12531. * // => true
  12532. *
  12533. * _.isString(1);
  12534. * // => false
  12535. */
  12536. function isString(value) {
  12537. return typeof value == 'string' ||
  12538. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12539. }
  12540. /**
  12541. * Checks if `value` is classified as a `Symbol` primitive or object.
  12542. *
  12543. * @static
  12544. * @memberOf _
  12545. * @since 4.0.0
  12546. * @category Lang
  12547. * @param {*} value The value to check.
  12548. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12549. * @example
  12550. *
  12551. * _.isSymbol(Symbol.iterator);
  12552. * // => true
  12553. *
  12554. * _.isSymbol('abc');
  12555. * // => false
  12556. */
  12557. function isSymbol(value) {
  12558. return typeof value == 'symbol' ||
  12559. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12560. }
  12561. /**
  12562. * Checks if `value` is classified as a typed array.
  12563. *
  12564. * @static
  12565. * @memberOf _
  12566. * @since 3.0.0
  12567. * @category Lang
  12568. * @param {*} value The value to check.
  12569. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12570. * @example
  12571. *
  12572. * _.isTypedArray(new Uint8Array);
  12573. * // => true
  12574. *
  12575. * _.isTypedArray([]);
  12576. * // => false
  12577. */
  12578. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12579. /**
  12580. * Checks if `value` is `undefined`.
  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 `undefined`, else `false`.
  12588. * @example
  12589. *
  12590. * _.isUndefined(void 0);
  12591. * // => true
  12592. *
  12593. * _.isUndefined(null);
  12594. * // => false
  12595. */
  12596. function isUndefined(value) {
  12597. return value === undefined;
  12598. }
  12599. /**
  12600. * Checks if `value` is classified as a `WeakMap` object.
  12601. *
  12602. * @static
  12603. * @memberOf _
  12604. * @since 4.3.0
  12605. * @category Lang
  12606. * @param {*} value The value to check.
  12607. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12608. * @example
  12609. *
  12610. * _.isWeakMap(new WeakMap);
  12611. * // => true
  12612. *
  12613. * _.isWeakMap(new Map);
  12614. * // => false
  12615. */
  12616. function isWeakMap(value) {
  12617. return isObjectLike(value) && getTag(value) == weakMapTag;
  12618. }
  12619. /**
  12620. * Checks if `value` is classified as a `WeakSet` object.
  12621. *
  12622. * @static
  12623. * @memberOf _
  12624. * @since 4.3.0
  12625. * @category Lang
  12626. * @param {*} value The value to check.
  12627. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12628. * @example
  12629. *
  12630. * _.isWeakSet(new WeakSet);
  12631. * // => true
  12632. *
  12633. * _.isWeakSet(new Set);
  12634. * // => false
  12635. */
  12636. function isWeakSet(value) {
  12637. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12638. }
  12639. /**
  12640. * Checks if `value` is less than `other`.
  12641. *
  12642. * @static
  12643. * @memberOf _
  12644. * @since 3.9.0
  12645. * @category Lang
  12646. * @param {*} value The value to compare.
  12647. * @param {*} other The other value to compare.
  12648. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12649. * else `false`.
  12650. * @see _.gt
  12651. * @example
  12652. *
  12653. * _.lt(1, 3);
  12654. * // => true
  12655. *
  12656. * _.lt(3, 3);
  12657. * // => false
  12658. *
  12659. * _.lt(3, 1);
  12660. * // => false
  12661. */
  12662. var lt = createRelationalOperation(baseLt);
  12663. /**
  12664. * Checks if `value` is less than or equal to `other`.
  12665. *
  12666. * @static
  12667. * @memberOf _
  12668. * @since 3.9.0
  12669. * @category Lang
  12670. * @param {*} value The value to compare.
  12671. * @param {*} other The other value to compare.
  12672. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12673. * `other`, else `false`.
  12674. * @see _.gte
  12675. * @example
  12676. *
  12677. * _.lte(1, 3);
  12678. * // => true
  12679. *
  12680. * _.lte(3, 3);
  12681. * // => true
  12682. *
  12683. * _.lte(3, 1);
  12684. * // => false
  12685. */
  12686. var lte = createRelationalOperation(function(value, other) {
  12687. return value <= other;
  12688. });
  12689. /**
  12690. * Converts `value` to an array.
  12691. *
  12692. * @static
  12693. * @since 0.1.0
  12694. * @memberOf _
  12695. * @category Lang
  12696. * @param {*} value The value to convert.
  12697. * @returns {Array} Returns the converted array.
  12698. * @example
  12699. *
  12700. * _.toArray({ 'a': 1, 'b': 2 });
  12701. * // => [1, 2]
  12702. *
  12703. * _.toArray('abc');
  12704. * // => ['a', 'b', 'c']
  12705. *
  12706. * _.toArray(1);
  12707. * // => []
  12708. *
  12709. * _.toArray(null);
  12710. * // => []
  12711. */
  12712. function toArray(value) {
  12713. if (!value) {
  12714. return [];
  12715. }
  12716. if (isArrayLike(value)) {
  12717. return isString(value) ? stringToArray(value) : copyArray(value);
  12718. }
  12719. if (symIterator && value[symIterator]) {
  12720. return iteratorToArray(value[symIterator]());
  12721. }
  12722. var tag = getTag(value),
  12723. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12724. return func(value);
  12725. }
  12726. /**
  12727. * Converts `value` to a finite number.
  12728. *
  12729. * @static
  12730. * @memberOf _
  12731. * @since 4.12.0
  12732. * @category Lang
  12733. * @param {*} value The value to convert.
  12734. * @returns {number} Returns the converted number.
  12735. * @example
  12736. *
  12737. * _.toFinite(3.2);
  12738. * // => 3.2
  12739. *
  12740. * _.toFinite(Number.MIN_VALUE);
  12741. * // => 5e-324
  12742. *
  12743. * _.toFinite(Infinity);
  12744. * // => 1.7976931348623157e+308
  12745. *
  12746. * _.toFinite('3.2');
  12747. * // => 3.2
  12748. */
  12749. function toFinite(value) {
  12750. if (!value) {
  12751. return value === 0 ? value : 0;
  12752. }
  12753. value = toNumber(value);
  12754. if (value === INFINITY || value === -INFINITY) {
  12755. var sign = (value < 0 ? -1 : 1);
  12756. return sign * MAX_INTEGER;
  12757. }
  12758. return value === value ? value : 0;
  12759. }
  12760. /**
  12761. * Converts `value` to an integer.
  12762. *
  12763. * **Note:** This method is loosely based on
  12764. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12765. *
  12766. * @static
  12767. * @memberOf _
  12768. * @since 4.0.0
  12769. * @category Lang
  12770. * @param {*} value The value to convert.
  12771. * @returns {number} Returns the converted integer.
  12772. * @example
  12773. *
  12774. * _.toInteger(3.2);
  12775. * // => 3
  12776. *
  12777. * _.toInteger(Number.MIN_VALUE);
  12778. * // => 0
  12779. *
  12780. * _.toInteger(Infinity);
  12781. * // => 1.7976931348623157e+308
  12782. *
  12783. * _.toInteger('3.2');
  12784. * // => 3
  12785. */
  12786. function toInteger(value) {
  12787. var result = toFinite(value),
  12788. remainder = result % 1;
  12789. return result === result ? (remainder ? result - remainder : result) : 0;
  12790. }
  12791. /**
  12792. * Converts `value` to an integer suitable for use as the length of an
  12793. * array-like object.
  12794. *
  12795. * **Note:** This method is based on
  12796. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12797. *
  12798. * @static
  12799. * @memberOf _
  12800. * @since 4.0.0
  12801. * @category Lang
  12802. * @param {*} value The value to convert.
  12803. * @returns {number} Returns the converted integer.
  12804. * @example
  12805. *
  12806. * _.toLength(3.2);
  12807. * // => 3
  12808. *
  12809. * _.toLength(Number.MIN_VALUE);
  12810. * // => 0
  12811. *
  12812. * _.toLength(Infinity);
  12813. * // => 4294967295
  12814. *
  12815. * _.toLength('3.2');
  12816. * // => 3
  12817. */
  12818. function toLength(value) {
  12819. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12820. }
  12821. /**
  12822. * Converts `value` to a number.
  12823. *
  12824. * @static
  12825. * @memberOf _
  12826. * @since 4.0.0
  12827. * @category Lang
  12828. * @param {*} value The value to process.
  12829. * @returns {number} Returns the number.
  12830. * @example
  12831. *
  12832. * _.toNumber(3.2);
  12833. * // => 3.2
  12834. *
  12835. * _.toNumber(Number.MIN_VALUE);
  12836. * // => 5e-324
  12837. *
  12838. * _.toNumber(Infinity);
  12839. * // => Infinity
  12840. *
  12841. * _.toNumber('3.2');
  12842. * // => 3.2
  12843. */
  12844. function toNumber(value) {
  12845. if (typeof value == 'number') {
  12846. return value;
  12847. }
  12848. if (isSymbol(value)) {
  12849. return NAN;
  12850. }
  12851. if (isObject(value)) {
  12852. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12853. value = isObject(other) ? (other + '') : other;
  12854. }
  12855. if (typeof value != 'string') {
  12856. return value === 0 ? value : +value;
  12857. }
  12858. value = baseTrim(value);
  12859. var isBinary = reIsBinary.test(value);
  12860. return (isBinary || reIsOctal.test(value))
  12861. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12862. : (reIsBadHex.test(value) ? NAN : +value);
  12863. }
  12864. /**
  12865. * Converts `value` to a plain object flattening inherited enumerable string
  12866. * keyed properties of `value` to own properties of the plain object.
  12867. *
  12868. * @static
  12869. * @memberOf _
  12870. * @since 3.0.0
  12871. * @category Lang
  12872. * @param {*} value The value to convert.
  12873. * @returns {Object} Returns the converted plain object.
  12874. * @example
  12875. *
  12876. * function Foo() {
  12877. * this.b = 2;
  12878. * }
  12879. *
  12880. * Foo.prototype.c = 3;
  12881. *
  12882. * _.assign({ 'a': 1 }, new Foo);
  12883. * // => { 'a': 1, 'b': 2 }
  12884. *
  12885. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12886. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12887. */
  12888. function toPlainObject(value) {
  12889. return copyObject(value, keysIn(value));
  12890. }
  12891. /**
  12892. * Converts `value` to a safe integer. A safe integer can be compared and
  12893. * represented correctly.
  12894. *
  12895. * @static
  12896. * @memberOf _
  12897. * @since 4.0.0
  12898. * @category Lang
  12899. * @param {*} value The value to convert.
  12900. * @returns {number} Returns the converted integer.
  12901. * @example
  12902. *
  12903. * _.toSafeInteger(3.2);
  12904. * // => 3
  12905. *
  12906. * _.toSafeInteger(Number.MIN_VALUE);
  12907. * // => 0
  12908. *
  12909. * _.toSafeInteger(Infinity);
  12910. * // => 9007199254740991
  12911. *
  12912. * _.toSafeInteger('3.2');
  12913. * // => 3
  12914. */
  12915. function toSafeInteger(value) {
  12916. return value
  12917. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12918. : (value === 0 ? value : 0);
  12919. }
  12920. /**
  12921. * Converts `value` to a string. An empty string is returned for `null`
  12922. * and `undefined` values. The sign of `-0` is preserved.
  12923. *
  12924. * @static
  12925. * @memberOf _
  12926. * @since 4.0.0
  12927. * @category Lang
  12928. * @param {*} value The value to convert.
  12929. * @returns {string} Returns the converted string.
  12930. * @example
  12931. *
  12932. * _.toString(null);
  12933. * // => ''
  12934. *
  12935. * _.toString(-0);
  12936. * // => '-0'
  12937. *
  12938. * _.toString([1, 2, 3]);
  12939. * // => '1,2,3'
  12940. */
  12941. function toString(value) {
  12942. return value == null ? '' : baseToString(value);
  12943. }
  12944. /*------------------------------------------------------------------------*/
  12945. /**
  12946. * Assigns own enumerable string keyed properties of source objects to the
  12947. * destination object. Source objects are applied from left to right.
  12948. * Subsequent sources overwrite property assignments of previous sources.
  12949. *
  12950. * **Note:** This method mutates `object` and is loosely based on
  12951. * [`Object.assign`](https://mdn.io/Object/assign).
  12952. *
  12953. * @static
  12954. * @memberOf _
  12955. * @since 0.10.0
  12956. * @category Object
  12957. * @param {Object} object The destination object.
  12958. * @param {...Object} [sources] The source objects.
  12959. * @returns {Object} Returns `object`.
  12960. * @see _.assignIn
  12961. * @example
  12962. *
  12963. * function Foo() {
  12964. * this.a = 1;
  12965. * }
  12966. *
  12967. * function Bar() {
  12968. * this.c = 3;
  12969. * }
  12970. *
  12971. * Foo.prototype.b = 2;
  12972. * Bar.prototype.d = 4;
  12973. *
  12974. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12975. * // => { 'a': 1, 'c': 3 }
  12976. */
  12977. var assign = createAssigner(function(object, source) {
  12978. if (isPrototype(source) || isArrayLike(source)) {
  12979. copyObject(source, keys(source), object);
  12980. return;
  12981. }
  12982. for (var key in source) {
  12983. if (hasOwnProperty.call(source, key)) {
  12984. assignValue(object, key, source[key]);
  12985. }
  12986. }
  12987. });
  12988. /**
  12989. * This method is like `_.assign` except that it iterates over own and
  12990. * inherited source properties.
  12991. *
  12992. * **Note:** This method mutates `object`.
  12993. *
  12994. * @static
  12995. * @memberOf _
  12996. * @since 4.0.0
  12997. * @alias extend
  12998. * @category Object
  12999. * @param {Object} object The destination object.
  13000. * @param {...Object} [sources] The source objects.
  13001. * @returns {Object} Returns `object`.
  13002. * @see _.assign
  13003. * @example
  13004. *
  13005. * function Foo() {
  13006. * this.a = 1;
  13007. * }
  13008. *
  13009. * function Bar() {
  13010. * this.c = 3;
  13011. * }
  13012. *
  13013. * Foo.prototype.b = 2;
  13014. * Bar.prototype.d = 4;
  13015. *
  13016. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13017. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13018. */
  13019. var assignIn = createAssigner(function(object, source) {
  13020. copyObject(source, keysIn(source), object);
  13021. });
  13022. /**
  13023. * This method is like `_.assignIn` except that it accepts `customizer`
  13024. * which is invoked to produce the assigned values. If `customizer` returns
  13025. * `undefined`, assignment is handled by the method instead. The `customizer`
  13026. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13027. *
  13028. * **Note:** This method mutates `object`.
  13029. *
  13030. * @static
  13031. * @memberOf _
  13032. * @since 4.0.0
  13033. * @alias extendWith
  13034. * @category Object
  13035. * @param {Object} object The destination object.
  13036. * @param {...Object} sources The source objects.
  13037. * @param {Function} [customizer] The function to customize assigned values.
  13038. * @returns {Object} Returns `object`.
  13039. * @see _.assignWith
  13040. * @example
  13041. *
  13042. * function customizer(objValue, srcValue) {
  13043. * return _.isUndefined(objValue) ? srcValue : objValue;
  13044. * }
  13045. *
  13046. * var defaults = _.partialRight(_.assignInWith, customizer);
  13047. *
  13048. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13049. * // => { 'a': 1, 'b': 2 }
  13050. */
  13051. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13052. copyObject(source, keysIn(source), object, customizer);
  13053. });
  13054. /**
  13055. * This method is like `_.assign` except that it accepts `customizer`
  13056. * which is invoked to produce the assigned values. If `customizer` returns
  13057. * `undefined`, assignment is handled by the method instead. The `customizer`
  13058. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13059. *
  13060. * **Note:** This method mutates `object`.
  13061. *
  13062. * @static
  13063. * @memberOf _
  13064. * @since 4.0.0
  13065. * @category Object
  13066. * @param {Object} object The destination object.
  13067. * @param {...Object} sources The source objects.
  13068. * @param {Function} [customizer] The function to customize assigned values.
  13069. * @returns {Object} Returns `object`.
  13070. * @see _.assignInWith
  13071. * @example
  13072. *
  13073. * function customizer(objValue, srcValue) {
  13074. * return _.isUndefined(objValue) ? srcValue : objValue;
  13075. * }
  13076. *
  13077. * var defaults = _.partialRight(_.assignWith, customizer);
  13078. *
  13079. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13080. * // => { 'a': 1, 'b': 2 }
  13081. */
  13082. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13083. copyObject(source, keys(source), object, customizer);
  13084. });
  13085. /**
  13086. * Creates an array of values corresponding to `paths` of `object`.
  13087. *
  13088. * @static
  13089. * @memberOf _
  13090. * @since 1.0.0
  13091. * @category Object
  13092. * @param {Object} object The object to iterate over.
  13093. * @param {...(string|string[])} [paths] The property paths to pick.
  13094. * @returns {Array} Returns the picked values.
  13095. * @example
  13096. *
  13097. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13098. *
  13099. * _.at(object, ['a[0].b.c', 'a[1]']);
  13100. * // => [3, 4]
  13101. */
  13102. var at = flatRest(baseAt);
  13103. /**
  13104. * Creates an object that inherits from the `prototype` object. If a
  13105. * `properties` object is given, its own enumerable string keyed properties
  13106. * are assigned to the created object.
  13107. *
  13108. * @static
  13109. * @memberOf _
  13110. * @since 2.3.0
  13111. * @category Object
  13112. * @param {Object} prototype The object to inherit from.
  13113. * @param {Object} [properties] The properties to assign to the object.
  13114. * @returns {Object} Returns the new object.
  13115. * @example
  13116. *
  13117. * function Shape() {
  13118. * this.x = 0;
  13119. * this.y = 0;
  13120. * }
  13121. *
  13122. * function Circle() {
  13123. * Shape.call(this);
  13124. * }
  13125. *
  13126. * Circle.prototype = _.create(Shape.prototype, {
  13127. * 'constructor': Circle
  13128. * });
  13129. *
  13130. * var circle = new Circle;
  13131. * circle instanceof Circle;
  13132. * // => true
  13133. *
  13134. * circle instanceof Shape;
  13135. * // => true
  13136. */
  13137. function create(prototype, properties) {
  13138. var result = baseCreate(prototype);
  13139. return properties == null ? result : baseAssign(result, properties);
  13140. }
  13141. /**
  13142. * Assigns own and inherited enumerable string keyed properties of source
  13143. * objects to the destination object for all destination properties that
  13144. * resolve to `undefined`. Source objects are applied from left to right.
  13145. * Once a property is set, additional values of the same property are ignored.
  13146. *
  13147. * **Note:** This method mutates `object`.
  13148. *
  13149. * @static
  13150. * @since 0.1.0
  13151. * @memberOf _
  13152. * @category Object
  13153. * @param {Object} object The destination object.
  13154. * @param {...Object} [sources] The source objects.
  13155. * @returns {Object} Returns `object`.
  13156. * @see _.defaultsDeep
  13157. * @example
  13158. *
  13159. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13160. * // => { 'a': 1, 'b': 2 }
  13161. */
  13162. var defaults = baseRest(function(object, sources) {
  13163. object = Object(object);
  13164. var index = -1;
  13165. var length = sources.length;
  13166. var guard = length > 2 ? sources[2] : undefined;
  13167. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13168. length = 1;
  13169. }
  13170. while (++index < length) {
  13171. var source = sources[index];
  13172. var props = keysIn(source);
  13173. var propsIndex = -1;
  13174. var propsLength = props.length;
  13175. while (++propsIndex < propsLength) {
  13176. var key = props[propsIndex];
  13177. var value = object[key];
  13178. if (value === undefined ||
  13179. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13180. object[key] = source[key];
  13181. }
  13182. }
  13183. }
  13184. return object;
  13185. });
  13186. /**
  13187. * This method is like `_.defaults` except that it recursively assigns
  13188. * default properties.
  13189. *
  13190. * **Note:** This method mutates `object`.
  13191. *
  13192. * @static
  13193. * @memberOf _
  13194. * @since 3.10.0
  13195. * @category Object
  13196. * @param {Object} object The destination object.
  13197. * @param {...Object} [sources] The source objects.
  13198. * @returns {Object} Returns `object`.
  13199. * @see _.defaults
  13200. * @example
  13201. *
  13202. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13203. * // => { 'a': { 'b': 2, 'c': 3 } }
  13204. */
  13205. var defaultsDeep = baseRest(function(args) {
  13206. args.push(undefined, customDefaultsMerge);
  13207. return apply(mergeWith, undefined, args);
  13208. });
  13209. /**
  13210. * This method is like `_.find` except that it returns the key of the first
  13211. * element `predicate` returns truthy for instead of the element itself.
  13212. *
  13213. * @static
  13214. * @memberOf _
  13215. * @since 1.1.0
  13216. * @category Object
  13217. * @param {Object} object The object to inspect.
  13218. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13219. * @returns {string|undefined} Returns the key of the matched element,
  13220. * else `undefined`.
  13221. * @example
  13222. *
  13223. * var users = {
  13224. * 'barney': { 'age': 36, 'active': true },
  13225. * 'fred': { 'age': 40, 'active': false },
  13226. * 'pebbles': { 'age': 1, 'active': true }
  13227. * };
  13228. *
  13229. * _.findKey(users, function(o) { return o.age < 40; });
  13230. * // => 'barney' (iteration order is not guaranteed)
  13231. *
  13232. * // The `_.matches` iteratee shorthand.
  13233. * _.findKey(users, { 'age': 1, 'active': true });
  13234. * // => 'pebbles'
  13235. *
  13236. * // The `_.matchesProperty` iteratee shorthand.
  13237. * _.findKey(users, ['active', false]);
  13238. * // => 'fred'
  13239. *
  13240. * // The `_.property` iteratee shorthand.
  13241. * _.findKey(users, 'active');
  13242. * // => 'barney'
  13243. */
  13244. function findKey(object, predicate) {
  13245. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13246. }
  13247. /**
  13248. * This method is like `_.findKey` except that it iterates over elements of
  13249. * a collection in the opposite order.
  13250. *
  13251. * @static
  13252. * @memberOf _
  13253. * @since 2.0.0
  13254. * @category Object
  13255. * @param {Object} object The object to inspect.
  13256. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13257. * @returns {string|undefined} Returns the key of the matched element,
  13258. * else `undefined`.
  13259. * @example
  13260. *
  13261. * var users = {
  13262. * 'barney': { 'age': 36, 'active': true },
  13263. * 'fred': { 'age': 40, 'active': false },
  13264. * 'pebbles': { 'age': 1, 'active': true }
  13265. * };
  13266. *
  13267. * _.findLastKey(users, function(o) { return o.age < 40; });
  13268. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13269. *
  13270. * // The `_.matches` iteratee shorthand.
  13271. * _.findLastKey(users, { 'age': 36, 'active': true });
  13272. * // => 'barney'
  13273. *
  13274. * // The `_.matchesProperty` iteratee shorthand.
  13275. * _.findLastKey(users, ['active', false]);
  13276. * // => 'fred'
  13277. *
  13278. * // The `_.property` iteratee shorthand.
  13279. * _.findLastKey(users, 'active');
  13280. * // => 'pebbles'
  13281. */
  13282. function findLastKey(object, predicate) {
  13283. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13284. }
  13285. /**
  13286. * Iterates over own and inherited enumerable string keyed properties of an
  13287. * object and invokes `iteratee` for each property. The iteratee is invoked
  13288. * with three arguments: (value, key, object). Iteratee functions may exit
  13289. * iteration early by explicitly returning `false`.
  13290. *
  13291. * @static
  13292. * @memberOf _
  13293. * @since 0.3.0
  13294. * @category Object
  13295. * @param {Object} object The object to iterate over.
  13296. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13297. * @returns {Object} Returns `object`.
  13298. * @see _.forInRight
  13299. * @example
  13300. *
  13301. * function Foo() {
  13302. * this.a = 1;
  13303. * this.b = 2;
  13304. * }
  13305. *
  13306. * Foo.prototype.c = 3;
  13307. *
  13308. * _.forIn(new Foo, function(value, key) {
  13309. * console.log(key);
  13310. * });
  13311. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13312. */
  13313. function forIn(object, iteratee) {
  13314. return object == null
  13315. ? object
  13316. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13317. }
  13318. /**
  13319. * This method is like `_.forIn` except that it iterates over properties of
  13320. * `object` in the opposite order.
  13321. *
  13322. * @static
  13323. * @memberOf _
  13324. * @since 2.0.0
  13325. * @category Object
  13326. * @param {Object} object The object to iterate over.
  13327. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13328. * @returns {Object} Returns `object`.
  13329. * @see _.forIn
  13330. * @example
  13331. *
  13332. * function Foo() {
  13333. * this.a = 1;
  13334. * this.b = 2;
  13335. * }
  13336. *
  13337. * Foo.prototype.c = 3;
  13338. *
  13339. * _.forInRight(new Foo, function(value, key) {
  13340. * console.log(key);
  13341. * });
  13342. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13343. */
  13344. function forInRight(object, iteratee) {
  13345. return object == null
  13346. ? object
  13347. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13348. }
  13349. /**
  13350. * Iterates over own enumerable string keyed properties of an object and
  13351. * invokes `iteratee` for each property. The iteratee is invoked with three
  13352. * arguments: (value, key, object). Iteratee functions may exit iteration
  13353. * early by explicitly returning `false`.
  13354. *
  13355. * @static
  13356. * @memberOf _
  13357. * @since 0.3.0
  13358. * @category Object
  13359. * @param {Object} object The object to iterate over.
  13360. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13361. * @returns {Object} Returns `object`.
  13362. * @see _.forOwnRight
  13363. * @example
  13364. *
  13365. * function Foo() {
  13366. * this.a = 1;
  13367. * this.b = 2;
  13368. * }
  13369. *
  13370. * Foo.prototype.c = 3;
  13371. *
  13372. * _.forOwn(new Foo, function(value, key) {
  13373. * console.log(key);
  13374. * });
  13375. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13376. */
  13377. function forOwn(object, iteratee) {
  13378. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13379. }
  13380. /**
  13381. * This method is like `_.forOwn` except that it iterates over properties of
  13382. * `object` in the opposite order.
  13383. *
  13384. * @static
  13385. * @memberOf _
  13386. * @since 2.0.0
  13387. * @category Object
  13388. * @param {Object} object The object to iterate over.
  13389. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13390. * @returns {Object} Returns `object`.
  13391. * @see _.forOwn
  13392. * @example
  13393. *
  13394. * function Foo() {
  13395. * this.a = 1;
  13396. * this.b = 2;
  13397. * }
  13398. *
  13399. * Foo.prototype.c = 3;
  13400. *
  13401. * _.forOwnRight(new Foo, function(value, key) {
  13402. * console.log(key);
  13403. * });
  13404. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13405. */
  13406. function forOwnRight(object, iteratee) {
  13407. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13408. }
  13409. /**
  13410. * Creates an array of function property names from own enumerable properties
  13411. * of `object`.
  13412. *
  13413. * @static
  13414. * @since 0.1.0
  13415. * @memberOf _
  13416. * @category Object
  13417. * @param {Object} object The object to inspect.
  13418. * @returns {Array} Returns the function names.
  13419. * @see _.functionsIn
  13420. * @example
  13421. *
  13422. * function Foo() {
  13423. * this.a = _.constant('a');
  13424. * this.b = _.constant('b');
  13425. * }
  13426. *
  13427. * Foo.prototype.c = _.constant('c');
  13428. *
  13429. * _.functions(new Foo);
  13430. * // => ['a', 'b']
  13431. */
  13432. function functions(object) {
  13433. return object == null ? [] : baseFunctions(object, keys(object));
  13434. }
  13435. /**
  13436. * Creates an array of function property names from own and inherited
  13437. * enumerable properties of `object`.
  13438. *
  13439. * @static
  13440. * @memberOf _
  13441. * @since 4.0.0
  13442. * @category Object
  13443. * @param {Object} object The object to inspect.
  13444. * @returns {Array} Returns the function names.
  13445. * @see _.functions
  13446. * @example
  13447. *
  13448. * function Foo() {
  13449. * this.a = _.constant('a');
  13450. * this.b = _.constant('b');
  13451. * }
  13452. *
  13453. * Foo.prototype.c = _.constant('c');
  13454. *
  13455. * _.functionsIn(new Foo);
  13456. * // => ['a', 'b', 'c']
  13457. */
  13458. function functionsIn(object) {
  13459. return object == null ? [] : baseFunctions(object, keysIn(object));
  13460. }
  13461. /**
  13462. * Gets the value at `path` of `object`. If the resolved value is
  13463. * `undefined`, the `defaultValue` is returned in its place.
  13464. *
  13465. * @static
  13466. * @memberOf _
  13467. * @since 3.7.0
  13468. * @category Object
  13469. * @param {Object} object The object to query.
  13470. * @param {Array|string} path The path of the property to get.
  13471. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13472. * @returns {*} Returns the resolved value.
  13473. * @example
  13474. *
  13475. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13476. *
  13477. * _.get(object, 'a[0].b.c');
  13478. * // => 3
  13479. *
  13480. * _.get(object, ['a', '0', 'b', 'c']);
  13481. * // => 3
  13482. *
  13483. * _.get(object, 'a.b.c', 'default');
  13484. * // => 'default'
  13485. */
  13486. function get(object, path, defaultValue) {
  13487. var result = object == null ? undefined : baseGet(object, path);
  13488. return result === undefined ? defaultValue : result;
  13489. }
  13490. /**
  13491. * Checks if `path` is a direct property of `object`.
  13492. *
  13493. * @static
  13494. * @since 0.1.0
  13495. * @memberOf _
  13496. * @category Object
  13497. * @param {Object} object The object to query.
  13498. * @param {Array|string} path The path to check.
  13499. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13500. * @example
  13501. *
  13502. * var object = { 'a': { 'b': 2 } };
  13503. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13504. *
  13505. * _.has(object, 'a');
  13506. * // => true
  13507. *
  13508. * _.has(object, 'a.b');
  13509. * // => true
  13510. *
  13511. * _.has(object, ['a', 'b']);
  13512. * // => true
  13513. *
  13514. * _.has(other, 'a');
  13515. * // => false
  13516. */
  13517. function has(object, path) {
  13518. return object != null && hasPath(object, path, baseHas);
  13519. }
  13520. /**
  13521. * Checks if `path` is a direct or inherited property of `object`.
  13522. *
  13523. * @static
  13524. * @memberOf _
  13525. * @since 4.0.0
  13526. * @category Object
  13527. * @param {Object} object The object to query.
  13528. * @param {Array|string} path The path to check.
  13529. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13530. * @example
  13531. *
  13532. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13533. *
  13534. * _.hasIn(object, 'a');
  13535. * // => true
  13536. *
  13537. * _.hasIn(object, 'a.b');
  13538. * // => true
  13539. *
  13540. * _.hasIn(object, ['a', 'b']);
  13541. * // => true
  13542. *
  13543. * _.hasIn(object, 'b');
  13544. * // => false
  13545. */
  13546. function hasIn(object, path) {
  13547. return object != null && hasPath(object, path, baseHasIn);
  13548. }
  13549. /**
  13550. * Creates an object composed of the inverted keys and values of `object`.
  13551. * If `object` contains duplicate values, subsequent values overwrite
  13552. * property assignments of previous values.
  13553. *
  13554. * @static
  13555. * @memberOf _
  13556. * @since 0.7.0
  13557. * @category Object
  13558. * @param {Object} object The object to invert.
  13559. * @returns {Object} Returns the new inverted object.
  13560. * @example
  13561. *
  13562. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13563. *
  13564. * _.invert(object);
  13565. * // => { '1': 'c', '2': 'b' }
  13566. */
  13567. var invert = createInverter(function(result, value, key) {
  13568. if (value != null &&
  13569. typeof value.toString != 'function') {
  13570. value = nativeObjectToString.call(value);
  13571. }
  13572. result[value] = key;
  13573. }, constant(identity));
  13574. /**
  13575. * This method is like `_.invert` except that the inverted object is generated
  13576. * from the results of running each element of `object` thru `iteratee`. The
  13577. * corresponding inverted value of each inverted key is an array of keys
  13578. * responsible for generating the inverted value. The iteratee is invoked
  13579. * with one argument: (value).
  13580. *
  13581. * @static
  13582. * @memberOf _
  13583. * @since 4.1.0
  13584. * @category Object
  13585. * @param {Object} object The object to invert.
  13586. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13587. * @returns {Object} Returns the new inverted object.
  13588. * @example
  13589. *
  13590. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13591. *
  13592. * _.invertBy(object);
  13593. * // => { '1': ['a', 'c'], '2': ['b'] }
  13594. *
  13595. * _.invertBy(object, function(value) {
  13596. * return 'group' + value;
  13597. * });
  13598. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13599. */
  13600. var invertBy = createInverter(function(result, value, key) {
  13601. if (value != null &&
  13602. typeof value.toString != 'function') {
  13603. value = nativeObjectToString.call(value);
  13604. }
  13605. if (hasOwnProperty.call(result, value)) {
  13606. result[value].push(key);
  13607. } else {
  13608. result[value] = [key];
  13609. }
  13610. }, getIteratee);
  13611. /**
  13612. * Invokes the method at `path` of `object`.
  13613. *
  13614. * @static
  13615. * @memberOf _
  13616. * @since 4.0.0
  13617. * @category Object
  13618. * @param {Object} object The object to query.
  13619. * @param {Array|string} path The path of the method to invoke.
  13620. * @param {...*} [args] The arguments to invoke the method with.
  13621. * @returns {*} Returns the result of the invoked method.
  13622. * @example
  13623. *
  13624. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13625. *
  13626. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13627. * // => [2, 3]
  13628. */
  13629. var invoke = baseRest(baseInvoke);
  13630. /**
  13631. * Creates an array of the own enumerable property names of `object`.
  13632. *
  13633. * **Note:** Non-object values are coerced to objects. See the
  13634. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13635. * for more details.
  13636. *
  13637. * @static
  13638. * @since 0.1.0
  13639. * @memberOf _
  13640. * @category Object
  13641. * @param {Object} object The object to query.
  13642. * @returns {Array} Returns the array of property names.
  13643. * @example
  13644. *
  13645. * function Foo() {
  13646. * this.a = 1;
  13647. * this.b = 2;
  13648. * }
  13649. *
  13650. * Foo.prototype.c = 3;
  13651. *
  13652. * _.keys(new Foo);
  13653. * // => ['a', 'b'] (iteration order is not guaranteed)
  13654. *
  13655. * _.keys('hi');
  13656. * // => ['0', '1']
  13657. */
  13658. function keys(object) {
  13659. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13660. }
  13661. /**
  13662. * Creates an array of the own and inherited enumerable property names of `object`.
  13663. *
  13664. * **Note:** Non-object values are coerced to objects.
  13665. *
  13666. * @static
  13667. * @memberOf _
  13668. * @since 3.0.0
  13669. * @category Object
  13670. * @param {Object} object The object to query.
  13671. * @returns {Array} Returns the array of property names.
  13672. * @example
  13673. *
  13674. * function Foo() {
  13675. * this.a = 1;
  13676. * this.b = 2;
  13677. * }
  13678. *
  13679. * Foo.prototype.c = 3;
  13680. *
  13681. * _.keysIn(new Foo);
  13682. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13683. */
  13684. function keysIn(object) {
  13685. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13686. }
  13687. /**
  13688. * The opposite of `_.mapValues`; this method creates an object with the
  13689. * same values as `object` and keys generated by running each own enumerable
  13690. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13691. * with three arguments: (value, key, object).
  13692. *
  13693. * @static
  13694. * @memberOf _
  13695. * @since 3.8.0
  13696. * @category Object
  13697. * @param {Object} object The object to iterate over.
  13698. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13699. * @returns {Object} Returns the new mapped object.
  13700. * @see _.mapValues
  13701. * @example
  13702. *
  13703. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13704. * return key + value;
  13705. * });
  13706. * // => { 'a1': 1, 'b2': 2 }
  13707. */
  13708. function mapKeys(object, iteratee) {
  13709. var result = {};
  13710. iteratee = getIteratee(iteratee, 3);
  13711. baseForOwn(object, function(value, key, object) {
  13712. baseAssignValue(result, iteratee(value, key, object), value);
  13713. });
  13714. return result;
  13715. }
  13716. /**
  13717. * Creates an object with the same keys as `object` and values generated
  13718. * by running each own enumerable string keyed property of `object` thru
  13719. * `iteratee`. The iteratee is invoked with three arguments:
  13720. * (value, key, object).
  13721. *
  13722. * @static
  13723. * @memberOf _
  13724. * @since 2.4.0
  13725. * @category Object
  13726. * @param {Object} object The object to iterate over.
  13727. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13728. * @returns {Object} Returns the new mapped object.
  13729. * @see _.mapKeys
  13730. * @example
  13731. *
  13732. * var users = {
  13733. * 'fred': { 'user': 'fred', 'age': 40 },
  13734. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13735. * };
  13736. *
  13737. * _.mapValues(users, function(o) { return o.age; });
  13738. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13739. *
  13740. * // The `_.property` iteratee shorthand.
  13741. * _.mapValues(users, 'age');
  13742. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13743. */
  13744. function mapValues(object, iteratee) {
  13745. var result = {};
  13746. iteratee = getIteratee(iteratee, 3);
  13747. baseForOwn(object, function(value, key, object) {
  13748. baseAssignValue(result, key, iteratee(value, key, object));
  13749. });
  13750. return result;
  13751. }
  13752. /**
  13753. * This method is like `_.assign` except that it recursively merges own and
  13754. * inherited enumerable string keyed properties of source objects into the
  13755. * destination object. Source properties that resolve to `undefined` are
  13756. * skipped if a destination value exists. Array and plain object properties
  13757. * are merged recursively. Other objects and value types are overridden by
  13758. * assignment. Source objects are applied from left to right. Subsequent
  13759. * sources overwrite property assignments of previous sources.
  13760. *
  13761. * **Note:** This method mutates `object`.
  13762. *
  13763. * @static
  13764. * @memberOf _
  13765. * @since 0.5.0
  13766. * @category Object
  13767. * @param {Object} object The destination object.
  13768. * @param {...Object} [sources] The source objects.
  13769. * @returns {Object} Returns `object`.
  13770. * @example
  13771. *
  13772. * var object = {
  13773. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13774. * };
  13775. *
  13776. * var other = {
  13777. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13778. * };
  13779. *
  13780. * _.merge(object, other);
  13781. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13782. */
  13783. var merge = createAssigner(function(object, source, srcIndex) {
  13784. baseMerge(object, source, srcIndex);
  13785. });
  13786. /**
  13787. * This method is like `_.merge` except that it accepts `customizer` which
  13788. * is invoked to produce the merged values of the destination and source
  13789. * properties. If `customizer` returns `undefined`, merging is handled by the
  13790. * method instead. The `customizer` is invoked with six arguments:
  13791. * (objValue, srcValue, key, object, source, stack).
  13792. *
  13793. * **Note:** This method mutates `object`.
  13794. *
  13795. * @static
  13796. * @memberOf _
  13797. * @since 4.0.0
  13798. * @category Object
  13799. * @param {Object} object The destination object.
  13800. * @param {...Object} sources The source objects.
  13801. * @param {Function} customizer The function to customize assigned values.
  13802. * @returns {Object} Returns `object`.
  13803. * @example
  13804. *
  13805. * function customizer(objValue, srcValue) {
  13806. * if (_.isArray(objValue)) {
  13807. * return objValue.concat(srcValue);
  13808. * }
  13809. * }
  13810. *
  13811. * var object = { 'a': [1], 'b': [2] };
  13812. * var other = { 'a': [3], 'b': [4] };
  13813. *
  13814. * _.mergeWith(object, other, customizer);
  13815. * // => { 'a': [1, 3], 'b': [2, 4] }
  13816. */
  13817. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13818. baseMerge(object, source, srcIndex, customizer);
  13819. });
  13820. /**
  13821. * The opposite of `_.pick`; this method creates an object composed of the
  13822. * own and inherited enumerable property paths of `object` that are not omitted.
  13823. *
  13824. * **Note:** This method is considerably slower than `_.pick`.
  13825. *
  13826. * @static
  13827. * @since 0.1.0
  13828. * @memberOf _
  13829. * @category Object
  13830. * @param {Object} object The source object.
  13831. * @param {...(string|string[])} [paths] The property paths to omit.
  13832. * @returns {Object} Returns the new object.
  13833. * @example
  13834. *
  13835. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13836. *
  13837. * _.omit(object, ['a', 'c']);
  13838. * // => { 'b': '2' }
  13839. */
  13840. var omit = flatRest(function(object, paths) {
  13841. var result = {};
  13842. if (object == null) {
  13843. return result;
  13844. }
  13845. var isDeep = false;
  13846. paths = arrayMap(paths, function(path) {
  13847. path = castPath(path, object);
  13848. isDeep || (isDeep = path.length > 1);
  13849. return path;
  13850. });
  13851. copyObject(object, getAllKeysIn(object), result);
  13852. if (isDeep) {
  13853. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13854. }
  13855. var length = paths.length;
  13856. while (length--) {
  13857. baseUnset(result, paths[length]);
  13858. }
  13859. return result;
  13860. });
  13861. /**
  13862. * The opposite of `_.pickBy`; this method creates an object composed of
  13863. * the own and inherited enumerable string keyed properties of `object` that
  13864. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13865. * arguments: (value, key).
  13866. *
  13867. * @static
  13868. * @memberOf _
  13869. * @since 4.0.0
  13870. * @category Object
  13871. * @param {Object} object The source object.
  13872. * @param {Function} [predicate=_.identity] The function invoked per property.
  13873. * @returns {Object} Returns the new object.
  13874. * @example
  13875. *
  13876. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13877. *
  13878. * _.omitBy(object, _.isNumber);
  13879. * // => { 'b': '2' }
  13880. */
  13881. function omitBy(object, predicate) {
  13882. return pickBy(object, negate(getIteratee(predicate)));
  13883. }
  13884. /**
  13885. * Creates an object composed of the picked `object` properties.
  13886. *
  13887. * @static
  13888. * @since 0.1.0
  13889. * @memberOf _
  13890. * @category Object
  13891. * @param {Object} object The source object.
  13892. * @param {...(string|string[])} [paths] The property paths to pick.
  13893. * @returns {Object} Returns the new object.
  13894. * @example
  13895. *
  13896. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13897. *
  13898. * _.pick(object, ['a', 'c']);
  13899. * // => { 'a': 1, 'c': 3 }
  13900. */
  13901. var pick = flatRest(function(object, paths) {
  13902. return object == null ? {} : basePick(object, paths);
  13903. });
  13904. /**
  13905. * Creates an object composed of the `object` properties `predicate` returns
  13906. * truthy for. The predicate is invoked with two arguments: (value, key).
  13907. *
  13908. * @static
  13909. * @memberOf _
  13910. * @since 4.0.0
  13911. * @category Object
  13912. * @param {Object} object The source object.
  13913. * @param {Function} [predicate=_.identity] The function invoked per property.
  13914. * @returns {Object} Returns the new object.
  13915. * @example
  13916. *
  13917. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13918. *
  13919. * _.pickBy(object, _.isNumber);
  13920. * // => { 'a': 1, 'c': 3 }
  13921. */
  13922. function pickBy(object, predicate) {
  13923. if (object == null) {
  13924. return {};
  13925. }
  13926. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13927. return [prop];
  13928. });
  13929. predicate = getIteratee(predicate);
  13930. return basePickBy(object, props, function(value, path) {
  13931. return predicate(value, path[0]);
  13932. });
  13933. }
  13934. /**
  13935. * This method is like `_.get` except that if the resolved value is a
  13936. * function it's invoked with the `this` binding of its parent object and
  13937. * its result is returned.
  13938. *
  13939. * @static
  13940. * @since 0.1.0
  13941. * @memberOf _
  13942. * @category Object
  13943. * @param {Object} object The object to query.
  13944. * @param {Array|string} path The path of the property to resolve.
  13945. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13946. * @returns {*} Returns the resolved value.
  13947. * @example
  13948. *
  13949. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13950. *
  13951. * _.result(object, 'a[0].b.c1');
  13952. * // => 3
  13953. *
  13954. * _.result(object, 'a[0].b.c2');
  13955. * // => 4
  13956. *
  13957. * _.result(object, 'a[0].b.c3', 'default');
  13958. * // => 'default'
  13959. *
  13960. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13961. * // => 'default'
  13962. */
  13963. function result(object, path, defaultValue) {
  13964. path = castPath(path, object);
  13965. var index = -1,
  13966. length = path.length;
  13967. // Ensure the loop is entered when path is empty.
  13968. if (!length) {
  13969. length = 1;
  13970. object = undefined;
  13971. }
  13972. while (++index < length) {
  13973. var value = object == null ? undefined : object[toKey(path[index])];
  13974. if (value === undefined) {
  13975. index = length;
  13976. value = defaultValue;
  13977. }
  13978. object = isFunction(value) ? value.call(object) : value;
  13979. }
  13980. return object;
  13981. }
  13982. /**
  13983. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13984. * it's created. Arrays are created for missing index properties while objects
  13985. * are created for all other missing properties. Use `_.setWith` to customize
  13986. * `path` creation.
  13987. *
  13988. * **Note:** This method mutates `object`.
  13989. *
  13990. * @static
  13991. * @memberOf _
  13992. * @since 3.7.0
  13993. * @category Object
  13994. * @param {Object} object The object to modify.
  13995. * @param {Array|string} path The path of the property to set.
  13996. * @param {*} value The value to set.
  13997. * @returns {Object} Returns `object`.
  13998. * @example
  13999. *
  14000. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14001. *
  14002. * _.set(object, 'a[0].b.c', 4);
  14003. * console.log(object.a[0].b.c);
  14004. * // => 4
  14005. *
  14006. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14007. * console.log(object.x[0].y.z);
  14008. * // => 5
  14009. */
  14010. function set(object, path, value) {
  14011. return object == null ? object : baseSet(object, path, value);
  14012. }
  14013. /**
  14014. * This method is like `_.set` except that it accepts `customizer` which is
  14015. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14016. * path creation is handled by the method instead. The `customizer` is invoked
  14017. * with three arguments: (nsValue, key, nsObject).
  14018. *
  14019. * **Note:** This method mutates `object`.
  14020. *
  14021. * @static
  14022. * @memberOf _
  14023. * @since 4.0.0
  14024. * @category Object
  14025. * @param {Object} object The object to modify.
  14026. * @param {Array|string} path The path of the property to set.
  14027. * @param {*} value The value to set.
  14028. * @param {Function} [customizer] The function to customize assigned values.
  14029. * @returns {Object} Returns `object`.
  14030. * @example
  14031. *
  14032. * var object = {};
  14033. *
  14034. * _.setWith(object, '[0][1]', 'a', Object);
  14035. * // => { '0': { '1': 'a' } }
  14036. */
  14037. function setWith(object, path, value, customizer) {
  14038. customizer = typeof customizer == 'function' ? customizer : undefined;
  14039. return object == null ? object : baseSet(object, path, value, customizer);
  14040. }
  14041. /**
  14042. * Creates an array of own enumerable string keyed-value pairs for `object`
  14043. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14044. * entries are returned.
  14045. *
  14046. * @static
  14047. * @memberOf _
  14048. * @since 4.0.0
  14049. * @alias entries
  14050. * @category Object
  14051. * @param {Object} object The object to query.
  14052. * @returns {Array} Returns the key-value pairs.
  14053. * @example
  14054. *
  14055. * function Foo() {
  14056. * this.a = 1;
  14057. * this.b = 2;
  14058. * }
  14059. *
  14060. * Foo.prototype.c = 3;
  14061. *
  14062. * _.toPairs(new Foo);
  14063. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14064. */
  14065. var toPairs = createToPairs(keys);
  14066. /**
  14067. * Creates an array of own and inherited enumerable string keyed-value pairs
  14068. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14069. * or set, its entries are returned.
  14070. *
  14071. * @static
  14072. * @memberOf _
  14073. * @since 4.0.0
  14074. * @alias entriesIn
  14075. * @category Object
  14076. * @param {Object} object The object to query.
  14077. * @returns {Array} Returns the key-value pairs.
  14078. * @example
  14079. *
  14080. * function Foo() {
  14081. * this.a = 1;
  14082. * this.b = 2;
  14083. * }
  14084. *
  14085. * Foo.prototype.c = 3;
  14086. *
  14087. * _.toPairsIn(new Foo);
  14088. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14089. */
  14090. var toPairsIn = createToPairs(keysIn);
  14091. /**
  14092. * An alternative to `_.reduce`; this method transforms `object` to a new
  14093. * `accumulator` object which is the result of running each of its own
  14094. * enumerable string keyed properties thru `iteratee`, with each invocation
  14095. * potentially mutating the `accumulator` object. If `accumulator` is not
  14096. * provided, a new object with the same `[[Prototype]]` will be used. The
  14097. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14098. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14099. *
  14100. * @static
  14101. * @memberOf _
  14102. * @since 1.3.0
  14103. * @category Object
  14104. * @param {Object} object The object to iterate over.
  14105. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14106. * @param {*} [accumulator] The custom accumulator value.
  14107. * @returns {*} Returns the accumulated value.
  14108. * @example
  14109. *
  14110. * _.transform([2, 3, 4], function(result, n) {
  14111. * result.push(n *= n);
  14112. * return n % 2 == 0;
  14113. * }, []);
  14114. * // => [4, 9]
  14115. *
  14116. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14117. * (result[value] || (result[value] = [])).push(key);
  14118. * }, {});
  14119. * // => { '1': ['a', 'c'], '2': ['b'] }
  14120. */
  14121. function transform(object, iteratee, accumulator) {
  14122. var isArr = isArray(object),
  14123. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14124. iteratee = getIteratee(iteratee, 4);
  14125. if (accumulator == null) {
  14126. var Ctor = object && object.constructor;
  14127. if (isArrLike) {
  14128. accumulator = isArr ? new Ctor : [];
  14129. }
  14130. else if (isObject(object)) {
  14131. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14132. }
  14133. else {
  14134. accumulator = {};
  14135. }
  14136. }
  14137. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14138. return iteratee(accumulator, value, index, object);
  14139. });
  14140. return accumulator;
  14141. }
  14142. /**
  14143. * Removes the property at `path` of `object`.
  14144. *
  14145. * **Note:** This method mutates `object`.
  14146. *
  14147. * @static
  14148. * @memberOf _
  14149. * @since 4.0.0
  14150. * @category Object
  14151. * @param {Object} object The object to modify.
  14152. * @param {Array|string} path The path of the property to unset.
  14153. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14154. * @example
  14155. *
  14156. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14157. * _.unset(object, 'a[0].b.c');
  14158. * // => true
  14159. *
  14160. * console.log(object);
  14161. * // => { 'a': [{ 'b': {} }] };
  14162. *
  14163. * _.unset(object, ['a', '0', 'b', 'c']);
  14164. * // => true
  14165. *
  14166. * console.log(object);
  14167. * // => { 'a': [{ 'b': {} }] };
  14168. */
  14169. function unset(object, path) {
  14170. return object == null ? true : baseUnset(object, path);
  14171. }
  14172. /**
  14173. * This method is like `_.set` except that accepts `updater` to produce the
  14174. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14175. * is invoked with one argument: (value).
  14176. *
  14177. * **Note:** This method mutates `object`.
  14178. *
  14179. * @static
  14180. * @memberOf _
  14181. * @since 4.6.0
  14182. * @category Object
  14183. * @param {Object} object The object to modify.
  14184. * @param {Array|string} path The path of the property to set.
  14185. * @param {Function} updater The function to produce the updated value.
  14186. * @returns {Object} Returns `object`.
  14187. * @example
  14188. *
  14189. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14190. *
  14191. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14192. * console.log(object.a[0].b.c);
  14193. * // => 9
  14194. *
  14195. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14196. * console.log(object.x[0].y.z);
  14197. * // => 0
  14198. */
  14199. function update(object, path, updater) {
  14200. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14201. }
  14202. /**
  14203. * This method is like `_.update` except that it accepts `customizer` which is
  14204. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14205. * path creation is handled by the method instead. The `customizer` is invoked
  14206. * with three arguments: (nsValue, key, nsObject).
  14207. *
  14208. * **Note:** This method mutates `object`.
  14209. *
  14210. * @static
  14211. * @memberOf _
  14212. * @since 4.6.0
  14213. * @category Object
  14214. * @param {Object} object The object to modify.
  14215. * @param {Array|string} path The path of the property to set.
  14216. * @param {Function} updater The function to produce the updated value.
  14217. * @param {Function} [customizer] The function to customize assigned values.
  14218. * @returns {Object} Returns `object`.
  14219. * @example
  14220. *
  14221. * var object = {};
  14222. *
  14223. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14224. * // => { '0': { '1': 'a' } }
  14225. */
  14226. function updateWith(object, path, updater, customizer) {
  14227. customizer = typeof customizer == 'function' ? customizer : undefined;
  14228. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14229. }
  14230. /**
  14231. * Creates an array of the own enumerable string keyed property values of `object`.
  14232. *
  14233. * **Note:** Non-object values are coerced to objects.
  14234. *
  14235. * @static
  14236. * @since 0.1.0
  14237. * @memberOf _
  14238. * @category Object
  14239. * @param {Object} object The object to query.
  14240. * @returns {Array} Returns the array of property values.
  14241. * @example
  14242. *
  14243. * function Foo() {
  14244. * this.a = 1;
  14245. * this.b = 2;
  14246. * }
  14247. *
  14248. * Foo.prototype.c = 3;
  14249. *
  14250. * _.values(new Foo);
  14251. * // => [1, 2] (iteration order is not guaranteed)
  14252. *
  14253. * _.values('hi');
  14254. * // => ['h', 'i']
  14255. */
  14256. function values(object) {
  14257. return object == null ? [] : baseValues(object, keys(object));
  14258. }
  14259. /**
  14260. * Creates an array of the own and inherited enumerable string keyed property
  14261. * values of `object`.
  14262. *
  14263. * **Note:** Non-object values are coerced to objects.
  14264. *
  14265. * @static
  14266. * @memberOf _
  14267. * @since 3.0.0
  14268. * @category Object
  14269. * @param {Object} object The object to query.
  14270. * @returns {Array} Returns the array of property values.
  14271. * @example
  14272. *
  14273. * function Foo() {
  14274. * this.a = 1;
  14275. * this.b = 2;
  14276. * }
  14277. *
  14278. * Foo.prototype.c = 3;
  14279. *
  14280. * _.valuesIn(new Foo);
  14281. * // => [1, 2, 3] (iteration order is not guaranteed)
  14282. */
  14283. function valuesIn(object) {
  14284. return object == null ? [] : baseValues(object, keysIn(object));
  14285. }
  14286. /*------------------------------------------------------------------------*/
  14287. /**
  14288. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14289. *
  14290. * @static
  14291. * @memberOf _
  14292. * @since 4.0.0
  14293. * @category Number
  14294. * @param {number} number The number to clamp.
  14295. * @param {number} [lower] The lower bound.
  14296. * @param {number} upper The upper bound.
  14297. * @returns {number} Returns the clamped number.
  14298. * @example
  14299. *
  14300. * _.clamp(-10, -5, 5);
  14301. * // => -5
  14302. *
  14303. * _.clamp(10, -5, 5);
  14304. * // => 5
  14305. */
  14306. function clamp(number, lower, upper) {
  14307. if (upper === undefined) {
  14308. upper = lower;
  14309. lower = undefined;
  14310. }
  14311. if (upper !== undefined) {
  14312. upper = toNumber(upper);
  14313. upper = upper === upper ? upper : 0;
  14314. }
  14315. if (lower !== undefined) {
  14316. lower = toNumber(lower);
  14317. lower = lower === lower ? lower : 0;
  14318. }
  14319. return baseClamp(toNumber(number), lower, upper);
  14320. }
  14321. /**
  14322. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14323. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14324. * If `start` is greater than `end` the params are swapped to support
  14325. * negative ranges.
  14326. *
  14327. * @static
  14328. * @memberOf _
  14329. * @since 3.3.0
  14330. * @category Number
  14331. * @param {number} number The number to check.
  14332. * @param {number} [start=0] The start of the range.
  14333. * @param {number} end The end of the range.
  14334. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14335. * @see _.range, _.rangeRight
  14336. * @example
  14337. *
  14338. * _.inRange(3, 2, 4);
  14339. * // => true
  14340. *
  14341. * _.inRange(4, 8);
  14342. * // => true
  14343. *
  14344. * _.inRange(4, 2);
  14345. * // => false
  14346. *
  14347. * _.inRange(2, 2);
  14348. * // => false
  14349. *
  14350. * _.inRange(1.2, 2);
  14351. * // => true
  14352. *
  14353. * _.inRange(5.2, 4);
  14354. * // => false
  14355. *
  14356. * _.inRange(-3, -2, -6);
  14357. * // => true
  14358. */
  14359. function inRange(number, start, end) {
  14360. start = toFinite(start);
  14361. if (end === undefined) {
  14362. end = start;
  14363. start = 0;
  14364. } else {
  14365. end = toFinite(end);
  14366. }
  14367. number = toNumber(number);
  14368. return baseInRange(number, start, end);
  14369. }
  14370. /**
  14371. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14372. * If only one argument is provided a number between `0` and the given number
  14373. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14374. * floats, a floating-point number is returned instead of an integer.
  14375. *
  14376. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14377. * floating-point values which can produce unexpected results.
  14378. *
  14379. * @static
  14380. * @memberOf _
  14381. * @since 0.7.0
  14382. * @category Number
  14383. * @param {number} [lower=0] The lower bound.
  14384. * @param {number} [upper=1] The upper bound.
  14385. * @param {boolean} [floating] Specify returning a floating-point number.
  14386. * @returns {number} Returns the random number.
  14387. * @example
  14388. *
  14389. * _.random(0, 5);
  14390. * // => an integer between 0 and 5
  14391. *
  14392. * _.random(5);
  14393. * // => also an integer between 0 and 5
  14394. *
  14395. * _.random(5, true);
  14396. * // => a floating-point number between 0 and 5
  14397. *
  14398. * _.random(1.2, 5.2);
  14399. * // => a floating-point number between 1.2 and 5.2
  14400. */
  14401. function random(lower, upper, floating) {
  14402. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14403. upper = floating = undefined;
  14404. }
  14405. if (floating === undefined) {
  14406. if (typeof upper == 'boolean') {
  14407. floating = upper;
  14408. upper = undefined;
  14409. }
  14410. else if (typeof lower == 'boolean') {
  14411. floating = lower;
  14412. lower = undefined;
  14413. }
  14414. }
  14415. if (lower === undefined && upper === undefined) {
  14416. lower = 0;
  14417. upper = 1;
  14418. }
  14419. else {
  14420. lower = toFinite(lower);
  14421. if (upper === undefined) {
  14422. upper = lower;
  14423. lower = 0;
  14424. } else {
  14425. upper = toFinite(upper);
  14426. }
  14427. }
  14428. if (lower > upper) {
  14429. var temp = lower;
  14430. lower = upper;
  14431. upper = temp;
  14432. }
  14433. if (floating || lower % 1 || upper % 1) {
  14434. var rand = nativeRandom();
  14435. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14436. }
  14437. return baseRandom(lower, upper);
  14438. }
  14439. /*------------------------------------------------------------------------*/
  14440. /**
  14441. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14442. *
  14443. * @static
  14444. * @memberOf _
  14445. * @since 3.0.0
  14446. * @category String
  14447. * @param {string} [string=''] The string to convert.
  14448. * @returns {string} Returns the camel cased string.
  14449. * @example
  14450. *
  14451. * _.camelCase('Foo Bar');
  14452. * // => 'fooBar'
  14453. *
  14454. * _.camelCase('--foo-bar--');
  14455. * // => 'fooBar'
  14456. *
  14457. * _.camelCase('__FOO_BAR__');
  14458. * // => 'fooBar'
  14459. */
  14460. var camelCase = createCompounder(function(result, word, index) {
  14461. word = word.toLowerCase();
  14462. return result + (index ? capitalize(word) : word);
  14463. });
  14464. /**
  14465. * Converts the first character of `string` to upper case and the remaining
  14466. * to lower case.
  14467. *
  14468. * @static
  14469. * @memberOf _
  14470. * @since 3.0.0
  14471. * @category String
  14472. * @param {string} [string=''] The string to capitalize.
  14473. * @returns {string} Returns the capitalized string.
  14474. * @example
  14475. *
  14476. * _.capitalize('FRED');
  14477. * // => 'Fred'
  14478. */
  14479. function capitalize(string) {
  14480. return upperFirst(toString(string).toLowerCase());
  14481. }
  14482. /**
  14483. * Deburrs `string` by converting
  14484. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14485. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14486. * letters to basic Latin letters and removing
  14487. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14488. *
  14489. * @static
  14490. * @memberOf _
  14491. * @since 3.0.0
  14492. * @category String
  14493. * @param {string} [string=''] The string to deburr.
  14494. * @returns {string} Returns the deburred string.
  14495. * @example
  14496. *
  14497. * _.deburr('déjà vu');
  14498. * // => 'deja vu'
  14499. */
  14500. function deburr(string) {
  14501. string = toString(string);
  14502. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14503. }
  14504. /**
  14505. * Checks if `string` ends with the given target string.
  14506. *
  14507. * @static
  14508. * @memberOf _
  14509. * @since 3.0.0
  14510. * @category String
  14511. * @param {string} [string=''] The string to inspect.
  14512. * @param {string} [target] The string to search for.
  14513. * @param {number} [position=string.length] The position to search up to.
  14514. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14515. * else `false`.
  14516. * @example
  14517. *
  14518. * _.endsWith('abc', 'c');
  14519. * // => true
  14520. *
  14521. * _.endsWith('abc', 'b');
  14522. * // => false
  14523. *
  14524. * _.endsWith('abc', 'b', 2);
  14525. * // => true
  14526. */
  14527. function endsWith(string, target, position) {
  14528. string = toString(string);
  14529. target = baseToString(target);
  14530. var length = string.length;
  14531. position = position === undefined
  14532. ? length
  14533. : baseClamp(toInteger(position), 0, length);
  14534. var end = position;
  14535. position -= target.length;
  14536. return position >= 0 && string.slice(position, end) == target;
  14537. }
  14538. /**
  14539. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14540. * corresponding HTML entities.
  14541. *
  14542. * **Note:** No other characters are escaped. To escape additional
  14543. * characters use a third-party library like [_he_](https://mths.be/he).
  14544. *
  14545. * Though the ">" character is escaped for symmetry, characters like
  14546. * ">" and "/" don't need escaping in HTML and have no special meaning
  14547. * unless they're part of a tag or unquoted attribute value. See
  14548. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14549. * (under "semi-related fun fact") for more details.
  14550. *
  14551. * When working with HTML you should always
  14552. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14553. * XSS vectors.
  14554. *
  14555. * @static
  14556. * @since 0.1.0
  14557. * @memberOf _
  14558. * @category String
  14559. * @param {string} [string=''] The string to escape.
  14560. * @returns {string} Returns the escaped string.
  14561. * @example
  14562. *
  14563. * _.escape('fred, barney, & pebbles');
  14564. * // => 'fred, barney, &amp; pebbles'
  14565. */
  14566. function escape(string) {
  14567. string = toString(string);
  14568. return (string && reHasUnescapedHtml.test(string))
  14569. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14570. : string;
  14571. }
  14572. /**
  14573. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14574. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14575. *
  14576. * @static
  14577. * @memberOf _
  14578. * @since 3.0.0
  14579. * @category String
  14580. * @param {string} [string=''] The string to escape.
  14581. * @returns {string} Returns the escaped string.
  14582. * @example
  14583. *
  14584. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14585. * // => '\[lodash\]\(https://lodash\.com/\)'
  14586. */
  14587. function escapeRegExp(string) {
  14588. string = toString(string);
  14589. return (string && reHasRegExpChar.test(string))
  14590. ? string.replace(reRegExpChar, '\\$&')
  14591. : string;
  14592. }
  14593. /**
  14594. * Converts `string` to
  14595. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14596. *
  14597. * @static
  14598. * @memberOf _
  14599. * @since 3.0.0
  14600. * @category String
  14601. * @param {string} [string=''] The string to convert.
  14602. * @returns {string} Returns the kebab cased string.
  14603. * @example
  14604. *
  14605. * _.kebabCase('Foo Bar');
  14606. * // => 'foo-bar'
  14607. *
  14608. * _.kebabCase('fooBar');
  14609. * // => 'foo-bar'
  14610. *
  14611. * _.kebabCase('__FOO_BAR__');
  14612. * // => 'foo-bar'
  14613. */
  14614. var kebabCase = createCompounder(function(result, word, index) {
  14615. return result + (index ? '-' : '') + word.toLowerCase();
  14616. });
  14617. /**
  14618. * Converts `string`, as space separated words, to lower case.
  14619. *
  14620. * @static
  14621. * @memberOf _
  14622. * @since 4.0.0
  14623. * @category String
  14624. * @param {string} [string=''] The string to convert.
  14625. * @returns {string} Returns the lower cased string.
  14626. * @example
  14627. *
  14628. * _.lowerCase('--Foo-Bar--');
  14629. * // => 'foo bar'
  14630. *
  14631. * _.lowerCase('fooBar');
  14632. * // => 'foo bar'
  14633. *
  14634. * _.lowerCase('__FOO_BAR__');
  14635. * // => 'foo bar'
  14636. */
  14637. var lowerCase = createCompounder(function(result, word, index) {
  14638. return result + (index ? ' ' : '') + word.toLowerCase();
  14639. });
  14640. /**
  14641. * Converts the first character of `string` to lower case.
  14642. *
  14643. * @static
  14644. * @memberOf _
  14645. * @since 4.0.0
  14646. * @category String
  14647. * @param {string} [string=''] The string to convert.
  14648. * @returns {string} Returns the converted string.
  14649. * @example
  14650. *
  14651. * _.lowerFirst('Fred');
  14652. * // => 'fred'
  14653. *
  14654. * _.lowerFirst('FRED');
  14655. * // => 'fRED'
  14656. */
  14657. var lowerFirst = createCaseFirst('toLowerCase');
  14658. /**
  14659. * Pads `string` on the left and right sides if it's shorter than `length`.
  14660. * Padding characters are truncated if they can't be evenly divided by `length`.
  14661. *
  14662. * @static
  14663. * @memberOf _
  14664. * @since 3.0.0
  14665. * @category String
  14666. * @param {string} [string=''] The string to pad.
  14667. * @param {number} [length=0] The padding length.
  14668. * @param {string} [chars=' '] The string used as padding.
  14669. * @returns {string} Returns the padded string.
  14670. * @example
  14671. *
  14672. * _.pad('abc', 8);
  14673. * // => ' abc '
  14674. *
  14675. * _.pad('abc', 8, '_-');
  14676. * // => '_-abc_-_'
  14677. *
  14678. * _.pad('abc', 3);
  14679. * // => 'abc'
  14680. */
  14681. function pad(string, length, chars) {
  14682. string = toString(string);
  14683. length = toInteger(length);
  14684. var strLength = length ? stringSize(string) : 0;
  14685. if (!length || strLength >= length) {
  14686. return string;
  14687. }
  14688. var mid = (length - strLength) / 2;
  14689. return (
  14690. createPadding(nativeFloor(mid), chars) +
  14691. string +
  14692. createPadding(nativeCeil(mid), chars)
  14693. );
  14694. }
  14695. /**
  14696. * Pads `string` on the right side if it's shorter than `length`. Padding
  14697. * characters are truncated if they exceed `length`.
  14698. *
  14699. * @static
  14700. * @memberOf _
  14701. * @since 4.0.0
  14702. * @category String
  14703. * @param {string} [string=''] The string to pad.
  14704. * @param {number} [length=0] The padding length.
  14705. * @param {string} [chars=' '] The string used as padding.
  14706. * @returns {string} Returns the padded string.
  14707. * @example
  14708. *
  14709. * _.padEnd('abc', 6);
  14710. * // => 'abc '
  14711. *
  14712. * _.padEnd('abc', 6, '_-');
  14713. * // => 'abc_-_'
  14714. *
  14715. * _.padEnd('abc', 3);
  14716. * // => 'abc'
  14717. */
  14718. function padEnd(string, length, chars) {
  14719. string = toString(string);
  14720. length = toInteger(length);
  14721. var strLength = length ? stringSize(string) : 0;
  14722. return (length && strLength < length)
  14723. ? (string + createPadding(length - strLength, chars))
  14724. : string;
  14725. }
  14726. /**
  14727. * Pads `string` on the left side if it's shorter than `length`. Padding
  14728. * characters are truncated if they exceed `length`.
  14729. *
  14730. * @static
  14731. * @memberOf _
  14732. * @since 4.0.0
  14733. * @category String
  14734. * @param {string} [string=''] The string to pad.
  14735. * @param {number} [length=0] The padding length.
  14736. * @param {string} [chars=' '] The string used as padding.
  14737. * @returns {string} Returns the padded string.
  14738. * @example
  14739. *
  14740. * _.padStart('abc', 6);
  14741. * // => ' abc'
  14742. *
  14743. * _.padStart('abc', 6, '_-');
  14744. * // => '_-_abc'
  14745. *
  14746. * _.padStart('abc', 3);
  14747. * // => 'abc'
  14748. */
  14749. function padStart(string, length, chars) {
  14750. string = toString(string);
  14751. length = toInteger(length);
  14752. var strLength = length ? stringSize(string) : 0;
  14753. return (length && strLength < length)
  14754. ? (createPadding(length - strLength, chars) + string)
  14755. : string;
  14756. }
  14757. /**
  14758. * Converts `string` to an integer of the specified radix. If `radix` is
  14759. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14760. * hexadecimal, in which case a `radix` of `16` is used.
  14761. *
  14762. * **Note:** This method aligns with the
  14763. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14764. *
  14765. * @static
  14766. * @memberOf _
  14767. * @since 1.1.0
  14768. * @category String
  14769. * @param {string} string The string to convert.
  14770. * @param {number} [radix=10] The radix to interpret `value` by.
  14771. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14772. * @returns {number} Returns the converted integer.
  14773. * @example
  14774. *
  14775. * _.parseInt('08');
  14776. * // => 8
  14777. *
  14778. * _.map(['6', '08', '10'], _.parseInt);
  14779. * // => [6, 8, 10]
  14780. */
  14781. function parseInt(string, radix, guard) {
  14782. if (guard || radix == null) {
  14783. radix = 0;
  14784. } else if (radix) {
  14785. radix = +radix;
  14786. }
  14787. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14788. }
  14789. /**
  14790. * Repeats the given string `n` times.
  14791. *
  14792. * @static
  14793. * @memberOf _
  14794. * @since 3.0.0
  14795. * @category String
  14796. * @param {string} [string=''] The string to repeat.
  14797. * @param {number} [n=1] The number of times to repeat the string.
  14798. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14799. * @returns {string} Returns the repeated string.
  14800. * @example
  14801. *
  14802. * _.repeat('*', 3);
  14803. * // => '***'
  14804. *
  14805. * _.repeat('abc', 2);
  14806. * // => 'abcabc'
  14807. *
  14808. * _.repeat('abc', 0);
  14809. * // => ''
  14810. */
  14811. function repeat(string, n, guard) {
  14812. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14813. n = 1;
  14814. } else {
  14815. n = toInteger(n);
  14816. }
  14817. return baseRepeat(toString(string), n);
  14818. }
  14819. /**
  14820. * Replaces matches for `pattern` in `string` with `replacement`.
  14821. *
  14822. * **Note:** This method is based on
  14823. * [`String#replace`](https://mdn.io/String/replace).
  14824. *
  14825. * @static
  14826. * @memberOf _
  14827. * @since 4.0.0
  14828. * @category String
  14829. * @param {string} [string=''] The string to modify.
  14830. * @param {RegExp|string} pattern The pattern to replace.
  14831. * @param {Function|string} replacement The match replacement.
  14832. * @returns {string} Returns the modified string.
  14833. * @example
  14834. *
  14835. * _.replace('Hi Fred', 'Fred', 'Barney');
  14836. * // => 'Hi Barney'
  14837. */
  14838. function replace() {
  14839. var args = arguments,
  14840. string = toString(args[0]);
  14841. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14842. }
  14843. /**
  14844. * Converts `string` to
  14845. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14846. *
  14847. * @static
  14848. * @memberOf _
  14849. * @since 3.0.0
  14850. * @category String
  14851. * @param {string} [string=''] The string to convert.
  14852. * @returns {string} Returns the snake cased string.
  14853. * @example
  14854. *
  14855. * _.snakeCase('Foo Bar');
  14856. * // => 'foo_bar'
  14857. *
  14858. * _.snakeCase('fooBar');
  14859. * // => 'foo_bar'
  14860. *
  14861. * _.snakeCase('--FOO-BAR--');
  14862. * // => 'foo_bar'
  14863. */
  14864. var snakeCase = createCompounder(function(result, word, index) {
  14865. return result + (index ? '_' : '') + word.toLowerCase();
  14866. });
  14867. /**
  14868. * Splits `string` by `separator`.
  14869. *
  14870. * **Note:** This method is based on
  14871. * [`String#split`](https://mdn.io/String/split).
  14872. *
  14873. * @static
  14874. * @memberOf _
  14875. * @since 4.0.0
  14876. * @category String
  14877. * @param {string} [string=''] The string to split.
  14878. * @param {RegExp|string} separator The separator pattern to split by.
  14879. * @param {number} [limit] The length to truncate results to.
  14880. * @returns {Array} Returns the string segments.
  14881. * @example
  14882. *
  14883. * _.split('a-b-c', '-', 2);
  14884. * // => ['a', 'b']
  14885. */
  14886. function split(string, separator, limit) {
  14887. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14888. separator = limit = undefined;
  14889. }
  14890. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14891. if (!limit) {
  14892. return [];
  14893. }
  14894. string = toString(string);
  14895. if (string && (
  14896. typeof separator == 'string' ||
  14897. (separator != null && !isRegExp(separator))
  14898. )) {
  14899. separator = baseToString(separator);
  14900. if (!separator && hasUnicode(string)) {
  14901. return castSlice(stringToArray(string), 0, limit);
  14902. }
  14903. }
  14904. return string.split(separator, limit);
  14905. }
  14906. /**
  14907. * Converts `string` to
  14908. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14909. *
  14910. * @static
  14911. * @memberOf _
  14912. * @since 3.1.0
  14913. * @category String
  14914. * @param {string} [string=''] The string to convert.
  14915. * @returns {string} Returns the start cased string.
  14916. * @example
  14917. *
  14918. * _.startCase('--foo-bar--');
  14919. * // => 'Foo Bar'
  14920. *
  14921. * _.startCase('fooBar');
  14922. * // => 'Foo Bar'
  14923. *
  14924. * _.startCase('__FOO_BAR__');
  14925. * // => 'FOO BAR'
  14926. */
  14927. var startCase = createCompounder(function(result, word, index) {
  14928. return result + (index ? ' ' : '') + upperFirst(word);
  14929. });
  14930. /**
  14931. * Checks if `string` starts with the given target string.
  14932. *
  14933. * @static
  14934. * @memberOf _
  14935. * @since 3.0.0
  14936. * @category String
  14937. * @param {string} [string=''] The string to inspect.
  14938. * @param {string} [target] The string to search for.
  14939. * @param {number} [position=0] The position to search from.
  14940. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14941. * else `false`.
  14942. * @example
  14943. *
  14944. * _.startsWith('abc', 'a');
  14945. * // => true
  14946. *
  14947. * _.startsWith('abc', 'b');
  14948. * // => false
  14949. *
  14950. * _.startsWith('abc', 'b', 1);
  14951. * // => true
  14952. */
  14953. function startsWith(string, target, position) {
  14954. string = toString(string);
  14955. position = position == null
  14956. ? 0
  14957. : baseClamp(toInteger(position), 0, string.length);
  14958. target = baseToString(target);
  14959. return string.slice(position, position + target.length) == target;
  14960. }
  14961. /**
  14962. * Creates a compiled template function that can interpolate data properties
  14963. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14964. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14965. * properties may be accessed as free variables in the template. If a setting
  14966. * object is given, it takes precedence over `_.templateSettings` values.
  14967. *
  14968. * **Note:** In the development build `_.template` utilizes
  14969. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14970. * for easier debugging.
  14971. *
  14972. * For more information on precompiling templates see
  14973. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14974. *
  14975. * For more information on Chrome extension sandboxes see
  14976. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14977. *
  14978. * @static
  14979. * @since 0.1.0
  14980. * @memberOf _
  14981. * @category String
  14982. * @param {string} [string=''] The template string.
  14983. * @param {Object} [options={}] The options object.
  14984. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14985. * The HTML "escape" delimiter.
  14986. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14987. * The "evaluate" delimiter.
  14988. * @param {Object} [options.imports=_.templateSettings.imports]
  14989. * An object to import into the template as free variables.
  14990. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14991. * The "interpolate" delimiter.
  14992. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14993. * The sourceURL of the compiled template.
  14994. * @param {string} [options.variable='obj']
  14995. * The data object variable name.
  14996. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14997. * @returns {Function} Returns the compiled template function.
  14998. * @example
  14999. *
  15000. * // Use the "interpolate" delimiter to create a compiled template.
  15001. * var compiled = _.template('hello <%= user %>!');
  15002. * compiled({ 'user': 'fred' });
  15003. * // => 'hello fred!'
  15004. *
  15005. * // Use the HTML "escape" delimiter to escape data property values.
  15006. * var compiled = _.template('<b><%- value %></b>');
  15007. * compiled({ 'value': '<script>' });
  15008. * // => '<b>&lt;script&gt;</b>'
  15009. *
  15010. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15011. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15012. * compiled({ 'users': ['fred', 'barney'] });
  15013. * // => '<li>fred</li><li>barney</li>'
  15014. *
  15015. * // Use the internal `print` function in "evaluate" delimiters.
  15016. * var compiled = _.template('<% print("hello " + user); %>!');
  15017. * compiled({ 'user': 'barney' });
  15018. * // => 'hello barney!'
  15019. *
  15020. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15021. * // Disable support by replacing the "interpolate" delimiter.
  15022. * var compiled = _.template('hello ${ user }!');
  15023. * compiled({ 'user': 'pebbles' });
  15024. * // => 'hello pebbles!'
  15025. *
  15026. * // Use backslashes to treat delimiters as plain text.
  15027. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15028. * compiled({ 'value': 'ignored' });
  15029. * // => '<%- value %>'
  15030. *
  15031. * // Use the `imports` option to import `jQuery` as `jq`.
  15032. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15033. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15034. * compiled({ 'users': ['fred', 'barney'] });
  15035. * // => '<li>fred</li><li>barney</li>'
  15036. *
  15037. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15038. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15039. * compiled(data);
  15040. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15041. *
  15042. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15043. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15044. * compiled.source;
  15045. * // => function(data) {
  15046. * // var __t, __p = '';
  15047. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15048. * // return __p;
  15049. * // }
  15050. *
  15051. * // Use custom template delimiters.
  15052. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15053. * var compiled = _.template('hello {{ user }}!');
  15054. * compiled({ 'user': 'mustache' });
  15055. * // => 'hello mustache!'
  15056. *
  15057. * // Use the `source` property to inline compiled templates for meaningful
  15058. * // line numbers in error messages and stack traces.
  15059. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15060. * var JST = {\
  15061. * "main": ' + _.template(mainText).source + '\
  15062. * };\
  15063. * ');
  15064. */
  15065. function template(string, options, guard) {
  15066. // Based on John Resig's `tmpl` implementation
  15067. // (http://ejohn.org/blog/javascript-micro-templating/)
  15068. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15069. var settings = lodash.templateSettings;
  15070. if (guard && isIterateeCall(string, options, guard)) {
  15071. options = undefined;
  15072. }
  15073. string = toString(string);
  15074. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15075. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15076. importsKeys = keys(imports),
  15077. importsValues = baseValues(imports, importsKeys);
  15078. var isEscaping,
  15079. isEvaluating,
  15080. index = 0,
  15081. interpolate = options.interpolate || reNoMatch,
  15082. source = "__p += '";
  15083. // Compile the regexp to match each delimiter.
  15084. var reDelimiters = RegExp(
  15085. (options.escape || reNoMatch).source + '|' +
  15086. interpolate.source + '|' +
  15087. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15088. (options.evaluate || reNoMatch).source + '|$'
  15089. , 'g');
  15090. // Use a sourceURL for easier debugging.
  15091. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15092. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15093. // and escape the comment, thus injecting code that gets evaled.
  15094. var sourceURL = '//# sourceURL=' +
  15095. (hasOwnProperty.call(options, 'sourceURL')
  15096. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15097. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15098. ) + '\n';
  15099. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15100. interpolateValue || (interpolateValue = esTemplateValue);
  15101. // Escape characters that can't be included in string literals.
  15102. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15103. // Replace delimiters with snippets.
  15104. if (escapeValue) {
  15105. isEscaping = true;
  15106. source += "' +\n__e(" + escapeValue + ") +\n'";
  15107. }
  15108. if (evaluateValue) {
  15109. isEvaluating = true;
  15110. source += "';\n" + evaluateValue + ";\n__p += '";
  15111. }
  15112. if (interpolateValue) {
  15113. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15114. }
  15115. index = offset + match.length;
  15116. // The JS engine embedded in Adobe products needs `match` returned in
  15117. // order to produce the correct `offset` value.
  15118. return match;
  15119. });
  15120. source += "';\n";
  15121. // If `variable` is not specified wrap a with-statement around the generated
  15122. // code to add the data object to the top of the scope chain.
  15123. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15124. if (!variable) {
  15125. source = 'with (obj) {\n' + source + '\n}\n';
  15126. }
  15127. // Throw an error if a forbidden character was found in `variable`, to prevent
  15128. // potential command injection attacks.
  15129. else if (reForbiddenIdentifierChars.test(variable)) {
  15130. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15131. }
  15132. // Cleanup code by stripping empty strings.
  15133. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15134. .replace(reEmptyStringMiddle, '$1')
  15135. .replace(reEmptyStringTrailing, '$1;');
  15136. // Frame code as the function body.
  15137. source = 'function(' + (variable || 'obj') + ') {\n' +
  15138. (variable
  15139. ? ''
  15140. : 'obj || (obj = {});\n'
  15141. ) +
  15142. "var __t, __p = ''" +
  15143. (isEscaping
  15144. ? ', __e = _.escape'
  15145. : ''
  15146. ) +
  15147. (isEvaluating
  15148. ? ', __j = Array.prototype.join;\n' +
  15149. "function print() { __p += __j.call(arguments, '') }\n"
  15150. : ';\n'
  15151. ) +
  15152. source +
  15153. 'return __p\n}';
  15154. var result = attempt(function() {
  15155. return Function(importsKeys, sourceURL + 'return ' + source)
  15156. .apply(undefined, importsValues);
  15157. });
  15158. // Provide the compiled function's source by its `toString` method or
  15159. // the `source` property as a convenience for inlining compiled templates.
  15160. result.source = source;
  15161. if (isError(result)) {
  15162. throw result;
  15163. }
  15164. return result;
  15165. }
  15166. /**
  15167. * Converts `string`, as a whole, to lower case just like
  15168. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15169. *
  15170. * @static
  15171. * @memberOf _
  15172. * @since 4.0.0
  15173. * @category String
  15174. * @param {string} [string=''] The string to convert.
  15175. * @returns {string} Returns the lower cased string.
  15176. * @example
  15177. *
  15178. * _.toLower('--Foo-Bar--');
  15179. * // => '--foo-bar--'
  15180. *
  15181. * _.toLower('fooBar');
  15182. * // => 'foobar'
  15183. *
  15184. * _.toLower('__FOO_BAR__');
  15185. * // => '__foo_bar__'
  15186. */
  15187. function toLower(value) {
  15188. return toString(value).toLowerCase();
  15189. }
  15190. /**
  15191. * Converts `string`, as a whole, to upper case just like
  15192. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15193. *
  15194. * @static
  15195. * @memberOf _
  15196. * @since 4.0.0
  15197. * @category String
  15198. * @param {string} [string=''] The string to convert.
  15199. * @returns {string} Returns the upper cased string.
  15200. * @example
  15201. *
  15202. * _.toUpper('--foo-bar--');
  15203. * // => '--FOO-BAR--'
  15204. *
  15205. * _.toUpper('fooBar');
  15206. * // => 'FOOBAR'
  15207. *
  15208. * _.toUpper('__foo_bar__');
  15209. * // => '__FOO_BAR__'
  15210. */
  15211. function toUpper(value) {
  15212. return toString(value).toUpperCase();
  15213. }
  15214. /**
  15215. * Removes leading and trailing whitespace or specified characters from `string`.
  15216. *
  15217. * @static
  15218. * @memberOf _
  15219. * @since 3.0.0
  15220. * @category String
  15221. * @param {string} [string=''] The string to trim.
  15222. * @param {string} [chars=whitespace] The characters to trim.
  15223. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15224. * @returns {string} Returns the trimmed string.
  15225. * @example
  15226. *
  15227. * _.trim(' abc ');
  15228. * // => 'abc'
  15229. *
  15230. * _.trim('-_-abc-_-', '_-');
  15231. * // => 'abc'
  15232. *
  15233. * _.map([' foo ', ' bar '], _.trim);
  15234. * // => ['foo', 'bar']
  15235. */
  15236. function trim(string, chars, guard) {
  15237. string = toString(string);
  15238. if (string && (guard || chars === undefined)) {
  15239. return baseTrim(string);
  15240. }
  15241. if (!string || !(chars = baseToString(chars))) {
  15242. return string;
  15243. }
  15244. var strSymbols = stringToArray(string),
  15245. chrSymbols = stringToArray(chars),
  15246. start = charsStartIndex(strSymbols, chrSymbols),
  15247. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15248. return castSlice(strSymbols, start, end).join('');
  15249. }
  15250. /**
  15251. * Removes trailing whitespace or specified characters from `string`.
  15252. *
  15253. * @static
  15254. * @memberOf _
  15255. * @since 4.0.0
  15256. * @category String
  15257. * @param {string} [string=''] The string to trim.
  15258. * @param {string} [chars=whitespace] The characters to trim.
  15259. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15260. * @returns {string} Returns the trimmed string.
  15261. * @example
  15262. *
  15263. * _.trimEnd(' abc ');
  15264. * // => ' abc'
  15265. *
  15266. * _.trimEnd('-_-abc-_-', '_-');
  15267. * // => '-_-abc'
  15268. */
  15269. function trimEnd(string, chars, guard) {
  15270. string = toString(string);
  15271. if (string && (guard || chars === undefined)) {
  15272. return string.slice(0, trimmedEndIndex(string) + 1);
  15273. }
  15274. if (!string || !(chars = baseToString(chars))) {
  15275. return string;
  15276. }
  15277. var strSymbols = stringToArray(string),
  15278. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15279. return castSlice(strSymbols, 0, end).join('');
  15280. }
  15281. /**
  15282. * Removes leading whitespace or specified characters from `string`.
  15283. *
  15284. * @static
  15285. * @memberOf _
  15286. * @since 4.0.0
  15287. * @category String
  15288. * @param {string} [string=''] The string to trim.
  15289. * @param {string} [chars=whitespace] The characters to trim.
  15290. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15291. * @returns {string} Returns the trimmed string.
  15292. * @example
  15293. *
  15294. * _.trimStart(' abc ');
  15295. * // => 'abc '
  15296. *
  15297. * _.trimStart('-_-abc-_-', '_-');
  15298. * // => 'abc-_-'
  15299. */
  15300. function trimStart(string, chars, guard) {
  15301. string = toString(string);
  15302. if (string && (guard || chars === undefined)) {
  15303. return string.replace(reTrimStart, '');
  15304. }
  15305. if (!string || !(chars = baseToString(chars))) {
  15306. return string;
  15307. }
  15308. var strSymbols = stringToArray(string),
  15309. start = charsStartIndex(strSymbols, stringToArray(chars));
  15310. return castSlice(strSymbols, start).join('');
  15311. }
  15312. /**
  15313. * Truncates `string` if it's longer than the given maximum string length.
  15314. * The last characters of the truncated string are replaced with the omission
  15315. * string which defaults to "...".
  15316. *
  15317. * @static
  15318. * @memberOf _
  15319. * @since 4.0.0
  15320. * @category String
  15321. * @param {string} [string=''] The string to truncate.
  15322. * @param {Object} [options={}] The options object.
  15323. * @param {number} [options.length=30] The maximum string length.
  15324. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15325. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15326. * @returns {string} Returns the truncated string.
  15327. * @example
  15328. *
  15329. * _.truncate('hi-diddly-ho there, neighborino');
  15330. * // => 'hi-diddly-ho there, neighbo...'
  15331. *
  15332. * _.truncate('hi-diddly-ho there, neighborino', {
  15333. * 'length': 24,
  15334. * 'separator': ' '
  15335. * });
  15336. * // => 'hi-diddly-ho there,...'
  15337. *
  15338. * _.truncate('hi-diddly-ho there, neighborino', {
  15339. * 'length': 24,
  15340. * 'separator': /,? +/
  15341. * });
  15342. * // => 'hi-diddly-ho there...'
  15343. *
  15344. * _.truncate('hi-diddly-ho there, neighborino', {
  15345. * 'omission': ' [...]'
  15346. * });
  15347. * // => 'hi-diddly-ho there, neig [...]'
  15348. */
  15349. function truncate(string, options) {
  15350. var length = DEFAULT_TRUNC_LENGTH,
  15351. omission = DEFAULT_TRUNC_OMISSION;
  15352. if (isObject(options)) {
  15353. var separator = 'separator' in options ? options.separator : separator;
  15354. length = 'length' in options ? toInteger(options.length) : length;
  15355. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15356. }
  15357. string = toString(string);
  15358. var strLength = string.length;
  15359. if (hasUnicode(string)) {
  15360. var strSymbols = stringToArray(string);
  15361. strLength = strSymbols.length;
  15362. }
  15363. if (length >= strLength) {
  15364. return string;
  15365. }
  15366. var end = length - stringSize(omission);
  15367. if (end < 1) {
  15368. return omission;
  15369. }
  15370. var result = strSymbols
  15371. ? castSlice(strSymbols, 0, end).join('')
  15372. : string.slice(0, end);
  15373. if (separator === undefined) {
  15374. return result + omission;
  15375. }
  15376. if (strSymbols) {
  15377. end += (result.length - end);
  15378. }
  15379. if (isRegExp(separator)) {
  15380. if (string.slice(end).search(separator)) {
  15381. var match,
  15382. substring = result;
  15383. if (!separator.global) {
  15384. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15385. }
  15386. separator.lastIndex = 0;
  15387. while ((match = separator.exec(substring))) {
  15388. var newEnd = match.index;
  15389. }
  15390. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15391. }
  15392. } else if (string.indexOf(baseToString(separator), end) != end) {
  15393. var index = result.lastIndexOf(separator);
  15394. if (index > -1) {
  15395. result = result.slice(0, index);
  15396. }
  15397. }
  15398. return result + omission;
  15399. }
  15400. /**
  15401. * The inverse of `_.escape`; this method converts the HTML entities
  15402. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15403. * their corresponding characters.
  15404. *
  15405. * **Note:** No other HTML entities are unescaped. To unescape additional
  15406. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15407. *
  15408. * @static
  15409. * @memberOf _
  15410. * @since 0.6.0
  15411. * @category String
  15412. * @param {string} [string=''] The string to unescape.
  15413. * @returns {string} Returns the unescaped string.
  15414. * @example
  15415. *
  15416. * _.unescape('fred, barney, &amp; pebbles');
  15417. * // => 'fred, barney, & pebbles'
  15418. */
  15419. function unescape(string) {
  15420. string = toString(string);
  15421. return (string && reHasEscapedHtml.test(string))
  15422. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15423. : string;
  15424. }
  15425. /**
  15426. * Converts `string`, as space separated words, to upper case.
  15427. *
  15428. * @static
  15429. * @memberOf _
  15430. * @since 4.0.0
  15431. * @category String
  15432. * @param {string} [string=''] The string to convert.
  15433. * @returns {string} Returns the upper cased string.
  15434. * @example
  15435. *
  15436. * _.upperCase('--foo-bar');
  15437. * // => 'FOO BAR'
  15438. *
  15439. * _.upperCase('fooBar');
  15440. * // => 'FOO BAR'
  15441. *
  15442. * _.upperCase('__foo_bar__');
  15443. * // => 'FOO BAR'
  15444. */
  15445. var upperCase = createCompounder(function(result, word, index) {
  15446. return result + (index ? ' ' : '') + word.toUpperCase();
  15447. });
  15448. /**
  15449. * Converts the first character of `string` to upper case.
  15450. *
  15451. * @static
  15452. * @memberOf _
  15453. * @since 4.0.0
  15454. * @category String
  15455. * @param {string} [string=''] The string to convert.
  15456. * @returns {string} Returns the converted string.
  15457. * @example
  15458. *
  15459. * _.upperFirst('fred');
  15460. * // => 'Fred'
  15461. *
  15462. * _.upperFirst('FRED');
  15463. * // => 'FRED'
  15464. */
  15465. var upperFirst = createCaseFirst('toUpperCase');
  15466. /**
  15467. * Splits `string` into an array of its words.
  15468. *
  15469. * @static
  15470. * @memberOf _
  15471. * @since 3.0.0
  15472. * @category String
  15473. * @param {string} [string=''] The string to inspect.
  15474. * @param {RegExp|string} [pattern] The pattern to match words.
  15475. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15476. * @returns {Array} Returns the words of `string`.
  15477. * @example
  15478. *
  15479. * _.words('fred, barney, & pebbles');
  15480. * // => ['fred', 'barney', 'pebbles']
  15481. *
  15482. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15483. * // => ['fred', 'barney', '&', 'pebbles']
  15484. */
  15485. function words(string, pattern, guard) {
  15486. string = toString(string);
  15487. pattern = guard ? undefined : pattern;
  15488. if (pattern === undefined) {
  15489. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15490. }
  15491. return string.match(pattern) || [];
  15492. }
  15493. /*------------------------------------------------------------------------*/
  15494. /**
  15495. * Attempts to invoke `func`, returning either the result or the caught error
  15496. * object. Any additional arguments are provided to `func` when it's invoked.
  15497. *
  15498. * @static
  15499. * @memberOf _
  15500. * @since 3.0.0
  15501. * @category Util
  15502. * @param {Function} func The function to attempt.
  15503. * @param {...*} [args] The arguments to invoke `func` with.
  15504. * @returns {*} Returns the `func` result or error object.
  15505. * @example
  15506. *
  15507. * // Avoid throwing errors for invalid selectors.
  15508. * var elements = _.attempt(function(selector) {
  15509. * return document.querySelectorAll(selector);
  15510. * }, '>_>');
  15511. *
  15512. * if (_.isError(elements)) {
  15513. * elements = [];
  15514. * }
  15515. */
  15516. var attempt = baseRest(function(func, args) {
  15517. try {
  15518. return apply(func, undefined, args);
  15519. } catch (e) {
  15520. return isError(e) ? e : new Error(e);
  15521. }
  15522. });
  15523. /**
  15524. * Binds methods of an object to the object itself, overwriting the existing
  15525. * method.
  15526. *
  15527. * **Note:** This method doesn't set the "length" property of bound functions.
  15528. *
  15529. * @static
  15530. * @since 0.1.0
  15531. * @memberOf _
  15532. * @category Util
  15533. * @param {Object} object The object to bind and assign the bound methods to.
  15534. * @param {...(string|string[])} methodNames The object method names to bind.
  15535. * @returns {Object} Returns `object`.
  15536. * @example
  15537. *
  15538. * var view = {
  15539. * 'label': 'docs',
  15540. * 'click': function() {
  15541. * console.log('clicked ' + this.label);
  15542. * }
  15543. * };
  15544. *
  15545. * _.bindAll(view, ['click']);
  15546. * jQuery(element).on('click', view.click);
  15547. * // => Logs 'clicked docs' when clicked.
  15548. */
  15549. var bindAll = flatRest(function(object, methodNames) {
  15550. arrayEach(methodNames, function(key) {
  15551. key = toKey(key);
  15552. baseAssignValue(object, key, bind(object[key], object));
  15553. });
  15554. return object;
  15555. });
  15556. /**
  15557. * Creates a function that iterates over `pairs` and invokes the corresponding
  15558. * function of the first predicate to return truthy. The predicate-function
  15559. * pairs are invoked with the `this` binding and arguments of the created
  15560. * function.
  15561. *
  15562. * @static
  15563. * @memberOf _
  15564. * @since 4.0.0
  15565. * @category Util
  15566. * @param {Array} pairs The predicate-function pairs.
  15567. * @returns {Function} Returns the new composite function.
  15568. * @example
  15569. *
  15570. * var func = _.cond([
  15571. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15572. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15573. * [_.stubTrue, _.constant('no match')]
  15574. * ]);
  15575. *
  15576. * func({ 'a': 1, 'b': 2 });
  15577. * // => 'matches A'
  15578. *
  15579. * func({ 'a': 0, 'b': 1 });
  15580. * // => 'matches B'
  15581. *
  15582. * func({ 'a': '1', 'b': '2' });
  15583. * // => 'no match'
  15584. */
  15585. function cond(pairs) {
  15586. var length = pairs == null ? 0 : pairs.length,
  15587. toIteratee = getIteratee();
  15588. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15589. if (typeof pair[1] != 'function') {
  15590. throw new TypeError(FUNC_ERROR_TEXT);
  15591. }
  15592. return [toIteratee(pair[0]), pair[1]];
  15593. });
  15594. return baseRest(function(args) {
  15595. var index = -1;
  15596. while (++index < length) {
  15597. var pair = pairs[index];
  15598. if (apply(pair[0], this, args)) {
  15599. return apply(pair[1], this, args);
  15600. }
  15601. }
  15602. });
  15603. }
  15604. /**
  15605. * Creates a function that invokes the predicate properties of `source` with
  15606. * the corresponding property values of a given object, returning `true` if
  15607. * all predicates return truthy, else `false`.
  15608. *
  15609. * **Note:** The created function is equivalent to `_.conformsTo` with
  15610. * `source` partially applied.
  15611. *
  15612. * @static
  15613. * @memberOf _
  15614. * @since 4.0.0
  15615. * @category Util
  15616. * @param {Object} source The object of property predicates to conform to.
  15617. * @returns {Function} Returns the new spec function.
  15618. * @example
  15619. *
  15620. * var objects = [
  15621. * { 'a': 2, 'b': 1 },
  15622. * { 'a': 1, 'b': 2 }
  15623. * ];
  15624. *
  15625. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15626. * // => [{ 'a': 1, 'b': 2 }]
  15627. */
  15628. function conforms(source) {
  15629. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15630. }
  15631. /**
  15632. * Creates a function that returns `value`.
  15633. *
  15634. * @static
  15635. * @memberOf _
  15636. * @since 2.4.0
  15637. * @category Util
  15638. * @param {*} value The value to return from the new function.
  15639. * @returns {Function} Returns the new constant function.
  15640. * @example
  15641. *
  15642. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15643. *
  15644. * console.log(objects);
  15645. * // => [{ 'a': 1 }, { 'a': 1 }]
  15646. *
  15647. * console.log(objects[0] === objects[1]);
  15648. * // => true
  15649. */
  15650. function constant(value) {
  15651. return function() {
  15652. return value;
  15653. };
  15654. }
  15655. /**
  15656. * Checks `value` to determine whether a default value should be returned in
  15657. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15658. * or `undefined`.
  15659. *
  15660. * @static
  15661. * @memberOf _
  15662. * @since 4.14.0
  15663. * @category Util
  15664. * @param {*} value The value to check.
  15665. * @param {*} defaultValue The default value.
  15666. * @returns {*} Returns the resolved value.
  15667. * @example
  15668. *
  15669. * _.defaultTo(1, 10);
  15670. * // => 1
  15671. *
  15672. * _.defaultTo(undefined, 10);
  15673. * // => 10
  15674. */
  15675. function defaultTo(value, defaultValue) {
  15676. return (value == null || value !== value) ? defaultValue : value;
  15677. }
  15678. /**
  15679. * Creates a function that returns the result of invoking the given functions
  15680. * with the `this` binding of the created function, where each successive
  15681. * invocation is supplied the return value of the previous.
  15682. *
  15683. * @static
  15684. * @memberOf _
  15685. * @since 3.0.0
  15686. * @category Util
  15687. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15688. * @returns {Function} Returns the new composite function.
  15689. * @see _.flowRight
  15690. * @example
  15691. *
  15692. * function square(n) {
  15693. * return n * n;
  15694. * }
  15695. *
  15696. * var addSquare = _.flow([_.add, square]);
  15697. * addSquare(1, 2);
  15698. * // => 9
  15699. */
  15700. var flow = createFlow();
  15701. /**
  15702. * This method is like `_.flow` except that it creates a function that
  15703. * invokes the given functions from right to left.
  15704. *
  15705. * @static
  15706. * @since 3.0.0
  15707. * @memberOf _
  15708. * @category Util
  15709. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15710. * @returns {Function} Returns the new composite function.
  15711. * @see _.flow
  15712. * @example
  15713. *
  15714. * function square(n) {
  15715. * return n * n;
  15716. * }
  15717. *
  15718. * var addSquare = _.flowRight([square, _.add]);
  15719. * addSquare(1, 2);
  15720. * // => 9
  15721. */
  15722. var flowRight = createFlow(true);
  15723. /**
  15724. * This method returns the first argument it receives.
  15725. *
  15726. * @static
  15727. * @since 0.1.0
  15728. * @memberOf _
  15729. * @category Util
  15730. * @param {*} value Any value.
  15731. * @returns {*} Returns `value`.
  15732. * @example
  15733. *
  15734. * var object = { 'a': 1 };
  15735. *
  15736. * console.log(_.identity(object) === object);
  15737. * // => true
  15738. */
  15739. function identity(value) {
  15740. return value;
  15741. }
  15742. /**
  15743. * Creates a function that invokes `func` with the arguments of the created
  15744. * function. If `func` is a property name, the created function returns the
  15745. * property value for a given element. If `func` is an array or object, the
  15746. * created function returns `true` for elements that contain the equivalent
  15747. * source properties, otherwise it returns `false`.
  15748. *
  15749. * @static
  15750. * @since 4.0.0
  15751. * @memberOf _
  15752. * @category Util
  15753. * @param {*} [func=_.identity] The value to convert to a callback.
  15754. * @returns {Function} Returns the callback.
  15755. * @example
  15756. *
  15757. * var users = [
  15758. * { 'user': 'barney', 'age': 36, 'active': true },
  15759. * { 'user': 'fred', 'age': 40, 'active': false }
  15760. * ];
  15761. *
  15762. * // The `_.matches` iteratee shorthand.
  15763. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15764. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15765. *
  15766. * // The `_.matchesProperty` iteratee shorthand.
  15767. * _.filter(users, _.iteratee(['user', 'fred']));
  15768. * // => [{ 'user': 'fred', 'age': 40 }]
  15769. *
  15770. * // The `_.property` iteratee shorthand.
  15771. * _.map(users, _.iteratee('user'));
  15772. * // => ['barney', 'fred']
  15773. *
  15774. * // Create custom iteratee shorthands.
  15775. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15776. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15777. * return func.test(string);
  15778. * };
  15779. * });
  15780. *
  15781. * _.filter(['abc', 'def'], /ef/);
  15782. * // => ['def']
  15783. */
  15784. function iteratee(func) {
  15785. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15786. }
  15787. /**
  15788. * Creates a function that performs a partial deep comparison between a given
  15789. * object and `source`, returning `true` if the given object has equivalent
  15790. * property values, else `false`.
  15791. *
  15792. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15793. * partially applied.
  15794. *
  15795. * Partial comparisons will match empty array and empty object `source`
  15796. * values against any array or object value, respectively. See `_.isEqual`
  15797. * for a list of supported value comparisons.
  15798. *
  15799. * **Note:** Multiple values can be checked by combining several matchers
  15800. * using `_.overSome`
  15801. *
  15802. * @static
  15803. * @memberOf _
  15804. * @since 3.0.0
  15805. * @category Util
  15806. * @param {Object} source The object of property values to match.
  15807. * @returns {Function} Returns the new spec function.
  15808. * @example
  15809. *
  15810. * var objects = [
  15811. * { 'a': 1, 'b': 2, 'c': 3 },
  15812. * { 'a': 4, 'b': 5, 'c': 6 }
  15813. * ];
  15814. *
  15815. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15816. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15817. *
  15818. * // Checking for several possible values
  15819. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15820. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15821. */
  15822. function matches(source) {
  15823. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15824. }
  15825. /**
  15826. * Creates a function that performs a partial deep comparison between the
  15827. * value at `path` of a given object to `srcValue`, returning `true` if the
  15828. * object value is equivalent, else `false`.
  15829. *
  15830. * **Note:** Partial comparisons will match empty array and empty object
  15831. * `srcValue` values against any array or object value, respectively. See
  15832. * `_.isEqual` for a list of supported value comparisons.
  15833. *
  15834. * **Note:** Multiple values can be checked by combining several matchers
  15835. * using `_.overSome`
  15836. *
  15837. * @static
  15838. * @memberOf _
  15839. * @since 3.2.0
  15840. * @category Util
  15841. * @param {Array|string} path The path of the property to get.
  15842. * @param {*} srcValue The value to match.
  15843. * @returns {Function} Returns the new spec function.
  15844. * @example
  15845. *
  15846. * var objects = [
  15847. * { 'a': 1, 'b': 2, 'c': 3 },
  15848. * { 'a': 4, 'b': 5, 'c': 6 }
  15849. * ];
  15850. *
  15851. * _.find(objects, _.matchesProperty('a', 4));
  15852. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15853. *
  15854. * // Checking for several possible values
  15855. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15856. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15857. */
  15858. function matchesProperty(path, srcValue) {
  15859. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15860. }
  15861. /**
  15862. * Creates a function that invokes the method at `path` of a given object.
  15863. * Any additional arguments are provided to the invoked method.
  15864. *
  15865. * @static
  15866. * @memberOf _
  15867. * @since 3.7.0
  15868. * @category Util
  15869. * @param {Array|string} path The path of the method to invoke.
  15870. * @param {...*} [args] The arguments to invoke the method with.
  15871. * @returns {Function} Returns the new invoker function.
  15872. * @example
  15873. *
  15874. * var objects = [
  15875. * { 'a': { 'b': _.constant(2) } },
  15876. * { 'a': { 'b': _.constant(1) } }
  15877. * ];
  15878. *
  15879. * _.map(objects, _.method('a.b'));
  15880. * // => [2, 1]
  15881. *
  15882. * _.map(objects, _.method(['a', 'b']));
  15883. * // => [2, 1]
  15884. */
  15885. var method = baseRest(function(path, args) {
  15886. return function(object) {
  15887. return baseInvoke(object, path, args);
  15888. };
  15889. });
  15890. /**
  15891. * The opposite of `_.method`; this method creates a function that invokes
  15892. * the method at a given path of `object`. Any additional arguments are
  15893. * provided to the invoked method.
  15894. *
  15895. * @static
  15896. * @memberOf _
  15897. * @since 3.7.0
  15898. * @category Util
  15899. * @param {Object} object The object to query.
  15900. * @param {...*} [args] The arguments to invoke the method with.
  15901. * @returns {Function} Returns the new invoker function.
  15902. * @example
  15903. *
  15904. * var array = _.times(3, _.constant),
  15905. * object = { 'a': array, 'b': array, 'c': array };
  15906. *
  15907. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15908. * // => [2, 0]
  15909. *
  15910. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15911. * // => [2, 0]
  15912. */
  15913. var methodOf = baseRest(function(object, args) {
  15914. return function(path) {
  15915. return baseInvoke(object, path, args);
  15916. };
  15917. });
  15918. /**
  15919. * Adds all own enumerable string keyed function properties of a source
  15920. * object to the destination object. If `object` is a function, then methods
  15921. * are added to its prototype as well.
  15922. *
  15923. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15924. * avoid conflicts caused by modifying the original.
  15925. *
  15926. * @static
  15927. * @since 0.1.0
  15928. * @memberOf _
  15929. * @category Util
  15930. * @param {Function|Object} [object=lodash] The destination object.
  15931. * @param {Object} source The object of functions to add.
  15932. * @param {Object} [options={}] The options object.
  15933. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15934. * @returns {Function|Object} Returns `object`.
  15935. * @example
  15936. *
  15937. * function vowels(string) {
  15938. * return _.filter(string, function(v) {
  15939. * return /[aeiou]/i.test(v);
  15940. * });
  15941. * }
  15942. *
  15943. * _.mixin({ 'vowels': vowels });
  15944. * _.vowels('fred');
  15945. * // => ['e']
  15946. *
  15947. * _('fred').vowels().value();
  15948. * // => ['e']
  15949. *
  15950. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15951. * _('fred').vowels();
  15952. * // => ['e']
  15953. */
  15954. function mixin(object, source, options) {
  15955. var props = keys(source),
  15956. methodNames = baseFunctions(source, props);
  15957. if (options == null &&
  15958. !(isObject(source) && (methodNames.length || !props.length))) {
  15959. options = source;
  15960. source = object;
  15961. object = this;
  15962. methodNames = baseFunctions(source, keys(source));
  15963. }
  15964. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15965. isFunc = isFunction(object);
  15966. arrayEach(methodNames, function(methodName) {
  15967. var func = source[methodName];
  15968. object[methodName] = func;
  15969. if (isFunc) {
  15970. object.prototype[methodName] = function() {
  15971. var chainAll = this.__chain__;
  15972. if (chain || chainAll) {
  15973. var result = object(this.__wrapped__),
  15974. actions = result.__actions__ = copyArray(this.__actions__);
  15975. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15976. result.__chain__ = chainAll;
  15977. return result;
  15978. }
  15979. return func.apply(object, arrayPush([this.value()], arguments));
  15980. };
  15981. }
  15982. });
  15983. return object;
  15984. }
  15985. /**
  15986. * Reverts the `_` variable to its previous value and returns a reference to
  15987. * the `lodash` function.
  15988. *
  15989. * @static
  15990. * @since 0.1.0
  15991. * @memberOf _
  15992. * @category Util
  15993. * @returns {Function} Returns the `lodash` function.
  15994. * @example
  15995. *
  15996. * var lodash = _.noConflict();
  15997. */
  15998. function noConflict() {
  15999. if (root._ === this) {
  16000. root._ = oldDash;
  16001. }
  16002. return this;
  16003. }
  16004. /**
  16005. * This method returns `undefined`.
  16006. *
  16007. * @static
  16008. * @memberOf _
  16009. * @since 2.3.0
  16010. * @category Util
  16011. * @example
  16012. *
  16013. * _.times(2, _.noop);
  16014. * // => [undefined, undefined]
  16015. */
  16016. function noop() {
  16017. // No operation performed.
  16018. }
  16019. /**
  16020. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16021. * the nth argument from the end is returned.
  16022. *
  16023. * @static
  16024. * @memberOf _
  16025. * @since 4.0.0
  16026. * @category Util
  16027. * @param {number} [n=0] The index of the argument to return.
  16028. * @returns {Function} Returns the new pass-thru function.
  16029. * @example
  16030. *
  16031. * var func = _.nthArg(1);
  16032. * func('a', 'b', 'c', 'd');
  16033. * // => 'b'
  16034. *
  16035. * var func = _.nthArg(-2);
  16036. * func('a', 'b', 'c', 'd');
  16037. * // => 'c'
  16038. */
  16039. function nthArg(n) {
  16040. n = toInteger(n);
  16041. return baseRest(function(args) {
  16042. return baseNth(args, n);
  16043. });
  16044. }
  16045. /**
  16046. * Creates a function that invokes `iteratees` with the arguments it receives
  16047. * and returns their results.
  16048. *
  16049. * @static
  16050. * @memberOf _
  16051. * @since 4.0.0
  16052. * @category Util
  16053. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16054. * The iteratees to invoke.
  16055. * @returns {Function} Returns the new function.
  16056. * @example
  16057. *
  16058. * var func = _.over([Math.max, Math.min]);
  16059. *
  16060. * func(1, 2, 3, 4);
  16061. * // => [4, 1]
  16062. */
  16063. var over = createOver(arrayMap);
  16064. /**
  16065. * Creates a function that checks if **all** of the `predicates` return
  16066. * truthy when invoked with the arguments it receives.
  16067. *
  16068. * Following shorthands are possible for providing predicates.
  16069. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16070. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16071. *
  16072. * @static
  16073. * @memberOf _
  16074. * @since 4.0.0
  16075. * @category Util
  16076. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16077. * The predicates to check.
  16078. * @returns {Function} Returns the new function.
  16079. * @example
  16080. *
  16081. * var func = _.overEvery([Boolean, isFinite]);
  16082. *
  16083. * func('1');
  16084. * // => true
  16085. *
  16086. * func(null);
  16087. * // => false
  16088. *
  16089. * func(NaN);
  16090. * // => false
  16091. */
  16092. var overEvery = createOver(arrayEvery);
  16093. /**
  16094. * Creates a function that checks if **any** of the `predicates` return
  16095. * truthy when invoked with the arguments it receives.
  16096. *
  16097. * Following shorthands are possible for providing predicates.
  16098. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16099. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16100. *
  16101. * @static
  16102. * @memberOf _
  16103. * @since 4.0.0
  16104. * @category Util
  16105. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16106. * The predicates to check.
  16107. * @returns {Function} Returns the new function.
  16108. * @example
  16109. *
  16110. * var func = _.overSome([Boolean, isFinite]);
  16111. *
  16112. * func('1');
  16113. * // => true
  16114. *
  16115. * func(null);
  16116. * // => true
  16117. *
  16118. * func(NaN);
  16119. * // => false
  16120. *
  16121. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16122. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16123. */
  16124. var overSome = createOver(arraySome);
  16125. /**
  16126. * Creates a function that returns the value at `path` of a given object.
  16127. *
  16128. * @static
  16129. * @memberOf _
  16130. * @since 2.4.0
  16131. * @category Util
  16132. * @param {Array|string} path The path of the property to get.
  16133. * @returns {Function} Returns the new accessor function.
  16134. * @example
  16135. *
  16136. * var objects = [
  16137. * { 'a': { 'b': 2 } },
  16138. * { 'a': { 'b': 1 } }
  16139. * ];
  16140. *
  16141. * _.map(objects, _.property('a.b'));
  16142. * // => [2, 1]
  16143. *
  16144. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16145. * // => [1, 2]
  16146. */
  16147. function property(path) {
  16148. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16149. }
  16150. /**
  16151. * The opposite of `_.property`; this method creates a function that returns
  16152. * the value at a given path of `object`.
  16153. *
  16154. * @static
  16155. * @memberOf _
  16156. * @since 3.0.0
  16157. * @category Util
  16158. * @param {Object} object The object to query.
  16159. * @returns {Function} Returns the new accessor function.
  16160. * @example
  16161. *
  16162. * var array = [0, 1, 2],
  16163. * object = { 'a': array, 'b': array, 'c': array };
  16164. *
  16165. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16166. * // => [2, 0]
  16167. *
  16168. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16169. * // => [2, 0]
  16170. */
  16171. function propertyOf(object) {
  16172. return function(path) {
  16173. return object == null ? undefined : baseGet(object, path);
  16174. };
  16175. }
  16176. /**
  16177. * Creates an array of numbers (positive and/or negative) progressing from
  16178. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16179. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16180. * it's set to `start` with `start` then set to `0`.
  16181. *
  16182. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16183. * floating-point values which can produce unexpected results.
  16184. *
  16185. * @static
  16186. * @since 0.1.0
  16187. * @memberOf _
  16188. * @category Util
  16189. * @param {number} [start=0] The start of the range.
  16190. * @param {number} end The end of the range.
  16191. * @param {number} [step=1] The value to increment or decrement by.
  16192. * @returns {Array} Returns the range of numbers.
  16193. * @see _.inRange, _.rangeRight
  16194. * @example
  16195. *
  16196. * _.range(4);
  16197. * // => [0, 1, 2, 3]
  16198. *
  16199. * _.range(-4);
  16200. * // => [0, -1, -2, -3]
  16201. *
  16202. * _.range(1, 5);
  16203. * // => [1, 2, 3, 4]
  16204. *
  16205. * _.range(0, 20, 5);
  16206. * // => [0, 5, 10, 15]
  16207. *
  16208. * _.range(0, -4, -1);
  16209. * // => [0, -1, -2, -3]
  16210. *
  16211. * _.range(1, 4, 0);
  16212. * // => [1, 1, 1]
  16213. *
  16214. * _.range(0);
  16215. * // => []
  16216. */
  16217. var range = createRange();
  16218. /**
  16219. * This method is like `_.range` except that it populates values in
  16220. * descending order.
  16221. *
  16222. * @static
  16223. * @memberOf _
  16224. * @since 4.0.0
  16225. * @category Util
  16226. * @param {number} [start=0] The start of the range.
  16227. * @param {number} end The end of the range.
  16228. * @param {number} [step=1] The value to increment or decrement by.
  16229. * @returns {Array} Returns the range of numbers.
  16230. * @see _.inRange, _.range
  16231. * @example
  16232. *
  16233. * _.rangeRight(4);
  16234. * // => [3, 2, 1, 0]
  16235. *
  16236. * _.rangeRight(-4);
  16237. * // => [-3, -2, -1, 0]
  16238. *
  16239. * _.rangeRight(1, 5);
  16240. * // => [4, 3, 2, 1]
  16241. *
  16242. * _.rangeRight(0, 20, 5);
  16243. * // => [15, 10, 5, 0]
  16244. *
  16245. * _.rangeRight(0, -4, -1);
  16246. * // => [-3, -2, -1, 0]
  16247. *
  16248. * _.rangeRight(1, 4, 0);
  16249. * // => [1, 1, 1]
  16250. *
  16251. * _.rangeRight(0);
  16252. * // => []
  16253. */
  16254. var rangeRight = createRange(true);
  16255. /**
  16256. * This method returns a new empty array.
  16257. *
  16258. * @static
  16259. * @memberOf _
  16260. * @since 4.13.0
  16261. * @category Util
  16262. * @returns {Array} Returns the new empty array.
  16263. * @example
  16264. *
  16265. * var arrays = _.times(2, _.stubArray);
  16266. *
  16267. * console.log(arrays);
  16268. * // => [[], []]
  16269. *
  16270. * console.log(arrays[0] === arrays[1]);
  16271. * // => false
  16272. */
  16273. function stubArray() {
  16274. return [];
  16275. }
  16276. /**
  16277. * This method returns `false`.
  16278. *
  16279. * @static
  16280. * @memberOf _
  16281. * @since 4.13.0
  16282. * @category Util
  16283. * @returns {boolean} Returns `false`.
  16284. * @example
  16285. *
  16286. * _.times(2, _.stubFalse);
  16287. * // => [false, false]
  16288. */
  16289. function stubFalse() {
  16290. return false;
  16291. }
  16292. /**
  16293. * This method returns a new empty object.
  16294. *
  16295. * @static
  16296. * @memberOf _
  16297. * @since 4.13.0
  16298. * @category Util
  16299. * @returns {Object} Returns the new empty object.
  16300. * @example
  16301. *
  16302. * var objects = _.times(2, _.stubObject);
  16303. *
  16304. * console.log(objects);
  16305. * // => [{}, {}]
  16306. *
  16307. * console.log(objects[0] === objects[1]);
  16308. * // => false
  16309. */
  16310. function stubObject() {
  16311. return {};
  16312. }
  16313. /**
  16314. * This method returns an empty string.
  16315. *
  16316. * @static
  16317. * @memberOf _
  16318. * @since 4.13.0
  16319. * @category Util
  16320. * @returns {string} Returns the empty string.
  16321. * @example
  16322. *
  16323. * _.times(2, _.stubString);
  16324. * // => ['', '']
  16325. */
  16326. function stubString() {
  16327. return '';
  16328. }
  16329. /**
  16330. * This method returns `true`.
  16331. *
  16332. * @static
  16333. * @memberOf _
  16334. * @since 4.13.0
  16335. * @category Util
  16336. * @returns {boolean} Returns `true`.
  16337. * @example
  16338. *
  16339. * _.times(2, _.stubTrue);
  16340. * // => [true, true]
  16341. */
  16342. function stubTrue() {
  16343. return true;
  16344. }
  16345. /**
  16346. * Invokes the iteratee `n` times, returning an array of the results of
  16347. * each invocation. The iteratee is invoked with one argument; (index).
  16348. *
  16349. * @static
  16350. * @since 0.1.0
  16351. * @memberOf _
  16352. * @category Util
  16353. * @param {number} n The number of times to invoke `iteratee`.
  16354. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16355. * @returns {Array} Returns the array of results.
  16356. * @example
  16357. *
  16358. * _.times(3, String);
  16359. * // => ['0', '1', '2']
  16360. *
  16361. * _.times(4, _.constant(0));
  16362. * // => [0, 0, 0, 0]
  16363. */
  16364. function times(n, iteratee) {
  16365. n = toInteger(n);
  16366. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16367. return [];
  16368. }
  16369. var index = MAX_ARRAY_LENGTH,
  16370. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16371. iteratee = getIteratee(iteratee);
  16372. n -= MAX_ARRAY_LENGTH;
  16373. var result = baseTimes(length, iteratee);
  16374. while (++index < n) {
  16375. iteratee(index);
  16376. }
  16377. return result;
  16378. }
  16379. /**
  16380. * Converts `value` to a property path array.
  16381. *
  16382. * @static
  16383. * @memberOf _
  16384. * @since 4.0.0
  16385. * @category Util
  16386. * @param {*} value The value to convert.
  16387. * @returns {Array} Returns the new property path array.
  16388. * @example
  16389. *
  16390. * _.toPath('a.b.c');
  16391. * // => ['a', 'b', 'c']
  16392. *
  16393. * _.toPath('a[0].b.c');
  16394. * // => ['a', '0', 'b', 'c']
  16395. */
  16396. function toPath(value) {
  16397. if (isArray(value)) {
  16398. return arrayMap(value, toKey);
  16399. }
  16400. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16401. }
  16402. /**
  16403. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16404. *
  16405. * @static
  16406. * @since 0.1.0
  16407. * @memberOf _
  16408. * @category Util
  16409. * @param {string} [prefix=''] The value to prefix the ID with.
  16410. * @returns {string} Returns the unique ID.
  16411. * @example
  16412. *
  16413. * _.uniqueId('contact_');
  16414. * // => 'contact_104'
  16415. *
  16416. * _.uniqueId();
  16417. * // => '105'
  16418. */
  16419. function uniqueId(prefix) {
  16420. var id = ++idCounter;
  16421. return toString(prefix) + id;
  16422. }
  16423. /*------------------------------------------------------------------------*/
  16424. /**
  16425. * Adds two numbers.
  16426. *
  16427. * @static
  16428. * @memberOf _
  16429. * @since 3.4.0
  16430. * @category Math
  16431. * @param {number} augend The first number in an addition.
  16432. * @param {number} addend The second number in an addition.
  16433. * @returns {number} Returns the total.
  16434. * @example
  16435. *
  16436. * _.add(6, 4);
  16437. * // => 10
  16438. */
  16439. var add = createMathOperation(function(augend, addend) {
  16440. return augend + addend;
  16441. }, 0);
  16442. /**
  16443. * Computes `number` rounded up to `precision`.
  16444. *
  16445. * @static
  16446. * @memberOf _
  16447. * @since 3.10.0
  16448. * @category Math
  16449. * @param {number} number The number to round up.
  16450. * @param {number} [precision=0] The precision to round up to.
  16451. * @returns {number} Returns the rounded up number.
  16452. * @example
  16453. *
  16454. * _.ceil(4.006);
  16455. * // => 5
  16456. *
  16457. * _.ceil(6.004, 2);
  16458. * // => 6.01
  16459. *
  16460. * _.ceil(6040, -2);
  16461. * // => 6100
  16462. */
  16463. var ceil = createRound('ceil');
  16464. /**
  16465. * Divide two numbers.
  16466. *
  16467. * @static
  16468. * @memberOf _
  16469. * @since 4.7.0
  16470. * @category Math
  16471. * @param {number} dividend The first number in a division.
  16472. * @param {number} divisor The second number in a division.
  16473. * @returns {number} Returns the quotient.
  16474. * @example
  16475. *
  16476. * _.divide(6, 4);
  16477. * // => 1.5
  16478. */
  16479. var divide = createMathOperation(function(dividend, divisor) {
  16480. return dividend / divisor;
  16481. }, 1);
  16482. /**
  16483. * Computes `number` rounded down to `precision`.
  16484. *
  16485. * @static
  16486. * @memberOf _
  16487. * @since 3.10.0
  16488. * @category Math
  16489. * @param {number} number The number to round down.
  16490. * @param {number} [precision=0] The precision to round down to.
  16491. * @returns {number} Returns the rounded down number.
  16492. * @example
  16493. *
  16494. * _.floor(4.006);
  16495. * // => 4
  16496. *
  16497. * _.floor(0.046, 2);
  16498. * // => 0.04
  16499. *
  16500. * _.floor(4060, -2);
  16501. * // => 4000
  16502. */
  16503. var floor = createRound('floor');
  16504. /**
  16505. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16506. * `undefined` is returned.
  16507. *
  16508. * @static
  16509. * @since 0.1.0
  16510. * @memberOf _
  16511. * @category Math
  16512. * @param {Array} array The array to iterate over.
  16513. * @returns {*} Returns the maximum value.
  16514. * @example
  16515. *
  16516. * _.max([4, 2, 8, 6]);
  16517. * // => 8
  16518. *
  16519. * _.max([]);
  16520. * // => undefined
  16521. */
  16522. function max(array) {
  16523. return (array && array.length)
  16524. ? baseExtremum(array, identity, baseGt)
  16525. : undefined;
  16526. }
  16527. /**
  16528. * This method is like `_.max` except that it accepts `iteratee` which is
  16529. * invoked for each element in `array` to generate the criterion by which
  16530. * the value is ranked. The iteratee is invoked with one argument: (value).
  16531. *
  16532. * @static
  16533. * @memberOf _
  16534. * @since 4.0.0
  16535. * @category Math
  16536. * @param {Array} array The array to iterate over.
  16537. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16538. * @returns {*} Returns the maximum value.
  16539. * @example
  16540. *
  16541. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16542. *
  16543. * _.maxBy(objects, function(o) { return o.n; });
  16544. * // => { 'n': 2 }
  16545. *
  16546. * // The `_.property` iteratee shorthand.
  16547. * _.maxBy(objects, 'n');
  16548. * // => { 'n': 2 }
  16549. */
  16550. function maxBy(array, iteratee) {
  16551. return (array && array.length)
  16552. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16553. : undefined;
  16554. }
  16555. /**
  16556. * Computes the mean of the values in `array`.
  16557. *
  16558. * @static
  16559. * @memberOf _
  16560. * @since 4.0.0
  16561. * @category Math
  16562. * @param {Array} array The array to iterate over.
  16563. * @returns {number} Returns the mean.
  16564. * @example
  16565. *
  16566. * _.mean([4, 2, 8, 6]);
  16567. * // => 5
  16568. */
  16569. function mean(array) {
  16570. return baseMean(array, identity);
  16571. }
  16572. /**
  16573. * This method is like `_.mean` except that it accepts `iteratee` which is
  16574. * invoked for each element in `array` to generate the value to be averaged.
  16575. * The iteratee is invoked with one argument: (value).
  16576. *
  16577. * @static
  16578. * @memberOf _
  16579. * @since 4.7.0
  16580. * @category Math
  16581. * @param {Array} array The array to iterate over.
  16582. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16583. * @returns {number} Returns the mean.
  16584. * @example
  16585. *
  16586. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16587. *
  16588. * _.meanBy(objects, function(o) { return o.n; });
  16589. * // => 5
  16590. *
  16591. * // The `_.property` iteratee shorthand.
  16592. * _.meanBy(objects, 'n');
  16593. * // => 5
  16594. */
  16595. function meanBy(array, iteratee) {
  16596. return baseMean(array, getIteratee(iteratee, 2));
  16597. }
  16598. /**
  16599. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16600. * `undefined` is returned.
  16601. *
  16602. * @static
  16603. * @since 0.1.0
  16604. * @memberOf _
  16605. * @category Math
  16606. * @param {Array} array The array to iterate over.
  16607. * @returns {*} Returns the minimum value.
  16608. * @example
  16609. *
  16610. * _.min([4, 2, 8, 6]);
  16611. * // => 2
  16612. *
  16613. * _.min([]);
  16614. * // => undefined
  16615. */
  16616. function min(array) {
  16617. return (array && array.length)
  16618. ? baseExtremum(array, identity, baseLt)
  16619. : undefined;
  16620. }
  16621. /**
  16622. * This method is like `_.min` except that it accepts `iteratee` which is
  16623. * invoked for each element in `array` to generate the criterion by which
  16624. * the value is ranked. The iteratee is invoked with one argument: (value).
  16625. *
  16626. * @static
  16627. * @memberOf _
  16628. * @since 4.0.0
  16629. * @category Math
  16630. * @param {Array} array The array to iterate over.
  16631. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16632. * @returns {*} Returns the minimum value.
  16633. * @example
  16634. *
  16635. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16636. *
  16637. * _.minBy(objects, function(o) { return o.n; });
  16638. * // => { 'n': 1 }
  16639. *
  16640. * // The `_.property` iteratee shorthand.
  16641. * _.minBy(objects, 'n');
  16642. * // => { 'n': 1 }
  16643. */
  16644. function minBy(array, iteratee) {
  16645. return (array && array.length)
  16646. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16647. : undefined;
  16648. }
  16649. /**
  16650. * Multiply two numbers.
  16651. *
  16652. * @static
  16653. * @memberOf _
  16654. * @since 4.7.0
  16655. * @category Math
  16656. * @param {number} multiplier The first number in a multiplication.
  16657. * @param {number} multiplicand The second number in a multiplication.
  16658. * @returns {number} Returns the product.
  16659. * @example
  16660. *
  16661. * _.multiply(6, 4);
  16662. * // => 24
  16663. */
  16664. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16665. return multiplier * multiplicand;
  16666. }, 1);
  16667. /**
  16668. * Computes `number` rounded to `precision`.
  16669. *
  16670. * @static
  16671. * @memberOf _
  16672. * @since 3.10.0
  16673. * @category Math
  16674. * @param {number} number The number to round.
  16675. * @param {number} [precision=0] The precision to round to.
  16676. * @returns {number} Returns the rounded number.
  16677. * @example
  16678. *
  16679. * _.round(4.006);
  16680. * // => 4
  16681. *
  16682. * _.round(4.006, 2);
  16683. * // => 4.01
  16684. *
  16685. * _.round(4060, -2);
  16686. * // => 4100
  16687. */
  16688. var round = createRound('round');
  16689. /**
  16690. * Subtract two numbers.
  16691. *
  16692. * @static
  16693. * @memberOf _
  16694. * @since 4.0.0
  16695. * @category Math
  16696. * @param {number} minuend The first number in a subtraction.
  16697. * @param {number} subtrahend The second number in a subtraction.
  16698. * @returns {number} Returns the difference.
  16699. * @example
  16700. *
  16701. * _.subtract(6, 4);
  16702. * // => 2
  16703. */
  16704. var subtract = createMathOperation(function(minuend, subtrahend) {
  16705. return minuend - subtrahend;
  16706. }, 0);
  16707. /**
  16708. * Computes the sum of the values in `array`.
  16709. *
  16710. * @static
  16711. * @memberOf _
  16712. * @since 3.4.0
  16713. * @category Math
  16714. * @param {Array} array The array to iterate over.
  16715. * @returns {number} Returns the sum.
  16716. * @example
  16717. *
  16718. * _.sum([4, 2, 8, 6]);
  16719. * // => 20
  16720. */
  16721. function sum(array) {
  16722. return (array && array.length)
  16723. ? baseSum(array, identity)
  16724. : 0;
  16725. }
  16726. /**
  16727. * This method is like `_.sum` except that it accepts `iteratee` which is
  16728. * invoked for each element in `array` to generate the value to be summed.
  16729. * The iteratee is invoked with one argument: (value).
  16730. *
  16731. * @static
  16732. * @memberOf _
  16733. * @since 4.0.0
  16734. * @category Math
  16735. * @param {Array} array The array to iterate over.
  16736. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16737. * @returns {number} Returns the sum.
  16738. * @example
  16739. *
  16740. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16741. *
  16742. * _.sumBy(objects, function(o) { return o.n; });
  16743. * // => 20
  16744. *
  16745. * // The `_.property` iteratee shorthand.
  16746. * _.sumBy(objects, 'n');
  16747. * // => 20
  16748. */
  16749. function sumBy(array, iteratee) {
  16750. return (array && array.length)
  16751. ? baseSum(array, getIteratee(iteratee, 2))
  16752. : 0;
  16753. }
  16754. /*------------------------------------------------------------------------*/
  16755. // Add methods that return wrapped values in chain sequences.
  16756. lodash.after = after;
  16757. lodash.ary = ary;
  16758. lodash.assign = assign;
  16759. lodash.assignIn = assignIn;
  16760. lodash.assignInWith = assignInWith;
  16761. lodash.assignWith = assignWith;
  16762. lodash.at = at;
  16763. lodash.before = before;
  16764. lodash.bind = bind;
  16765. lodash.bindAll = bindAll;
  16766. lodash.bindKey = bindKey;
  16767. lodash.castArray = castArray;
  16768. lodash.chain = chain;
  16769. lodash.chunk = chunk;
  16770. lodash.compact = compact;
  16771. lodash.concat = concat;
  16772. lodash.cond = cond;
  16773. lodash.conforms = conforms;
  16774. lodash.constant = constant;
  16775. lodash.countBy = countBy;
  16776. lodash.create = create;
  16777. lodash.curry = curry;
  16778. lodash.curryRight = curryRight;
  16779. lodash.debounce = debounce;
  16780. lodash.defaults = defaults;
  16781. lodash.defaultsDeep = defaultsDeep;
  16782. lodash.defer = defer;
  16783. lodash.delay = delay;
  16784. lodash.difference = difference;
  16785. lodash.differenceBy = differenceBy;
  16786. lodash.differenceWith = differenceWith;
  16787. lodash.drop = drop;
  16788. lodash.dropRight = dropRight;
  16789. lodash.dropRightWhile = dropRightWhile;
  16790. lodash.dropWhile = dropWhile;
  16791. lodash.fill = fill;
  16792. lodash.filter = filter;
  16793. lodash.flatMap = flatMap;
  16794. lodash.flatMapDeep = flatMapDeep;
  16795. lodash.flatMapDepth = flatMapDepth;
  16796. lodash.flatten = flatten;
  16797. lodash.flattenDeep = flattenDeep;
  16798. lodash.flattenDepth = flattenDepth;
  16799. lodash.flip = flip;
  16800. lodash.flow = flow;
  16801. lodash.flowRight = flowRight;
  16802. lodash.fromPairs = fromPairs;
  16803. lodash.functions = functions;
  16804. lodash.functionsIn = functionsIn;
  16805. lodash.groupBy = groupBy;
  16806. lodash.initial = initial;
  16807. lodash.intersection = intersection;
  16808. lodash.intersectionBy = intersectionBy;
  16809. lodash.intersectionWith = intersectionWith;
  16810. lodash.invert = invert;
  16811. lodash.invertBy = invertBy;
  16812. lodash.invokeMap = invokeMap;
  16813. lodash.iteratee = iteratee;
  16814. lodash.keyBy = keyBy;
  16815. lodash.keys = keys;
  16816. lodash.keysIn = keysIn;
  16817. lodash.map = map;
  16818. lodash.mapKeys = mapKeys;
  16819. lodash.mapValues = mapValues;
  16820. lodash.matches = matches;
  16821. lodash.matchesProperty = matchesProperty;
  16822. lodash.memoize = memoize;
  16823. lodash.merge = merge;
  16824. lodash.mergeWith = mergeWith;
  16825. lodash.method = method;
  16826. lodash.methodOf = methodOf;
  16827. lodash.mixin = mixin;
  16828. lodash.negate = negate;
  16829. lodash.nthArg = nthArg;
  16830. lodash.omit = omit;
  16831. lodash.omitBy = omitBy;
  16832. lodash.once = once;
  16833. lodash.orderBy = orderBy;
  16834. lodash.over = over;
  16835. lodash.overArgs = overArgs;
  16836. lodash.overEvery = overEvery;
  16837. lodash.overSome = overSome;
  16838. lodash.partial = partial;
  16839. lodash.partialRight = partialRight;
  16840. lodash.partition = partition;
  16841. lodash.pick = pick;
  16842. lodash.pickBy = pickBy;
  16843. lodash.property = property;
  16844. lodash.propertyOf = propertyOf;
  16845. lodash.pull = pull;
  16846. lodash.pullAll = pullAll;
  16847. lodash.pullAllBy = pullAllBy;
  16848. lodash.pullAllWith = pullAllWith;
  16849. lodash.pullAt = pullAt;
  16850. lodash.range = range;
  16851. lodash.rangeRight = rangeRight;
  16852. lodash.rearg = rearg;
  16853. lodash.reject = reject;
  16854. lodash.remove = remove;
  16855. lodash.rest = rest;
  16856. lodash.reverse = reverse;
  16857. lodash.sampleSize = sampleSize;
  16858. lodash.set = set;
  16859. lodash.setWith = setWith;
  16860. lodash.shuffle = shuffle;
  16861. lodash.slice = slice;
  16862. lodash.sortBy = sortBy;
  16863. lodash.sortedUniq = sortedUniq;
  16864. lodash.sortedUniqBy = sortedUniqBy;
  16865. lodash.split = split;
  16866. lodash.spread = spread;
  16867. lodash.tail = tail;
  16868. lodash.take = take;
  16869. lodash.takeRight = takeRight;
  16870. lodash.takeRightWhile = takeRightWhile;
  16871. lodash.takeWhile = takeWhile;
  16872. lodash.tap = tap;
  16873. lodash.throttle = throttle;
  16874. lodash.thru = thru;
  16875. lodash.toArray = toArray;
  16876. lodash.toPairs = toPairs;
  16877. lodash.toPairsIn = toPairsIn;
  16878. lodash.toPath = toPath;
  16879. lodash.toPlainObject = toPlainObject;
  16880. lodash.transform = transform;
  16881. lodash.unary = unary;
  16882. lodash.union = union;
  16883. lodash.unionBy = unionBy;
  16884. lodash.unionWith = unionWith;
  16885. lodash.uniq = uniq;
  16886. lodash.uniqBy = uniqBy;
  16887. lodash.uniqWith = uniqWith;
  16888. lodash.unset = unset;
  16889. lodash.unzip = unzip;
  16890. lodash.unzipWith = unzipWith;
  16891. lodash.update = update;
  16892. lodash.updateWith = updateWith;
  16893. lodash.values = values;
  16894. lodash.valuesIn = valuesIn;
  16895. lodash.without = without;
  16896. lodash.words = words;
  16897. lodash.wrap = wrap;
  16898. lodash.xor = xor;
  16899. lodash.xorBy = xorBy;
  16900. lodash.xorWith = xorWith;
  16901. lodash.zip = zip;
  16902. lodash.zipObject = zipObject;
  16903. lodash.zipObjectDeep = zipObjectDeep;
  16904. lodash.zipWith = zipWith;
  16905. // Add aliases.
  16906. lodash.entries = toPairs;
  16907. lodash.entriesIn = toPairsIn;
  16908. lodash.extend = assignIn;
  16909. lodash.extendWith = assignInWith;
  16910. // Add methods to `lodash.prototype`.
  16911. mixin(lodash, lodash);
  16912. /*------------------------------------------------------------------------*/
  16913. // Add methods that return unwrapped values in chain sequences.
  16914. lodash.add = add;
  16915. lodash.attempt = attempt;
  16916. lodash.camelCase = camelCase;
  16917. lodash.capitalize = capitalize;
  16918. lodash.ceil = ceil;
  16919. lodash.clamp = clamp;
  16920. lodash.clone = clone;
  16921. lodash.cloneDeep = cloneDeep;
  16922. lodash.cloneDeepWith = cloneDeepWith;
  16923. lodash.cloneWith = cloneWith;
  16924. lodash.conformsTo = conformsTo;
  16925. lodash.deburr = deburr;
  16926. lodash.defaultTo = defaultTo;
  16927. lodash.divide = divide;
  16928. lodash.endsWith = endsWith;
  16929. lodash.eq = eq;
  16930. lodash.escape = escape;
  16931. lodash.escapeRegExp = escapeRegExp;
  16932. lodash.every = every;
  16933. lodash.find = find;
  16934. lodash.findIndex = findIndex;
  16935. lodash.findKey = findKey;
  16936. lodash.findLast = findLast;
  16937. lodash.findLastIndex = findLastIndex;
  16938. lodash.findLastKey = findLastKey;
  16939. lodash.floor = floor;
  16940. lodash.forEach = forEach;
  16941. lodash.forEachRight = forEachRight;
  16942. lodash.forIn = forIn;
  16943. lodash.forInRight = forInRight;
  16944. lodash.forOwn = forOwn;
  16945. lodash.forOwnRight = forOwnRight;
  16946. lodash.get = get;
  16947. lodash.gt = gt;
  16948. lodash.gte = gte;
  16949. lodash.has = has;
  16950. lodash.hasIn = hasIn;
  16951. lodash.head = head;
  16952. lodash.identity = identity;
  16953. lodash.includes = includes;
  16954. lodash.indexOf = indexOf;
  16955. lodash.inRange = inRange;
  16956. lodash.invoke = invoke;
  16957. lodash.isArguments = isArguments;
  16958. lodash.isArray = isArray;
  16959. lodash.isArrayBuffer = isArrayBuffer;
  16960. lodash.isArrayLike = isArrayLike;
  16961. lodash.isArrayLikeObject = isArrayLikeObject;
  16962. lodash.isBoolean = isBoolean;
  16963. lodash.isBuffer = isBuffer;
  16964. lodash.isDate = isDate;
  16965. lodash.isElement = isElement;
  16966. lodash.isEmpty = isEmpty;
  16967. lodash.isEqual = isEqual;
  16968. lodash.isEqualWith = isEqualWith;
  16969. lodash.isError = isError;
  16970. lodash.isFinite = isFinite;
  16971. lodash.isFunction = isFunction;
  16972. lodash.isInteger = isInteger;
  16973. lodash.isLength = isLength;
  16974. lodash.isMap = isMap;
  16975. lodash.isMatch = isMatch;
  16976. lodash.isMatchWith = isMatchWith;
  16977. lodash.isNaN = isNaN;
  16978. lodash.isNative = isNative;
  16979. lodash.isNil = isNil;
  16980. lodash.isNull = isNull;
  16981. lodash.isNumber = isNumber;
  16982. lodash.isObject = isObject;
  16983. lodash.isObjectLike = isObjectLike;
  16984. lodash.isPlainObject = isPlainObject;
  16985. lodash.isRegExp = isRegExp;
  16986. lodash.isSafeInteger = isSafeInteger;
  16987. lodash.isSet = isSet;
  16988. lodash.isString = isString;
  16989. lodash.isSymbol = isSymbol;
  16990. lodash.isTypedArray = isTypedArray;
  16991. lodash.isUndefined = isUndefined;
  16992. lodash.isWeakMap = isWeakMap;
  16993. lodash.isWeakSet = isWeakSet;
  16994. lodash.join = join;
  16995. lodash.kebabCase = kebabCase;
  16996. lodash.last = last;
  16997. lodash.lastIndexOf = lastIndexOf;
  16998. lodash.lowerCase = lowerCase;
  16999. lodash.lowerFirst = lowerFirst;
  17000. lodash.lt = lt;
  17001. lodash.lte = lte;
  17002. lodash.max = max;
  17003. lodash.maxBy = maxBy;
  17004. lodash.mean = mean;
  17005. lodash.meanBy = meanBy;
  17006. lodash.min = min;
  17007. lodash.minBy = minBy;
  17008. lodash.stubArray = stubArray;
  17009. lodash.stubFalse = stubFalse;
  17010. lodash.stubObject = stubObject;
  17011. lodash.stubString = stubString;
  17012. lodash.stubTrue = stubTrue;
  17013. lodash.multiply = multiply;
  17014. lodash.nth = nth;
  17015. lodash.noConflict = noConflict;
  17016. lodash.noop = noop;
  17017. lodash.now = now;
  17018. lodash.pad = pad;
  17019. lodash.padEnd = padEnd;
  17020. lodash.padStart = padStart;
  17021. lodash.parseInt = parseInt;
  17022. lodash.random = random;
  17023. lodash.reduce = reduce;
  17024. lodash.reduceRight = reduceRight;
  17025. lodash.repeat = repeat;
  17026. lodash.replace = replace;
  17027. lodash.result = result;
  17028. lodash.round = round;
  17029. lodash.runInContext = runInContext;
  17030. lodash.sample = sample;
  17031. lodash.size = size;
  17032. lodash.snakeCase = snakeCase;
  17033. lodash.some = some;
  17034. lodash.sortedIndex = sortedIndex;
  17035. lodash.sortedIndexBy = sortedIndexBy;
  17036. lodash.sortedIndexOf = sortedIndexOf;
  17037. lodash.sortedLastIndex = sortedLastIndex;
  17038. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17039. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17040. lodash.startCase = startCase;
  17041. lodash.startsWith = startsWith;
  17042. lodash.subtract = subtract;
  17043. lodash.sum = sum;
  17044. lodash.sumBy = sumBy;
  17045. lodash.template = template;
  17046. lodash.times = times;
  17047. lodash.toFinite = toFinite;
  17048. lodash.toInteger = toInteger;
  17049. lodash.toLength = toLength;
  17050. lodash.toLower = toLower;
  17051. lodash.toNumber = toNumber;
  17052. lodash.toSafeInteger = toSafeInteger;
  17053. lodash.toString = toString;
  17054. lodash.toUpper = toUpper;
  17055. lodash.trim = trim;
  17056. lodash.trimEnd = trimEnd;
  17057. lodash.trimStart = trimStart;
  17058. lodash.truncate = truncate;
  17059. lodash.unescape = unescape;
  17060. lodash.uniqueId = uniqueId;
  17061. lodash.upperCase = upperCase;
  17062. lodash.upperFirst = upperFirst;
  17063. // Add aliases.
  17064. lodash.each = forEach;
  17065. lodash.eachRight = forEachRight;
  17066. lodash.first = head;
  17067. mixin(lodash, (function() {
  17068. var source = {};
  17069. baseForOwn(lodash, function(func, methodName) {
  17070. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17071. source[methodName] = func;
  17072. }
  17073. });
  17074. return source;
  17075. }()), { 'chain': false });
  17076. /*------------------------------------------------------------------------*/
  17077. /**
  17078. * The semantic version number.
  17079. *
  17080. * @static
  17081. * @memberOf _
  17082. * @type {string}
  17083. */
  17084. lodash.VERSION = VERSION;
  17085. // Assign default placeholders.
  17086. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17087. lodash[methodName].placeholder = lodash;
  17088. });
  17089. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17090. arrayEach(['drop', 'take'], function(methodName, index) {
  17091. LazyWrapper.prototype[methodName] = function(n) {
  17092. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17093. var result = (this.__filtered__ && !index)
  17094. ? new LazyWrapper(this)
  17095. : this.clone();
  17096. if (result.__filtered__) {
  17097. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17098. } else {
  17099. result.__views__.push({
  17100. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17101. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17102. });
  17103. }
  17104. return result;
  17105. };
  17106. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17107. return this.reverse()[methodName](n).reverse();
  17108. };
  17109. });
  17110. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17111. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17112. var type = index + 1,
  17113. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17114. LazyWrapper.prototype[methodName] = function(iteratee) {
  17115. var result = this.clone();
  17116. result.__iteratees__.push({
  17117. 'iteratee': getIteratee(iteratee, 3),
  17118. 'type': type
  17119. });
  17120. result.__filtered__ = result.__filtered__ || isFilter;
  17121. return result;
  17122. };
  17123. });
  17124. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17125. arrayEach(['head', 'last'], function(methodName, index) {
  17126. var takeName = 'take' + (index ? 'Right' : '');
  17127. LazyWrapper.prototype[methodName] = function() {
  17128. return this[takeName](1).value()[0];
  17129. };
  17130. });
  17131. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17132. arrayEach(['initial', 'tail'], function(methodName, index) {
  17133. var dropName = 'drop' + (index ? '' : 'Right');
  17134. LazyWrapper.prototype[methodName] = function() {
  17135. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17136. };
  17137. });
  17138. LazyWrapper.prototype.compact = function() {
  17139. return this.filter(identity);
  17140. };
  17141. LazyWrapper.prototype.find = function(predicate) {
  17142. return this.filter(predicate).head();
  17143. };
  17144. LazyWrapper.prototype.findLast = function(predicate) {
  17145. return this.reverse().find(predicate);
  17146. };
  17147. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17148. if (typeof path == 'function') {
  17149. return new LazyWrapper(this);
  17150. }
  17151. return this.map(function(value) {
  17152. return baseInvoke(value, path, args);
  17153. });
  17154. });
  17155. LazyWrapper.prototype.reject = function(predicate) {
  17156. return this.filter(negate(getIteratee(predicate)));
  17157. };
  17158. LazyWrapper.prototype.slice = function(start, end) {
  17159. start = toInteger(start);
  17160. var result = this;
  17161. if (result.__filtered__ && (start > 0 || end < 0)) {
  17162. return new LazyWrapper(result);
  17163. }
  17164. if (start < 0) {
  17165. result = result.takeRight(-start);
  17166. } else if (start) {
  17167. result = result.drop(start);
  17168. }
  17169. if (end !== undefined) {
  17170. end = toInteger(end);
  17171. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17172. }
  17173. return result;
  17174. };
  17175. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17176. return this.reverse().takeWhile(predicate).reverse();
  17177. };
  17178. LazyWrapper.prototype.toArray = function() {
  17179. return this.take(MAX_ARRAY_LENGTH);
  17180. };
  17181. // Add `LazyWrapper` methods to `lodash.prototype`.
  17182. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17183. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17184. isTaker = /^(?:head|last)$/.test(methodName),
  17185. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17186. retUnwrapped = isTaker || /^find/.test(methodName);
  17187. if (!lodashFunc) {
  17188. return;
  17189. }
  17190. lodash.prototype[methodName] = function() {
  17191. var value = this.__wrapped__,
  17192. args = isTaker ? [1] : arguments,
  17193. isLazy = value instanceof LazyWrapper,
  17194. iteratee = args[0],
  17195. useLazy = isLazy || isArray(value);
  17196. var interceptor = function(value) {
  17197. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17198. return (isTaker && chainAll) ? result[0] : result;
  17199. };
  17200. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17201. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17202. isLazy = useLazy = false;
  17203. }
  17204. var chainAll = this.__chain__,
  17205. isHybrid = !!this.__actions__.length,
  17206. isUnwrapped = retUnwrapped && !chainAll,
  17207. onlyLazy = isLazy && !isHybrid;
  17208. if (!retUnwrapped && useLazy) {
  17209. value = onlyLazy ? value : new LazyWrapper(this);
  17210. var result = func.apply(value, args);
  17211. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17212. return new LodashWrapper(result, chainAll);
  17213. }
  17214. if (isUnwrapped && onlyLazy) {
  17215. return func.apply(this, args);
  17216. }
  17217. result = this.thru(interceptor);
  17218. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17219. };
  17220. });
  17221. // Add `Array` methods to `lodash.prototype`.
  17222. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17223. var func = arrayProto[methodName],
  17224. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17225. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17226. lodash.prototype[methodName] = function() {
  17227. var args = arguments;
  17228. if (retUnwrapped && !this.__chain__) {
  17229. var value = this.value();
  17230. return func.apply(isArray(value) ? value : [], args);
  17231. }
  17232. return this[chainName](function(value) {
  17233. return func.apply(isArray(value) ? value : [], args);
  17234. });
  17235. };
  17236. });
  17237. // Map minified method names to their real names.
  17238. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17239. var lodashFunc = lodash[methodName];
  17240. if (lodashFunc) {
  17241. var key = lodashFunc.name + '';
  17242. if (!hasOwnProperty.call(realNames, key)) {
  17243. realNames[key] = [];
  17244. }
  17245. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17246. }
  17247. });
  17248. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17249. 'name': 'wrapper',
  17250. 'func': undefined
  17251. }];
  17252. // Add methods to `LazyWrapper`.
  17253. LazyWrapper.prototype.clone = lazyClone;
  17254. LazyWrapper.prototype.reverse = lazyReverse;
  17255. LazyWrapper.prototype.value = lazyValue;
  17256. // Add chain sequence methods to the `lodash` wrapper.
  17257. lodash.prototype.at = wrapperAt;
  17258. lodash.prototype.chain = wrapperChain;
  17259. lodash.prototype.commit = wrapperCommit;
  17260. lodash.prototype.next = wrapperNext;
  17261. lodash.prototype.plant = wrapperPlant;
  17262. lodash.prototype.reverse = wrapperReverse;
  17263. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17264. // Add lazy aliases.
  17265. lodash.prototype.first = lodash.prototype.head;
  17266. if (symIterator) {
  17267. lodash.prototype[symIterator] = wrapperToIterator;
  17268. }
  17269. return lodash;
  17270. });
  17271. /*--------------------------------------------------------------------------*/
  17272. // Export lodash.
  17273. var _ = runInContext();
  17274. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17275. if (true) {
  17276. // Expose Lodash on the global object to prevent errors when Lodash is
  17277. // loaded by a script tag in the presence of an AMD loader.
  17278. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17279. // Use `_.noConflict` to remove Lodash from the global object.
  17280. root._ = _;
  17281. // Define as an anonymous module so, through path mapping, it can be
  17282. // referenced as the "underscore" module.
  17283. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17284. return _;
  17285. }).call(exports, __webpack_require__, exports, module),
  17286. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17287. }
  17288. // Check for `exports` after `define` in case a build optimizer adds it.
  17289. else {}
  17290. }.call(this));
  17291. /***/ }),
  17292. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17293. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17294. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17295. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17296. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17297. "use strict";
  17298. __webpack_require__.r(__webpack_exports__);
  17299. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17300. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17301. /* harmony export */ });
  17302. /* 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");
  17303. /* 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__);
  17304. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17305. var options = {};
  17306. options.insert = "head";
  17307. options.singleton = false;
  17308. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17309. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17310. /***/ }),
  17311. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17312. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17313. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17314. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17315. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17316. "use strict";
  17317. __webpack_require__.r(__webpack_exports__);
  17318. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17319. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17320. /* harmony export */ });
  17321. /* 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");
  17322. /* 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__);
  17323. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17324. var options = {};
  17325. options.insert = "head";
  17326. options.singleton = false;
  17327. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17328. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17329. /***/ }),
  17330. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17331. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17332. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17333. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17334. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17335. "use strict";
  17336. __webpack_require__.r(__webpack_exports__);
  17337. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17338. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17339. /* harmony export */ });
  17340. /* 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");
  17341. /* 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__);
  17342. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17343. var options = {};
  17344. options.insert = "head";
  17345. options.singleton = false;
  17346. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17347. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17348. /***/ }),
  17349. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17350. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17351. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17352. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17353. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17354. "use strict";
  17355. __webpack_require__.r(__webpack_exports__);
  17356. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17357. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17358. /* harmony export */ });
  17359. /* 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");
  17360. /* 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__);
  17361. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17362. var options = {};
  17363. options.insert = "head";
  17364. options.singleton = false;
  17365. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17366. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17367. /***/ }),
  17368. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17369. /*!******************************************************!*\
  17370. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17371. \******************************************************/
  17372. /***/ ((__unused_webpack_module, exports) => {
  17373. "use strict";
  17374. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17375. // runtime helper for setting properties on components
  17376. // in a tree-shakable way
  17377. exports["default"] = (sfc, props) => {
  17378. const target = sfc.__vccOpts || sfc;
  17379. for (const [key, val] of props) {
  17380. target[key] = val;
  17381. }
  17382. return target;
  17383. };
  17384. /***/ }),
  17385. /***/ "./resources/js/components/AppButtonLink.vue":
  17386. /*!***************************************************!*\
  17387. !*** ./resources/js/components/AppButtonLink.vue ***!
  17388. \***************************************************/
  17389. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17390. "use strict";
  17391. __webpack_require__.r(__webpack_exports__);
  17392. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17393. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17394. /* harmony export */ });
  17395. /* 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");
  17396. /* 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");
  17397. /* 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");
  17398. ;
  17399. 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"]])
  17400. /* hot reload */
  17401. if (false) {}
  17402. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17403. /***/ }),
  17404. /***/ "./resources/js/components/AppMessage.vue":
  17405. /*!************************************************!*\
  17406. !*** ./resources/js/components/AppMessage.vue ***!
  17407. \************************************************/
  17408. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17409. "use strict";
  17410. __webpack_require__.r(__webpack_exports__);
  17411. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17412. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17413. /* harmony export */ });
  17414. /* 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");
  17415. /* 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");
  17416. /* 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");
  17417. ;
  17418. 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"]])
  17419. /* hot reload */
  17420. if (false) {}
  17421. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17422. /***/ }),
  17423. /***/ "./resources/js/components/AppPagination.vue":
  17424. /*!***************************************************!*\
  17425. !*** ./resources/js/components/AppPagination.vue ***!
  17426. \***************************************************/
  17427. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17428. "use strict";
  17429. __webpack_require__.r(__webpack_exports__);
  17430. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17431. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17432. /* harmony export */ });
  17433. /* 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");
  17434. /* 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");
  17435. /* 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");
  17436. ;
  17437. 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"]])
  17438. /* hot reload */
  17439. if (false) {}
  17440. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17441. /***/ }),
  17442. /***/ "./resources/js/components/AppSidebar.vue":
  17443. /*!************************************************!*\
  17444. !*** ./resources/js/components/AppSidebar.vue ***!
  17445. \************************************************/
  17446. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17447. "use strict";
  17448. __webpack_require__.r(__webpack_exports__);
  17449. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17450. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17451. /* harmony export */ });
  17452. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17453. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17454. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17455. /* 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");
  17456. ;
  17457. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17458. /* hot reload */
  17459. if (false) {}
  17460. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17461. /***/ }),
  17462. /***/ "./resources/js/components/AppSubSidebar.vue":
  17463. /*!***************************************************!*\
  17464. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17465. \***************************************************/
  17466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17467. "use strict";
  17468. __webpack_require__.r(__webpack_exports__);
  17469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17470. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17471. /* harmony export */ });
  17472. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17473. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17474. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17475. /* 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");
  17476. ;
  17477. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17478. /* hot reload */
  17479. if (false) {}
  17480. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17481. /***/ }),
  17482. /***/ "./resources/js/components/AppTopBar.vue":
  17483. /*!***********************************************!*\
  17484. !*** ./resources/js/components/AppTopBar.vue ***!
  17485. \***********************************************/
  17486. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17487. "use strict";
  17488. __webpack_require__.r(__webpack_exports__);
  17489. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17490. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17491. /* harmony export */ });
  17492. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17493. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17494. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17495. /* 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");
  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_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17498. /* hot reload */
  17499. if (false) {}
  17500. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17501. /***/ }),
  17502. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17503. /*!**************************************************!*\
  17504. !*** ./resources/js/layouts/DashboardLayout.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 _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17513. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17514. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17515. /* 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");
  17516. ;
  17517. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17518. /* hot reload */
  17519. if (false) {}
  17520. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17521. /***/ }),
  17522. /***/ "./resources/js/pages/Sales/Index.vue":
  17523. /*!********************************************!*\
  17524. !*** ./resources/js/pages/Sales/Index.vue ***!
  17525. \********************************************/
  17526. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17527. "use strict";
  17528. __webpack_require__.r(__webpack_exports__);
  17529. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17530. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17531. /* harmony export */ });
  17532. /* 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");
  17533. /* 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");
  17534. /* 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");
  17535. ;
  17536. 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"]])
  17537. /* hot reload */
  17538. if (false) {}
  17539. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17540. /***/ }),
  17541. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17542. /*!**************************************************************************************!*\
  17543. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17544. \**************************************************************************************/
  17545. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17546. "use strict";
  17547. __webpack_require__.r(__webpack_exports__);
  17548. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17549. /* 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"])
  17550. /* harmony export */ });
  17551. /* 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");
  17552. /***/ }),
  17553. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17554. /*!***********************************************************************************!*\
  17555. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17556. \***********************************************************************************/
  17557. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17558. "use strict";
  17559. __webpack_require__.r(__webpack_exports__);
  17560. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17561. /* harmony export */ "default": () => (/* 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"])
  17562. /* harmony export */ });
  17563. /* 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");
  17564. /***/ }),
  17565. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17566. /*!**************************************************************************************!*\
  17567. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17568. \**************************************************************************************/
  17569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17570. "use strict";
  17571. __webpack_require__.r(__webpack_exports__);
  17572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17573. /* 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"])
  17574. /* harmony export */ });
  17575. /* 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");
  17576. /***/ }),
  17577. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17578. /*!***********************************************************************************!*\
  17579. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17580. \***********************************************************************************/
  17581. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17582. "use strict";
  17583. __webpack_require__.r(__webpack_exports__);
  17584. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17585. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17586. /* harmony export */ });
  17587. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17588. /***/ }),
  17589. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17590. /*!**************************************************************************************!*\
  17591. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17592. \**************************************************************************************/
  17593. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17594. "use strict";
  17595. __webpack_require__.r(__webpack_exports__);
  17596. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17597. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17598. /* harmony export */ });
  17599. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17600. /***/ }),
  17601. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17602. /*!**********************************************************************************!*\
  17603. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17604. \**********************************************************************************/
  17605. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17606. "use strict";
  17607. __webpack_require__.r(__webpack_exports__);
  17608. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17609. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17610. /* harmony export */ });
  17611. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17612. /***/ }),
  17613. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17614. /*!*************************************************************************************!*\
  17615. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17616. \*************************************************************************************/
  17617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17618. "use strict";
  17619. __webpack_require__.r(__webpack_exports__);
  17620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17621. /* 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"])
  17622. /* harmony export */ });
  17623. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17624. /***/ }),
  17625. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js":
  17626. /*!*******************************************************************************!*\
  17627. !*** ./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js ***!
  17628. \*******************************************************************************/
  17629. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17630. "use strict";
  17631. __webpack_require__.r(__webpack_exports__);
  17632. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17633. /* 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"])
  17634. /* harmony export */ });
  17635. /* 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");
  17636. /***/ }),
  17637. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17638. /*!*********************************************************************************!*\
  17639. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17640. \*********************************************************************************/
  17641. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17642. "use strict";
  17643. __webpack_require__.r(__webpack_exports__);
  17644. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17645. /* 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)
  17646. /* harmony export */ });
  17647. /* 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");
  17648. /***/ }),
  17649. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17650. /*!******************************************************************************!*\
  17651. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17652. \******************************************************************************/
  17653. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17654. "use strict";
  17655. __webpack_require__.r(__webpack_exports__);
  17656. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17657. /* 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)
  17658. /* harmony export */ });
  17659. /* 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");
  17660. /***/ }),
  17661. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17662. /*!*********************************************************************************!*\
  17663. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17664. \*********************************************************************************/
  17665. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17666. "use strict";
  17667. __webpack_require__.r(__webpack_exports__);
  17668. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17669. /* 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)
  17670. /* harmony export */ });
  17671. /* 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");
  17672. /***/ }),
  17673. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17674. /*!******************************************************************************************!*\
  17675. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17676. \******************************************************************************************/
  17677. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17678. "use strict";
  17679. __webpack_require__.r(__webpack_exports__);
  17680. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17681. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17682. /* harmony export */ });
  17683. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17684. /***/ }),
  17685. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17686. /*!*********************************************************************************************!*\
  17687. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17688. \*********************************************************************************************/
  17689. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17690. "use strict";
  17691. __webpack_require__.r(__webpack_exports__);
  17692. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17693. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17694. /* harmony export */ });
  17695. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17696. /***/ }),
  17697. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17698. /*!*****************************************************************************************!*\
  17699. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17700. \*****************************************************************************************/
  17701. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17702. "use strict";
  17703. __webpack_require__.r(__webpack_exports__);
  17704. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17705. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17706. /* harmony export */ });
  17707. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17708. /***/ }),
  17709. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17710. /*!********************************************************************************************!*\
  17711. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17712. \********************************************************************************************/
  17713. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17714. "use strict";
  17715. __webpack_require__.r(__webpack_exports__);
  17716. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17717. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17718. /* harmony export */ });
  17719. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17720. /***/ }),
  17721. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776":
  17722. /*!**************************************************************************!*\
  17723. !*** ./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776 ***!
  17724. \**************************************************************************/
  17725. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17726. "use strict";
  17727. __webpack_require__.r(__webpack_exports__);
  17728. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17729. /* 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)
  17730. /* harmony export */ });
  17731. /* 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");
  17732. /***/ }),
  17733. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17734. /*!*********************************************************************************************************!*\
  17735. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17736. \*********************************************************************************************************/
  17737. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17738. "use strict";
  17739. __webpack_require__.r(__webpack_exports__);
  17740. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17741. /***/ }),
  17742. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17743. /*!************************************************************************************************************!*\
  17744. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17745. \************************************************************************************************************/
  17746. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17747. "use strict";
  17748. __webpack_require__.r(__webpack_exports__);
  17749. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17750. /***/ }),
  17751. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17752. /*!********************************************************************************************************!*\
  17753. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17754. \********************************************************************************************************/
  17755. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17756. "use strict";
  17757. __webpack_require__.r(__webpack_exports__);
  17758. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17759. /***/ }),
  17760. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17761. /*!***********************************************************************************************************!*\
  17762. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17763. \***********************************************************************************************************/
  17764. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17765. "use strict";
  17766. __webpack_require__.r(__webpack_exports__);
  17767. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17768. /***/ })
  17769. }]);