resources_js_pages_topup_Index_vue.js 705KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_topup_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. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./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":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./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 ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./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":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./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":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./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 ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./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":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./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 ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./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":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./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 ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./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":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./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 ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./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/topup/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!***********************************************************************************************************************************************************************************************************!*\
  260. !*** ./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/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \***********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  269. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/topup/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  276. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  279. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  280. props: {
  281. topUp: Object,
  282. initialSearch: String,
  283. initialDateRange: Array
  284. },
  285. setup: function setup(__props, _ref) {
  286. var expose = _ref.expose;
  287. expose();
  288. var props = __props;
  289. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  290. search = _useSearchText.search;
  291. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter)(props),
  292. dates = _useDateRangeFilter.dates,
  293. startDate = _useDateRangeFilter.startDate,
  294. endDate = _useDateRangeFilter.endDate;
  295. (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)([dates, search], function () {
  296. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  297. startDate: startDate.value,
  298. endDate: endDate.value,
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var filterReset = function filterReset() {
  305. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups');
  306. };
  307. var __returned__ = {
  308. props: props,
  309. search: search,
  310. dates: dates,
  311. startDate: startDate,
  312. endDate: endDate,
  313. filterReset: filterReset,
  314. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  315. watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
  316. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  317. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  318. indexTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.indexTable,
  319. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  320. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter,
  321. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  322. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  323. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__["default"]
  324. };
  325. Object.defineProperty(__returned__, '__isScriptSetup', {
  326. enumerable: false,
  327. value: true
  328. });
  329. return __returned__;
  330. }
  331. });
  332. /***/ }),
  333. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  334. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  335. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  336. \***********************************************************************************************************************************************************************************************************************************************************************************/
  337. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  338. "use strict";
  339. __webpack_require__.r(__webpack_exports__);
  340. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  341. /* harmony export */ "render": () => (/* binding */ render)
  342. /* harmony export */ });
  343. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  344. var _hoisted_1 = {
  345. key: 1,
  346. "class": "p-button-label"
  347. };
  348. var _hoisted_2 = {
  349. key: 1,
  350. "class": "p-button-label"
  351. };
  352. function render(_ctx, _cache, $props, $setup, $data, $options) {
  353. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  354. key: 0,
  355. "class": "p-button p-component",
  356. as: "button",
  357. type: "button"
  358. }, {
  359. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  360. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  361. key: 0,
  362. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  363. }, null, 2
  364. /* CLASS */
  365. )) : (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
  366. /* TEXT */
  367. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  368. }),
  369. _: 1
  370. /* STABLE */
  371. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  372. key: 1,
  373. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  374. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  375. key: 0,
  376. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  377. }, null, 2
  378. /* CLASS */
  379. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  380. /* TEXT */
  381. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  382. /* CLASS */
  383. ));
  384. }
  385. /***/ }),
  386. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  387. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  388. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  389. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  390. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  391. "use strict";
  392. __webpack_require__.r(__webpack_exports__);
  393. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  394. /* harmony export */ "render": () => (/* binding */ render)
  395. /* harmony export */ });
  396. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  397. var _withScopeId = function _withScopeId(n) {
  398. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  399. };
  400. var _hoisted_1 = {
  401. "class": "layout-footer"
  402. };
  403. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  404. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  405. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  406. href: "https://dijitalcode.com",
  407. target: "_blank",
  408. "class": "font-medium ml-2"
  409. }, "DijitalCODE", -1
  410. /* HOISTED */
  411. );
  412. });
  413. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  414. function render(_ctx, _cache) {
  415. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  416. }
  417. /***/ }),
  418. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  419. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  420. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  421. \********************************************************************************************************************************************************************************************************************************************************************************/
  422. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  423. "use strict";
  424. __webpack_require__.r(__webpack_exports__);
  425. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  426. /* harmony export */ "render": () => (/* binding */ render)
  427. /* harmony export */ });
  428. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  429. var _hoisted_1 = {
  430. key: 0
  431. };
  432. var _hoisted_2 = {
  433. key: 1
  434. };
  435. function render(_ctx, _cache, $props, $setup, $data, $options) {
  436. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  437. 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, {
  438. key: 0,
  439. severity: "success",
  440. onClose: $setup.onClose
  441. }, {
  442. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  443. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  444. /* TEXT */
  445. )];
  446. }),
  447. _: 1
  448. /* STABLE */
  449. })) : (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, {
  450. key: 1,
  451. severity: "error",
  452. onClose: $setup.onClose
  453. }, {
  454. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  455. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  456. /* TEXT */
  457. )];
  458. }),
  459. _: 1
  460. /* STABLE */
  461. })) : (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, {
  462. key: 2,
  463. severity: "error",
  464. onClose: $setup.onClose
  465. }, {
  466. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  467. 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
  468. /* TEXT */
  469. ))];
  470. }),
  471. _: 1
  472. /* STABLE */
  473. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  474. /* STABLE_FRAGMENT */
  475. );
  476. }
  477. /***/ }),
  478. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  479. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  480. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  481. \***********************************************************************************************************************************************************************************************************************************************************************************/
  482. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  483. "use strict";
  484. __webpack_require__.r(__webpack_exports__);
  485. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  486. /* harmony export */ "render": () => (/* binding */ render)
  487. /* harmony export */ });
  488. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  489. var _hoisted_1 = {
  490. key: 0,
  491. "class": "p-paginator p-component flex justify-content-start"
  492. };
  493. var _hoisted_2 = {
  494. "class": "p-paginator-pages"
  495. };
  496. var _hoisted_3 = ["innerHTML"];
  497. function render(_ctx, _cache, $props, $setup, $data, $options) {
  498. 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) {
  499. 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", {
  500. key: "link-".concat(key),
  501. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  502. 'p-disabled': link
  503. }]),
  504. innerHTML: link.label
  505. }, null, 10
  506. /* CLASS, PROPS */
  507. , _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"], {
  508. key: "link-".concat(key),
  509. href: link.url,
  510. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  511. 'p-highlight': link.active
  512. }, "p-paginator-page p-paginator-element p-link"]),
  513. innerHTML: link.label
  514. }, null, 8
  515. /* PROPS */
  516. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  517. /* STABLE_FRAGMENT */
  518. );
  519. }), 256
  520. /* UNKEYED_FRAGMENT */
  521. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  522. }
  523. /***/ }),
  524. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  525. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  526. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  527. \********************************************************************************************************************************************************************************************************************************************************************************************/
  528. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  529. "use strict";
  530. __webpack_require__.r(__webpack_exports__);
  531. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  532. /* harmony export */ "render": () => (/* binding */ render)
  533. /* harmony export */ });
  534. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  535. function render(_ctx, _cache, $props, $setup, $data, $options) {
  536. 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"], {
  537. "class": "layout-menu",
  538. items: $props.menu,
  539. root: true
  540. }, null, 8
  541. /* PROPS */
  542. , ["items"])]);
  543. }
  544. /***/ }),
  545. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  546. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  547. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  548. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  550. "use strict";
  551. __webpack_require__.r(__webpack_exports__);
  552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  553. /* harmony export */ "render": () => (/* binding */ render)
  554. /* harmony export */ });
  555. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  556. var _withScopeId = function _withScopeId(n) {
  557. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  558. };
  559. var _hoisted_1 = {
  560. key: 0
  561. };
  562. var _hoisted_2 = ["aria-label"];
  563. var _hoisted_3 = ["aria-label"];
  564. function render(_ctx, _cache, $props, $setup, $data, $options) {
  565. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  566. 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) {
  567. 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", {
  568. key: i,
  569. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  570. 'layout-menuitem-category': $props.root
  571. }]),
  572. role: "none"
  573. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  574. key: 0
  575. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  576. "class": "layout-menuitem-root-text",
  577. "aria-label": item.label
  578. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  579. /* TEXT, PROPS */
  580. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  581. items: item.items
  582. }, null, 8
  583. /* PROPS */
  584. , ["items"])], 64
  585. /* STABLE_FRAGMENT */
  586. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  587. key: 1
  588. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  589. key: 0,
  590. role: "menuitem",
  591. href: item.to,
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  593. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  594. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  595. }]),
  596. "aria-label": item.label
  597. }, {
  598. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  599. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  600. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  601. }, null, 2
  602. /* CLASS */
  603. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  604. /* TEXT */
  605. )];
  606. }),
  607. _: 2
  608. /* DYNAMIC */
  609. }, 1032
  610. /* PROPS, DYNAMIC_SLOTS */
  611. , ["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", {
  612. key: 1,
  613. href: "#",
  614. role: "menuitem",
  615. "aria-label": item.label
  616. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  617. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  618. }, null, 2
  619. /* CLASS */
  620. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  621. /* TEXT */
  622. )], 8
  623. /* PROPS */
  624. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  625. items: item.items
  626. }, null, 8
  627. /* PROPS */
  628. , ["items"])], 64
  629. /* STABLE_FRAGMENT */
  630. ))], 2
  631. /* CLASS */
  632. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  633. /* STABLE_FRAGMENT */
  634. );
  635. }), 256
  636. /* UNKEYED_FRAGMENT */
  637. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  638. }
  639. /***/ }),
  640. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  641. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  642. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  643. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  645. "use strict";
  646. __webpack_require__.r(__webpack_exports__);
  647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  648. /* harmony export */ "render": () => (/* binding */ render)
  649. /* harmony export */ });
  650. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  651. var _withScopeId = function _withScopeId(n) {
  652. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  653. };
  654. var _hoisted_1 = {
  655. "class": "layout-topbar"
  656. };
  657. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  658. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  659. alt: "Logo",
  660. src: "/images/logo.svg",
  661. "class": "md:mr-3"
  662. }, null, -1
  663. /* HOISTED */
  664. );
  665. });
  666. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  668. /* HOISTED */
  669. );
  670. });
  671. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  672. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  673. "class": "pi pi-bars"
  674. }, null, -1
  675. /* HOISTED */
  676. );
  677. });
  678. var _hoisted_5 = [_hoisted_4];
  679. var _hoisted_6 = {
  680. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  681. };
  682. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  683. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  684. "class": "pi pi-ellipsis-v"
  685. }, null, -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_8 = [_hoisted_7];
  690. var _hoisted_9 = {
  691. "class": "layout-topbar-menu hidden lg:flex origin-top"
  692. };
  693. var _hoisted_10 = {
  694. "class": "align-self-center"
  695. };
  696. var _hoisted_11 = {
  697. "class": "hidden lg:inline"
  698. };
  699. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  700. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  701. "class": "pi pi-user"
  702. }, null, -1
  703. /* HOISTED */
  704. );
  705. });
  706. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  707. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  708. /* HOISTED */
  709. );
  710. });
  711. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  712. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  713. "class": "pi pi-sign-out"
  714. }, null, -1
  715. /* HOISTED */
  716. );
  717. });
  718. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  719. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  720. /* HOISTED */
  721. );
  722. });
  723. function render(_ctx, _cache, $props, $setup, $data, $options) {
  724. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  725. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  726. 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"], {
  727. href: "/",
  728. "class": "layout-topbar-logo"
  729. }, {
  730. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  731. return [_hoisted_2, _hoisted_3];
  732. }),
  733. _: 1
  734. /* STABLE */
  735. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  736. "class": "p-link layout-menu-button layout-topbar-button",
  737. onClick: _cache[0] || (_cache[0] = function ($event) {
  738. return _ctx.$emit('menu-toggle', $event);
  739. })
  740. }, _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, {
  741. selector: '@next',
  742. enterClass: 'hidden',
  743. enterActiveClass: 'scalein',
  744. leaveToClass: 'hidden',
  745. leaveActiveClass: 'fadeout',
  746. hideOnOutsideClick: true
  747. }]]), (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
  748. /* TEXT */
  749. )]), (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"], {
  750. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  751. "class": "p-link layout-topbar-button"
  752. }, {
  753. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  754. return [_hoisted_12, _hoisted_13];
  755. }),
  756. _: 1
  757. /* STABLE */
  758. }, 8
  759. /* PROPS */
  760. , ["href"])), [[_directive_tooltip, {
  761. value: 'Ubah Profil',
  762. "class": 'layout-topbar-menu-tooltip'
  763. }, void 0, {
  764. bottom: true
  765. }]])]), (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"], {
  766. href: _ctx.route('logout'),
  767. as: "button",
  768. method: "post",
  769. "class": "p-link layout-topbar-button"
  770. }, {
  771. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  772. return [_hoisted_14, _hoisted_15];
  773. }),
  774. _: 1
  775. /* STABLE */
  776. }, 8
  777. /* PROPS */
  778. , ["href"])), [[_directive_tooltip, {
  779. value: 'Keluar',
  780. "class": 'layout-topbar-menu-tooltip'
  781. }, void 0, {
  782. bottom: true
  783. }]])])])]);
  784. }
  785. /***/ }),
  786. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  787. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  788. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  789. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  790. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  791. "use strict";
  792. __webpack_require__.r(__webpack_exports__);
  793. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  794. /* harmony export */ "render": () => (/* binding */ render)
  795. /* harmony export */ });
  796. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  797. var _withScopeId = function _withScopeId(n) {
  798. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  799. };
  800. var _hoisted_1 = {
  801. "class": "layout-sidebar"
  802. };
  803. var _hoisted_2 = {
  804. "class": "layout-main-container"
  805. };
  806. var _hoisted_3 = {
  807. "class": "layout-main"
  808. };
  809. var _hoisted_4 = {
  810. key: 0,
  811. "class": "layout-mask p-component-overlay"
  812. };
  813. function render(_ctx, _cache, $props, $setup, $data, $options) {
  814. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  815. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  816. onClick: $setup.onWrapperClick
  817. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  818. onMenuToggle: $setup.onMenuToggle
  819. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  820. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  821. }, null, 8
  822. /* PROPS */
  823. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  824. name: "layout-mask"
  825. }, {
  826. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  827. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  828. }),
  829. _: 1
  830. /* STABLE */
  831. })], 2
  832. /* CLASS */
  833. );
  834. }
  835. /***/ }),
  836. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/topup/Index.vue?vue&type=template&id=3bf54f8c":
  837. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  838. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  839. \****************************************************************************************************************************************************************************************************************************************************************************/
  840. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  841. "use strict";
  842. __webpack_require__.r(__webpack_exports__);
  843. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  844. /* harmony export */ "render": () => (/* binding */ render)
  845. /* harmony export */ });
  846. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  847. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Top Up", -1
  848. /* HOISTED */
  849. );
  850. var _hoisted_2 = {
  851. "class": "grid"
  852. };
  853. var _hoisted_3 = {
  854. "class": "col-12 md:col-8"
  855. };
  856. var _hoisted_4 = {
  857. "class": "grid"
  858. };
  859. var _hoisted_5 = {
  860. "class": "col-12 md:col-3"
  861. };
  862. var _hoisted_6 = {
  863. "class": "col-12 md:col-3"
  864. };
  865. var _hoisted_7 = {
  866. "class": "col-auto mt-2 ml-2"
  867. };
  868. var _hoisted_8 = {
  869. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  870. };
  871. function render(_ctx, _cache, $props, $setup, $data, $options) {
  872. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  873. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  874. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  875. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  876. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  877. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  878. 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"], {
  879. title: "Top Up"
  880. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  881. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  882. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  883. "responsive-layout": "scroll",
  884. "column-resize-mode": "expand",
  885. value: $props.topUp.data,
  886. "row-hover": true,
  887. "striped-rows": true
  888. }, {
  889. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  890. 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__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  891. "class": "w-full",
  892. placeholder: "cari, contoh: tina",
  893. modelValue: $setup.search,
  894. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  895. return $setup.search = $event;
  896. })
  897. }, null, 8
  898. /* PROPS */
  899. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  900. "touch-u-i": "",
  901. "class": "w-full",
  902. modelValue: $setup.dates,
  903. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  904. return $setup.dates = $event;
  905. }),
  906. "selection-mode": "range",
  907. placeholder: "filter waktu...",
  908. "date-format": "dd/mm/yy",
  909. "manual-input": false
  910. }, null, 8
  911. /* PROPS */
  912. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  913. label: "reset",
  914. "class": "p-button-link",
  915. onClick: $setup.filterReset
  916. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  917. label: "Top Up",
  918. "class": "p-button-outlined",
  919. icon: "pi pi-pencil",
  920. href: _ctx.route('top-ups.create')
  921. }, null, 8
  922. /* PROPS */
  923. , ["href"])])])];
  924. }),
  925. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  926. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  927. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  928. field: value.field,
  929. header: value.header,
  930. key: value.field
  931. }, null, 8
  932. /* PROPS */
  933. , ["field", "header"]);
  934. }), 128
  935. /* KEYED_FRAGMENT */
  936. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  937. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  938. var data = _ref.data;
  939. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  940. icon: "pi pi-eye",
  941. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  942. href: _ctx.route('top-ups.show', data.id)
  943. }, null, 8
  944. /* PROPS */
  945. , ["href"]), [[_directive_tooltip, 'Detail Top Up', void 0, {
  946. bottom: true
  947. }]])];
  948. }),
  949. _: 1
  950. /* STABLE */
  951. })];
  952. }),
  953. _: 1
  954. /* STABLE */
  955. }, 8
  956. /* PROPS */
  957. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  958. links: $props.topUp.links
  959. }, null, 8
  960. /* PROPS */
  961. , ["links"])];
  962. }),
  963. _: 1
  964. /* STABLE */
  965. })], 64
  966. /* STABLE_FRAGMENT */
  967. );
  968. }
  969. /***/ }),
  970. /***/ "./resources/js/components/useDateRangeFilter.js":
  971. /*!*******************************************************!*\
  972. !*** ./resources/js/components/useDateRangeFilter.js ***!
  973. \*******************************************************/
  974. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  975. "use strict";
  976. __webpack_require__.r(__webpack_exports__);
  977. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  978. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  979. /* harmony export */ });
  980. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  981. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  982. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  983. function useDateRangeFilter(props) {
  984. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  985. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  986. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  987. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  988. if (!props.initialDateRange) {
  989. return;
  990. }
  991. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  992. if (props.initialDateRange[1]) {
  993. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  994. } else {
  995. dates.value = [new Date(props.props.initialDateRange[1]), null];
  996. }
  997. }
  998. });
  999. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  1000. if (dates.value[1]) {
  1001. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1002. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  1003. } else if (dates.value[0]) {
  1004. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1005. endDate.value = null;
  1006. }
  1007. });
  1008. return {
  1009. dates: dates,
  1010. startDate: startDate,
  1011. endDate: endDate
  1012. };
  1013. }
  1014. /***/ }),
  1015. /***/ "./resources/js/components/useSearchText.js":
  1016. /*!**************************************************!*\
  1017. !*** ./resources/js/components/useSearchText.js ***!
  1018. \**************************************************/
  1019. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1020. "use strict";
  1021. __webpack_require__.r(__webpack_exports__);
  1022. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1023. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  1024. /* harmony export */ });
  1025. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1026. function useSearchText(props) {
  1027. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  1028. return {
  1029. search: search
  1030. };
  1031. }
  1032. /***/ }),
  1033. /***/ "./resources/js/pages/topup/tableHeader.js":
  1034. /*!*************************************************!*\
  1035. !*** ./resources/js/pages/topup/tableHeader.js ***!
  1036. \*************************************************/
  1037. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1038. "use strict";
  1039. __webpack_require__.r(__webpack_exports__);
  1040. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1041. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1042. /* harmony export */ "topUpTable": () => (/* binding */ topUpTable)
  1043. /* harmony export */ });
  1044. var indexTable = [{
  1045. field: 'updatedAt',
  1046. header: 'Diperbaharui'
  1047. }, {
  1048. field: 'name',
  1049. header: 'Nama'
  1050. }, {
  1051. field: 'platNumber',
  1052. header: 'Plat Kendaraan'
  1053. }, {
  1054. field: 'type',
  1055. header: 'Jenis Member'
  1056. }, {
  1057. field: 'amount',
  1058. header: 'Tarif Member'
  1059. }, {
  1060. field: 'expDate',
  1061. header: 'Berakhir'
  1062. }];
  1063. var topUpTable = [{
  1064. field: 'updatedAt',
  1065. header: 'Diperbaharui'
  1066. }, {
  1067. field: 'name',
  1068. header: 'Petugas Parkir'
  1069. }, {
  1070. field: 'platNumber',
  1071. header: 'Plat Kendaraan'
  1072. }, {
  1073. field: 'type',
  1074. header: 'Jenis Member'
  1075. }, {
  1076. field: 'amount',
  1077. header: 'Tarif Member'
  1078. }, {
  1079. field: 'expDate',
  1080. header: 'Berakhir'
  1081. }];
  1082. /***/ }),
  1083. /***/ "./resources/js/utils/menu.js":
  1084. /*!************************************!*\
  1085. !*** ./resources/js/utils/menu.js ***!
  1086. \************************************/
  1087. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1088. "use strict";
  1089. __webpack_require__.r(__webpack_exports__);
  1090. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1091. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1092. /* harmony export */ });
  1093. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1094. // Admin
  1095. 1: [{
  1096. label: 'Home',
  1097. items: [{
  1098. label: 'Dashboard',
  1099. icon: 'pi pi-home',
  1100. to: '/dashboards',
  1101. component: 'home/Index'
  1102. }]
  1103. }, {
  1104. label: 'Master',
  1105. items: [{
  1106. label: 'User',
  1107. icon: 'pi pi-user',
  1108. to: '/users',
  1109. component: 'user/Index'
  1110. }]
  1111. }],
  1112. // Supervisor
  1113. 2: [{
  1114. label: 'Home',
  1115. items: [{
  1116. label: 'Dashboard',
  1117. icon: 'pi pi-home',
  1118. to: '/dashboards',
  1119. component: 'home/Index'
  1120. }]
  1121. }, {
  1122. label: 'Menu',
  1123. items: [{
  1124. label: 'Pengeluaran',
  1125. icon: 'pi pi-wallet',
  1126. to: '/expenses',
  1127. component: 'expense/Index'
  1128. }, {
  1129. label: 'Laporan',
  1130. icon: 'pi pi-book',
  1131. items: [{
  1132. label: 'Mutasi',
  1133. icon: 'pi pi-circle',
  1134. to: '/reports/mutations',
  1135. component: 'mutation/Report'
  1136. }]
  1137. }]
  1138. }, {
  1139. label: 'Master',
  1140. items: [{
  1141. label: 'Jenis Kendaraan',
  1142. icon: 'pi pi-car',
  1143. to: '/type-vehicles',
  1144. component: 'typevehicle/Index'
  1145. }, {
  1146. label: 'Jenis Member',
  1147. icon: 'pi pi-id-card',
  1148. to: '/type-members',
  1149. component: 'typemember/Index'
  1150. }]
  1151. }, {
  1152. label: 'Pengaturan',
  1153. items: [{
  1154. label: 'Tarif Parkir',
  1155. icon: 'pi pi-car',
  1156. to: '/parking-fees/create',
  1157. component: 'parkingfee/Create'
  1158. }]
  1159. }],
  1160. // Operator
  1161. 3: [{
  1162. label: 'Home',
  1163. items: [{
  1164. label: 'Dashboard',
  1165. icon: 'pi pi-home',
  1166. to: '/dashboards',
  1167. component: 'home/Index'
  1168. }]
  1169. }, {
  1170. label: 'Transaksi',
  1171. items: [{
  1172. label: 'Transaksi Keluar',
  1173. icon: 'pi pi-car',
  1174. to: '/transactions/create',
  1175. component: 'transaction/Create'
  1176. }]
  1177. }, {
  1178. label: 'Menu',
  1179. items: [{
  1180. label: 'Pengeluaran',
  1181. icon: 'pi pi-wallet',
  1182. to: '/expenses',
  1183. component: 'expense/Index'
  1184. }, {
  1185. label: 'Member',
  1186. icon: 'pi pi-id-card',
  1187. to: '/members',
  1188. component: 'member/Index'
  1189. }, {
  1190. label: 'Top Up',
  1191. icon: 'pi pi-car',
  1192. to: '/top-ups',
  1193. component: 'topup/Index'
  1194. }]
  1195. }]
  1196. });
  1197. /***/ }),
  1198. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1199. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1200. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1201. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1202. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1203. "use strict";
  1204. __webpack_require__.r(__webpack_exports__);
  1205. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1206. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1207. /* harmony export */ });
  1208. /* 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");
  1209. /* 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__);
  1210. // Imports
  1211. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1212. // Module
  1213. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1214. // Exports
  1215. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1216. /***/ }),
  1217. /***/ "./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":
  1218. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1219. !*** ./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 ***!
  1220. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1221. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1222. "use strict";
  1223. __webpack_require__.r(__webpack_exports__);
  1224. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1225. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1226. /* harmony export */ });
  1227. /* 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");
  1228. /* 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__);
  1229. // Imports
  1230. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1231. // Module
  1232. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1233. // Exports
  1234. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1235. /***/ }),
  1236. /***/ "./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":
  1237. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1238. !*** ./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 ***!
  1239. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1240. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1241. "use strict";
  1242. __webpack_require__.r(__webpack_exports__);
  1243. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1244. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1245. /* harmony export */ });
  1246. /* 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");
  1247. /* 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__);
  1248. // Imports
  1249. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1250. // Module
  1251. ___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}", ""]);
  1252. // Exports
  1253. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1254. /***/ }),
  1255. /***/ "./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":
  1256. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1257. !*** ./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 ***!
  1258. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1259. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1260. "use strict";
  1261. __webpack_require__.r(__webpack_exports__);
  1262. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1263. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1264. /* harmony export */ });
  1265. /* 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");
  1266. /* 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__);
  1267. // Imports
  1268. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1269. // Module
  1270. ___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}", ""]);
  1271. // Exports
  1272. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1273. /***/ }),
  1274. /***/ "./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":
  1275. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1276. !*** ./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 ***!
  1277. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1278. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1279. "use strict";
  1280. __webpack_require__.r(__webpack_exports__);
  1281. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1282. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1283. /* harmony export */ });
  1284. /* 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");
  1285. /* 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__);
  1286. // Imports
  1287. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1288. // Module
  1289. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1290. // Exports
  1291. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1292. /***/ }),
  1293. /***/ "./node_modules/dayjs/dayjs.min.js":
  1294. /*!*****************************************!*\
  1295. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1296. \*****************************************/
  1297. /***/ (function(module) {
  1298. !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
  1299. /***/ }),
  1300. /***/ "./node_modules/lodash/lodash.js":
  1301. /*!***************************************!*\
  1302. !*** ./node_modules/lodash/lodash.js ***!
  1303. \***************************************/
  1304. /***/ (function(module, exports, __webpack_require__) {
  1305. /* module decorator */ module = __webpack_require__.nmd(module);
  1306. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1307. * @license
  1308. * Lodash <https://lodash.com/>
  1309. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1310. * Released under MIT license <https://lodash.com/license>
  1311. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1312. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1313. */
  1314. ;(function() {
  1315. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1316. var undefined;
  1317. /** Used as the semantic version number. */
  1318. var VERSION = '4.17.21';
  1319. /** Used as the size to enable large array optimizations. */
  1320. var LARGE_ARRAY_SIZE = 200;
  1321. /** Error message constants. */
  1322. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1323. FUNC_ERROR_TEXT = 'Expected a function',
  1324. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1325. /** Used to stand-in for `undefined` hash values. */
  1326. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1327. /** Used as the maximum memoize cache size. */
  1328. var MAX_MEMOIZE_SIZE = 500;
  1329. /** Used as the internal argument placeholder. */
  1330. var PLACEHOLDER = '__lodash_placeholder__';
  1331. /** Used to compose bitmasks for cloning. */
  1332. var CLONE_DEEP_FLAG = 1,
  1333. CLONE_FLAT_FLAG = 2,
  1334. CLONE_SYMBOLS_FLAG = 4;
  1335. /** Used to compose bitmasks for value comparisons. */
  1336. var COMPARE_PARTIAL_FLAG = 1,
  1337. COMPARE_UNORDERED_FLAG = 2;
  1338. /** Used to compose bitmasks for function metadata. */
  1339. var WRAP_BIND_FLAG = 1,
  1340. WRAP_BIND_KEY_FLAG = 2,
  1341. WRAP_CURRY_BOUND_FLAG = 4,
  1342. WRAP_CURRY_FLAG = 8,
  1343. WRAP_CURRY_RIGHT_FLAG = 16,
  1344. WRAP_PARTIAL_FLAG = 32,
  1345. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1346. WRAP_ARY_FLAG = 128,
  1347. WRAP_REARG_FLAG = 256,
  1348. WRAP_FLIP_FLAG = 512;
  1349. /** Used as default options for `_.truncate`. */
  1350. var DEFAULT_TRUNC_LENGTH = 30,
  1351. DEFAULT_TRUNC_OMISSION = '...';
  1352. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1353. var HOT_COUNT = 800,
  1354. HOT_SPAN = 16;
  1355. /** Used to indicate the type of lazy iteratees. */
  1356. var LAZY_FILTER_FLAG = 1,
  1357. LAZY_MAP_FLAG = 2,
  1358. LAZY_WHILE_FLAG = 3;
  1359. /** Used as references for various `Number` constants. */
  1360. var INFINITY = 1 / 0,
  1361. MAX_SAFE_INTEGER = 9007199254740991,
  1362. MAX_INTEGER = 1.7976931348623157e+308,
  1363. NAN = 0 / 0;
  1364. /** Used as references for the maximum length and index of an array. */
  1365. var MAX_ARRAY_LENGTH = 4294967295,
  1366. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1367. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1368. /** Used to associate wrap methods with their bit flags. */
  1369. var wrapFlags = [
  1370. ['ary', WRAP_ARY_FLAG],
  1371. ['bind', WRAP_BIND_FLAG],
  1372. ['bindKey', WRAP_BIND_KEY_FLAG],
  1373. ['curry', WRAP_CURRY_FLAG],
  1374. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1375. ['flip', WRAP_FLIP_FLAG],
  1376. ['partial', WRAP_PARTIAL_FLAG],
  1377. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1378. ['rearg', WRAP_REARG_FLAG]
  1379. ];
  1380. /** `Object#toString` result references. */
  1381. var argsTag = '[object Arguments]',
  1382. arrayTag = '[object Array]',
  1383. asyncTag = '[object AsyncFunction]',
  1384. boolTag = '[object Boolean]',
  1385. dateTag = '[object Date]',
  1386. domExcTag = '[object DOMException]',
  1387. errorTag = '[object Error]',
  1388. funcTag = '[object Function]',
  1389. genTag = '[object GeneratorFunction]',
  1390. mapTag = '[object Map]',
  1391. numberTag = '[object Number]',
  1392. nullTag = '[object Null]',
  1393. objectTag = '[object Object]',
  1394. promiseTag = '[object Promise]',
  1395. proxyTag = '[object Proxy]',
  1396. regexpTag = '[object RegExp]',
  1397. setTag = '[object Set]',
  1398. stringTag = '[object String]',
  1399. symbolTag = '[object Symbol]',
  1400. undefinedTag = '[object Undefined]',
  1401. weakMapTag = '[object WeakMap]',
  1402. weakSetTag = '[object WeakSet]';
  1403. var arrayBufferTag = '[object ArrayBuffer]',
  1404. dataViewTag = '[object DataView]',
  1405. float32Tag = '[object Float32Array]',
  1406. float64Tag = '[object Float64Array]',
  1407. int8Tag = '[object Int8Array]',
  1408. int16Tag = '[object Int16Array]',
  1409. int32Tag = '[object Int32Array]',
  1410. uint8Tag = '[object Uint8Array]',
  1411. uint8ClampedTag = '[object Uint8ClampedArray]',
  1412. uint16Tag = '[object Uint16Array]',
  1413. uint32Tag = '[object Uint32Array]';
  1414. /** Used to match empty string literals in compiled template source. */
  1415. var reEmptyStringLeading = /\b__p \+= '';/g,
  1416. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1417. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1418. /** Used to match HTML entities and HTML characters. */
  1419. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1420. reUnescapedHtml = /[&<>"']/g,
  1421. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1422. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1423. /** Used to match template delimiters. */
  1424. var reEscape = /<%-([\s\S]+?)%>/g,
  1425. reEvaluate = /<%([\s\S]+?)%>/g,
  1426. reInterpolate = /<%=([\s\S]+?)%>/g;
  1427. /** Used to match property names within property paths. */
  1428. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1429. reIsPlainProp = /^\w*$/,
  1430. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1431. /**
  1432. * Used to match `RegExp`
  1433. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1434. */
  1435. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1436. reHasRegExpChar = RegExp(reRegExpChar.source);
  1437. /** Used to match leading whitespace. */
  1438. var reTrimStart = /^\s+/;
  1439. /** Used to match a single whitespace character. */
  1440. var reWhitespace = /\s/;
  1441. /** Used to match wrap detail comments. */
  1442. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1443. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1444. reSplitDetails = /,? & /;
  1445. /** Used to match words composed of alphanumeric characters. */
  1446. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1447. /**
  1448. * Used to validate the `validate` option in `_.template` variable.
  1449. *
  1450. * Forbids characters which could potentially change the meaning of the function argument definition:
  1451. * - "()," (modification of function parameters)
  1452. * - "=" (default value)
  1453. * - "[]{}" (destructuring of function parameters)
  1454. * - "/" (beginning of a comment)
  1455. * - whitespace
  1456. */
  1457. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1458. /** Used to match backslashes in property paths. */
  1459. var reEscapeChar = /\\(\\)?/g;
  1460. /**
  1461. * Used to match
  1462. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1463. */
  1464. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1465. /** Used to match `RegExp` flags from their coerced string values. */
  1466. var reFlags = /\w*$/;
  1467. /** Used to detect bad signed hexadecimal string values. */
  1468. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1469. /** Used to detect binary string values. */
  1470. var reIsBinary = /^0b[01]+$/i;
  1471. /** Used to detect host constructors (Safari). */
  1472. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1473. /** Used to detect octal string values. */
  1474. var reIsOctal = /^0o[0-7]+$/i;
  1475. /** Used to detect unsigned integer values. */
  1476. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1477. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1478. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1479. /** Used to ensure capturing order of template delimiters. */
  1480. var reNoMatch = /($^)/;
  1481. /** Used to match unescaped characters in compiled string literals. */
  1482. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1483. /** Used to compose unicode character classes. */
  1484. var rsAstralRange = '\\ud800-\\udfff',
  1485. rsComboMarksRange = '\\u0300-\\u036f',
  1486. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1487. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1488. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1489. rsDingbatRange = '\\u2700-\\u27bf',
  1490. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1491. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1492. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1493. rsPunctuationRange = '\\u2000-\\u206f',
  1494. 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',
  1495. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1496. rsVarRange = '\\ufe0e\\ufe0f',
  1497. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1498. /** Used to compose unicode capture groups. */
  1499. var rsApos = "['\u2019]",
  1500. rsAstral = '[' + rsAstralRange + ']',
  1501. rsBreak = '[' + rsBreakRange + ']',
  1502. rsCombo = '[' + rsComboRange + ']',
  1503. rsDigits = '\\d+',
  1504. rsDingbat = '[' + rsDingbatRange + ']',
  1505. rsLower = '[' + rsLowerRange + ']',
  1506. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1507. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1508. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1509. rsNonAstral = '[^' + rsAstralRange + ']',
  1510. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1511. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1512. rsUpper = '[' + rsUpperRange + ']',
  1513. rsZWJ = '\\u200d';
  1514. /** Used to compose unicode regexes. */
  1515. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1516. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1517. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1518. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1519. reOptMod = rsModifier + '?',
  1520. rsOptVar = '[' + rsVarRange + ']?',
  1521. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1522. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1523. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1524. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1525. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1526. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1527. /** Used to match apostrophes. */
  1528. var reApos = RegExp(rsApos, 'g');
  1529. /**
  1530. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1531. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1532. */
  1533. var reComboMark = RegExp(rsCombo, 'g');
  1534. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1535. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1536. /** Used to match complex or compound words. */
  1537. var reUnicodeWord = RegExp([
  1538. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1539. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1540. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1541. rsUpper + '+' + rsOptContrUpper,
  1542. rsOrdUpper,
  1543. rsOrdLower,
  1544. rsDigits,
  1545. rsEmoji
  1546. ].join('|'), 'g');
  1547. /** 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/). */
  1548. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1549. /** Used to detect strings that need a more robust regexp to match words. */
  1550. 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 ]/;
  1551. /** Used to assign default `context` object properties. */
  1552. var contextProps = [
  1553. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1554. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1555. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1556. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1557. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1558. ];
  1559. /** Used to make template sourceURLs easier to identify. */
  1560. var templateCounter = -1;
  1561. /** Used to identify `toStringTag` values of typed arrays. */
  1562. var typedArrayTags = {};
  1563. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1564. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1565. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1566. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1567. typedArrayTags[uint32Tag] = true;
  1568. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1569. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1570. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1571. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1572. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1573. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1574. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1575. typedArrayTags[weakMapTag] = false;
  1576. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1577. var cloneableTags = {};
  1578. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1579. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1580. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1581. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1582. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1583. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1584. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1585. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1586. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1587. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1588. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1589. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1590. cloneableTags[weakMapTag] = false;
  1591. /** Used to map Latin Unicode letters to basic Latin letters. */
  1592. var deburredLetters = {
  1593. // Latin-1 Supplement block.
  1594. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1595. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1596. '\xc7': 'C', '\xe7': 'c',
  1597. '\xd0': 'D', '\xf0': 'd',
  1598. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1599. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1600. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1601. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1602. '\xd1': 'N', '\xf1': 'n',
  1603. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1604. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1605. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1606. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1607. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1608. '\xc6': 'Ae', '\xe6': 'ae',
  1609. '\xde': 'Th', '\xfe': 'th',
  1610. '\xdf': 'ss',
  1611. // Latin Extended-A block.
  1612. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1613. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1614. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1615. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1616. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1617. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1618. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1619. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1620. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1621. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1622. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1623. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1624. '\u0134': 'J', '\u0135': 'j',
  1625. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1626. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1627. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1628. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1629. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1630. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1631. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1632. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1633. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1634. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1635. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1636. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1637. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1638. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1639. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1640. '\u0174': 'W', '\u0175': 'w',
  1641. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1642. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1643. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1644. '\u0132': 'IJ', '\u0133': 'ij',
  1645. '\u0152': 'Oe', '\u0153': 'oe',
  1646. '\u0149': "'n", '\u017f': 's'
  1647. };
  1648. /** Used to map characters to HTML entities. */
  1649. var htmlEscapes = {
  1650. '&': '&amp;',
  1651. '<': '&lt;',
  1652. '>': '&gt;',
  1653. '"': '&quot;',
  1654. "'": '&#39;'
  1655. };
  1656. /** Used to map HTML entities to characters. */
  1657. var htmlUnescapes = {
  1658. '&amp;': '&',
  1659. '&lt;': '<',
  1660. '&gt;': '>',
  1661. '&quot;': '"',
  1662. '&#39;': "'"
  1663. };
  1664. /** Used to escape characters for inclusion in compiled string literals. */
  1665. var stringEscapes = {
  1666. '\\': '\\',
  1667. "'": "'",
  1668. '\n': 'n',
  1669. '\r': 'r',
  1670. '\u2028': 'u2028',
  1671. '\u2029': 'u2029'
  1672. };
  1673. /** Built-in method references without a dependency on `root`. */
  1674. var freeParseFloat = parseFloat,
  1675. freeParseInt = parseInt;
  1676. /** Detect free variable `global` from Node.js. */
  1677. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1678. /** Detect free variable `self`. */
  1679. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1680. /** Used as a reference to the global object. */
  1681. var root = freeGlobal || freeSelf || Function('return this')();
  1682. /** Detect free variable `exports`. */
  1683. var freeExports = true && exports && !exports.nodeType && exports;
  1684. /** Detect free variable `module`. */
  1685. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1686. /** Detect the popular CommonJS extension `module.exports`. */
  1687. var moduleExports = freeModule && freeModule.exports === freeExports;
  1688. /** Detect free variable `process` from Node.js. */
  1689. var freeProcess = moduleExports && freeGlobal.process;
  1690. /** Used to access faster Node.js helpers. */
  1691. var nodeUtil = (function() {
  1692. try {
  1693. // Use `util.types` for Node.js 10+.
  1694. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1695. if (types) {
  1696. return types;
  1697. }
  1698. // Legacy `process.binding('util')` for Node.js < 10.
  1699. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1700. } catch (e) {}
  1701. }());
  1702. /* Node.js helper references. */
  1703. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1704. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1705. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1706. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1707. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1708. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1709. /*--------------------------------------------------------------------------*/
  1710. /**
  1711. * A faster alternative to `Function#apply`, this function invokes `func`
  1712. * with the `this` binding of `thisArg` and the arguments of `args`.
  1713. *
  1714. * @private
  1715. * @param {Function} func The function to invoke.
  1716. * @param {*} thisArg The `this` binding of `func`.
  1717. * @param {Array} args The arguments to invoke `func` with.
  1718. * @returns {*} Returns the result of `func`.
  1719. */
  1720. function apply(func, thisArg, args) {
  1721. switch (args.length) {
  1722. case 0: return func.call(thisArg);
  1723. case 1: return func.call(thisArg, args[0]);
  1724. case 2: return func.call(thisArg, args[0], args[1]);
  1725. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1726. }
  1727. return func.apply(thisArg, args);
  1728. }
  1729. /**
  1730. * A specialized version of `baseAggregator` for arrays.
  1731. *
  1732. * @private
  1733. * @param {Array} [array] The array to iterate over.
  1734. * @param {Function} setter The function to set `accumulator` values.
  1735. * @param {Function} iteratee The iteratee to transform keys.
  1736. * @param {Object} accumulator The initial aggregated object.
  1737. * @returns {Function} Returns `accumulator`.
  1738. */
  1739. function arrayAggregator(array, setter, iteratee, accumulator) {
  1740. var index = -1,
  1741. length = array == null ? 0 : array.length;
  1742. while (++index < length) {
  1743. var value = array[index];
  1744. setter(accumulator, value, iteratee(value), array);
  1745. }
  1746. return accumulator;
  1747. }
  1748. /**
  1749. * A specialized version of `_.forEach` for arrays without support for
  1750. * iteratee shorthands.
  1751. *
  1752. * @private
  1753. * @param {Array} [array] The array to iterate over.
  1754. * @param {Function} iteratee The function invoked per iteration.
  1755. * @returns {Array} Returns `array`.
  1756. */
  1757. function arrayEach(array, iteratee) {
  1758. var index = -1,
  1759. length = array == null ? 0 : array.length;
  1760. while (++index < length) {
  1761. if (iteratee(array[index], index, array) === false) {
  1762. break;
  1763. }
  1764. }
  1765. return array;
  1766. }
  1767. /**
  1768. * A specialized version of `_.forEachRight` for arrays without support for
  1769. * iteratee shorthands.
  1770. *
  1771. * @private
  1772. * @param {Array} [array] The array to iterate over.
  1773. * @param {Function} iteratee The function invoked per iteration.
  1774. * @returns {Array} Returns `array`.
  1775. */
  1776. function arrayEachRight(array, iteratee) {
  1777. var length = array == null ? 0 : array.length;
  1778. while (length--) {
  1779. if (iteratee(array[length], length, array) === false) {
  1780. break;
  1781. }
  1782. }
  1783. return array;
  1784. }
  1785. /**
  1786. * A specialized version of `_.every` for arrays without support for
  1787. * iteratee shorthands.
  1788. *
  1789. * @private
  1790. * @param {Array} [array] The array to iterate over.
  1791. * @param {Function} predicate The function invoked per iteration.
  1792. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1793. * else `false`.
  1794. */
  1795. function arrayEvery(array, predicate) {
  1796. var index = -1,
  1797. length = array == null ? 0 : array.length;
  1798. while (++index < length) {
  1799. if (!predicate(array[index], index, array)) {
  1800. return false;
  1801. }
  1802. }
  1803. return true;
  1804. }
  1805. /**
  1806. * A specialized version of `_.filter` for arrays without support for
  1807. * iteratee shorthands.
  1808. *
  1809. * @private
  1810. * @param {Array} [array] The array to iterate over.
  1811. * @param {Function} predicate The function invoked per iteration.
  1812. * @returns {Array} Returns the new filtered array.
  1813. */
  1814. function arrayFilter(array, predicate) {
  1815. var index = -1,
  1816. length = array == null ? 0 : array.length,
  1817. resIndex = 0,
  1818. result = [];
  1819. while (++index < length) {
  1820. var value = array[index];
  1821. if (predicate(value, index, array)) {
  1822. result[resIndex++] = value;
  1823. }
  1824. }
  1825. return result;
  1826. }
  1827. /**
  1828. * A specialized version of `_.includes` for arrays without support for
  1829. * specifying an index to search from.
  1830. *
  1831. * @private
  1832. * @param {Array} [array] The array to inspect.
  1833. * @param {*} target The value to search for.
  1834. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1835. */
  1836. function arrayIncludes(array, value) {
  1837. var length = array == null ? 0 : array.length;
  1838. return !!length && baseIndexOf(array, value, 0) > -1;
  1839. }
  1840. /**
  1841. * This function is like `arrayIncludes` except that it accepts a comparator.
  1842. *
  1843. * @private
  1844. * @param {Array} [array] The array to inspect.
  1845. * @param {*} target The value to search for.
  1846. * @param {Function} comparator The comparator invoked per element.
  1847. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1848. */
  1849. function arrayIncludesWith(array, value, comparator) {
  1850. var index = -1,
  1851. length = array == null ? 0 : array.length;
  1852. while (++index < length) {
  1853. if (comparator(value, array[index])) {
  1854. return true;
  1855. }
  1856. }
  1857. return false;
  1858. }
  1859. /**
  1860. * A specialized version of `_.map` for arrays without support for iteratee
  1861. * shorthands.
  1862. *
  1863. * @private
  1864. * @param {Array} [array] The array to iterate over.
  1865. * @param {Function} iteratee The function invoked per iteration.
  1866. * @returns {Array} Returns the new mapped array.
  1867. */
  1868. function arrayMap(array, iteratee) {
  1869. var index = -1,
  1870. length = array == null ? 0 : array.length,
  1871. result = Array(length);
  1872. while (++index < length) {
  1873. result[index] = iteratee(array[index], index, array);
  1874. }
  1875. return result;
  1876. }
  1877. /**
  1878. * Appends the elements of `values` to `array`.
  1879. *
  1880. * @private
  1881. * @param {Array} array The array to modify.
  1882. * @param {Array} values The values to append.
  1883. * @returns {Array} Returns `array`.
  1884. */
  1885. function arrayPush(array, values) {
  1886. var index = -1,
  1887. length = values.length,
  1888. offset = array.length;
  1889. while (++index < length) {
  1890. array[offset + index] = values[index];
  1891. }
  1892. return array;
  1893. }
  1894. /**
  1895. * A specialized version of `_.reduce` for arrays without support for
  1896. * iteratee shorthands.
  1897. *
  1898. * @private
  1899. * @param {Array} [array] The array to iterate over.
  1900. * @param {Function} iteratee The function invoked per iteration.
  1901. * @param {*} [accumulator] The initial value.
  1902. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1903. * the initial value.
  1904. * @returns {*} Returns the accumulated value.
  1905. */
  1906. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1907. var index = -1,
  1908. length = array == null ? 0 : array.length;
  1909. if (initAccum && length) {
  1910. accumulator = array[++index];
  1911. }
  1912. while (++index < length) {
  1913. accumulator = iteratee(accumulator, array[index], index, array);
  1914. }
  1915. return accumulator;
  1916. }
  1917. /**
  1918. * A specialized version of `_.reduceRight` for arrays without support for
  1919. * iteratee shorthands.
  1920. *
  1921. * @private
  1922. * @param {Array} [array] The array to iterate over.
  1923. * @param {Function} iteratee The function invoked per iteration.
  1924. * @param {*} [accumulator] The initial value.
  1925. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1926. * the initial value.
  1927. * @returns {*} Returns the accumulated value.
  1928. */
  1929. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1930. var length = array == null ? 0 : array.length;
  1931. if (initAccum && length) {
  1932. accumulator = array[--length];
  1933. }
  1934. while (length--) {
  1935. accumulator = iteratee(accumulator, array[length], length, array);
  1936. }
  1937. return accumulator;
  1938. }
  1939. /**
  1940. * A specialized version of `_.some` for arrays without support for iteratee
  1941. * shorthands.
  1942. *
  1943. * @private
  1944. * @param {Array} [array] The array to iterate over.
  1945. * @param {Function} predicate The function invoked per iteration.
  1946. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1947. * else `false`.
  1948. */
  1949. function arraySome(array, predicate) {
  1950. var index = -1,
  1951. length = array == null ? 0 : array.length;
  1952. while (++index < length) {
  1953. if (predicate(array[index], index, array)) {
  1954. return true;
  1955. }
  1956. }
  1957. return false;
  1958. }
  1959. /**
  1960. * Gets the size of an ASCII `string`.
  1961. *
  1962. * @private
  1963. * @param {string} string The string inspect.
  1964. * @returns {number} Returns the string size.
  1965. */
  1966. var asciiSize = baseProperty('length');
  1967. /**
  1968. * Converts an ASCII `string` to an array.
  1969. *
  1970. * @private
  1971. * @param {string} string The string to convert.
  1972. * @returns {Array} Returns the converted array.
  1973. */
  1974. function asciiToArray(string) {
  1975. return string.split('');
  1976. }
  1977. /**
  1978. * Splits an ASCII `string` into an array of its words.
  1979. *
  1980. * @private
  1981. * @param {string} The string to inspect.
  1982. * @returns {Array} Returns the words of `string`.
  1983. */
  1984. function asciiWords(string) {
  1985. return string.match(reAsciiWord) || [];
  1986. }
  1987. /**
  1988. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1989. * without support for iteratee shorthands, which iterates over `collection`
  1990. * using `eachFunc`.
  1991. *
  1992. * @private
  1993. * @param {Array|Object} collection The collection to inspect.
  1994. * @param {Function} predicate The function invoked per iteration.
  1995. * @param {Function} eachFunc The function to iterate over `collection`.
  1996. * @returns {*} Returns the found element or its key, else `undefined`.
  1997. */
  1998. function baseFindKey(collection, predicate, eachFunc) {
  1999. var result;
  2000. eachFunc(collection, function(value, key, collection) {
  2001. if (predicate(value, key, collection)) {
  2002. result = key;
  2003. return false;
  2004. }
  2005. });
  2006. return result;
  2007. }
  2008. /**
  2009. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2010. * support for iteratee shorthands.
  2011. *
  2012. * @private
  2013. * @param {Array} array The array to inspect.
  2014. * @param {Function} predicate The function invoked per iteration.
  2015. * @param {number} fromIndex The index to search from.
  2016. * @param {boolean} [fromRight] Specify iterating from right to left.
  2017. * @returns {number} Returns the index of the matched value, else `-1`.
  2018. */
  2019. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2020. var length = array.length,
  2021. index = fromIndex + (fromRight ? 1 : -1);
  2022. while ((fromRight ? index-- : ++index < length)) {
  2023. if (predicate(array[index], index, array)) {
  2024. return index;
  2025. }
  2026. }
  2027. return -1;
  2028. }
  2029. /**
  2030. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2031. *
  2032. * @private
  2033. * @param {Array} array The array to inspect.
  2034. * @param {*} value The value to search for.
  2035. * @param {number} fromIndex The index to search from.
  2036. * @returns {number} Returns the index of the matched value, else `-1`.
  2037. */
  2038. function baseIndexOf(array, value, fromIndex) {
  2039. return value === value
  2040. ? strictIndexOf(array, value, fromIndex)
  2041. : baseFindIndex(array, baseIsNaN, fromIndex);
  2042. }
  2043. /**
  2044. * This function is like `baseIndexOf` except that it accepts a comparator.
  2045. *
  2046. * @private
  2047. * @param {Array} array The array to inspect.
  2048. * @param {*} value The value to search for.
  2049. * @param {number} fromIndex The index to search from.
  2050. * @param {Function} comparator The comparator invoked per element.
  2051. * @returns {number} Returns the index of the matched value, else `-1`.
  2052. */
  2053. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2054. var index = fromIndex - 1,
  2055. length = array.length;
  2056. while (++index < length) {
  2057. if (comparator(array[index], value)) {
  2058. return index;
  2059. }
  2060. }
  2061. return -1;
  2062. }
  2063. /**
  2064. * The base implementation of `_.isNaN` without support for number objects.
  2065. *
  2066. * @private
  2067. * @param {*} value The value to check.
  2068. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2069. */
  2070. function baseIsNaN(value) {
  2071. return value !== value;
  2072. }
  2073. /**
  2074. * The base implementation of `_.mean` and `_.meanBy` without support for
  2075. * iteratee shorthands.
  2076. *
  2077. * @private
  2078. * @param {Array} array The array to iterate over.
  2079. * @param {Function} iteratee The function invoked per iteration.
  2080. * @returns {number} Returns the mean.
  2081. */
  2082. function baseMean(array, iteratee) {
  2083. var length = array == null ? 0 : array.length;
  2084. return length ? (baseSum(array, iteratee) / length) : NAN;
  2085. }
  2086. /**
  2087. * The base implementation of `_.property` without support for deep paths.
  2088. *
  2089. * @private
  2090. * @param {string} key The key of the property to get.
  2091. * @returns {Function} Returns the new accessor function.
  2092. */
  2093. function baseProperty(key) {
  2094. return function(object) {
  2095. return object == null ? undefined : object[key];
  2096. };
  2097. }
  2098. /**
  2099. * The base implementation of `_.propertyOf` without support for deep paths.
  2100. *
  2101. * @private
  2102. * @param {Object} object The object to query.
  2103. * @returns {Function} Returns the new accessor function.
  2104. */
  2105. function basePropertyOf(object) {
  2106. return function(key) {
  2107. return object == null ? undefined : object[key];
  2108. };
  2109. }
  2110. /**
  2111. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2112. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2113. *
  2114. * @private
  2115. * @param {Array|Object} collection The collection to iterate over.
  2116. * @param {Function} iteratee The function invoked per iteration.
  2117. * @param {*} accumulator The initial value.
  2118. * @param {boolean} initAccum Specify using the first or last element of
  2119. * `collection` as the initial value.
  2120. * @param {Function} eachFunc The function to iterate over `collection`.
  2121. * @returns {*} Returns the accumulated value.
  2122. */
  2123. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2124. eachFunc(collection, function(value, index, collection) {
  2125. accumulator = initAccum
  2126. ? (initAccum = false, value)
  2127. : iteratee(accumulator, value, index, collection);
  2128. });
  2129. return accumulator;
  2130. }
  2131. /**
  2132. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2133. * sort order of `array` and replaces criteria objects with their corresponding
  2134. * values.
  2135. *
  2136. * @private
  2137. * @param {Array} array The array to sort.
  2138. * @param {Function} comparer The function to define sort order.
  2139. * @returns {Array} Returns `array`.
  2140. */
  2141. function baseSortBy(array, comparer) {
  2142. var length = array.length;
  2143. array.sort(comparer);
  2144. while (length--) {
  2145. array[length] = array[length].value;
  2146. }
  2147. return array;
  2148. }
  2149. /**
  2150. * The base implementation of `_.sum` and `_.sumBy` without support for
  2151. * iteratee shorthands.
  2152. *
  2153. * @private
  2154. * @param {Array} array The array to iterate over.
  2155. * @param {Function} iteratee The function invoked per iteration.
  2156. * @returns {number} Returns the sum.
  2157. */
  2158. function baseSum(array, iteratee) {
  2159. var result,
  2160. index = -1,
  2161. length = array.length;
  2162. while (++index < length) {
  2163. var current = iteratee(array[index]);
  2164. if (current !== undefined) {
  2165. result = result === undefined ? current : (result + current);
  2166. }
  2167. }
  2168. return result;
  2169. }
  2170. /**
  2171. * The base implementation of `_.times` without support for iteratee shorthands
  2172. * or max array length checks.
  2173. *
  2174. * @private
  2175. * @param {number} n The number of times to invoke `iteratee`.
  2176. * @param {Function} iteratee The function invoked per iteration.
  2177. * @returns {Array} Returns the array of results.
  2178. */
  2179. function baseTimes(n, iteratee) {
  2180. var index = -1,
  2181. result = Array(n);
  2182. while (++index < n) {
  2183. result[index] = iteratee(index);
  2184. }
  2185. return result;
  2186. }
  2187. /**
  2188. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2189. * of key-value pairs for `object` corresponding to the property names of `props`.
  2190. *
  2191. * @private
  2192. * @param {Object} object The object to query.
  2193. * @param {Array} props The property names to get values for.
  2194. * @returns {Object} Returns the key-value pairs.
  2195. */
  2196. function baseToPairs(object, props) {
  2197. return arrayMap(props, function(key) {
  2198. return [key, object[key]];
  2199. });
  2200. }
  2201. /**
  2202. * The base implementation of `_.trim`.
  2203. *
  2204. * @private
  2205. * @param {string} string The string to trim.
  2206. * @returns {string} Returns the trimmed string.
  2207. */
  2208. function baseTrim(string) {
  2209. return string
  2210. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2211. : string;
  2212. }
  2213. /**
  2214. * The base implementation of `_.unary` without support for storing metadata.
  2215. *
  2216. * @private
  2217. * @param {Function} func The function to cap arguments for.
  2218. * @returns {Function} Returns the new capped function.
  2219. */
  2220. function baseUnary(func) {
  2221. return function(value) {
  2222. return func(value);
  2223. };
  2224. }
  2225. /**
  2226. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2227. * array of `object` property values corresponding to the property names
  2228. * of `props`.
  2229. *
  2230. * @private
  2231. * @param {Object} object The object to query.
  2232. * @param {Array} props The property names to get values for.
  2233. * @returns {Object} Returns the array of property values.
  2234. */
  2235. function baseValues(object, props) {
  2236. return arrayMap(props, function(key) {
  2237. return object[key];
  2238. });
  2239. }
  2240. /**
  2241. * Checks if a `cache` value for `key` exists.
  2242. *
  2243. * @private
  2244. * @param {Object} cache The cache to query.
  2245. * @param {string} key The key of the entry to check.
  2246. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2247. */
  2248. function cacheHas(cache, key) {
  2249. return cache.has(key);
  2250. }
  2251. /**
  2252. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2253. * that is not found in the character symbols.
  2254. *
  2255. * @private
  2256. * @param {Array} strSymbols The string symbols to inspect.
  2257. * @param {Array} chrSymbols The character symbols to find.
  2258. * @returns {number} Returns the index of the first unmatched string symbol.
  2259. */
  2260. function charsStartIndex(strSymbols, chrSymbols) {
  2261. var index = -1,
  2262. length = strSymbols.length;
  2263. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2264. return index;
  2265. }
  2266. /**
  2267. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2268. * that is not found in the character symbols.
  2269. *
  2270. * @private
  2271. * @param {Array} strSymbols The string symbols to inspect.
  2272. * @param {Array} chrSymbols The character symbols to find.
  2273. * @returns {number} Returns the index of the last unmatched string symbol.
  2274. */
  2275. function charsEndIndex(strSymbols, chrSymbols) {
  2276. var index = strSymbols.length;
  2277. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2278. return index;
  2279. }
  2280. /**
  2281. * Gets the number of `placeholder` occurrences in `array`.
  2282. *
  2283. * @private
  2284. * @param {Array} array The array to inspect.
  2285. * @param {*} placeholder The placeholder to search for.
  2286. * @returns {number} Returns the placeholder count.
  2287. */
  2288. function countHolders(array, placeholder) {
  2289. var length = array.length,
  2290. result = 0;
  2291. while (length--) {
  2292. if (array[length] === placeholder) {
  2293. ++result;
  2294. }
  2295. }
  2296. return result;
  2297. }
  2298. /**
  2299. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2300. * letters to basic Latin letters.
  2301. *
  2302. * @private
  2303. * @param {string} letter The matched letter to deburr.
  2304. * @returns {string} Returns the deburred letter.
  2305. */
  2306. var deburrLetter = basePropertyOf(deburredLetters);
  2307. /**
  2308. * Used by `_.escape` to convert characters to HTML entities.
  2309. *
  2310. * @private
  2311. * @param {string} chr The matched character to escape.
  2312. * @returns {string} Returns the escaped character.
  2313. */
  2314. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2315. /**
  2316. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2317. *
  2318. * @private
  2319. * @param {string} chr The matched character to escape.
  2320. * @returns {string} Returns the escaped character.
  2321. */
  2322. function escapeStringChar(chr) {
  2323. return '\\' + stringEscapes[chr];
  2324. }
  2325. /**
  2326. * Gets the value at `key` of `object`.
  2327. *
  2328. * @private
  2329. * @param {Object} [object] The object to query.
  2330. * @param {string} key The key of the property to get.
  2331. * @returns {*} Returns the property value.
  2332. */
  2333. function getValue(object, key) {
  2334. return object == null ? undefined : object[key];
  2335. }
  2336. /**
  2337. * Checks if `string` contains Unicode symbols.
  2338. *
  2339. * @private
  2340. * @param {string} string The string to inspect.
  2341. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2342. */
  2343. function hasUnicode(string) {
  2344. return reHasUnicode.test(string);
  2345. }
  2346. /**
  2347. * Checks if `string` contains a word composed of Unicode symbols.
  2348. *
  2349. * @private
  2350. * @param {string} string The string to inspect.
  2351. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2352. */
  2353. function hasUnicodeWord(string) {
  2354. return reHasUnicodeWord.test(string);
  2355. }
  2356. /**
  2357. * Converts `iterator` to an array.
  2358. *
  2359. * @private
  2360. * @param {Object} iterator The iterator to convert.
  2361. * @returns {Array} Returns the converted array.
  2362. */
  2363. function iteratorToArray(iterator) {
  2364. var data,
  2365. result = [];
  2366. while (!(data = iterator.next()).done) {
  2367. result.push(data.value);
  2368. }
  2369. return result;
  2370. }
  2371. /**
  2372. * Converts `map` to its key-value pairs.
  2373. *
  2374. * @private
  2375. * @param {Object} map The map to convert.
  2376. * @returns {Array} Returns the key-value pairs.
  2377. */
  2378. function mapToArray(map) {
  2379. var index = -1,
  2380. result = Array(map.size);
  2381. map.forEach(function(value, key) {
  2382. result[++index] = [key, value];
  2383. });
  2384. return result;
  2385. }
  2386. /**
  2387. * Creates a unary function that invokes `func` with its argument transformed.
  2388. *
  2389. * @private
  2390. * @param {Function} func The function to wrap.
  2391. * @param {Function} transform The argument transform.
  2392. * @returns {Function} Returns the new function.
  2393. */
  2394. function overArg(func, transform) {
  2395. return function(arg) {
  2396. return func(transform(arg));
  2397. };
  2398. }
  2399. /**
  2400. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2401. * and returns an array of their indexes.
  2402. *
  2403. * @private
  2404. * @param {Array} array The array to modify.
  2405. * @param {*} placeholder The placeholder to replace.
  2406. * @returns {Array} Returns the new array of placeholder indexes.
  2407. */
  2408. function replaceHolders(array, placeholder) {
  2409. var index = -1,
  2410. length = array.length,
  2411. resIndex = 0,
  2412. result = [];
  2413. while (++index < length) {
  2414. var value = array[index];
  2415. if (value === placeholder || value === PLACEHOLDER) {
  2416. array[index] = PLACEHOLDER;
  2417. result[resIndex++] = index;
  2418. }
  2419. }
  2420. return result;
  2421. }
  2422. /**
  2423. * Converts `set` to an array of its values.
  2424. *
  2425. * @private
  2426. * @param {Object} set The set to convert.
  2427. * @returns {Array} Returns the values.
  2428. */
  2429. function setToArray(set) {
  2430. var index = -1,
  2431. result = Array(set.size);
  2432. set.forEach(function(value) {
  2433. result[++index] = value;
  2434. });
  2435. return result;
  2436. }
  2437. /**
  2438. * Converts `set` to its value-value pairs.
  2439. *
  2440. * @private
  2441. * @param {Object} set The set to convert.
  2442. * @returns {Array} Returns the value-value pairs.
  2443. */
  2444. function setToPairs(set) {
  2445. var index = -1,
  2446. result = Array(set.size);
  2447. set.forEach(function(value) {
  2448. result[++index] = [value, value];
  2449. });
  2450. return result;
  2451. }
  2452. /**
  2453. * A specialized version of `_.indexOf` which performs strict equality
  2454. * comparisons of values, i.e. `===`.
  2455. *
  2456. * @private
  2457. * @param {Array} array The array to inspect.
  2458. * @param {*} value The value to search for.
  2459. * @param {number} fromIndex The index to search from.
  2460. * @returns {number} Returns the index of the matched value, else `-1`.
  2461. */
  2462. function strictIndexOf(array, value, fromIndex) {
  2463. var index = fromIndex - 1,
  2464. length = array.length;
  2465. while (++index < length) {
  2466. if (array[index] === value) {
  2467. return index;
  2468. }
  2469. }
  2470. return -1;
  2471. }
  2472. /**
  2473. * A specialized version of `_.lastIndexOf` which performs strict equality
  2474. * comparisons of values, i.e. `===`.
  2475. *
  2476. * @private
  2477. * @param {Array} array The array to inspect.
  2478. * @param {*} value The value to search for.
  2479. * @param {number} fromIndex The index to search from.
  2480. * @returns {number} Returns the index of the matched value, else `-1`.
  2481. */
  2482. function strictLastIndexOf(array, value, fromIndex) {
  2483. var index = fromIndex + 1;
  2484. while (index--) {
  2485. if (array[index] === value) {
  2486. return index;
  2487. }
  2488. }
  2489. return index;
  2490. }
  2491. /**
  2492. * Gets the number of symbols in `string`.
  2493. *
  2494. * @private
  2495. * @param {string} string The string to inspect.
  2496. * @returns {number} Returns the string size.
  2497. */
  2498. function stringSize(string) {
  2499. return hasUnicode(string)
  2500. ? unicodeSize(string)
  2501. : asciiSize(string);
  2502. }
  2503. /**
  2504. * Converts `string` to an array.
  2505. *
  2506. * @private
  2507. * @param {string} string The string to convert.
  2508. * @returns {Array} Returns the converted array.
  2509. */
  2510. function stringToArray(string) {
  2511. return hasUnicode(string)
  2512. ? unicodeToArray(string)
  2513. : asciiToArray(string);
  2514. }
  2515. /**
  2516. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2517. * character of `string`.
  2518. *
  2519. * @private
  2520. * @param {string} string The string to inspect.
  2521. * @returns {number} Returns the index of the last non-whitespace character.
  2522. */
  2523. function trimmedEndIndex(string) {
  2524. var index = string.length;
  2525. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2526. return index;
  2527. }
  2528. /**
  2529. * Used by `_.unescape` to convert HTML entities to characters.
  2530. *
  2531. * @private
  2532. * @param {string} chr The matched character to unescape.
  2533. * @returns {string} Returns the unescaped character.
  2534. */
  2535. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2536. /**
  2537. * Gets the size of a Unicode `string`.
  2538. *
  2539. * @private
  2540. * @param {string} string The string inspect.
  2541. * @returns {number} Returns the string size.
  2542. */
  2543. function unicodeSize(string) {
  2544. var result = reUnicode.lastIndex = 0;
  2545. while (reUnicode.test(string)) {
  2546. ++result;
  2547. }
  2548. return result;
  2549. }
  2550. /**
  2551. * Converts a Unicode `string` to an array.
  2552. *
  2553. * @private
  2554. * @param {string} string The string to convert.
  2555. * @returns {Array} Returns the converted array.
  2556. */
  2557. function unicodeToArray(string) {
  2558. return string.match(reUnicode) || [];
  2559. }
  2560. /**
  2561. * Splits a Unicode `string` into an array of its words.
  2562. *
  2563. * @private
  2564. * @param {string} The string to inspect.
  2565. * @returns {Array} Returns the words of `string`.
  2566. */
  2567. function unicodeWords(string) {
  2568. return string.match(reUnicodeWord) || [];
  2569. }
  2570. /*--------------------------------------------------------------------------*/
  2571. /**
  2572. * Create a new pristine `lodash` function using the `context` object.
  2573. *
  2574. * @static
  2575. * @memberOf _
  2576. * @since 1.1.0
  2577. * @category Util
  2578. * @param {Object} [context=root] The context object.
  2579. * @returns {Function} Returns a new `lodash` function.
  2580. * @example
  2581. *
  2582. * _.mixin({ 'foo': _.constant('foo') });
  2583. *
  2584. * var lodash = _.runInContext();
  2585. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2586. *
  2587. * _.isFunction(_.foo);
  2588. * // => true
  2589. * _.isFunction(_.bar);
  2590. * // => false
  2591. *
  2592. * lodash.isFunction(lodash.foo);
  2593. * // => false
  2594. * lodash.isFunction(lodash.bar);
  2595. * // => true
  2596. *
  2597. * // Create a suped-up `defer` in Node.js.
  2598. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2599. */
  2600. var runInContext = (function runInContext(context) {
  2601. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2602. /** Built-in constructor references. */
  2603. var Array = context.Array,
  2604. Date = context.Date,
  2605. Error = context.Error,
  2606. Function = context.Function,
  2607. Math = context.Math,
  2608. Object = context.Object,
  2609. RegExp = context.RegExp,
  2610. String = context.String,
  2611. TypeError = context.TypeError;
  2612. /** Used for built-in method references. */
  2613. var arrayProto = Array.prototype,
  2614. funcProto = Function.prototype,
  2615. objectProto = Object.prototype;
  2616. /** Used to detect overreaching core-js shims. */
  2617. var coreJsData = context['__core-js_shared__'];
  2618. /** Used to resolve the decompiled source of functions. */
  2619. var funcToString = funcProto.toString;
  2620. /** Used to check objects for own properties. */
  2621. var hasOwnProperty = objectProto.hasOwnProperty;
  2622. /** Used to generate unique IDs. */
  2623. var idCounter = 0;
  2624. /** Used to detect methods masquerading as native. */
  2625. var maskSrcKey = (function() {
  2626. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2627. return uid ? ('Symbol(src)_1.' + uid) : '';
  2628. }());
  2629. /**
  2630. * Used to resolve the
  2631. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2632. * of values.
  2633. */
  2634. var nativeObjectToString = objectProto.toString;
  2635. /** Used to infer the `Object` constructor. */
  2636. var objectCtorString = funcToString.call(Object);
  2637. /** Used to restore the original `_` reference in `_.noConflict`. */
  2638. var oldDash = root._;
  2639. /** Used to detect if a method is native. */
  2640. var reIsNative = RegExp('^' +
  2641. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2642. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2643. );
  2644. /** Built-in value references. */
  2645. var Buffer = moduleExports ? context.Buffer : undefined,
  2646. Symbol = context.Symbol,
  2647. Uint8Array = context.Uint8Array,
  2648. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2649. getPrototype = overArg(Object.getPrototypeOf, Object),
  2650. objectCreate = Object.create,
  2651. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2652. splice = arrayProto.splice,
  2653. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2654. symIterator = Symbol ? Symbol.iterator : undefined,
  2655. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2656. var defineProperty = (function() {
  2657. try {
  2658. var func = getNative(Object, 'defineProperty');
  2659. func({}, '', {});
  2660. return func;
  2661. } catch (e) {}
  2662. }());
  2663. /** Mocked built-ins. */
  2664. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2665. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2666. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2667. /* Built-in method references for those with the same name as other `lodash` methods. */
  2668. var nativeCeil = Math.ceil,
  2669. nativeFloor = Math.floor,
  2670. nativeGetSymbols = Object.getOwnPropertySymbols,
  2671. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2672. nativeIsFinite = context.isFinite,
  2673. nativeJoin = arrayProto.join,
  2674. nativeKeys = overArg(Object.keys, Object),
  2675. nativeMax = Math.max,
  2676. nativeMin = Math.min,
  2677. nativeNow = Date.now,
  2678. nativeParseInt = context.parseInt,
  2679. nativeRandom = Math.random,
  2680. nativeReverse = arrayProto.reverse;
  2681. /* Built-in method references that are verified to be native. */
  2682. var DataView = getNative(context, 'DataView'),
  2683. Map = getNative(context, 'Map'),
  2684. Promise = getNative(context, 'Promise'),
  2685. Set = getNative(context, 'Set'),
  2686. WeakMap = getNative(context, 'WeakMap'),
  2687. nativeCreate = getNative(Object, 'create');
  2688. /** Used to store function metadata. */
  2689. var metaMap = WeakMap && new WeakMap;
  2690. /** Used to lookup unminified function names. */
  2691. var realNames = {};
  2692. /** Used to detect maps, sets, and weakmaps. */
  2693. var dataViewCtorString = toSource(DataView),
  2694. mapCtorString = toSource(Map),
  2695. promiseCtorString = toSource(Promise),
  2696. setCtorString = toSource(Set),
  2697. weakMapCtorString = toSource(WeakMap);
  2698. /** Used to convert symbols to primitives and strings. */
  2699. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2700. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2701. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2702. /*------------------------------------------------------------------------*/
  2703. /**
  2704. * Creates a `lodash` object which wraps `value` to enable implicit method
  2705. * chain sequences. Methods that operate on and return arrays, collections,
  2706. * and functions can be chained together. Methods that retrieve a single value
  2707. * or may return a primitive value will automatically end the chain sequence
  2708. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2709. * with `_#value`.
  2710. *
  2711. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2712. * enabled using `_.chain`.
  2713. *
  2714. * The execution of chained methods is lazy, that is, it's deferred until
  2715. * `_#value` is implicitly or explicitly called.
  2716. *
  2717. * Lazy evaluation allows several methods to support shortcut fusion.
  2718. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2719. * the creation of intermediate arrays and can greatly reduce the number of
  2720. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2721. * fusion if the section is applied to an array and iteratees accept only
  2722. * one argument. The heuristic for whether a section qualifies for shortcut
  2723. * fusion is subject to change.
  2724. *
  2725. * Chaining is supported in custom builds as long as the `_#value` method is
  2726. * directly or indirectly included in the build.
  2727. *
  2728. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2729. *
  2730. * The wrapper `Array` methods are:
  2731. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2732. *
  2733. * The wrapper `String` methods are:
  2734. * `replace` and `split`
  2735. *
  2736. * The wrapper methods that support shortcut fusion are:
  2737. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2738. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2739. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2740. *
  2741. * The chainable wrapper methods are:
  2742. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2743. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2744. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2745. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2746. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2747. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2748. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2749. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2750. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2751. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2752. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2753. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2754. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2755. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2756. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2757. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2758. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2759. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2760. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2761. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2762. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2763. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2764. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2765. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2766. *
  2767. * The wrapper methods that are **not** chainable by default are:
  2768. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2769. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2770. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2771. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2772. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2773. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2774. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2775. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2776. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2777. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2778. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2779. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2780. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2781. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2782. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2783. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2784. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2785. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2786. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2787. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2788. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2789. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2790. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2791. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2792. * `upperFirst`, `value`, and `words`
  2793. *
  2794. * @name _
  2795. * @constructor
  2796. * @category Seq
  2797. * @param {*} value The value to wrap in a `lodash` instance.
  2798. * @returns {Object} Returns the new `lodash` wrapper instance.
  2799. * @example
  2800. *
  2801. * function square(n) {
  2802. * return n * n;
  2803. * }
  2804. *
  2805. * var wrapped = _([1, 2, 3]);
  2806. *
  2807. * // Returns an unwrapped value.
  2808. * wrapped.reduce(_.add);
  2809. * // => 6
  2810. *
  2811. * // Returns a wrapped value.
  2812. * var squares = wrapped.map(square);
  2813. *
  2814. * _.isArray(squares);
  2815. * // => false
  2816. *
  2817. * _.isArray(squares.value());
  2818. * // => true
  2819. */
  2820. function lodash(value) {
  2821. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2822. if (value instanceof LodashWrapper) {
  2823. return value;
  2824. }
  2825. if (hasOwnProperty.call(value, '__wrapped__')) {
  2826. return wrapperClone(value);
  2827. }
  2828. }
  2829. return new LodashWrapper(value);
  2830. }
  2831. /**
  2832. * The base implementation of `_.create` without support for assigning
  2833. * properties to the created object.
  2834. *
  2835. * @private
  2836. * @param {Object} proto The object to inherit from.
  2837. * @returns {Object} Returns the new object.
  2838. */
  2839. var baseCreate = (function() {
  2840. function object() {}
  2841. return function(proto) {
  2842. if (!isObject(proto)) {
  2843. return {};
  2844. }
  2845. if (objectCreate) {
  2846. return objectCreate(proto);
  2847. }
  2848. object.prototype = proto;
  2849. var result = new object;
  2850. object.prototype = undefined;
  2851. return result;
  2852. };
  2853. }());
  2854. /**
  2855. * The function whose prototype chain sequence wrappers inherit from.
  2856. *
  2857. * @private
  2858. */
  2859. function baseLodash() {
  2860. // No operation performed.
  2861. }
  2862. /**
  2863. * The base constructor for creating `lodash` wrapper objects.
  2864. *
  2865. * @private
  2866. * @param {*} value The value to wrap.
  2867. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2868. */
  2869. function LodashWrapper(value, chainAll) {
  2870. this.__wrapped__ = value;
  2871. this.__actions__ = [];
  2872. this.__chain__ = !!chainAll;
  2873. this.__index__ = 0;
  2874. this.__values__ = undefined;
  2875. }
  2876. /**
  2877. * By default, the template delimiters used by lodash are like those in
  2878. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2879. * following template settings to use alternative delimiters.
  2880. *
  2881. * @static
  2882. * @memberOf _
  2883. * @type {Object}
  2884. */
  2885. lodash.templateSettings = {
  2886. /**
  2887. * Used to detect `data` property values to be HTML-escaped.
  2888. *
  2889. * @memberOf _.templateSettings
  2890. * @type {RegExp}
  2891. */
  2892. 'escape': reEscape,
  2893. /**
  2894. * Used to detect code to be evaluated.
  2895. *
  2896. * @memberOf _.templateSettings
  2897. * @type {RegExp}
  2898. */
  2899. 'evaluate': reEvaluate,
  2900. /**
  2901. * Used to detect `data` property values to inject.
  2902. *
  2903. * @memberOf _.templateSettings
  2904. * @type {RegExp}
  2905. */
  2906. 'interpolate': reInterpolate,
  2907. /**
  2908. * Used to reference the data object in the template text.
  2909. *
  2910. * @memberOf _.templateSettings
  2911. * @type {string}
  2912. */
  2913. 'variable': '',
  2914. /**
  2915. * Used to import variables into the compiled template.
  2916. *
  2917. * @memberOf _.templateSettings
  2918. * @type {Object}
  2919. */
  2920. 'imports': {
  2921. /**
  2922. * A reference to the `lodash` function.
  2923. *
  2924. * @memberOf _.templateSettings.imports
  2925. * @type {Function}
  2926. */
  2927. '_': lodash
  2928. }
  2929. };
  2930. // Ensure wrappers are instances of `baseLodash`.
  2931. lodash.prototype = baseLodash.prototype;
  2932. lodash.prototype.constructor = lodash;
  2933. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2934. LodashWrapper.prototype.constructor = LodashWrapper;
  2935. /*------------------------------------------------------------------------*/
  2936. /**
  2937. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2938. *
  2939. * @private
  2940. * @constructor
  2941. * @param {*} value The value to wrap.
  2942. */
  2943. function LazyWrapper(value) {
  2944. this.__wrapped__ = value;
  2945. this.__actions__ = [];
  2946. this.__dir__ = 1;
  2947. this.__filtered__ = false;
  2948. this.__iteratees__ = [];
  2949. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2950. this.__views__ = [];
  2951. }
  2952. /**
  2953. * Creates a clone of the lazy wrapper object.
  2954. *
  2955. * @private
  2956. * @name clone
  2957. * @memberOf LazyWrapper
  2958. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2959. */
  2960. function lazyClone() {
  2961. var result = new LazyWrapper(this.__wrapped__);
  2962. result.__actions__ = copyArray(this.__actions__);
  2963. result.__dir__ = this.__dir__;
  2964. result.__filtered__ = this.__filtered__;
  2965. result.__iteratees__ = copyArray(this.__iteratees__);
  2966. result.__takeCount__ = this.__takeCount__;
  2967. result.__views__ = copyArray(this.__views__);
  2968. return result;
  2969. }
  2970. /**
  2971. * Reverses the direction of lazy iteration.
  2972. *
  2973. * @private
  2974. * @name reverse
  2975. * @memberOf LazyWrapper
  2976. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2977. */
  2978. function lazyReverse() {
  2979. if (this.__filtered__) {
  2980. var result = new LazyWrapper(this);
  2981. result.__dir__ = -1;
  2982. result.__filtered__ = true;
  2983. } else {
  2984. result = this.clone();
  2985. result.__dir__ *= -1;
  2986. }
  2987. return result;
  2988. }
  2989. /**
  2990. * Extracts the unwrapped value from its lazy wrapper.
  2991. *
  2992. * @private
  2993. * @name value
  2994. * @memberOf LazyWrapper
  2995. * @returns {*} Returns the unwrapped value.
  2996. */
  2997. function lazyValue() {
  2998. var array = this.__wrapped__.value(),
  2999. dir = this.__dir__,
  3000. isArr = isArray(array),
  3001. isRight = dir < 0,
  3002. arrLength = isArr ? array.length : 0,
  3003. view = getView(0, arrLength, this.__views__),
  3004. start = view.start,
  3005. end = view.end,
  3006. length = end - start,
  3007. index = isRight ? end : (start - 1),
  3008. iteratees = this.__iteratees__,
  3009. iterLength = iteratees.length,
  3010. resIndex = 0,
  3011. takeCount = nativeMin(length, this.__takeCount__);
  3012. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3013. return baseWrapperValue(array, this.__actions__);
  3014. }
  3015. var result = [];
  3016. outer:
  3017. while (length-- && resIndex < takeCount) {
  3018. index += dir;
  3019. var iterIndex = -1,
  3020. value = array[index];
  3021. while (++iterIndex < iterLength) {
  3022. var data = iteratees[iterIndex],
  3023. iteratee = data.iteratee,
  3024. type = data.type,
  3025. computed = iteratee(value);
  3026. if (type == LAZY_MAP_FLAG) {
  3027. value = computed;
  3028. } else if (!computed) {
  3029. if (type == LAZY_FILTER_FLAG) {
  3030. continue outer;
  3031. } else {
  3032. break outer;
  3033. }
  3034. }
  3035. }
  3036. result[resIndex++] = value;
  3037. }
  3038. return result;
  3039. }
  3040. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3041. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3042. LazyWrapper.prototype.constructor = LazyWrapper;
  3043. /*------------------------------------------------------------------------*/
  3044. /**
  3045. * Creates a hash object.
  3046. *
  3047. * @private
  3048. * @constructor
  3049. * @param {Array} [entries] The key-value pairs to cache.
  3050. */
  3051. function Hash(entries) {
  3052. var index = -1,
  3053. length = entries == null ? 0 : entries.length;
  3054. this.clear();
  3055. while (++index < length) {
  3056. var entry = entries[index];
  3057. this.set(entry[0], entry[1]);
  3058. }
  3059. }
  3060. /**
  3061. * Removes all key-value entries from the hash.
  3062. *
  3063. * @private
  3064. * @name clear
  3065. * @memberOf Hash
  3066. */
  3067. function hashClear() {
  3068. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3069. this.size = 0;
  3070. }
  3071. /**
  3072. * Removes `key` and its value from the hash.
  3073. *
  3074. * @private
  3075. * @name delete
  3076. * @memberOf Hash
  3077. * @param {Object} hash The hash to modify.
  3078. * @param {string} key The key of the value to remove.
  3079. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3080. */
  3081. function hashDelete(key) {
  3082. var result = this.has(key) && delete this.__data__[key];
  3083. this.size -= result ? 1 : 0;
  3084. return result;
  3085. }
  3086. /**
  3087. * Gets the hash value for `key`.
  3088. *
  3089. * @private
  3090. * @name get
  3091. * @memberOf Hash
  3092. * @param {string} key The key of the value to get.
  3093. * @returns {*} Returns the entry value.
  3094. */
  3095. function hashGet(key) {
  3096. var data = this.__data__;
  3097. if (nativeCreate) {
  3098. var result = data[key];
  3099. return result === HASH_UNDEFINED ? undefined : result;
  3100. }
  3101. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3102. }
  3103. /**
  3104. * Checks if a hash value for `key` exists.
  3105. *
  3106. * @private
  3107. * @name has
  3108. * @memberOf Hash
  3109. * @param {string} key The key of the entry to check.
  3110. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3111. */
  3112. function hashHas(key) {
  3113. var data = this.__data__;
  3114. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3115. }
  3116. /**
  3117. * Sets the hash `key` to `value`.
  3118. *
  3119. * @private
  3120. * @name set
  3121. * @memberOf Hash
  3122. * @param {string} key The key of the value to set.
  3123. * @param {*} value The value to set.
  3124. * @returns {Object} Returns the hash instance.
  3125. */
  3126. function hashSet(key, value) {
  3127. var data = this.__data__;
  3128. this.size += this.has(key) ? 0 : 1;
  3129. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3130. return this;
  3131. }
  3132. // Add methods to `Hash`.
  3133. Hash.prototype.clear = hashClear;
  3134. Hash.prototype['delete'] = hashDelete;
  3135. Hash.prototype.get = hashGet;
  3136. Hash.prototype.has = hashHas;
  3137. Hash.prototype.set = hashSet;
  3138. /*------------------------------------------------------------------------*/
  3139. /**
  3140. * Creates an list cache object.
  3141. *
  3142. * @private
  3143. * @constructor
  3144. * @param {Array} [entries] The key-value pairs to cache.
  3145. */
  3146. function ListCache(entries) {
  3147. var index = -1,
  3148. length = entries == null ? 0 : entries.length;
  3149. this.clear();
  3150. while (++index < length) {
  3151. var entry = entries[index];
  3152. this.set(entry[0], entry[1]);
  3153. }
  3154. }
  3155. /**
  3156. * Removes all key-value entries from the list cache.
  3157. *
  3158. * @private
  3159. * @name clear
  3160. * @memberOf ListCache
  3161. */
  3162. function listCacheClear() {
  3163. this.__data__ = [];
  3164. this.size = 0;
  3165. }
  3166. /**
  3167. * Removes `key` and its value from the list cache.
  3168. *
  3169. * @private
  3170. * @name delete
  3171. * @memberOf ListCache
  3172. * @param {string} key The key of the value to remove.
  3173. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3174. */
  3175. function listCacheDelete(key) {
  3176. var data = this.__data__,
  3177. index = assocIndexOf(data, key);
  3178. if (index < 0) {
  3179. return false;
  3180. }
  3181. var lastIndex = data.length - 1;
  3182. if (index == lastIndex) {
  3183. data.pop();
  3184. } else {
  3185. splice.call(data, index, 1);
  3186. }
  3187. --this.size;
  3188. return true;
  3189. }
  3190. /**
  3191. * Gets the list cache value for `key`.
  3192. *
  3193. * @private
  3194. * @name get
  3195. * @memberOf ListCache
  3196. * @param {string} key The key of the value to get.
  3197. * @returns {*} Returns the entry value.
  3198. */
  3199. function listCacheGet(key) {
  3200. var data = this.__data__,
  3201. index = assocIndexOf(data, key);
  3202. return index < 0 ? undefined : data[index][1];
  3203. }
  3204. /**
  3205. * Checks if a list cache value for `key` exists.
  3206. *
  3207. * @private
  3208. * @name has
  3209. * @memberOf ListCache
  3210. * @param {string} key The key of the entry to check.
  3211. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3212. */
  3213. function listCacheHas(key) {
  3214. return assocIndexOf(this.__data__, key) > -1;
  3215. }
  3216. /**
  3217. * Sets the list cache `key` to `value`.
  3218. *
  3219. * @private
  3220. * @name set
  3221. * @memberOf ListCache
  3222. * @param {string} key The key of the value to set.
  3223. * @param {*} value The value to set.
  3224. * @returns {Object} Returns the list cache instance.
  3225. */
  3226. function listCacheSet(key, value) {
  3227. var data = this.__data__,
  3228. index = assocIndexOf(data, key);
  3229. if (index < 0) {
  3230. ++this.size;
  3231. data.push([key, value]);
  3232. } else {
  3233. data[index][1] = value;
  3234. }
  3235. return this;
  3236. }
  3237. // Add methods to `ListCache`.
  3238. ListCache.prototype.clear = listCacheClear;
  3239. ListCache.prototype['delete'] = listCacheDelete;
  3240. ListCache.prototype.get = listCacheGet;
  3241. ListCache.prototype.has = listCacheHas;
  3242. ListCache.prototype.set = listCacheSet;
  3243. /*------------------------------------------------------------------------*/
  3244. /**
  3245. * Creates a map cache object to store key-value pairs.
  3246. *
  3247. * @private
  3248. * @constructor
  3249. * @param {Array} [entries] The key-value pairs to cache.
  3250. */
  3251. function MapCache(entries) {
  3252. var index = -1,
  3253. length = entries == null ? 0 : entries.length;
  3254. this.clear();
  3255. while (++index < length) {
  3256. var entry = entries[index];
  3257. this.set(entry[0], entry[1]);
  3258. }
  3259. }
  3260. /**
  3261. * Removes all key-value entries from the map.
  3262. *
  3263. * @private
  3264. * @name clear
  3265. * @memberOf MapCache
  3266. */
  3267. function mapCacheClear() {
  3268. this.size = 0;
  3269. this.__data__ = {
  3270. 'hash': new Hash,
  3271. 'map': new (Map || ListCache),
  3272. 'string': new Hash
  3273. };
  3274. }
  3275. /**
  3276. * Removes `key` and its value from the map.
  3277. *
  3278. * @private
  3279. * @name delete
  3280. * @memberOf MapCache
  3281. * @param {string} key The key of the value to remove.
  3282. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3283. */
  3284. function mapCacheDelete(key) {
  3285. var result = getMapData(this, key)['delete'](key);
  3286. this.size -= result ? 1 : 0;
  3287. return result;
  3288. }
  3289. /**
  3290. * Gets the map value for `key`.
  3291. *
  3292. * @private
  3293. * @name get
  3294. * @memberOf MapCache
  3295. * @param {string} key The key of the value to get.
  3296. * @returns {*} Returns the entry value.
  3297. */
  3298. function mapCacheGet(key) {
  3299. return getMapData(this, key).get(key);
  3300. }
  3301. /**
  3302. * Checks if a map value for `key` exists.
  3303. *
  3304. * @private
  3305. * @name has
  3306. * @memberOf MapCache
  3307. * @param {string} key The key of the entry to check.
  3308. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3309. */
  3310. function mapCacheHas(key) {
  3311. return getMapData(this, key).has(key);
  3312. }
  3313. /**
  3314. * Sets the map `key` to `value`.
  3315. *
  3316. * @private
  3317. * @name set
  3318. * @memberOf MapCache
  3319. * @param {string} key The key of the value to set.
  3320. * @param {*} value The value to set.
  3321. * @returns {Object} Returns the map cache instance.
  3322. */
  3323. function mapCacheSet(key, value) {
  3324. var data = getMapData(this, key),
  3325. size = data.size;
  3326. data.set(key, value);
  3327. this.size += data.size == size ? 0 : 1;
  3328. return this;
  3329. }
  3330. // Add methods to `MapCache`.
  3331. MapCache.prototype.clear = mapCacheClear;
  3332. MapCache.prototype['delete'] = mapCacheDelete;
  3333. MapCache.prototype.get = mapCacheGet;
  3334. MapCache.prototype.has = mapCacheHas;
  3335. MapCache.prototype.set = mapCacheSet;
  3336. /*------------------------------------------------------------------------*/
  3337. /**
  3338. *
  3339. * Creates an array cache object to store unique values.
  3340. *
  3341. * @private
  3342. * @constructor
  3343. * @param {Array} [values] The values to cache.
  3344. */
  3345. function SetCache(values) {
  3346. var index = -1,
  3347. length = values == null ? 0 : values.length;
  3348. this.__data__ = new MapCache;
  3349. while (++index < length) {
  3350. this.add(values[index]);
  3351. }
  3352. }
  3353. /**
  3354. * Adds `value` to the array cache.
  3355. *
  3356. * @private
  3357. * @name add
  3358. * @memberOf SetCache
  3359. * @alias push
  3360. * @param {*} value The value to cache.
  3361. * @returns {Object} Returns the cache instance.
  3362. */
  3363. function setCacheAdd(value) {
  3364. this.__data__.set(value, HASH_UNDEFINED);
  3365. return this;
  3366. }
  3367. /**
  3368. * Checks if `value` is in the array cache.
  3369. *
  3370. * @private
  3371. * @name has
  3372. * @memberOf SetCache
  3373. * @param {*} value The value to search for.
  3374. * @returns {number} Returns `true` if `value` is found, else `false`.
  3375. */
  3376. function setCacheHas(value) {
  3377. return this.__data__.has(value);
  3378. }
  3379. // Add methods to `SetCache`.
  3380. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3381. SetCache.prototype.has = setCacheHas;
  3382. /*------------------------------------------------------------------------*/
  3383. /**
  3384. * Creates a stack cache object to store key-value pairs.
  3385. *
  3386. * @private
  3387. * @constructor
  3388. * @param {Array} [entries] The key-value pairs to cache.
  3389. */
  3390. function Stack(entries) {
  3391. var data = this.__data__ = new ListCache(entries);
  3392. this.size = data.size;
  3393. }
  3394. /**
  3395. * Removes all key-value entries from the stack.
  3396. *
  3397. * @private
  3398. * @name clear
  3399. * @memberOf Stack
  3400. */
  3401. function stackClear() {
  3402. this.__data__ = new ListCache;
  3403. this.size = 0;
  3404. }
  3405. /**
  3406. * Removes `key` and its value from the stack.
  3407. *
  3408. * @private
  3409. * @name delete
  3410. * @memberOf Stack
  3411. * @param {string} key The key of the value to remove.
  3412. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3413. */
  3414. function stackDelete(key) {
  3415. var data = this.__data__,
  3416. result = data['delete'](key);
  3417. this.size = data.size;
  3418. return result;
  3419. }
  3420. /**
  3421. * Gets the stack value for `key`.
  3422. *
  3423. * @private
  3424. * @name get
  3425. * @memberOf Stack
  3426. * @param {string} key The key of the value to get.
  3427. * @returns {*} Returns the entry value.
  3428. */
  3429. function stackGet(key) {
  3430. return this.__data__.get(key);
  3431. }
  3432. /**
  3433. * Checks if a stack value for `key` exists.
  3434. *
  3435. * @private
  3436. * @name has
  3437. * @memberOf Stack
  3438. * @param {string} key The key of the entry to check.
  3439. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3440. */
  3441. function stackHas(key) {
  3442. return this.__data__.has(key);
  3443. }
  3444. /**
  3445. * Sets the stack `key` to `value`.
  3446. *
  3447. * @private
  3448. * @name set
  3449. * @memberOf Stack
  3450. * @param {string} key The key of the value to set.
  3451. * @param {*} value The value to set.
  3452. * @returns {Object} Returns the stack cache instance.
  3453. */
  3454. function stackSet(key, value) {
  3455. var data = this.__data__;
  3456. if (data instanceof ListCache) {
  3457. var pairs = data.__data__;
  3458. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3459. pairs.push([key, value]);
  3460. this.size = ++data.size;
  3461. return this;
  3462. }
  3463. data = this.__data__ = new MapCache(pairs);
  3464. }
  3465. data.set(key, value);
  3466. this.size = data.size;
  3467. return this;
  3468. }
  3469. // Add methods to `Stack`.
  3470. Stack.prototype.clear = stackClear;
  3471. Stack.prototype['delete'] = stackDelete;
  3472. Stack.prototype.get = stackGet;
  3473. Stack.prototype.has = stackHas;
  3474. Stack.prototype.set = stackSet;
  3475. /*------------------------------------------------------------------------*/
  3476. /**
  3477. * Creates an array of the enumerable property names of the array-like `value`.
  3478. *
  3479. * @private
  3480. * @param {*} value The value to query.
  3481. * @param {boolean} inherited Specify returning inherited property names.
  3482. * @returns {Array} Returns the array of property names.
  3483. */
  3484. function arrayLikeKeys(value, inherited) {
  3485. var isArr = isArray(value),
  3486. isArg = !isArr && isArguments(value),
  3487. isBuff = !isArr && !isArg && isBuffer(value),
  3488. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3489. skipIndexes = isArr || isArg || isBuff || isType,
  3490. result = skipIndexes ? baseTimes(value.length, String) : [],
  3491. length = result.length;
  3492. for (var key in value) {
  3493. if ((inherited || hasOwnProperty.call(value, key)) &&
  3494. !(skipIndexes && (
  3495. // Safari 9 has enumerable `arguments.length` in strict mode.
  3496. key == 'length' ||
  3497. // Node.js 0.10 has enumerable non-index properties on buffers.
  3498. (isBuff && (key == 'offset' || key == 'parent')) ||
  3499. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3500. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3501. // Skip index properties.
  3502. isIndex(key, length)
  3503. ))) {
  3504. result.push(key);
  3505. }
  3506. }
  3507. return result;
  3508. }
  3509. /**
  3510. * A specialized version of `_.sample` for arrays.
  3511. *
  3512. * @private
  3513. * @param {Array} array The array to sample.
  3514. * @returns {*} Returns the random element.
  3515. */
  3516. function arraySample(array) {
  3517. var length = array.length;
  3518. return length ? array[baseRandom(0, length - 1)] : undefined;
  3519. }
  3520. /**
  3521. * A specialized version of `_.sampleSize` for arrays.
  3522. *
  3523. * @private
  3524. * @param {Array} array The array to sample.
  3525. * @param {number} n The number of elements to sample.
  3526. * @returns {Array} Returns the random elements.
  3527. */
  3528. function arraySampleSize(array, n) {
  3529. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3530. }
  3531. /**
  3532. * A specialized version of `_.shuffle` for arrays.
  3533. *
  3534. * @private
  3535. * @param {Array} array The array to shuffle.
  3536. * @returns {Array} Returns the new shuffled array.
  3537. */
  3538. function arrayShuffle(array) {
  3539. return shuffleSelf(copyArray(array));
  3540. }
  3541. /**
  3542. * This function is like `assignValue` except that it doesn't assign
  3543. * `undefined` values.
  3544. *
  3545. * @private
  3546. * @param {Object} object The object to modify.
  3547. * @param {string} key The key of the property to assign.
  3548. * @param {*} value The value to assign.
  3549. */
  3550. function assignMergeValue(object, key, value) {
  3551. if ((value !== undefined && !eq(object[key], value)) ||
  3552. (value === undefined && !(key in object))) {
  3553. baseAssignValue(object, key, value);
  3554. }
  3555. }
  3556. /**
  3557. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3558. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3559. * for equality comparisons.
  3560. *
  3561. * @private
  3562. * @param {Object} object The object to modify.
  3563. * @param {string} key The key of the property to assign.
  3564. * @param {*} value The value to assign.
  3565. */
  3566. function assignValue(object, key, value) {
  3567. var objValue = object[key];
  3568. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3569. (value === undefined && !(key in object))) {
  3570. baseAssignValue(object, key, value);
  3571. }
  3572. }
  3573. /**
  3574. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3575. *
  3576. * @private
  3577. * @param {Array} array The array to inspect.
  3578. * @param {*} key The key to search for.
  3579. * @returns {number} Returns the index of the matched value, else `-1`.
  3580. */
  3581. function assocIndexOf(array, key) {
  3582. var length = array.length;
  3583. while (length--) {
  3584. if (eq(array[length][0], key)) {
  3585. return length;
  3586. }
  3587. }
  3588. return -1;
  3589. }
  3590. /**
  3591. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3592. * by `iteratee` and values set by `setter`.
  3593. *
  3594. * @private
  3595. * @param {Array|Object} collection The collection to iterate over.
  3596. * @param {Function} setter The function to set `accumulator` values.
  3597. * @param {Function} iteratee The iteratee to transform keys.
  3598. * @param {Object} accumulator The initial aggregated object.
  3599. * @returns {Function} Returns `accumulator`.
  3600. */
  3601. function baseAggregator(collection, setter, iteratee, accumulator) {
  3602. baseEach(collection, function(value, key, collection) {
  3603. setter(accumulator, value, iteratee(value), collection);
  3604. });
  3605. return accumulator;
  3606. }
  3607. /**
  3608. * The base implementation of `_.assign` without support for multiple sources
  3609. * or `customizer` functions.
  3610. *
  3611. * @private
  3612. * @param {Object} object The destination object.
  3613. * @param {Object} source The source object.
  3614. * @returns {Object} Returns `object`.
  3615. */
  3616. function baseAssign(object, source) {
  3617. return object && copyObject(source, keys(source), object);
  3618. }
  3619. /**
  3620. * The base implementation of `_.assignIn` without support for multiple sources
  3621. * or `customizer` functions.
  3622. *
  3623. * @private
  3624. * @param {Object} object The destination object.
  3625. * @param {Object} source The source object.
  3626. * @returns {Object} Returns `object`.
  3627. */
  3628. function baseAssignIn(object, source) {
  3629. return object && copyObject(source, keysIn(source), object);
  3630. }
  3631. /**
  3632. * The base implementation of `assignValue` and `assignMergeValue` without
  3633. * value checks.
  3634. *
  3635. * @private
  3636. * @param {Object} object The object to modify.
  3637. * @param {string} key The key of the property to assign.
  3638. * @param {*} value The value to assign.
  3639. */
  3640. function baseAssignValue(object, key, value) {
  3641. if (key == '__proto__' && defineProperty) {
  3642. defineProperty(object, key, {
  3643. 'configurable': true,
  3644. 'enumerable': true,
  3645. 'value': value,
  3646. 'writable': true
  3647. });
  3648. } else {
  3649. object[key] = value;
  3650. }
  3651. }
  3652. /**
  3653. * The base implementation of `_.at` without support for individual paths.
  3654. *
  3655. * @private
  3656. * @param {Object} object The object to iterate over.
  3657. * @param {string[]} paths The property paths to pick.
  3658. * @returns {Array} Returns the picked elements.
  3659. */
  3660. function baseAt(object, paths) {
  3661. var index = -1,
  3662. length = paths.length,
  3663. result = Array(length),
  3664. skip = object == null;
  3665. while (++index < length) {
  3666. result[index] = skip ? undefined : get(object, paths[index]);
  3667. }
  3668. return result;
  3669. }
  3670. /**
  3671. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3672. *
  3673. * @private
  3674. * @param {number} number The number to clamp.
  3675. * @param {number} [lower] The lower bound.
  3676. * @param {number} upper The upper bound.
  3677. * @returns {number} Returns the clamped number.
  3678. */
  3679. function baseClamp(number, lower, upper) {
  3680. if (number === number) {
  3681. if (upper !== undefined) {
  3682. number = number <= upper ? number : upper;
  3683. }
  3684. if (lower !== undefined) {
  3685. number = number >= lower ? number : lower;
  3686. }
  3687. }
  3688. return number;
  3689. }
  3690. /**
  3691. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3692. * traversed objects.
  3693. *
  3694. * @private
  3695. * @param {*} value The value to clone.
  3696. * @param {boolean} bitmask The bitmask flags.
  3697. * 1 - Deep clone
  3698. * 2 - Flatten inherited properties
  3699. * 4 - Clone symbols
  3700. * @param {Function} [customizer] The function to customize cloning.
  3701. * @param {string} [key] The key of `value`.
  3702. * @param {Object} [object] The parent object of `value`.
  3703. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3704. * @returns {*} Returns the cloned value.
  3705. */
  3706. function baseClone(value, bitmask, customizer, key, object, stack) {
  3707. var result,
  3708. isDeep = bitmask & CLONE_DEEP_FLAG,
  3709. isFlat = bitmask & CLONE_FLAT_FLAG,
  3710. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3711. if (customizer) {
  3712. result = object ? customizer(value, key, object, stack) : customizer(value);
  3713. }
  3714. if (result !== undefined) {
  3715. return result;
  3716. }
  3717. if (!isObject(value)) {
  3718. return value;
  3719. }
  3720. var isArr = isArray(value);
  3721. if (isArr) {
  3722. result = initCloneArray(value);
  3723. if (!isDeep) {
  3724. return copyArray(value, result);
  3725. }
  3726. } else {
  3727. var tag = getTag(value),
  3728. isFunc = tag == funcTag || tag == genTag;
  3729. if (isBuffer(value)) {
  3730. return cloneBuffer(value, isDeep);
  3731. }
  3732. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3733. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3734. if (!isDeep) {
  3735. return isFlat
  3736. ? copySymbolsIn(value, baseAssignIn(result, value))
  3737. : copySymbols(value, baseAssign(result, value));
  3738. }
  3739. } else {
  3740. if (!cloneableTags[tag]) {
  3741. return object ? value : {};
  3742. }
  3743. result = initCloneByTag(value, tag, isDeep);
  3744. }
  3745. }
  3746. // Check for circular references and return its corresponding clone.
  3747. stack || (stack = new Stack);
  3748. var stacked = stack.get(value);
  3749. if (stacked) {
  3750. return stacked;
  3751. }
  3752. stack.set(value, result);
  3753. if (isSet(value)) {
  3754. value.forEach(function(subValue) {
  3755. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3756. });
  3757. } else if (isMap(value)) {
  3758. value.forEach(function(subValue, key) {
  3759. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3760. });
  3761. }
  3762. var keysFunc = isFull
  3763. ? (isFlat ? getAllKeysIn : getAllKeys)
  3764. : (isFlat ? keysIn : keys);
  3765. var props = isArr ? undefined : keysFunc(value);
  3766. arrayEach(props || value, function(subValue, key) {
  3767. if (props) {
  3768. key = subValue;
  3769. subValue = value[key];
  3770. }
  3771. // Recursively populate clone (susceptible to call stack limits).
  3772. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3773. });
  3774. return result;
  3775. }
  3776. /**
  3777. * The base implementation of `_.conforms` which doesn't clone `source`.
  3778. *
  3779. * @private
  3780. * @param {Object} source The object of property predicates to conform to.
  3781. * @returns {Function} Returns the new spec function.
  3782. */
  3783. function baseConforms(source) {
  3784. var props = keys(source);
  3785. return function(object) {
  3786. return baseConformsTo(object, source, props);
  3787. };
  3788. }
  3789. /**
  3790. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3791. *
  3792. * @private
  3793. * @param {Object} object The object to inspect.
  3794. * @param {Object} source The object of property predicates to conform to.
  3795. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3796. */
  3797. function baseConformsTo(object, source, props) {
  3798. var length = props.length;
  3799. if (object == null) {
  3800. return !length;
  3801. }
  3802. object = Object(object);
  3803. while (length--) {
  3804. var key = props[length],
  3805. predicate = source[key],
  3806. value = object[key];
  3807. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3808. return false;
  3809. }
  3810. }
  3811. return true;
  3812. }
  3813. /**
  3814. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3815. * to provide to `func`.
  3816. *
  3817. * @private
  3818. * @param {Function} func The function to delay.
  3819. * @param {number} wait The number of milliseconds to delay invocation.
  3820. * @param {Array} args The arguments to provide to `func`.
  3821. * @returns {number|Object} Returns the timer id or timeout object.
  3822. */
  3823. function baseDelay(func, wait, args) {
  3824. if (typeof func != 'function') {
  3825. throw new TypeError(FUNC_ERROR_TEXT);
  3826. }
  3827. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3828. }
  3829. /**
  3830. * The base implementation of methods like `_.difference` without support
  3831. * for excluding multiple arrays or iteratee shorthands.
  3832. *
  3833. * @private
  3834. * @param {Array} array The array to inspect.
  3835. * @param {Array} values The values to exclude.
  3836. * @param {Function} [iteratee] The iteratee invoked per element.
  3837. * @param {Function} [comparator] The comparator invoked per element.
  3838. * @returns {Array} Returns the new array of filtered values.
  3839. */
  3840. function baseDifference(array, values, iteratee, comparator) {
  3841. var index = -1,
  3842. includes = arrayIncludes,
  3843. isCommon = true,
  3844. length = array.length,
  3845. result = [],
  3846. valuesLength = values.length;
  3847. if (!length) {
  3848. return result;
  3849. }
  3850. if (iteratee) {
  3851. values = arrayMap(values, baseUnary(iteratee));
  3852. }
  3853. if (comparator) {
  3854. includes = arrayIncludesWith;
  3855. isCommon = false;
  3856. }
  3857. else if (values.length >= LARGE_ARRAY_SIZE) {
  3858. includes = cacheHas;
  3859. isCommon = false;
  3860. values = new SetCache(values);
  3861. }
  3862. outer:
  3863. while (++index < length) {
  3864. var value = array[index],
  3865. computed = iteratee == null ? value : iteratee(value);
  3866. value = (comparator || value !== 0) ? value : 0;
  3867. if (isCommon && computed === computed) {
  3868. var valuesIndex = valuesLength;
  3869. while (valuesIndex--) {
  3870. if (values[valuesIndex] === computed) {
  3871. continue outer;
  3872. }
  3873. }
  3874. result.push(value);
  3875. }
  3876. else if (!includes(values, computed, comparator)) {
  3877. result.push(value);
  3878. }
  3879. }
  3880. return result;
  3881. }
  3882. /**
  3883. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3884. *
  3885. * @private
  3886. * @param {Array|Object} collection The collection to iterate over.
  3887. * @param {Function} iteratee The function invoked per iteration.
  3888. * @returns {Array|Object} Returns `collection`.
  3889. */
  3890. var baseEach = createBaseEach(baseForOwn);
  3891. /**
  3892. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3893. *
  3894. * @private
  3895. * @param {Array|Object} collection The collection to iterate over.
  3896. * @param {Function} iteratee The function invoked per iteration.
  3897. * @returns {Array|Object} Returns `collection`.
  3898. */
  3899. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3900. /**
  3901. * The base implementation of `_.every` without support for iteratee shorthands.
  3902. *
  3903. * @private
  3904. * @param {Array|Object} collection The collection to iterate over.
  3905. * @param {Function} predicate The function invoked per iteration.
  3906. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3907. * else `false`
  3908. */
  3909. function baseEvery(collection, predicate) {
  3910. var result = true;
  3911. baseEach(collection, function(value, index, collection) {
  3912. result = !!predicate(value, index, collection);
  3913. return result;
  3914. });
  3915. return result;
  3916. }
  3917. /**
  3918. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3919. * `comparator` to determine the extremum value.
  3920. *
  3921. * @private
  3922. * @param {Array} array The array to iterate over.
  3923. * @param {Function} iteratee The iteratee invoked per iteration.
  3924. * @param {Function} comparator The comparator used to compare values.
  3925. * @returns {*} Returns the extremum value.
  3926. */
  3927. function baseExtremum(array, iteratee, comparator) {
  3928. var index = -1,
  3929. length = array.length;
  3930. while (++index < length) {
  3931. var value = array[index],
  3932. current = iteratee(value);
  3933. if (current != null && (computed === undefined
  3934. ? (current === current && !isSymbol(current))
  3935. : comparator(current, computed)
  3936. )) {
  3937. var computed = current,
  3938. result = value;
  3939. }
  3940. }
  3941. return result;
  3942. }
  3943. /**
  3944. * The base implementation of `_.fill` without an iteratee call guard.
  3945. *
  3946. * @private
  3947. * @param {Array} array The array to fill.
  3948. * @param {*} value The value to fill `array` with.
  3949. * @param {number} [start=0] The start position.
  3950. * @param {number} [end=array.length] The end position.
  3951. * @returns {Array} Returns `array`.
  3952. */
  3953. function baseFill(array, value, start, end) {
  3954. var length = array.length;
  3955. start = toInteger(start);
  3956. if (start < 0) {
  3957. start = -start > length ? 0 : (length + start);
  3958. }
  3959. end = (end === undefined || end > length) ? length : toInteger(end);
  3960. if (end < 0) {
  3961. end += length;
  3962. }
  3963. end = start > end ? 0 : toLength(end);
  3964. while (start < end) {
  3965. array[start++] = value;
  3966. }
  3967. return array;
  3968. }
  3969. /**
  3970. * The base implementation of `_.filter` without support for iteratee shorthands.
  3971. *
  3972. * @private
  3973. * @param {Array|Object} collection The collection to iterate over.
  3974. * @param {Function} predicate The function invoked per iteration.
  3975. * @returns {Array} Returns the new filtered array.
  3976. */
  3977. function baseFilter(collection, predicate) {
  3978. var result = [];
  3979. baseEach(collection, function(value, index, collection) {
  3980. if (predicate(value, index, collection)) {
  3981. result.push(value);
  3982. }
  3983. });
  3984. return result;
  3985. }
  3986. /**
  3987. * The base implementation of `_.flatten` with support for restricting flattening.
  3988. *
  3989. * @private
  3990. * @param {Array} array The array to flatten.
  3991. * @param {number} depth The maximum recursion depth.
  3992. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3993. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3994. * @param {Array} [result=[]] The initial result value.
  3995. * @returns {Array} Returns the new flattened array.
  3996. */
  3997. function baseFlatten(array, depth, predicate, isStrict, result) {
  3998. var index = -1,
  3999. length = array.length;
  4000. predicate || (predicate = isFlattenable);
  4001. result || (result = []);
  4002. while (++index < length) {
  4003. var value = array[index];
  4004. if (depth > 0 && predicate(value)) {
  4005. if (depth > 1) {
  4006. // Recursively flatten arrays (susceptible to call stack limits).
  4007. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4008. } else {
  4009. arrayPush(result, value);
  4010. }
  4011. } else if (!isStrict) {
  4012. result[result.length] = value;
  4013. }
  4014. }
  4015. return result;
  4016. }
  4017. /**
  4018. * The base implementation of `baseForOwn` which iterates over `object`
  4019. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4020. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4021. *
  4022. * @private
  4023. * @param {Object} object The object to iterate over.
  4024. * @param {Function} iteratee The function invoked per iteration.
  4025. * @param {Function} keysFunc The function to get the keys of `object`.
  4026. * @returns {Object} Returns `object`.
  4027. */
  4028. var baseFor = createBaseFor();
  4029. /**
  4030. * This function is like `baseFor` except that it iterates over properties
  4031. * in the opposite order.
  4032. *
  4033. * @private
  4034. * @param {Object} object The object to iterate over.
  4035. * @param {Function} iteratee The function invoked per iteration.
  4036. * @param {Function} keysFunc The function to get the keys of `object`.
  4037. * @returns {Object} Returns `object`.
  4038. */
  4039. var baseForRight = createBaseFor(true);
  4040. /**
  4041. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4042. *
  4043. * @private
  4044. * @param {Object} object The object to iterate over.
  4045. * @param {Function} iteratee The function invoked per iteration.
  4046. * @returns {Object} Returns `object`.
  4047. */
  4048. function baseForOwn(object, iteratee) {
  4049. return object && baseFor(object, iteratee, keys);
  4050. }
  4051. /**
  4052. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4053. *
  4054. * @private
  4055. * @param {Object} object The object to iterate over.
  4056. * @param {Function} iteratee The function invoked per iteration.
  4057. * @returns {Object} Returns `object`.
  4058. */
  4059. function baseForOwnRight(object, iteratee) {
  4060. return object && baseForRight(object, iteratee, keys);
  4061. }
  4062. /**
  4063. * The base implementation of `_.functions` which creates an array of
  4064. * `object` function property names filtered from `props`.
  4065. *
  4066. * @private
  4067. * @param {Object} object The object to inspect.
  4068. * @param {Array} props The property names to filter.
  4069. * @returns {Array} Returns the function names.
  4070. */
  4071. function baseFunctions(object, props) {
  4072. return arrayFilter(props, function(key) {
  4073. return isFunction(object[key]);
  4074. });
  4075. }
  4076. /**
  4077. * The base implementation of `_.get` without support for default values.
  4078. *
  4079. * @private
  4080. * @param {Object} object The object to query.
  4081. * @param {Array|string} path The path of the property to get.
  4082. * @returns {*} Returns the resolved value.
  4083. */
  4084. function baseGet(object, path) {
  4085. path = castPath(path, object);
  4086. var index = 0,
  4087. length = path.length;
  4088. while (object != null && index < length) {
  4089. object = object[toKey(path[index++])];
  4090. }
  4091. return (index && index == length) ? object : undefined;
  4092. }
  4093. /**
  4094. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4095. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4096. * symbols of `object`.
  4097. *
  4098. * @private
  4099. * @param {Object} object The object to query.
  4100. * @param {Function} keysFunc The function to get the keys of `object`.
  4101. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4102. * @returns {Array} Returns the array of property names and symbols.
  4103. */
  4104. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4105. var result = keysFunc(object);
  4106. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4107. }
  4108. /**
  4109. * The base implementation of `getTag` without fallbacks for buggy environments.
  4110. *
  4111. * @private
  4112. * @param {*} value The value to query.
  4113. * @returns {string} Returns the `toStringTag`.
  4114. */
  4115. function baseGetTag(value) {
  4116. if (value == null) {
  4117. return value === undefined ? undefinedTag : nullTag;
  4118. }
  4119. return (symToStringTag && symToStringTag in Object(value))
  4120. ? getRawTag(value)
  4121. : objectToString(value);
  4122. }
  4123. /**
  4124. * The base implementation of `_.gt` which doesn't coerce arguments.
  4125. *
  4126. * @private
  4127. * @param {*} value The value to compare.
  4128. * @param {*} other The other value to compare.
  4129. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4130. * else `false`.
  4131. */
  4132. function baseGt(value, other) {
  4133. return value > other;
  4134. }
  4135. /**
  4136. * The base implementation of `_.has` without support for deep paths.
  4137. *
  4138. * @private
  4139. * @param {Object} [object] The object to query.
  4140. * @param {Array|string} key The key to check.
  4141. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4142. */
  4143. function baseHas(object, key) {
  4144. return object != null && hasOwnProperty.call(object, key);
  4145. }
  4146. /**
  4147. * The base implementation of `_.hasIn` without support for deep paths.
  4148. *
  4149. * @private
  4150. * @param {Object} [object] The object to query.
  4151. * @param {Array|string} key The key to check.
  4152. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4153. */
  4154. function baseHasIn(object, key) {
  4155. return object != null && key in Object(object);
  4156. }
  4157. /**
  4158. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4159. *
  4160. * @private
  4161. * @param {number} number The number to check.
  4162. * @param {number} start The start of the range.
  4163. * @param {number} end The end of the range.
  4164. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4165. */
  4166. function baseInRange(number, start, end) {
  4167. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4168. }
  4169. /**
  4170. * The base implementation of methods like `_.intersection`, without support
  4171. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4172. *
  4173. * @private
  4174. * @param {Array} arrays The arrays to inspect.
  4175. * @param {Function} [iteratee] The iteratee invoked per element.
  4176. * @param {Function} [comparator] The comparator invoked per element.
  4177. * @returns {Array} Returns the new array of shared values.
  4178. */
  4179. function baseIntersection(arrays, iteratee, comparator) {
  4180. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4181. length = arrays[0].length,
  4182. othLength = arrays.length,
  4183. othIndex = othLength,
  4184. caches = Array(othLength),
  4185. maxLength = Infinity,
  4186. result = [];
  4187. while (othIndex--) {
  4188. var array = arrays[othIndex];
  4189. if (othIndex && iteratee) {
  4190. array = arrayMap(array, baseUnary(iteratee));
  4191. }
  4192. maxLength = nativeMin(array.length, maxLength);
  4193. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4194. ? new SetCache(othIndex && array)
  4195. : undefined;
  4196. }
  4197. array = arrays[0];
  4198. var index = -1,
  4199. seen = caches[0];
  4200. outer:
  4201. while (++index < length && result.length < maxLength) {
  4202. var value = array[index],
  4203. computed = iteratee ? iteratee(value) : value;
  4204. value = (comparator || value !== 0) ? value : 0;
  4205. if (!(seen
  4206. ? cacheHas(seen, computed)
  4207. : includes(result, computed, comparator)
  4208. )) {
  4209. othIndex = othLength;
  4210. while (--othIndex) {
  4211. var cache = caches[othIndex];
  4212. if (!(cache
  4213. ? cacheHas(cache, computed)
  4214. : includes(arrays[othIndex], computed, comparator))
  4215. ) {
  4216. continue outer;
  4217. }
  4218. }
  4219. if (seen) {
  4220. seen.push(computed);
  4221. }
  4222. result.push(value);
  4223. }
  4224. }
  4225. return result;
  4226. }
  4227. /**
  4228. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4229. * `object` with values transformed by `iteratee` and set by `setter`.
  4230. *
  4231. * @private
  4232. * @param {Object} object The object to iterate over.
  4233. * @param {Function} setter The function to set `accumulator` values.
  4234. * @param {Function} iteratee The iteratee to transform values.
  4235. * @param {Object} accumulator The initial inverted object.
  4236. * @returns {Function} Returns `accumulator`.
  4237. */
  4238. function baseInverter(object, setter, iteratee, accumulator) {
  4239. baseForOwn(object, function(value, key, object) {
  4240. setter(accumulator, iteratee(value), key, object);
  4241. });
  4242. return accumulator;
  4243. }
  4244. /**
  4245. * The base implementation of `_.invoke` without support for individual
  4246. * method arguments.
  4247. *
  4248. * @private
  4249. * @param {Object} object The object to query.
  4250. * @param {Array|string} path The path of the method to invoke.
  4251. * @param {Array} args The arguments to invoke the method with.
  4252. * @returns {*} Returns the result of the invoked method.
  4253. */
  4254. function baseInvoke(object, path, args) {
  4255. path = castPath(path, object);
  4256. object = parent(object, path);
  4257. var func = object == null ? object : object[toKey(last(path))];
  4258. return func == null ? undefined : apply(func, object, args);
  4259. }
  4260. /**
  4261. * The base implementation of `_.isArguments`.
  4262. *
  4263. * @private
  4264. * @param {*} value The value to check.
  4265. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4266. */
  4267. function baseIsArguments(value) {
  4268. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4269. }
  4270. /**
  4271. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4272. *
  4273. * @private
  4274. * @param {*} value The value to check.
  4275. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4276. */
  4277. function baseIsArrayBuffer(value) {
  4278. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4279. }
  4280. /**
  4281. * The base implementation of `_.isDate` without Node.js optimizations.
  4282. *
  4283. * @private
  4284. * @param {*} value The value to check.
  4285. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4286. */
  4287. function baseIsDate(value) {
  4288. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4289. }
  4290. /**
  4291. * The base implementation of `_.isEqual` which supports partial comparisons
  4292. * and tracks traversed objects.
  4293. *
  4294. * @private
  4295. * @param {*} value The value to compare.
  4296. * @param {*} other The other value to compare.
  4297. * @param {boolean} bitmask The bitmask flags.
  4298. * 1 - Unordered comparison
  4299. * 2 - Partial comparison
  4300. * @param {Function} [customizer] The function to customize comparisons.
  4301. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4302. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4303. */
  4304. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4305. if (value === other) {
  4306. return true;
  4307. }
  4308. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4309. return value !== value && other !== other;
  4310. }
  4311. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4312. }
  4313. /**
  4314. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4315. * deep comparisons and tracks traversed objects enabling objects with circular
  4316. * references to be compared.
  4317. *
  4318. * @private
  4319. * @param {Object} object The object to compare.
  4320. * @param {Object} other The other object to compare.
  4321. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4322. * @param {Function} customizer The function to customize comparisons.
  4323. * @param {Function} equalFunc The function to determine equivalents of values.
  4324. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4325. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4326. */
  4327. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4328. var objIsArr = isArray(object),
  4329. othIsArr = isArray(other),
  4330. objTag = objIsArr ? arrayTag : getTag(object),
  4331. othTag = othIsArr ? arrayTag : getTag(other);
  4332. objTag = objTag == argsTag ? objectTag : objTag;
  4333. othTag = othTag == argsTag ? objectTag : othTag;
  4334. var objIsObj = objTag == objectTag,
  4335. othIsObj = othTag == objectTag,
  4336. isSameTag = objTag == othTag;
  4337. if (isSameTag && isBuffer(object)) {
  4338. if (!isBuffer(other)) {
  4339. return false;
  4340. }
  4341. objIsArr = true;
  4342. objIsObj = false;
  4343. }
  4344. if (isSameTag && !objIsObj) {
  4345. stack || (stack = new Stack);
  4346. return (objIsArr || isTypedArray(object))
  4347. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4348. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4349. }
  4350. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4351. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4352. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4353. if (objIsWrapped || othIsWrapped) {
  4354. var objUnwrapped = objIsWrapped ? object.value() : object,
  4355. othUnwrapped = othIsWrapped ? other.value() : other;
  4356. stack || (stack = new Stack);
  4357. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4358. }
  4359. }
  4360. if (!isSameTag) {
  4361. return false;
  4362. }
  4363. stack || (stack = new Stack);
  4364. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4365. }
  4366. /**
  4367. * The base implementation of `_.isMap` without Node.js optimizations.
  4368. *
  4369. * @private
  4370. * @param {*} value The value to check.
  4371. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4372. */
  4373. function baseIsMap(value) {
  4374. return isObjectLike(value) && getTag(value) == mapTag;
  4375. }
  4376. /**
  4377. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4378. *
  4379. * @private
  4380. * @param {Object} object The object to inspect.
  4381. * @param {Object} source The object of property values to match.
  4382. * @param {Array} matchData The property names, values, and compare flags to match.
  4383. * @param {Function} [customizer] The function to customize comparisons.
  4384. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4385. */
  4386. function baseIsMatch(object, source, matchData, customizer) {
  4387. var index = matchData.length,
  4388. length = index,
  4389. noCustomizer = !customizer;
  4390. if (object == null) {
  4391. return !length;
  4392. }
  4393. object = Object(object);
  4394. while (index--) {
  4395. var data = matchData[index];
  4396. if ((noCustomizer && data[2])
  4397. ? data[1] !== object[data[0]]
  4398. : !(data[0] in object)
  4399. ) {
  4400. return false;
  4401. }
  4402. }
  4403. while (++index < length) {
  4404. data = matchData[index];
  4405. var key = data[0],
  4406. objValue = object[key],
  4407. srcValue = data[1];
  4408. if (noCustomizer && data[2]) {
  4409. if (objValue === undefined && !(key in object)) {
  4410. return false;
  4411. }
  4412. } else {
  4413. var stack = new Stack;
  4414. if (customizer) {
  4415. var result = customizer(objValue, srcValue, key, object, source, stack);
  4416. }
  4417. if (!(result === undefined
  4418. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4419. : result
  4420. )) {
  4421. return false;
  4422. }
  4423. }
  4424. }
  4425. return true;
  4426. }
  4427. /**
  4428. * The base implementation of `_.isNative` without bad shim checks.
  4429. *
  4430. * @private
  4431. * @param {*} value The value to check.
  4432. * @returns {boolean} Returns `true` if `value` is a native function,
  4433. * else `false`.
  4434. */
  4435. function baseIsNative(value) {
  4436. if (!isObject(value) || isMasked(value)) {
  4437. return false;
  4438. }
  4439. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4440. return pattern.test(toSource(value));
  4441. }
  4442. /**
  4443. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4444. *
  4445. * @private
  4446. * @param {*} value The value to check.
  4447. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4448. */
  4449. function baseIsRegExp(value) {
  4450. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4451. }
  4452. /**
  4453. * The base implementation of `_.isSet` without Node.js optimizations.
  4454. *
  4455. * @private
  4456. * @param {*} value The value to check.
  4457. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4458. */
  4459. function baseIsSet(value) {
  4460. return isObjectLike(value) && getTag(value) == setTag;
  4461. }
  4462. /**
  4463. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4464. *
  4465. * @private
  4466. * @param {*} value The value to check.
  4467. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4468. */
  4469. function baseIsTypedArray(value) {
  4470. return isObjectLike(value) &&
  4471. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4472. }
  4473. /**
  4474. * The base implementation of `_.iteratee`.
  4475. *
  4476. * @private
  4477. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4478. * @returns {Function} Returns the iteratee.
  4479. */
  4480. function baseIteratee(value) {
  4481. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4482. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4483. if (typeof value == 'function') {
  4484. return value;
  4485. }
  4486. if (value == null) {
  4487. return identity;
  4488. }
  4489. if (typeof value == 'object') {
  4490. return isArray(value)
  4491. ? baseMatchesProperty(value[0], value[1])
  4492. : baseMatches(value);
  4493. }
  4494. return property(value);
  4495. }
  4496. /**
  4497. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4498. *
  4499. * @private
  4500. * @param {Object} object The object to query.
  4501. * @returns {Array} Returns the array of property names.
  4502. */
  4503. function baseKeys(object) {
  4504. if (!isPrototype(object)) {
  4505. return nativeKeys(object);
  4506. }
  4507. var result = [];
  4508. for (var key in Object(object)) {
  4509. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4510. result.push(key);
  4511. }
  4512. }
  4513. return result;
  4514. }
  4515. /**
  4516. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4517. *
  4518. * @private
  4519. * @param {Object} object The object to query.
  4520. * @returns {Array} Returns the array of property names.
  4521. */
  4522. function baseKeysIn(object) {
  4523. if (!isObject(object)) {
  4524. return nativeKeysIn(object);
  4525. }
  4526. var isProto = isPrototype(object),
  4527. result = [];
  4528. for (var key in object) {
  4529. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4530. result.push(key);
  4531. }
  4532. }
  4533. return result;
  4534. }
  4535. /**
  4536. * The base implementation of `_.lt` which doesn't coerce arguments.
  4537. *
  4538. * @private
  4539. * @param {*} value The value to compare.
  4540. * @param {*} other The other value to compare.
  4541. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4542. * else `false`.
  4543. */
  4544. function baseLt(value, other) {
  4545. return value < other;
  4546. }
  4547. /**
  4548. * The base implementation of `_.map` without support for iteratee shorthands.
  4549. *
  4550. * @private
  4551. * @param {Array|Object} collection The collection to iterate over.
  4552. * @param {Function} iteratee The function invoked per iteration.
  4553. * @returns {Array} Returns the new mapped array.
  4554. */
  4555. function baseMap(collection, iteratee) {
  4556. var index = -1,
  4557. result = isArrayLike(collection) ? Array(collection.length) : [];
  4558. baseEach(collection, function(value, key, collection) {
  4559. result[++index] = iteratee(value, key, collection);
  4560. });
  4561. return result;
  4562. }
  4563. /**
  4564. * The base implementation of `_.matches` which doesn't clone `source`.
  4565. *
  4566. * @private
  4567. * @param {Object} source The object of property values to match.
  4568. * @returns {Function} Returns the new spec function.
  4569. */
  4570. function baseMatches(source) {
  4571. var matchData = getMatchData(source);
  4572. if (matchData.length == 1 && matchData[0][2]) {
  4573. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4574. }
  4575. return function(object) {
  4576. return object === source || baseIsMatch(object, source, matchData);
  4577. };
  4578. }
  4579. /**
  4580. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4581. *
  4582. * @private
  4583. * @param {string} path The path of the property to get.
  4584. * @param {*} srcValue The value to match.
  4585. * @returns {Function} Returns the new spec function.
  4586. */
  4587. function baseMatchesProperty(path, srcValue) {
  4588. if (isKey(path) && isStrictComparable(srcValue)) {
  4589. return matchesStrictComparable(toKey(path), srcValue);
  4590. }
  4591. return function(object) {
  4592. var objValue = get(object, path);
  4593. return (objValue === undefined && objValue === srcValue)
  4594. ? hasIn(object, path)
  4595. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4596. };
  4597. }
  4598. /**
  4599. * The base implementation of `_.merge` without support for multiple sources.
  4600. *
  4601. * @private
  4602. * @param {Object} object The destination object.
  4603. * @param {Object} source The source object.
  4604. * @param {number} srcIndex The index of `source`.
  4605. * @param {Function} [customizer] The function to customize merged values.
  4606. * @param {Object} [stack] Tracks traversed source values and their merged
  4607. * counterparts.
  4608. */
  4609. function baseMerge(object, source, srcIndex, customizer, stack) {
  4610. if (object === source) {
  4611. return;
  4612. }
  4613. baseFor(source, function(srcValue, key) {
  4614. stack || (stack = new Stack);
  4615. if (isObject(srcValue)) {
  4616. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4617. }
  4618. else {
  4619. var newValue = customizer
  4620. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4621. : undefined;
  4622. if (newValue === undefined) {
  4623. newValue = srcValue;
  4624. }
  4625. assignMergeValue(object, key, newValue);
  4626. }
  4627. }, keysIn);
  4628. }
  4629. /**
  4630. * A specialized version of `baseMerge` for arrays and objects which performs
  4631. * deep merges and tracks traversed objects enabling objects with circular
  4632. * references to be merged.
  4633. *
  4634. * @private
  4635. * @param {Object} object The destination object.
  4636. * @param {Object} source The source object.
  4637. * @param {string} key The key of the value to merge.
  4638. * @param {number} srcIndex The index of `source`.
  4639. * @param {Function} mergeFunc The function to merge values.
  4640. * @param {Function} [customizer] The function to customize assigned values.
  4641. * @param {Object} [stack] Tracks traversed source values and their merged
  4642. * counterparts.
  4643. */
  4644. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4645. var objValue = safeGet(object, key),
  4646. srcValue = safeGet(source, key),
  4647. stacked = stack.get(srcValue);
  4648. if (stacked) {
  4649. assignMergeValue(object, key, stacked);
  4650. return;
  4651. }
  4652. var newValue = customizer
  4653. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4654. : undefined;
  4655. var isCommon = newValue === undefined;
  4656. if (isCommon) {
  4657. var isArr = isArray(srcValue),
  4658. isBuff = !isArr && isBuffer(srcValue),
  4659. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4660. newValue = srcValue;
  4661. if (isArr || isBuff || isTyped) {
  4662. if (isArray(objValue)) {
  4663. newValue = objValue;
  4664. }
  4665. else if (isArrayLikeObject(objValue)) {
  4666. newValue = copyArray(objValue);
  4667. }
  4668. else if (isBuff) {
  4669. isCommon = false;
  4670. newValue = cloneBuffer(srcValue, true);
  4671. }
  4672. else if (isTyped) {
  4673. isCommon = false;
  4674. newValue = cloneTypedArray(srcValue, true);
  4675. }
  4676. else {
  4677. newValue = [];
  4678. }
  4679. }
  4680. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4681. newValue = objValue;
  4682. if (isArguments(objValue)) {
  4683. newValue = toPlainObject(objValue);
  4684. }
  4685. else if (!isObject(objValue) || isFunction(objValue)) {
  4686. newValue = initCloneObject(srcValue);
  4687. }
  4688. }
  4689. else {
  4690. isCommon = false;
  4691. }
  4692. }
  4693. if (isCommon) {
  4694. // Recursively merge objects and arrays (susceptible to call stack limits).
  4695. stack.set(srcValue, newValue);
  4696. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4697. stack['delete'](srcValue);
  4698. }
  4699. assignMergeValue(object, key, newValue);
  4700. }
  4701. /**
  4702. * The base implementation of `_.nth` which doesn't coerce arguments.
  4703. *
  4704. * @private
  4705. * @param {Array} array The array to query.
  4706. * @param {number} n The index of the element to return.
  4707. * @returns {*} Returns the nth element of `array`.
  4708. */
  4709. function baseNth(array, n) {
  4710. var length = array.length;
  4711. if (!length) {
  4712. return;
  4713. }
  4714. n += n < 0 ? length : 0;
  4715. return isIndex(n, length) ? array[n] : undefined;
  4716. }
  4717. /**
  4718. * The base implementation of `_.orderBy` without param guards.
  4719. *
  4720. * @private
  4721. * @param {Array|Object} collection The collection to iterate over.
  4722. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4723. * @param {string[]} orders The sort orders of `iteratees`.
  4724. * @returns {Array} Returns the new sorted array.
  4725. */
  4726. function baseOrderBy(collection, iteratees, orders) {
  4727. if (iteratees.length) {
  4728. iteratees = arrayMap(iteratees, function(iteratee) {
  4729. if (isArray(iteratee)) {
  4730. return function(value) {
  4731. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4732. }
  4733. }
  4734. return iteratee;
  4735. });
  4736. } else {
  4737. iteratees = [identity];
  4738. }
  4739. var index = -1;
  4740. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4741. var result = baseMap(collection, function(value, key, collection) {
  4742. var criteria = arrayMap(iteratees, function(iteratee) {
  4743. return iteratee(value);
  4744. });
  4745. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4746. });
  4747. return baseSortBy(result, function(object, other) {
  4748. return compareMultiple(object, other, orders);
  4749. });
  4750. }
  4751. /**
  4752. * The base implementation of `_.pick` without support for individual
  4753. * property identifiers.
  4754. *
  4755. * @private
  4756. * @param {Object} object The source object.
  4757. * @param {string[]} paths The property paths to pick.
  4758. * @returns {Object} Returns the new object.
  4759. */
  4760. function basePick(object, paths) {
  4761. return basePickBy(object, paths, function(value, path) {
  4762. return hasIn(object, path);
  4763. });
  4764. }
  4765. /**
  4766. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4767. *
  4768. * @private
  4769. * @param {Object} object The source object.
  4770. * @param {string[]} paths The property paths to pick.
  4771. * @param {Function} predicate The function invoked per property.
  4772. * @returns {Object} Returns the new object.
  4773. */
  4774. function basePickBy(object, paths, predicate) {
  4775. var index = -1,
  4776. length = paths.length,
  4777. result = {};
  4778. while (++index < length) {
  4779. var path = paths[index],
  4780. value = baseGet(object, path);
  4781. if (predicate(value, path)) {
  4782. baseSet(result, castPath(path, object), value);
  4783. }
  4784. }
  4785. return result;
  4786. }
  4787. /**
  4788. * A specialized version of `baseProperty` which supports deep paths.
  4789. *
  4790. * @private
  4791. * @param {Array|string} path The path of the property to get.
  4792. * @returns {Function} Returns the new accessor function.
  4793. */
  4794. function basePropertyDeep(path) {
  4795. return function(object) {
  4796. return baseGet(object, path);
  4797. };
  4798. }
  4799. /**
  4800. * The base implementation of `_.pullAllBy` without support for iteratee
  4801. * shorthands.
  4802. *
  4803. * @private
  4804. * @param {Array} array The array to modify.
  4805. * @param {Array} values The values to remove.
  4806. * @param {Function} [iteratee] The iteratee invoked per element.
  4807. * @param {Function} [comparator] The comparator invoked per element.
  4808. * @returns {Array} Returns `array`.
  4809. */
  4810. function basePullAll(array, values, iteratee, comparator) {
  4811. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4812. index = -1,
  4813. length = values.length,
  4814. seen = array;
  4815. if (array === values) {
  4816. values = copyArray(values);
  4817. }
  4818. if (iteratee) {
  4819. seen = arrayMap(array, baseUnary(iteratee));
  4820. }
  4821. while (++index < length) {
  4822. var fromIndex = 0,
  4823. value = values[index],
  4824. computed = iteratee ? iteratee(value) : value;
  4825. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4826. if (seen !== array) {
  4827. splice.call(seen, fromIndex, 1);
  4828. }
  4829. splice.call(array, fromIndex, 1);
  4830. }
  4831. }
  4832. return array;
  4833. }
  4834. /**
  4835. * The base implementation of `_.pullAt` without support for individual
  4836. * indexes or capturing the removed elements.
  4837. *
  4838. * @private
  4839. * @param {Array} array The array to modify.
  4840. * @param {number[]} indexes The indexes of elements to remove.
  4841. * @returns {Array} Returns `array`.
  4842. */
  4843. function basePullAt(array, indexes) {
  4844. var length = array ? indexes.length : 0,
  4845. lastIndex = length - 1;
  4846. while (length--) {
  4847. var index = indexes[length];
  4848. if (length == lastIndex || index !== previous) {
  4849. var previous = index;
  4850. if (isIndex(index)) {
  4851. splice.call(array, index, 1);
  4852. } else {
  4853. baseUnset(array, index);
  4854. }
  4855. }
  4856. }
  4857. return array;
  4858. }
  4859. /**
  4860. * The base implementation of `_.random` without support for returning
  4861. * floating-point numbers.
  4862. *
  4863. * @private
  4864. * @param {number} lower The lower bound.
  4865. * @param {number} upper The upper bound.
  4866. * @returns {number} Returns the random number.
  4867. */
  4868. function baseRandom(lower, upper) {
  4869. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4870. }
  4871. /**
  4872. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4873. * coerce arguments.
  4874. *
  4875. * @private
  4876. * @param {number} start The start of the range.
  4877. * @param {number} end The end of the range.
  4878. * @param {number} step The value to increment or decrement by.
  4879. * @param {boolean} [fromRight] Specify iterating from right to left.
  4880. * @returns {Array} Returns the range of numbers.
  4881. */
  4882. function baseRange(start, end, step, fromRight) {
  4883. var index = -1,
  4884. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4885. result = Array(length);
  4886. while (length--) {
  4887. result[fromRight ? length : ++index] = start;
  4888. start += step;
  4889. }
  4890. return result;
  4891. }
  4892. /**
  4893. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4894. *
  4895. * @private
  4896. * @param {string} string The string to repeat.
  4897. * @param {number} n The number of times to repeat the string.
  4898. * @returns {string} Returns the repeated string.
  4899. */
  4900. function baseRepeat(string, n) {
  4901. var result = '';
  4902. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4903. return result;
  4904. }
  4905. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4906. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4907. do {
  4908. if (n % 2) {
  4909. result += string;
  4910. }
  4911. n = nativeFloor(n / 2);
  4912. if (n) {
  4913. string += string;
  4914. }
  4915. } while (n);
  4916. return result;
  4917. }
  4918. /**
  4919. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4920. *
  4921. * @private
  4922. * @param {Function} func The function to apply a rest parameter to.
  4923. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4924. * @returns {Function} Returns the new function.
  4925. */
  4926. function baseRest(func, start) {
  4927. return setToString(overRest(func, start, identity), func + '');
  4928. }
  4929. /**
  4930. * The base implementation of `_.sample`.
  4931. *
  4932. * @private
  4933. * @param {Array|Object} collection The collection to sample.
  4934. * @returns {*} Returns the random element.
  4935. */
  4936. function baseSample(collection) {
  4937. return arraySample(values(collection));
  4938. }
  4939. /**
  4940. * The base implementation of `_.sampleSize` without param guards.
  4941. *
  4942. * @private
  4943. * @param {Array|Object} collection The collection to sample.
  4944. * @param {number} n The number of elements to sample.
  4945. * @returns {Array} Returns the random elements.
  4946. */
  4947. function baseSampleSize(collection, n) {
  4948. var array = values(collection);
  4949. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4950. }
  4951. /**
  4952. * The base implementation of `_.set`.
  4953. *
  4954. * @private
  4955. * @param {Object} object The object to modify.
  4956. * @param {Array|string} path The path of the property to set.
  4957. * @param {*} value The value to set.
  4958. * @param {Function} [customizer] The function to customize path creation.
  4959. * @returns {Object} Returns `object`.
  4960. */
  4961. function baseSet(object, path, value, customizer) {
  4962. if (!isObject(object)) {
  4963. return object;
  4964. }
  4965. path = castPath(path, object);
  4966. var index = -1,
  4967. length = path.length,
  4968. lastIndex = length - 1,
  4969. nested = object;
  4970. while (nested != null && ++index < length) {
  4971. var key = toKey(path[index]),
  4972. newValue = value;
  4973. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4974. return object;
  4975. }
  4976. if (index != lastIndex) {
  4977. var objValue = nested[key];
  4978. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4979. if (newValue === undefined) {
  4980. newValue = isObject(objValue)
  4981. ? objValue
  4982. : (isIndex(path[index + 1]) ? [] : {});
  4983. }
  4984. }
  4985. assignValue(nested, key, newValue);
  4986. nested = nested[key];
  4987. }
  4988. return object;
  4989. }
  4990. /**
  4991. * The base implementation of `setData` without support for hot loop shorting.
  4992. *
  4993. * @private
  4994. * @param {Function} func The function to associate metadata with.
  4995. * @param {*} data The metadata.
  4996. * @returns {Function} Returns `func`.
  4997. */
  4998. var baseSetData = !metaMap ? identity : function(func, data) {
  4999. metaMap.set(func, data);
  5000. return func;
  5001. };
  5002. /**
  5003. * The base implementation of `setToString` without support for hot loop shorting.
  5004. *
  5005. * @private
  5006. * @param {Function} func The function to modify.
  5007. * @param {Function} string The `toString` result.
  5008. * @returns {Function} Returns `func`.
  5009. */
  5010. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5011. return defineProperty(func, 'toString', {
  5012. 'configurable': true,
  5013. 'enumerable': false,
  5014. 'value': constant(string),
  5015. 'writable': true
  5016. });
  5017. };
  5018. /**
  5019. * The base implementation of `_.shuffle`.
  5020. *
  5021. * @private
  5022. * @param {Array|Object} collection The collection to shuffle.
  5023. * @returns {Array} Returns the new shuffled array.
  5024. */
  5025. function baseShuffle(collection) {
  5026. return shuffleSelf(values(collection));
  5027. }
  5028. /**
  5029. * The base implementation of `_.slice` without an iteratee call guard.
  5030. *
  5031. * @private
  5032. * @param {Array} array The array to slice.
  5033. * @param {number} [start=0] The start position.
  5034. * @param {number} [end=array.length] The end position.
  5035. * @returns {Array} Returns the slice of `array`.
  5036. */
  5037. function baseSlice(array, start, end) {
  5038. var index = -1,
  5039. length = array.length;
  5040. if (start < 0) {
  5041. start = -start > length ? 0 : (length + start);
  5042. }
  5043. end = end > length ? length : end;
  5044. if (end < 0) {
  5045. end += length;
  5046. }
  5047. length = start > end ? 0 : ((end - start) >>> 0);
  5048. start >>>= 0;
  5049. var result = Array(length);
  5050. while (++index < length) {
  5051. result[index] = array[index + start];
  5052. }
  5053. return result;
  5054. }
  5055. /**
  5056. * The base implementation of `_.some` without support for iteratee shorthands.
  5057. *
  5058. * @private
  5059. * @param {Array|Object} collection The collection to iterate over.
  5060. * @param {Function} predicate The function invoked per iteration.
  5061. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5062. * else `false`.
  5063. */
  5064. function baseSome(collection, predicate) {
  5065. var result;
  5066. baseEach(collection, function(value, index, collection) {
  5067. result = predicate(value, index, collection);
  5068. return !result;
  5069. });
  5070. return !!result;
  5071. }
  5072. /**
  5073. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5074. * performs a binary search of `array` to determine the index at which `value`
  5075. * should be inserted into `array` in order to maintain its sort order.
  5076. *
  5077. * @private
  5078. * @param {Array} array The sorted array to inspect.
  5079. * @param {*} value The value to evaluate.
  5080. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5081. * @returns {number} Returns the index at which `value` should be inserted
  5082. * into `array`.
  5083. */
  5084. function baseSortedIndex(array, value, retHighest) {
  5085. var low = 0,
  5086. high = array == null ? low : array.length;
  5087. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5088. while (low < high) {
  5089. var mid = (low + high) >>> 1,
  5090. computed = array[mid];
  5091. if (computed !== null && !isSymbol(computed) &&
  5092. (retHighest ? (computed <= value) : (computed < value))) {
  5093. low = mid + 1;
  5094. } else {
  5095. high = mid;
  5096. }
  5097. }
  5098. return high;
  5099. }
  5100. return baseSortedIndexBy(array, value, identity, retHighest);
  5101. }
  5102. /**
  5103. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5104. * which invokes `iteratee` for `value` and each element of `array` to compute
  5105. * their sort ranking. The iteratee is invoked with one argument; (value).
  5106. *
  5107. * @private
  5108. * @param {Array} array The sorted array to inspect.
  5109. * @param {*} value The value to evaluate.
  5110. * @param {Function} iteratee The iteratee invoked per element.
  5111. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5112. * @returns {number} Returns the index at which `value` should be inserted
  5113. * into `array`.
  5114. */
  5115. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5116. var low = 0,
  5117. high = array == null ? 0 : array.length;
  5118. if (high === 0) {
  5119. return 0;
  5120. }
  5121. value = iteratee(value);
  5122. var valIsNaN = value !== value,
  5123. valIsNull = value === null,
  5124. valIsSymbol = isSymbol(value),
  5125. valIsUndefined = value === undefined;
  5126. while (low < high) {
  5127. var mid = nativeFloor((low + high) / 2),
  5128. computed = iteratee(array[mid]),
  5129. othIsDefined = computed !== undefined,
  5130. othIsNull = computed === null,
  5131. othIsReflexive = computed === computed,
  5132. othIsSymbol = isSymbol(computed);
  5133. if (valIsNaN) {
  5134. var setLow = retHighest || othIsReflexive;
  5135. } else if (valIsUndefined) {
  5136. setLow = othIsReflexive && (retHighest || othIsDefined);
  5137. } else if (valIsNull) {
  5138. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5139. } else if (valIsSymbol) {
  5140. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5141. } else if (othIsNull || othIsSymbol) {
  5142. setLow = false;
  5143. } else {
  5144. setLow = retHighest ? (computed <= value) : (computed < value);
  5145. }
  5146. if (setLow) {
  5147. low = mid + 1;
  5148. } else {
  5149. high = mid;
  5150. }
  5151. }
  5152. return nativeMin(high, MAX_ARRAY_INDEX);
  5153. }
  5154. /**
  5155. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5156. * support for iteratee shorthands.
  5157. *
  5158. * @private
  5159. * @param {Array} array The array to inspect.
  5160. * @param {Function} [iteratee] The iteratee invoked per element.
  5161. * @returns {Array} Returns the new duplicate free array.
  5162. */
  5163. function baseSortedUniq(array, iteratee) {
  5164. var index = -1,
  5165. length = array.length,
  5166. resIndex = 0,
  5167. result = [];
  5168. while (++index < length) {
  5169. var value = array[index],
  5170. computed = iteratee ? iteratee(value) : value;
  5171. if (!index || !eq(computed, seen)) {
  5172. var seen = computed;
  5173. result[resIndex++] = value === 0 ? 0 : value;
  5174. }
  5175. }
  5176. return result;
  5177. }
  5178. /**
  5179. * The base implementation of `_.toNumber` which doesn't ensure correct
  5180. * conversions of binary, hexadecimal, or octal string values.
  5181. *
  5182. * @private
  5183. * @param {*} value The value to process.
  5184. * @returns {number} Returns the number.
  5185. */
  5186. function baseToNumber(value) {
  5187. if (typeof value == 'number') {
  5188. return value;
  5189. }
  5190. if (isSymbol(value)) {
  5191. return NAN;
  5192. }
  5193. return +value;
  5194. }
  5195. /**
  5196. * The base implementation of `_.toString` which doesn't convert nullish
  5197. * values to empty strings.
  5198. *
  5199. * @private
  5200. * @param {*} value The value to process.
  5201. * @returns {string} Returns the string.
  5202. */
  5203. function baseToString(value) {
  5204. // Exit early for strings to avoid a performance hit in some environments.
  5205. if (typeof value == 'string') {
  5206. return value;
  5207. }
  5208. if (isArray(value)) {
  5209. // Recursively convert values (susceptible to call stack limits).
  5210. return arrayMap(value, baseToString) + '';
  5211. }
  5212. if (isSymbol(value)) {
  5213. return symbolToString ? symbolToString.call(value) : '';
  5214. }
  5215. var result = (value + '');
  5216. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5217. }
  5218. /**
  5219. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5220. *
  5221. * @private
  5222. * @param {Array} array The array to inspect.
  5223. * @param {Function} [iteratee] The iteratee invoked per element.
  5224. * @param {Function} [comparator] The comparator invoked per element.
  5225. * @returns {Array} Returns the new duplicate free array.
  5226. */
  5227. function baseUniq(array, iteratee, comparator) {
  5228. var index = -1,
  5229. includes = arrayIncludes,
  5230. length = array.length,
  5231. isCommon = true,
  5232. result = [],
  5233. seen = result;
  5234. if (comparator) {
  5235. isCommon = false;
  5236. includes = arrayIncludesWith;
  5237. }
  5238. else if (length >= LARGE_ARRAY_SIZE) {
  5239. var set = iteratee ? null : createSet(array);
  5240. if (set) {
  5241. return setToArray(set);
  5242. }
  5243. isCommon = false;
  5244. includes = cacheHas;
  5245. seen = new SetCache;
  5246. }
  5247. else {
  5248. seen = iteratee ? [] : result;
  5249. }
  5250. outer:
  5251. while (++index < length) {
  5252. var value = array[index],
  5253. computed = iteratee ? iteratee(value) : value;
  5254. value = (comparator || value !== 0) ? value : 0;
  5255. if (isCommon && computed === computed) {
  5256. var seenIndex = seen.length;
  5257. while (seenIndex--) {
  5258. if (seen[seenIndex] === computed) {
  5259. continue outer;
  5260. }
  5261. }
  5262. if (iteratee) {
  5263. seen.push(computed);
  5264. }
  5265. result.push(value);
  5266. }
  5267. else if (!includes(seen, computed, comparator)) {
  5268. if (seen !== result) {
  5269. seen.push(computed);
  5270. }
  5271. result.push(value);
  5272. }
  5273. }
  5274. return result;
  5275. }
  5276. /**
  5277. * The base implementation of `_.unset`.
  5278. *
  5279. * @private
  5280. * @param {Object} object The object to modify.
  5281. * @param {Array|string} path The property path to unset.
  5282. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5283. */
  5284. function baseUnset(object, path) {
  5285. path = castPath(path, object);
  5286. object = parent(object, path);
  5287. return object == null || delete object[toKey(last(path))];
  5288. }
  5289. /**
  5290. * The base implementation of `_.update`.
  5291. *
  5292. * @private
  5293. * @param {Object} object The object to modify.
  5294. * @param {Array|string} path The path of the property to update.
  5295. * @param {Function} updater The function to produce the updated value.
  5296. * @param {Function} [customizer] The function to customize path creation.
  5297. * @returns {Object} Returns `object`.
  5298. */
  5299. function baseUpdate(object, path, updater, customizer) {
  5300. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5301. }
  5302. /**
  5303. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5304. * without support for iteratee shorthands.
  5305. *
  5306. * @private
  5307. * @param {Array} array The array to query.
  5308. * @param {Function} predicate The function invoked per iteration.
  5309. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5310. * @param {boolean} [fromRight] Specify iterating from right to left.
  5311. * @returns {Array} Returns the slice of `array`.
  5312. */
  5313. function baseWhile(array, predicate, isDrop, fromRight) {
  5314. var length = array.length,
  5315. index = fromRight ? length : -1;
  5316. while ((fromRight ? index-- : ++index < length) &&
  5317. predicate(array[index], index, array)) {}
  5318. return isDrop
  5319. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5320. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5321. }
  5322. /**
  5323. * The base implementation of `wrapperValue` which returns the result of
  5324. * performing a sequence of actions on the unwrapped `value`, where each
  5325. * successive action is supplied the return value of the previous.
  5326. *
  5327. * @private
  5328. * @param {*} value The unwrapped value.
  5329. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5330. * @returns {*} Returns the resolved value.
  5331. */
  5332. function baseWrapperValue(value, actions) {
  5333. var result = value;
  5334. if (result instanceof LazyWrapper) {
  5335. result = result.value();
  5336. }
  5337. return arrayReduce(actions, function(result, action) {
  5338. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5339. }, result);
  5340. }
  5341. /**
  5342. * The base implementation of methods like `_.xor`, without support for
  5343. * iteratee shorthands, that accepts an array of arrays to inspect.
  5344. *
  5345. * @private
  5346. * @param {Array} arrays The arrays to inspect.
  5347. * @param {Function} [iteratee] The iteratee invoked per element.
  5348. * @param {Function} [comparator] The comparator invoked per element.
  5349. * @returns {Array} Returns the new array of values.
  5350. */
  5351. function baseXor(arrays, iteratee, comparator) {
  5352. var length = arrays.length;
  5353. if (length < 2) {
  5354. return length ? baseUniq(arrays[0]) : [];
  5355. }
  5356. var index = -1,
  5357. result = Array(length);
  5358. while (++index < length) {
  5359. var array = arrays[index],
  5360. othIndex = -1;
  5361. while (++othIndex < length) {
  5362. if (othIndex != index) {
  5363. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5364. }
  5365. }
  5366. }
  5367. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5368. }
  5369. /**
  5370. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5371. *
  5372. * @private
  5373. * @param {Array} props The property identifiers.
  5374. * @param {Array} values The property values.
  5375. * @param {Function} assignFunc The function to assign values.
  5376. * @returns {Object} Returns the new object.
  5377. */
  5378. function baseZipObject(props, values, assignFunc) {
  5379. var index = -1,
  5380. length = props.length,
  5381. valsLength = values.length,
  5382. result = {};
  5383. while (++index < length) {
  5384. var value = index < valsLength ? values[index] : undefined;
  5385. assignFunc(result, props[index], value);
  5386. }
  5387. return result;
  5388. }
  5389. /**
  5390. * Casts `value` to an empty array if it's not an array like object.
  5391. *
  5392. * @private
  5393. * @param {*} value The value to inspect.
  5394. * @returns {Array|Object} Returns the cast array-like object.
  5395. */
  5396. function castArrayLikeObject(value) {
  5397. return isArrayLikeObject(value) ? value : [];
  5398. }
  5399. /**
  5400. * Casts `value` to `identity` if it's not a function.
  5401. *
  5402. * @private
  5403. * @param {*} value The value to inspect.
  5404. * @returns {Function} Returns cast function.
  5405. */
  5406. function castFunction(value) {
  5407. return typeof value == 'function' ? value : identity;
  5408. }
  5409. /**
  5410. * Casts `value` to a path array if it's not one.
  5411. *
  5412. * @private
  5413. * @param {*} value The value to inspect.
  5414. * @param {Object} [object] The object to query keys on.
  5415. * @returns {Array} Returns the cast property path array.
  5416. */
  5417. function castPath(value, object) {
  5418. if (isArray(value)) {
  5419. return value;
  5420. }
  5421. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5422. }
  5423. /**
  5424. * A `baseRest` alias which can be replaced with `identity` by module
  5425. * replacement plugins.
  5426. *
  5427. * @private
  5428. * @type {Function}
  5429. * @param {Function} func The function to apply a rest parameter to.
  5430. * @returns {Function} Returns the new function.
  5431. */
  5432. var castRest = baseRest;
  5433. /**
  5434. * Casts `array` to a slice if it's needed.
  5435. *
  5436. * @private
  5437. * @param {Array} array The array to inspect.
  5438. * @param {number} start The start position.
  5439. * @param {number} [end=array.length] The end position.
  5440. * @returns {Array} Returns the cast slice.
  5441. */
  5442. function castSlice(array, start, end) {
  5443. var length = array.length;
  5444. end = end === undefined ? length : end;
  5445. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5446. }
  5447. /**
  5448. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5449. *
  5450. * @private
  5451. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5452. */
  5453. var clearTimeout = ctxClearTimeout || function(id) {
  5454. return root.clearTimeout(id);
  5455. };
  5456. /**
  5457. * Creates a clone of `buffer`.
  5458. *
  5459. * @private
  5460. * @param {Buffer} buffer The buffer to clone.
  5461. * @param {boolean} [isDeep] Specify a deep clone.
  5462. * @returns {Buffer} Returns the cloned buffer.
  5463. */
  5464. function cloneBuffer(buffer, isDeep) {
  5465. if (isDeep) {
  5466. return buffer.slice();
  5467. }
  5468. var length = buffer.length,
  5469. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5470. buffer.copy(result);
  5471. return result;
  5472. }
  5473. /**
  5474. * Creates a clone of `arrayBuffer`.
  5475. *
  5476. * @private
  5477. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5478. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5479. */
  5480. function cloneArrayBuffer(arrayBuffer) {
  5481. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5482. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5483. return result;
  5484. }
  5485. /**
  5486. * Creates a clone of `dataView`.
  5487. *
  5488. * @private
  5489. * @param {Object} dataView The data view to clone.
  5490. * @param {boolean} [isDeep] Specify a deep clone.
  5491. * @returns {Object} Returns the cloned data view.
  5492. */
  5493. function cloneDataView(dataView, isDeep) {
  5494. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5495. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5496. }
  5497. /**
  5498. * Creates a clone of `regexp`.
  5499. *
  5500. * @private
  5501. * @param {Object} regexp The regexp to clone.
  5502. * @returns {Object} Returns the cloned regexp.
  5503. */
  5504. function cloneRegExp(regexp) {
  5505. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5506. result.lastIndex = regexp.lastIndex;
  5507. return result;
  5508. }
  5509. /**
  5510. * Creates a clone of the `symbol` object.
  5511. *
  5512. * @private
  5513. * @param {Object} symbol The symbol object to clone.
  5514. * @returns {Object} Returns the cloned symbol object.
  5515. */
  5516. function cloneSymbol(symbol) {
  5517. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5518. }
  5519. /**
  5520. * Creates a clone of `typedArray`.
  5521. *
  5522. * @private
  5523. * @param {Object} typedArray The typed array to clone.
  5524. * @param {boolean} [isDeep] Specify a deep clone.
  5525. * @returns {Object} Returns the cloned typed array.
  5526. */
  5527. function cloneTypedArray(typedArray, isDeep) {
  5528. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5529. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5530. }
  5531. /**
  5532. * Compares values to sort them in ascending order.
  5533. *
  5534. * @private
  5535. * @param {*} value The value to compare.
  5536. * @param {*} other The other value to compare.
  5537. * @returns {number} Returns the sort order indicator for `value`.
  5538. */
  5539. function compareAscending(value, other) {
  5540. if (value !== other) {
  5541. var valIsDefined = value !== undefined,
  5542. valIsNull = value === null,
  5543. valIsReflexive = value === value,
  5544. valIsSymbol = isSymbol(value);
  5545. var othIsDefined = other !== undefined,
  5546. othIsNull = other === null,
  5547. othIsReflexive = other === other,
  5548. othIsSymbol = isSymbol(other);
  5549. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5550. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5551. (valIsNull && othIsDefined && othIsReflexive) ||
  5552. (!valIsDefined && othIsReflexive) ||
  5553. !valIsReflexive) {
  5554. return 1;
  5555. }
  5556. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5557. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5558. (othIsNull && valIsDefined && valIsReflexive) ||
  5559. (!othIsDefined && valIsReflexive) ||
  5560. !othIsReflexive) {
  5561. return -1;
  5562. }
  5563. }
  5564. return 0;
  5565. }
  5566. /**
  5567. * Used by `_.orderBy` to compare multiple properties of a value to another
  5568. * and stable sort them.
  5569. *
  5570. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5571. * specify an order of "desc" for descending or "asc" for ascending sort order
  5572. * of corresponding values.
  5573. *
  5574. * @private
  5575. * @param {Object} object The object to compare.
  5576. * @param {Object} other The other object to compare.
  5577. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5578. * @returns {number} Returns the sort order indicator for `object`.
  5579. */
  5580. function compareMultiple(object, other, orders) {
  5581. var index = -1,
  5582. objCriteria = object.criteria,
  5583. othCriteria = other.criteria,
  5584. length = objCriteria.length,
  5585. ordersLength = orders.length;
  5586. while (++index < length) {
  5587. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5588. if (result) {
  5589. if (index >= ordersLength) {
  5590. return result;
  5591. }
  5592. var order = orders[index];
  5593. return result * (order == 'desc' ? -1 : 1);
  5594. }
  5595. }
  5596. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5597. // that causes it, under certain circumstances, to provide the same value for
  5598. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5599. // for more details.
  5600. //
  5601. // This also ensures a stable sort in V8 and other engines.
  5602. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5603. return object.index - other.index;
  5604. }
  5605. /**
  5606. * Creates an array that is the composition of partially applied arguments,
  5607. * placeholders, and provided arguments into a single array of arguments.
  5608. *
  5609. * @private
  5610. * @param {Array} args The provided arguments.
  5611. * @param {Array} partials The arguments to prepend to those provided.
  5612. * @param {Array} holders The `partials` placeholder indexes.
  5613. * @params {boolean} [isCurried] Specify composing for a curried function.
  5614. * @returns {Array} Returns the new array of composed arguments.
  5615. */
  5616. function composeArgs(args, partials, holders, isCurried) {
  5617. var argsIndex = -1,
  5618. argsLength = args.length,
  5619. holdersLength = holders.length,
  5620. leftIndex = -1,
  5621. leftLength = partials.length,
  5622. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5623. result = Array(leftLength + rangeLength),
  5624. isUncurried = !isCurried;
  5625. while (++leftIndex < leftLength) {
  5626. result[leftIndex] = partials[leftIndex];
  5627. }
  5628. while (++argsIndex < holdersLength) {
  5629. if (isUncurried || argsIndex < argsLength) {
  5630. result[holders[argsIndex]] = args[argsIndex];
  5631. }
  5632. }
  5633. while (rangeLength--) {
  5634. result[leftIndex++] = args[argsIndex++];
  5635. }
  5636. return result;
  5637. }
  5638. /**
  5639. * This function is like `composeArgs` except that the arguments composition
  5640. * is tailored for `_.partialRight`.
  5641. *
  5642. * @private
  5643. * @param {Array} args The provided arguments.
  5644. * @param {Array} partials The arguments to append to those provided.
  5645. * @param {Array} holders The `partials` placeholder indexes.
  5646. * @params {boolean} [isCurried] Specify composing for a curried function.
  5647. * @returns {Array} Returns the new array of composed arguments.
  5648. */
  5649. function composeArgsRight(args, partials, holders, isCurried) {
  5650. var argsIndex = -1,
  5651. argsLength = args.length,
  5652. holdersIndex = -1,
  5653. holdersLength = holders.length,
  5654. rightIndex = -1,
  5655. rightLength = partials.length,
  5656. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5657. result = Array(rangeLength + rightLength),
  5658. isUncurried = !isCurried;
  5659. while (++argsIndex < rangeLength) {
  5660. result[argsIndex] = args[argsIndex];
  5661. }
  5662. var offset = argsIndex;
  5663. while (++rightIndex < rightLength) {
  5664. result[offset + rightIndex] = partials[rightIndex];
  5665. }
  5666. while (++holdersIndex < holdersLength) {
  5667. if (isUncurried || argsIndex < argsLength) {
  5668. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5669. }
  5670. }
  5671. return result;
  5672. }
  5673. /**
  5674. * Copies the values of `source` to `array`.
  5675. *
  5676. * @private
  5677. * @param {Array} source The array to copy values from.
  5678. * @param {Array} [array=[]] The array to copy values to.
  5679. * @returns {Array} Returns `array`.
  5680. */
  5681. function copyArray(source, array) {
  5682. var index = -1,
  5683. length = source.length;
  5684. array || (array = Array(length));
  5685. while (++index < length) {
  5686. array[index] = source[index];
  5687. }
  5688. return array;
  5689. }
  5690. /**
  5691. * Copies properties of `source` to `object`.
  5692. *
  5693. * @private
  5694. * @param {Object} source The object to copy properties from.
  5695. * @param {Array} props The property identifiers to copy.
  5696. * @param {Object} [object={}] The object to copy properties to.
  5697. * @param {Function} [customizer] The function to customize copied values.
  5698. * @returns {Object} Returns `object`.
  5699. */
  5700. function copyObject(source, props, object, customizer) {
  5701. var isNew = !object;
  5702. object || (object = {});
  5703. var index = -1,
  5704. length = props.length;
  5705. while (++index < length) {
  5706. var key = props[index];
  5707. var newValue = customizer
  5708. ? customizer(object[key], source[key], key, object, source)
  5709. : undefined;
  5710. if (newValue === undefined) {
  5711. newValue = source[key];
  5712. }
  5713. if (isNew) {
  5714. baseAssignValue(object, key, newValue);
  5715. } else {
  5716. assignValue(object, key, newValue);
  5717. }
  5718. }
  5719. return object;
  5720. }
  5721. /**
  5722. * Copies own symbols of `source` to `object`.
  5723. *
  5724. * @private
  5725. * @param {Object} source The object to copy symbols from.
  5726. * @param {Object} [object={}] The object to copy symbols to.
  5727. * @returns {Object} Returns `object`.
  5728. */
  5729. function copySymbols(source, object) {
  5730. return copyObject(source, getSymbols(source), object);
  5731. }
  5732. /**
  5733. * Copies own and inherited symbols of `source` to `object`.
  5734. *
  5735. * @private
  5736. * @param {Object} source The object to copy symbols from.
  5737. * @param {Object} [object={}] The object to copy symbols to.
  5738. * @returns {Object} Returns `object`.
  5739. */
  5740. function copySymbolsIn(source, object) {
  5741. return copyObject(source, getSymbolsIn(source), object);
  5742. }
  5743. /**
  5744. * Creates a function like `_.groupBy`.
  5745. *
  5746. * @private
  5747. * @param {Function} setter The function to set accumulator values.
  5748. * @param {Function} [initializer] The accumulator object initializer.
  5749. * @returns {Function} Returns the new aggregator function.
  5750. */
  5751. function createAggregator(setter, initializer) {
  5752. return function(collection, iteratee) {
  5753. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5754. accumulator = initializer ? initializer() : {};
  5755. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5756. };
  5757. }
  5758. /**
  5759. * Creates a function like `_.assign`.
  5760. *
  5761. * @private
  5762. * @param {Function} assigner The function to assign values.
  5763. * @returns {Function} Returns the new assigner function.
  5764. */
  5765. function createAssigner(assigner) {
  5766. return baseRest(function(object, sources) {
  5767. var index = -1,
  5768. length = sources.length,
  5769. customizer = length > 1 ? sources[length - 1] : undefined,
  5770. guard = length > 2 ? sources[2] : undefined;
  5771. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5772. ? (length--, customizer)
  5773. : undefined;
  5774. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5775. customizer = length < 3 ? undefined : customizer;
  5776. length = 1;
  5777. }
  5778. object = Object(object);
  5779. while (++index < length) {
  5780. var source = sources[index];
  5781. if (source) {
  5782. assigner(object, source, index, customizer);
  5783. }
  5784. }
  5785. return object;
  5786. });
  5787. }
  5788. /**
  5789. * Creates a `baseEach` or `baseEachRight` function.
  5790. *
  5791. * @private
  5792. * @param {Function} eachFunc The function to iterate over a collection.
  5793. * @param {boolean} [fromRight] Specify iterating from right to left.
  5794. * @returns {Function} Returns the new base function.
  5795. */
  5796. function createBaseEach(eachFunc, fromRight) {
  5797. return function(collection, iteratee) {
  5798. if (collection == null) {
  5799. return collection;
  5800. }
  5801. if (!isArrayLike(collection)) {
  5802. return eachFunc(collection, iteratee);
  5803. }
  5804. var length = collection.length,
  5805. index = fromRight ? length : -1,
  5806. iterable = Object(collection);
  5807. while ((fromRight ? index-- : ++index < length)) {
  5808. if (iteratee(iterable[index], index, iterable) === false) {
  5809. break;
  5810. }
  5811. }
  5812. return collection;
  5813. };
  5814. }
  5815. /**
  5816. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5817. *
  5818. * @private
  5819. * @param {boolean} [fromRight] Specify iterating from right to left.
  5820. * @returns {Function} Returns the new base function.
  5821. */
  5822. function createBaseFor(fromRight) {
  5823. return function(object, iteratee, keysFunc) {
  5824. var index = -1,
  5825. iterable = Object(object),
  5826. props = keysFunc(object),
  5827. length = props.length;
  5828. while (length--) {
  5829. var key = props[fromRight ? length : ++index];
  5830. if (iteratee(iterable[key], key, iterable) === false) {
  5831. break;
  5832. }
  5833. }
  5834. return object;
  5835. };
  5836. }
  5837. /**
  5838. * Creates a function that wraps `func` to invoke it with the optional `this`
  5839. * binding of `thisArg`.
  5840. *
  5841. * @private
  5842. * @param {Function} func The function to wrap.
  5843. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5844. * @param {*} [thisArg] The `this` binding of `func`.
  5845. * @returns {Function} Returns the new wrapped function.
  5846. */
  5847. function createBind(func, bitmask, thisArg) {
  5848. var isBind = bitmask & WRAP_BIND_FLAG,
  5849. Ctor = createCtor(func);
  5850. function wrapper() {
  5851. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5852. return fn.apply(isBind ? thisArg : this, arguments);
  5853. }
  5854. return wrapper;
  5855. }
  5856. /**
  5857. * Creates a function like `_.lowerFirst`.
  5858. *
  5859. * @private
  5860. * @param {string} methodName The name of the `String` case method to use.
  5861. * @returns {Function} Returns the new case function.
  5862. */
  5863. function createCaseFirst(methodName) {
  5864. return function(string) {
  5865. string = toString(string);
  5866. var strSymbols = hasUnicode(string)
  5867. ? stringToArray(string)
  5868. : undefined;
  5869. var chr = strSymbols
  5870. ? strSymbols[0]
  5871. : string.charAt(0);
  5872. var trailing = strSymbols
  5873. ? castSlice(strSymbols, 1).join('')
  5874. : string.slice(1);
  5875. return chr[methodName]() + trailing;
  5876. };
  5877. }
  5878. /**
  5879. * Creates a function like `_.camelCase`.
  5880. *
  5881. * @private
  5882. * @param {Function} callback The function to combine each word.
  5883. * @returns {Function} Returns the new compounder function.
  5884. */
  5885. function createCompounder(callback) {
  5886. return function(string) {
  5887. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5888. };
  5889. }
  5890. /**
  5891. * Creates a function that produces an instance of `Ctor` regardless of
  5892. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5893. *
  5894. * @private
  5895. * @param {Function} Ctor The constructor to wrap.
  5896. * @returns {Function} Returns the new wrapped function.
  5897. */
  5898. function createCtor(Ctor) {
  5899. return function() {
  5900. // Use a `switch` statement to work with class constructors. See
  5901. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5902. // for more details.
  5903. var args = arguments;
  5904. switch (args.length) {
  5905. case 0: return new Ctor;
  5906. case 1: return new Ctor(args[0]);
  5907. case 2: return new Ctor(args[0], args[1]);
  5908. case 3: return new Ctor(args[0], args[1], args[2]);
  5909. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5910. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5911. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5912. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5913. }
  5914. var thisBinding = baseCreate(Ctor.prototype),
  5915. result = Ctor.apply(thisBinding, args);
  5916. // Mimic the constructor's `return` behavior.
  5917. // See https://es5.github.io/#x13.2.2 for more details.
  5918. return isObject(result) ? result : thisBinding;
  5919. };
  5920. }
  5921. /**
  5922. * Creates a function that wraps `func` to enable currying.
  5923. *
  5924. * @private
  5925. * @param {Function} func The function to wrap.
  5926. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5927. * @param {number} arity The arity of `func`.
  5928. * @returns {Function} Returns the new wrapped function.
  5929. */
  5930. function createCurry(func, bitmask, arity) {
  5931. var Ctor = createCtor(func);
  5932. function wrapper() {
  5933. var length = arguments.length,
  5934. args = Array(length),
  5935. index = length,
  5936. placeholder = getHolder(wrapper);
  5937. while (index--) {
  5938. args[index] = arguments[index];
  5939. }
  5940. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5941. ? []
  5942. : replaceHolders(args, placeholder);
  5943. length -= holders.length;
  5944. if (length < arity) {
  5945. return createRecurry(
  5946. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5947. args, holders, undefined, undefined, arity - length);
  5948. }
  5949. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5950. return apply(fn, this, args);
  5951. }
  5952. return wrapper;
  5953. }
  5954. /**
  5955. * Creates a `_.find` or `_.findLast` function.
  5956. *
  5957. * @private
  5958. * @param {Function} findIndexFunc The function to find the collection index.
  5959. * @returns {Function} Returns the new find function.
  5960. */
  5961. function createFind(findIndexFunc) {
  5962. return function(collection, predicate, fromIndex) {
  5963. var iterable = Object(collection);
  5964. if (!isArrayLike(collection)) {
  5965. var iteratee = getIteratee(predicate, 3);
  5966. collection = keys(collection);
  5967. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5968. }
  5969. var index = findIndexFunc(collection, predicate, fromIndex);
  5970. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5971. };
  5972. }
  5973. /**
  5974. * Creates a `_.flow` or `_.flowRight` function.
  5975. *
  5976. * @private
  5977. * @param {boolean} [fromRight] Specify iterating from right to left.
  5978. * @returns {Function} Returns the new flow function.
  5979. */
  5980. function createFlow(fromRight) {
  5981. return flatRest(function(funcs) {
  5982. var length = funcs.length,
  5983. index = length,
  5984. prereq = LodashWrapper.prototype.thru;
  5985. if (fromRight) {
  5986. funcs.reverse();
  5987. }
  5988. while (index--) {
  5989. var func = funcs[index];
  5990. if (typeof func != 'function') {
  5991. throw new TypeError(FUNC_ERROR_TEXT);
  5992. }
  5993. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5994. var wrapper = new LodashWrapper([], true);
  5995. }
  5996. }
  5997. index = wrapper ? index : length;
  5998. while (++index < length) {
  5999. func = funcs[index];
  6000. var funcName = getFuncName(func),
  6001. data = funcName == 'wrapper' ? getData(func) : undefined;
  6002. if (data && isLaziable(data[0]) &&
  6003. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6004. !data[4].length && data[9] == 1
  6005. ) {
  6006. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6007. } else {
  6008. wrapper = (func.length == 1 && isLaziable(func))
  6009. ? wrapper[funcName]()
  6010. : wrapper.thru(func);
  6011. }
  6012. }
  6013. return function() {
  6014. var args = arguments,
  6015. value = args[0];
  6016. if (wrapper && args.length == 1 && isArray(value)) {
  6017. return wrapper.plant(value).value();
  6018. }
  6019. var index = 0,
  6020. result = length ? funcs[index].apply(this, args) : value;
  6021. while (++index < length) {
  6022. result = funcs[index].call(this, result);
  6023. }
  6024. return result;
  6025. };
  6026. });
  6027. }
  6028. /**
  6029. * Creates a function that wraps `func` to invoke it with optional `this`
  6030. * binding of `thisArg`, partial application, and currying.
  6031. *
  6032. * @private
  6033. * @param {Function|string} func The function or method name to wrap.
  6034. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6035. * @param {*} [thisArg] The `this` binding of `func`.
  6036. * @param {Array} [partials] The arguments to prepend to those provided to
  6037. * the new function.
  6038. * @param {Array} [holders] The `partials` placeholder indexes.
  6039. * @param {Array} [partialsRight] The arguments to append to those provided
  6040. * to the new function.
  6041. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6042. * @param {Array} [argPos] The argument positions of the new function.
  6043. * @param {number} [ary] The arity cap of `func`.
  6044. * @param {number} [arity] The arity of `func`.
  6045. * @returns {Function} Returns the new wrapped function.
  6046. */
  6047. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6048. var isAry = bitmask & WRAP_ARY_FLAG,
  6049. isBind = bitmask & WRAP_BIND_FLAG,
  6050. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6051. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6052. isFlip = bitmask & WRAP_FLIP_FLAG,
  6053. Ctor = isBindKey ? undefined : createCtor(func);
  6054. function wrapper() {
  6055. var length = arguments.length,
  6056. args = Array(length),
  6057. index = length;
  6058. while (index--) {
  6059. args[index] = arguments[index];
  6060. }
  6061. if (isCurried) {
  6062. var placeholder = getHolder(wrapper),
  6063. holdersCount = countHolders(args, placeholder);
  6064. }
  6065. if (partials) {
  6066. args = composeArgs(args, partials, holders, isCurried);
  6067. }
  6068. if (partialsRight) {
  6069. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6070. }
  6071. length -= holdersCount;
  6072. if (isCurried && length < arity) {
  6073. var newHolders = replaceHolders(args, placeholder);
  6074. return createRecurry(
  6075. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6076. args, newHolders, argPos, ary, arity - length
  6077. );
  6078. }
  6079. var thisBinding = isBind ? thisArg : this,
  6080. fn = isBindKey ? thisBinding[func] : func;
  6081. length = args.length;
  6082. if (argPos) {
  6083. args = reorder(args, argPos);
  6084. } else if (isFlip && length > 1) {
  6085. args.reverse();
  6086. }
  6087. if (isAry && ary < length) {
  6088. args.length = ary;
  6089. }
  6090. if (this && this !== root && this instanceof wrapper) {
  6091. fn = Ctor || createCtor(fn);
  6092. }
  6093. return fn.apply(thisBinding, args);
  6094. }
  6095. return wrapper;
  6096. }
  6097. /**
  6098. * Creates a function like `_.invertBy`.
  6099. *
  6100. * @private
  6101. * @param {Function} setter The function to set accumulator values.
  6102. * @param {Function} toIteratee The function to resolve iteratees.
  6103. * @returns {Function} Returns the new inverter function.
  6104. */
  6105. function createInverter(setter, toIteratee) {
  6106. return function(object, iteratee) {
  6107. return baseInverter(object, setter, toIteratee(iteratee), {});
  6108. };
  6109. }
  6110. /**
  6111. * Creates a function that performs a mathematical operation on two values.
  6112. *
  6113. * @private
  6114. * @param {Function} operator The function to perform the operation.
  6115. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6116. * @returns {Function} Returns the new mathematical operation function.
  6117. */
  6118. function createMathOperation(operator, defaultValue) {
  6119. return function(value, other) {
  6120. var result;
  6121. if (value === undefined && other === undefined) {
  6122. return defaultValue;
  6123. }
  6124. if (value !== undefined) {
  6125. result = value;
  6126. }
  6127. if (other !== undefined) {
  6128. if (result === undefined) {
  6129. return other;
  6130. }
  6131. if (typeof value == 'string' || typeof other == 'string') {
  6132. value = baseToString(value);
  6133. other = baseToString(other);
  6134. } else {
  6135. value = baseToNumber(value);
  6136. other = baseToNumber(other);
  6137. }
  6138. result = operator(value, other);
  6139. }
  6140. return result;
  6141. };
  6142. }
  6143. /**
  6144. * Creates a function like `_.over`.
  6145. *
  6146. * @private
  6147. * @param {Function} arrayFunc The function to iterate over iteratees.
  6148. * @returns {Function} Returns the new over function.
  6149. */
  6150. function createOver(arrayFunc) {
  6151. return flatRest(function(iteratees) {
  6152. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6153. return baseRest(function(args) {
  6154. var thisArg = this;
  6155. return arrayFunc(iteratees, function(iteratee) {
  6156. return apply(iteratee, thisArg, args);
  6157. });
  6158. });
  6159. });
  6160. }
  6161. /**
  6162. * Creates the padding for `string` based on `length`. The `chars` string
  6163. * is truncated if the number of characters exceeds `length`.
  6164. *
  6165. * @private
  6166. * @param {number} length The padding length.
  6167. * @param {string} [chars=' '] The string used as padding.
  6168. * @returns {string} Returns the padding for `string`.
  6169. */
  6170. function createPadding(length, chars) {
  6171. chars = chars === undefined ? ' ' : baseToString(chars);
  6172. var charsLength = chars.length;
  6173. if (charsLength < 2) {
  6174. return charsLength ? baseRepeat(chars, length) : chars;
  6175. }
  6176. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6177. return hasUnicode(chars)
  6178. ? castSlice(stringToArray(result), 0, length).join('')
  6179. : result.slice(0, length);
  6180. }
  6181. /**
  6182. * Creates a function that wraps `func` to invoke it with the `this` binding
  6183. * of `thisArg` and `partials` prepended to the arguments it receives.
  6184. *
  6185. * @private
  6186. * @param {Function} func The function to wrap.
  6187. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6188. * @param {*} thisArg The `this` binding of `func`.
  6189. * @param {Array} partials The arguments to prepend to those provided to
  6190. * the new function.
  6191. * @returns {Function} Returns the new wrapped function.
  6192. */
  6193. function createPartial(func, bitmask, thisArg, partials) {
  6194. var isBind = bitmask & WRAP_BIND_FLAG,
  6195. Ctor = createCtor(func);
  6196. function wrapper() {
  6197. var argsIndex = -1,
  6198. argsLength = arguments.length,
  6199. leftIndex = -1,
  6200. leftLength = partials.length,
  6201. args = Array(leftLength + argsLength),
  6202. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6203. while (++leftIndex < leftLength) {
  6204. args[leftIndex] = partials[leftIndex];
  6205. }
  6206. while (argsLength--) {
  6207. args[leftIndex++] = arguments[++argsIndex];
  6208. }
  6209. return apply(fn, isBind ? thisArg : this, args);
  6210. }
  6211. return wrapper;
  6212. }
  6213. /**
  6214. * Creates a `_.range` or `_.rangeRight` function.
  6215. *
  6216. * @private
  6217. * @param {boolean} [fromRight] Specify iterating from right to left.
  6218. * @returns {Function} Returns the new range function.
  6219. */
  6220. function createRange(fromRight) {
  6221. return function(start, end, step) {
  6222. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6223. end = step = undefined;
  6224. }
  6225. // Ensure the sign of `-0` is preserved.
  6226. start = toFinite(start);
  6227. if (end === undefined) {
  6228. end = start;
  6229. start = 0;
  6230. } else {
  6231. end = toFinite(end);
  6232. }
  6233. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6234. return baseRange(start, end, step, fromRight);
  6235. };
  6236. }
  6237. /**
  6238. * Creates a function that performs a relational operation on two values.
  6239. *
  6240. * @private
  6241. * @param {Function} operator The function to perform the operation.
  6242. * @returns {Function} Returns the new relational operation function.
  6243. */
  6244. function createRelationalOperation(operator) {
  6245. return function(value, other) {
  6246. if (!(typeof value == 'string' && typeof other == 'string')) {
  6247. value = toNumber(value);
  6248. other = toNumber(other);
  6249. }
  6250. return operator(value, other);
  6251. };
  6252. }
  6253. /**
  6254. * Creates a function that wraps `func` to continue currying.
  6255. *
  6256. * @private
  6257. * @param {Function} func The function to wrap.
  6258. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6259. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6260. * @param {*} placeholder The placeholder value.
  6261. * @param {*} [thisArg] The `this` binding of `func`.
  6262. * @param {Array} [partials] The arguments to prepend to those provided to
  6263. * the new function.
  6264. * @param {Array} [holders] The `partials` placeholder indexes.
  6265. * @param {Array} [argPos] The argument positions of the new function.
  6266. * @param {number} [ary] The arity cap of `func`.
  6267. * @param {number} [arity] The arity of `func`.
  6268. * @returns {Function} Returns the new wrapped function.
  6269. */
  6270. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6271. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6272. newHolders = isCurry ? holders : undefined,
  6273. newHoldersRight = isCurry ? undefined : holders,
  6274. newPartials = isCurry ? partials : undefined,
  6275. newPartialsRight = isCurry ? undefined : partials;
  6276. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6277. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6278. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6279. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6280. }
  6281. var newData = [
  6282. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6283. newHoldersRight, argPos, ary, arity
  6284. ];
  6285. var result = wrapFunc.apply(undefined, newData);
  6286. if (isLaziable(func)) {
  6287. setData(result, newData);
  6288. }
  6289. result.placeholder = placeholder;
  6290. return setWrapToString(result, func, bitmask);
  6291. }
  6292. /**
  6293. * Creates a function like `_.round`.
  6294. *
  6295. * @private
  6296. * @param {string} methodName The name of the `Math` method to use when rounding.
  6297. * @returns {Function} Returns the new round function.
  6298. */
  6299. function createRound(methodName) {
  6300. var func = Math[methodName];
  6301. return function(number, precision) {
  6302. number = toNumber(number);
  6303. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6304. if (precision && nativeIsFinite(number)) {
  6305. // Shift with exponential notation to avoid floating-point issues.
  6306. // See [MDN](https://mdn.io/round#Examples) for more details.
  6307. var pair = (toString(number) + 'e').split('e'),
  6308. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6309. pair = (toString(value) + 'e').split('e');
  6310. return +(pair[0] + 'e' + (+pair[1] - precision));
  6311. }
  6312. return func(number);
  6313. };
  6314. }
  6315. /**
  6316. * Creates a set object of `values`.
  6317. *
  6318. * @private
  6319. * @param {Array} values The values to add to the set.
  6320. * @returns {Object} Returns the new set.
  6321. */
  6322. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6323. return new Set(values);
  6324. };
  6325. /**
  6326. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6327. *
  6328. * @private
  6329. * @param {Function} keysFunc The function to get the keys of a given object.
  6330. * @returns {Function} Returns the new pairs function.
  6331. */
  6332. function createToPairs(keysFunc) {
  6333. return function(object) {
  6334. var tag = getTag(object);
  6335. if (tag == mapTag) {
  6336. return mapToArray(object);
  6337. }
  6338. if (tag == setTag) {
  6339. return setToPairs(object);
  6340. }
  6341. return baseToPairs(object, keysFunc(object));
  6342. };
  6343. }
  6344. /**
  6345. * Creates a function that either curries or invokes `func` with optional
  6346. * `this` binding and partially applied arguments.
  6347. *
  6348. * @private
  6349. * @param {Function|string} func The function or method name to wrap.
  6350. * @param {number} bitmask The bitmask flags.
  6351. * 1 - `_.bind`
  6352. * 2 - `_.bindKey`
  6353. * 4 - `_.curry` or `_.curryRight` of a bound function
  6354. * 8 - `_.curry`
  6355. * 16 - `_.curryRight`
  6356. * 32 - `_.partial`
  6357. * 64 - `_.partialRight`
  6358. * 128 - `_.rearg`
  6359. * 256 - `_.ary`
  6360. * 512 - `_.flip`
  6361. * @param {*} [thisArg] The `this` binding of `func`.
  6362. * @param {Array} [partials] The arguments to be partially applied.
  6363. * @param {Array} [holders] The `partials` placeholder indexes.
  6364. * @param {Array} [argPos] The argument positions of the new function.
  6365. * @param {number} [ary] The arity cap of `func`.
  6366. * @param {number} [arity] The arity of `func`.
  6367. * @returns {Function} Returns the new wrapped function.
  6368. */
  6369. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6370. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6371. if (!isBindKey && typeof func != 'function') {
  6372. throw new TypeError(FUNC_ERROR_TEXT);
  6373. }
  6374. var length = partials ? partials.length : 0;
  6375. if (!length) {
  6376. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6377. partials = holders = undefined;
  6378. }
  6379. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6380. arity = arity === undefined ? arity : toInteger(arity);
  6381. length -= holders ? holders.length : 0;
  6382. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6383. var partialsRight = partials,
  6384. holdersRight = holders;
  6385. partials = holders = undefined;
  6386. }
  6387. var data = isBindKey ? undefined : getData(func);
  6388. var newData = [
  6389. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6390. argPos, ary, arity
  6391. ];
  6392. if (data) {
  6393. mergeData(newData, data);
  6394. }
  6395. func = newData[0];
  6396. bitmask = newData[1];
  6397. thisArg = newData[2];
  6398. partials = newData[3];
  6399. holders = newData[4];
  6400. arity = newData[9] = newData[9] === undefined
  6401. ? (isBindKey ? 0 : func.length)
  6402. : nativeMax(newData[9] - length, 0);
  6403. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6404. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6405. }
  6406. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6407. var result = createBind(func, bitmask, thisArg);
  6408. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6409. result = createCurry(func, bitmask, arity);
  6410. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6411. result = createPartial(func, bitmask, thisArg, partials);
  6412. } else {
  6413. result = createHybrid.apply(undefined, newData);
  6414. }
  6415. var setter = data ? baseSetData : setData;
  6416. return setWrapToString(setter(result, newData), func, bitmask);
  6417. }
  6418. /**
  6419. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6420. * of source objects to the destination object for all destination properties
  6421. * that resolve to `undefined`.
  6422. *
  6423. * @private
  6424. * @param {*} objValue The destination value.
  6425. * @param {*} srcValue The source value.
  6426. * @param {string} key The key of the property to assign.
  6427. * @param {Object} object The parent object of `objValue`.
  6428. * @returns {*} Returns the value to assign.
  6429. */
  6430. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6431. if (objValue === undefined ||
  6432. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6433. return srcValue;
  6434. }
  6435. return objValue;
  6436. }
  6437. /**
  6438. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6439. * objects into destination objects that are passed thru.
  6440. *
  6441. * @private
  6442. * @param {*} objValue The destination value.
  6443. * @param {*} srcValue The source value.
  6444. * @param {string} key The key of the property to merge.
  6445. * @param {Object} object The parent object of `objValue`.
  6446. * @param {Object} source The parent object of `srcValue`.
  6447. * @param {Object} [stack] Tracks traversed source values and their merged
  6448. * counterparts.
  6449. * @returns {*} Returns the value to assign.
  6450. */
  6451. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6452. if (isObject(objValue) && isObject(srcValue)) {
  6453. // Recursively merge objects and arrays (susceptible to call stack limits).
  6454. stack.set(srcValue, objValue);
  6455. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6456. stack['delete'](srcValue);
  6457. }
  6458. return objValue;
  6459. }
  6460. /**
  6461. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6462. * objects.
  6463. *
  6464. * @private
  6465. * @param {*} value The value to inspect.
  6466. * @param {string} key The key of the property to inspect.
  6467. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6468. */
  6469. function customOmitClone(value) {
  6470. return isPlainObject(value) ? undefined : value;
  6471. }
  6472. /**
  6473. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6474. * partial deep comparisons.
  6475. *
  6476. * @private
  6477. * @param {Array} array The array to compare.
  6478. * @param {Array} other The other array to compare.
  6479. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6480. * @param {Function} customizer The function to customize comparisons.
  6481. * @param {Function} equalFunc The function to determine equivalents of values.
  6482. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6483. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6484. */
  6485. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6486. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6487. arrLength = array.length,
  6488. othLength = other.length;
  6489. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6490. return false;
  6491. }
  6492. // Check that cyclic values are equal.
  6493. var arrStacked = stack.get(array);
  6494. var othStacked = stack.get(other);
  6495. if (arrStacked && othStacked) {
  6496. return arrStacked == other && othStacked == array;
  6497. }
  6498. var index = -1,
  6499. result = true,
  6500. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6501. stack.set(array, other);
  6502. stack.set(other, array);
  6503. // Ignore non-index properties.
  6504. while (++index < arrLength) {
  6505. var arrValue = array[index],
  6506. othValue = other[index];
  6507. if (customizer) {
  6508. var compared = isPartial
  6509. ? customizer(othValue, arrValue, index, other, array, stack)
  6510. : customizer(arrValue, othValue, index, array, other, stack);
  6511. }
  6512. if (compared !== undefined) {
  6513. if (compared) {
  6514. continue;
  6515. }
  6516. result = false;
  6517. break;
  6518. }
  6519. // Recursively compare arrays (susceptible to call stack limits).
  6520. if (seen) {
  6521. if (!arraySome(other, function(othValue, othIndex) {
  6522. if (!cacheHas(seen, othIndex) &&
  6523. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6524. return seen.push(othIndex);
  6525. }
  6526. })) {
  6527. result = false;
  6528. break;
  6529. }
  6530. } else if (!(
  6531. arrValue === othValue ||
  6532. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6533. )) {
  6534. result = false;
  6535. break;
  6536. }
  6537. }
  6538. stack['delete'](array);
  6539. stack['delete'](other);
  6540. return result;
  6541. }
  6542. /**
  6543. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6544. * the same `toStringTag`.
  6545. *
  6546. * **Note:** This function only supports comparing values with tags of
  6547. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6548. *
  6549. * @private
  6550. * @param {Object} object The object to compare.
  6551. * @param {Object} other The other object to compare.
  6552. * @param {string} tag The `toStringTag` of the objects to compare.
  6553. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6554. * @param {Function} customizer The function to customize comparisons.
  6555. * @param {Function} equalFunc The function to determine equivalents of values.
  6556. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6557. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6558. */
  6559. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6560. switch (tag) {
  6561. case dataViewTag:
  6562. if ((object.byteLength != other.byteLength) ||
  6563. (object.byteOffset != other.byteOffset)) {
  6564. return false;
  6565. }
  6566. object = object.buffer;
  6567. other = other.buffer;
  6568. case arrayBufferTag:
  6569. if ((object.byteLength != other.byteLength) ||
  6570. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6571. return false;
  6572. }
  6573. return true;
  6574. case boolTag:
  6575. case dateTag:
  6576. case numberTag:
  6577. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6578. // Invalid dates are coerced to `NaN`.
  6579. return eq(+object, +other);
  6580. case errorTag:
  6581. return object.name == other.name && object.message == other.message;
  6582. case regexpTag:
  6583. case stringTag:
  6584. // Coerce regexes to strings and treat strings, primitives and objects,
  6585. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6586. // for more details.
  6587. return object == (other + '');
  6588. case mapTag:
  6589. var convert = mapToArray;
  6590. case setTag:
  6591. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6592. convert || (convert = setToArray);
  6593. if (object.size != other.size && !isPartial) {
  6594. return false;
  6595. }
  6596. // Assume cyclic values are equal.
  6597. var stacked = stack.get(object);
  6598. if (stacked) {
  6599. return stacked == other;
  6600. }
  6601. bitmask |= COMPARE_UNORDERED_FLAG;
  6602. // Recursively compare objects (susceptible to call stack limits).
  6603. stack.set(object, other);
  6604. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6605. stack['delete'](object);
  6606. return result;
  6607. case symbolTag:
  6608. if (symbolValueOf) {
  6609. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6610. }
  6611. }
  6612. return false;
  6613. }
  6614. /**
  6615. * A specialized version of `baseIsEqualDeep` for objects with support for
  6616. * partial deep comparisons.
  6617. *
  6618. * @private
  6619. * @param {Object} object The object to compare.
  6620. * @param {Object} other The other object to compare.
  6621. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6622. * @param {Function} customizer The function to customize comparisons.
  6623. * @param {Function} equalFunc The function to determine equivalents of values.
  6624. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6625. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6626. */
  6627. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6628. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6629. objProps = getAllKeys(object),
  6630. objLength = objProps.length,
  6631. othProps = getAllKeys(other),
  6632. othLength = othProps.length;
  6633. if (objLength != othLength && !isPartial) {
  6634. return false;
  6635. }
  6636. var index = objLength;
  6637. while (index--) {
  6638. var key = objProps[index];
  6639. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6640. return false;
  6641. }
  6642. }
  6643. // Check that cyclic values are equal.
  6644. var objStacked = stack.get(object);
  6645. var othStacked = stack.get(other);
  6646. if (objStacked && othStacked) {
  6647. return objStacked == other && othStacked == object;
  6648. }
  6649. var result = true;
  6650. stack.set(object, other);
  6651. stack.set(other, object);
  6652. var skipCtor = isPartial;
  6653. while (++index < objLength) {
  6654. key = objProps[index];
  6655. var objValue = object[key],
  6656. othValue = other[key];
  6657. if (customizer) {
  6658. var compared = isPartial
  6659. ? customizer(othValue, objValue, key, other, object, stack)
  6660. : customizer(objValue, othValue, key, object, other, stack);
  6661. }
  6662. // Recursively compare objects (susceptible to call stack limits).
  6663. if (!(compared === undefined
  6664. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6665. : compared
  6666. )) {
  6667. result = false;
  6668. break;
  6669. }
  6670. skipCtor || (skipCtor = key == 'constructor');
  6671. }
  6672. if (result && !skipCtor) {
  6673. var objCtor = object.constructor,
  6674. othCtor = other.constructor;
  6675. // Non `Object` object instances with different constructors are not equal.
  6676. if (objCtor != othCtor &&
  6677. ('constructor' in object && 'constructor' in other) &&
  6678. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6679. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6680. result = false;
  6681. }
  6682. }
  6683. stack['delete'](object);
  6684. stack['delete'](other);
  6685. return result;
  6686. }
  6687. /**
  6688. * A specialized version of `baseRest` which flattens the rest array.
  6689. *
  6690. * @private
  6691. * @param {Function} func The function to apply a rest parameter to.
  6692. * @returns {Function} Returns the new function.
  6693. */
  6694. function flatRest(func) {
  6695. return setToString(overRest(func, undefined, flatten), func + '');
  6696. }
  6697. /**
  6698. * Creates an array of own enumerable property names and symbols of `object`.
  6699. *
  6700. * @private
  6701. * @param {Object} object The object to query.
  6702. * @returns {Array} Returns the array of property names and symbols.
  6703. */
  6704. function getAllKeys(object) {
  6705. return baseGetAllKeys(object, keys, getSymbols);
  6706. }
  6707. /**
  6708. * Creates an array of own and inherited enumerable property names and
  6709. * symbols of `object`.
  6710. *
  6711. * @private
  6712. * @param {Object} object The object to query.
  6713. * @returns {Array} Returns the array of property names and symbols.
  6714. */
  6715. function getAllKeysIn(object) {
  6716. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6717. }
  6718. /**
  6719. * Gets metadata for `func`.
  6720. *
  6721. * @private
  6722. * @param {Function} func The function to query.
  6723. * @returns {*} Returns the metadata for `func`.
  6724. */
  6725. var getData = !metaMap ? noop : function(func) {
  6726. return metaMap.get(func);
  6727. };
  6728. /**
  6729. * Gets the name of `func`.
  6730. *
  6731. * @private
  6732. * @param {Function} func The function to query.
  6733. * @returns {string} Returns the function name.
  6734. */
  6735. function getFuncName(func) {
  6736. var result = (func.name + ''),
  6737. array = realNames[result],
  6738. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6739. while (length--) {
  6740. var data = array[length],
  6741. otherFunc = data.func;
  6742. if (otherFunc == null || otherFunc == func) {
  6743. return data.name;
  6744. }
  6745. }
  6746. return result;
  6747. }
  6748. /**
  6749. * Gets the argument placeholder value for `func`.
  6750. *
  6751. * @private
  6752. * @param {Function} func The function to inspect.
  6753. * @returns {*} Returns the placeholder value.
  6754. */
  6755. function getHolder(func) {
  6756. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6757. return object.placeholder;
  6758. }
  6759. /**
  6760. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6761. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6762. * If arguments are provided, the chosen function is invoked with them and
  6763. * its result is returned.
  6764. *
  6765. * @private
  6766. * @param {*} [value] The value to convert to an iteratee.
  6767. * @param {number} [arity] The arity of the created iteratee.
  6768. * @returns {Function} Returns the chosen function or its result.
  6769. */
  6770. function getIteratee() {
  6771. var result = lodash.iteratee || iteratee;
  6772. result = result === iteratee ? baseIteratee : result;
  6773. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6774. }
  6775. /**
  6776. * Gets the data for `map`.
  6777. *
  6778. * @private
  6779. * @param {Object} map The map to query.
  6780. * @param {string} key The reference key.
  6781. * @returns {*} Returns the map data.
  6782. */
  6783. function getMapData(map, key) {
  6784. var data = map.__data__;
  6785. return isKeyable(key)
  6786. ? data[typeof key == 'string' ? 'string' : 'hash']
  6787. : data.map;
  6788. }
  6789. /**
  6790. * Gets the property names, values, and compare flags of `object`.
  6791. *
  6792. * @private
  6793. * @param {Object} object The object to query.
  6794. * @returns {Array} Returns the match data of `object`.
  6795. */
  6796. function getMatchData(object) {
  6797. var result = keys(object),
  6798. length = result.length;
  6799. while (length--) {
  6800. var key = result[length],
  6801. value = object[key];
  6802. result[length] = [key, value, isStrictComparable(value)];
  6803. }
  6804. return result;
  6805. }
  6806. /**
  6807. * Gets the native function at `key` of `object`.
  6808. *
  6809. * @private
  6810. * @param {Object} object The object to query.
  6811. * @param {string} key The key of the method to get.
  6812. * @returns {*} Returns the function if it's native, else `undefined`.
  6813. */
  6814. function getNative(object, key) {
  6815. var value = getValue(object, key);
  6816. return baseIsNative(value) ? value : undefined;
  6817. }
  6818. /**
  6819. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6820. *
  6821. * @private
  6822. * @param {*} value The value to query.
  6823. * @returns {string} Returns the raw `toStringTag`.
  6824. */
  6825. function getRawTag(value) {
  6826. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6827. tag = value[symToStringTag];
  6828. try {
  6829. value[symToStringTag] = undefined;
  6830. var unmasked = true;
  6831. } catch (e) {}
  6832. var result = nativeObjectToString.call(value);
  6833. if (unmasked) {
  6834. if (isOwn) {
  6835. value[symToStringTag] = tag;
  6836. } else {
  6837. delete value[symToStringTag];
  6838. }
  6839. }
  6840. return result;
  6841. }
  6842. /**
  6843. * Creates an array of the own enumerable symbols of `object`.
  6844. *
  6845. * @private
  6846. * @param {Object} object The object to query.
  6847. * @returns {Array} Returns the array of symbols.
  6848. */
  6849. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6850. if (object == null) {
  6851. return [];
  6852. }
  6853. object = Object(object);
  6854. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6855. return propertyIsEnumerable.call(object, symbol);
  6856. });
  6857. };
  6858. /**
  6859. * Creates an array of the own and inherited enumerable symbols of `object`.
  6860. *
  6861. * @private
  6862. * @param {Object} object The object to query.
  6863. * @returns {Array} Returns the array of symbols.
  6864. */
  6865. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6866. var result = [];
  6867. while (object) {
  6868. arrayPush(result, getSymbols(object));
  6869. object = getPrototype(object);
  6870. }
  6871. return result;
  6872. };
  6873. /**
  6874. * Gets the `toStringTag` of `value`.
  6875. *
  6876. * @private
  6877. * @param {*} value The value to query.
  6878. * @returns {string} Returns the `toStringTag`.
  6879. */
  6880. var getTag = baseGetTag;
  6881. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6882. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6883. (Map && getTag(new Map) != mapTag) ||
  6884. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6885. (Set && getTag(new Set) != setTag) ||
  6886. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6887. getTag = function(value) {
  6888. var result = baseGetTag(value),
  6889. Ctor = result == objectTag ? value.constructor : undefined,
  6890. ctorString = Ctor ? toSource(Ctor) : '';
  6891. if (ctorString) {
  6892. switch (ctorString) {
  6893. case dataViewCtorString: return dataViewTag;
  6894. case mapCtorString: return mapTag;
  6895. case promiseCtorString: return promiseTag;
  6896. case setCtorString: return setTag;
  6897. case weakMapCtorString: return weakMapTag;
  6898. }
  6899. }
  6900. return result;
  6901. };
  6902. }
  6903. /**
  6904. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6905. *
  6906. * @private
  6907. * @param {number} start The start of the view.
  6908. * @param {number} end The end of the view.
  6909. * @param {Array} transforms The transformations to apply to the view.
  6910. * @returns {Object} Returns an object containing the `start` and `end`
  6911. * positions of the view.
  6912. */
  6913. function getView(start, end, transforms) {
  6914. var index = -1,
  6915. length = transforms.length;
  6916. while (++index < length) {
  6917. var data = transforms[index],
  6918. size = data.size;
  6919. switch (data.type) {
  6920. case 'drop': start += size; break;
  6921. case 'dropRight': end -= size; break;
  6922. case 'take': end = nativeMin(end, start + size); break;
  6923. case 'takeRight': start = nativeMax(start, end - size); break;
  6924. }
  6925. }
  6926. return { 'start': start, 'end': end };
  6927. }
  6928. /**
  6929. * Extracts wrapper details from the `source` body comment.
  6930. *
  6931. * @private
  6932. * @param {string} source The source to inspect.
  6933. * @returns {Array} Returns the wrapper details.
  6934. */
  6935. function getWrapDetails(source) {
  6936. var match = source.match(reWrapDetails);
  6937. return match ? match[1].split(reSplitDetails) : [];
  6938. }
  6939. /**
  6940. * Checks if `path` exists on `object`.
  6941. *
  6942. * @private
  6943. * @param {Object} object The object to query.
  6944. * @param {Array|string} path The path to check.
  6945. * @param {Function} hasFunc The function to check properties.
  6946. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6947. */
  6948. function hasPath(object, path, hasFunc) {
  6949. path = castPath(path, object);
  6950. var index = -1,
  6951. length = path.length,
  6952. result = false;
  6953. while (++index < length) {
  6954. var key = toKey(path[index]);
  6955. if (!(result = object != null && hasFunc(object, key))) {
  6956. break;
  6957. }
  6958. object = object[key];
  6959. }
  6960. if (result || ++index != length) {
  6961. return result;
  6962. }
  6963. length = object == null ? 0 : object.length;
  6964. return !!length && isLength(length) && isIndex(key, length) &&
  6965. (isArray(object) || isArguments(object));
  6966. }
  6967. /**
  6968. * Initializes an array clone.
  6969. *
  6970. * @private
  6971. * @param {Array} array The array to clone.
  6972. * @returns {Array} Returns the initialized clone.
  6973. */
  6974. function initCloneArray(array) {
  6975. var length = array.length,
  6976. result = new array.constructor(length);
  6977. // Add properties assigned by `RegExp#exec`.
  6978. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6979. result.index = array.index;
  6980. result.input = array.input;
  6981. }
  6982. return result;
  6983. }
  6984. /**
  6985. * Initializes an object clone.
  6986. *
  6987. * @private
  6988. * @param {Object} object The object to clone.
  6989. * @returns {Object} Returns the initialized clone.
  6990. */
  6991. function initCloneObject(object) {
  6992. return (typeof object.constructor == 'function' && !isPrototype(object))
  6993. ? baseCreate(getPrototype(object))
  6994. : {};
  6995. }
  6996. /**
  6997. * Initializes an object clone based on its `toStringTag`.
  6998. *
  6999. * **Note:** This function only supports cloning values with tags of
  7000. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7001. *
  7002. * @private
  7003. * @param {Object} object The object to clone.
  7004. * @param {string} tag The `toStringTag` of the object to clone.
  7005. * @param {boolean} [isDeep] Specify a deep clone.
  7006. * @returns {Object} Returns the initialized clone.
  7007. */
  7008. function initCloneByTag(object, tag, isDeep) {
  7009. var Ctor = object.constructor;
  7010. switch (tag) {
  7011. case arrayBufferTag:
  7012. return cloneArrayBuffer(object);
  7013. case boolTag:
  7014. case dateTag:
  7015. return new Ctor(+object);
  7016. case dataViewTag:
  7017. return cloneDataView(object, isDeep);
  7018. case float32Tag: case float64Tag:
  7019. case int8Tag: case int16Tag: case int32Tag:
  7020. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7021. return cloneTypedArray(object, isDeep);
  7022. case mapTag:
  7023. return new Ctor;
  7024. case numberTag:
  7025. case stringTag:
  7026. return new Ctor(object);
  7027. case regexpTag:
  7028. return cloneRegExp(object);
  7029. case setTag:
  7030. return new Ctor;
  7031. case symbolTag:
  7032. return cloneSymbol(object);
  7033. }
  7034. }
  7035. /**
  7036. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7037. *
  7038. * @private
  7039. * @param {string} source The source to modify.
  7040. * @returns {Array} details The details to insert.
  7041. * @returns {string} Returns the modified source.
  7042. */
  7043. function insertWrapDetails(source, details) {
  7044. var length = details.length;
  7045. if (!length) {
  7046. return source;
  7047. }
  7048. var lastIndex = length - 1;
  7049. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7050. details = details.join(length > 2 ? ', ' : ' ');
  7051. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7052. }
  7053. /**
  7054. * Checks if `value` is a flattenable `arguments` object or array.
  7055. *
  7056. * @private
  7057. * @param {*} value The value to check.
  7058. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7059. */
  7060. function isFlattenable(value) {
  7061. return isArray(value) || isArguments(value) ||
  7062. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7063. }
  7064. /**
  7065. * Checks if `value` is a valid array-like index.
  7066. *
  7067. * @private
  7068. * @param {*} value The value to check.
  7069. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7070. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7071. */
  7072. function isIndex(value, length) {
  7073. var type = typeof value;
  7074. length = length == null ? MAX_SAFE_INTEGER : length;
  7075. return !!length &&
  7076. (type == 'number' ||
  7077. (type != 'symbol' && reIsUint.test(value))) &&
  7078. (value > -1 && value % 1 == 0 && value < length);
  7079. }
  7080. /**
  7081. * Checks if the given arguments are from an iteratee call.
  7082. *
  7083. * @private
  7084. * @param {*} value The potential iteratee value argument.
  7085. * @param {*} index The potential iteratee index or key argument.
  7086. * @param {*} object The potential iteratee object argument.
  7087. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7088. * else `false`.
  7089. */
  7090. function isIterateeCall(value, index, object) {
  7091. if (!isObject(object)) {
  7092. return false;
  7093. }
  7094. var type = typeof index;
  7095. if (type == 'number'
  7096. ? (isArrayLike(object) && isIndex(index, object.length))
  7097. : (type == 'string' && index in object)
  7098. ) {
  7099. return eq(object[index], value);
  7100. }
  7101. return false;
  7102. }
  7103. /**
  7104. * Checks if `value` is a property name and not a property path.
  7105. *
  7106. * @private
  7107. * @param {*} value The value to check.
  7108. * @param {Object} [object] The object to query keys on.
  7109. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7110. */
  7111. function isKey(value, object) {
  7112. if (isArray(value)) {
  7113. return false;
  7114. }
  7115. var type = typeof value;
  7116. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7117. value == null || isSymbol(value)) {
  7118. return true;
  7119. }
  7120. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7121. (object != null && value in Object(object));
  7122. }
  7123. /**
  7124. * Checks if `value` is suitable for use as unique object key.
  7125. *
  7126. * @private
  7127. * @param {*} value The value to check.
  7128. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7129. */
  7130. function isKeyable(value) {
  7131. var type = typeof value;
  7132. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7133. ? (value !== '__proto__')
  7134. : (value === null);
  7135. }
  7136. /**
  7137. * Checks if `func` has a lazy counterpart.
  7138. *
  7139. * @private
  7140. * @param {Function} func The function to check.
  7141. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7142. * else `false`.
  7143. */
  7144. function isLaziable(func) {
  7145. var funcName = getFuncName(func),
  7146. other = lodash[funcName];
  7147. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7148. return false;
  7149. }
  7150. if (func === other) {
  7151. return true;
  7152. }
  7153. var data = getData(other);
  7154. return !!data && func === data[0];
  7155. }
  7156. /**
  7157. * Checks if `func` has its source masked.
  7158. *
  7159. * @private
  7160. * @param {Function} func The function to check.
  7161. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7162. */
  7163. function isMasked(func) {
  7164. return !!maskSrcKey && (maskSrcKey in func);
  7165. }
  7166. /**
  7167. * Checks if `func` is capable of being masked.
  7168. *
  7169. * @private
  7170. * @param {*} value The value to check.
  7171. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7172. */
  7173. var isMaskable = coreJsData ? isFunction : stubFalse;
  7174. /**
  7175. * Checks if `value` is likely a prototype object.
  7176. *
  7177. * @private
  7178. * @param {*} value The value to check.
  7179. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7180. */
  7181. function isPrototype(value) {
  7182. var Ctor = value && value.constructor,
  7183. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7184. return value === proto;
  7185. }
  7186. /**
  7187. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7188. *
  7189. * @private
  7190. * @param {*} value The value to check.
  7191. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7192. * equality comparisons, else `false`.
  7193. */
  7194. function isStrictComparable(value) {
  7195. return value === value && !isObject(value);
  7196. }
  7197. /**
  7198. * A specialized version of `matchesProperty` for source values suitable
  7199. * for strict equality comparisons, i.e. `===`.
  7200. *
  7201. * @private
  7202. * @param {string} key The key of the property to get.
  7203. * @param {*} srcValue The value to match.
  7204. * @returns {Function} Returns the new spec function.
  7205. */
  7206. function matchesStrictComparable(key, srcValue) {
  7207. return function(object) {
  7208. if (object == null) {
  7209. return false;
  7210. }
  7211. return object[key] === srcValue &&
  7212. (srcValue !== undefined || (key in Object(object)));
  7213. };
  7214. }
  7215. /**
  7216. * A specialized version of `_.memoize` which clears the memoized function's
  7217. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7218. *
  7219. * @private
  7220. * @param {Function} func The function to have its output memoized.
  7221. * @returns {Function} Returns the new memoized function.
  7222. */
  7223. function memoizeCapped(func) {
  7224. var result = memoize(func, function(key) {
  7225. if (cache.size === MAX_MEMOIZE_SIZE) {
  7226. cache.clear();
  7227. }
  7228. return key;
  7229. });
  7230. var cache = result.cache;
  7231. return result;
  7232. }
  7233. /**
  7234. * Merges the function metadata of `source` into `data`.
  7235. *
  7236. * Merging metadata reduces the number of wrappers used to invoke a function.
  7237. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7238. * may be applied regardless of execution order. Methods like `_.ary` and
  7239. * `_.rearg` modify function arguments, making the order in which they are
  7240. * executed important, preventing the merging of metadata. However, we make
  7241. * an exception for a safe combined case where curried functions have `_.ary`
  7242. * and or `_.rearg` applied.
  7243. *
  7244. * @private
  7245. * @param {Array} data The destination metadata.
  7246. * @param {Array} source The source metadata.
  7247. * @returns {Array} Returns `data`.
  7248. */
  7249. function mergeData(data, source) {
  7250. var bitmask = data[1],
  7251. srcBitmask = source[1],
  7252. newBitmask = bitmask | srcBitmask,
  7253. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7254. var isCombo =
  7255. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7256. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7257. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7258. // Exit early if metadata can't be merged.
  7259. if (!(isCommon || isCombo)) {
  7260. return data;
  7261. }
  7262. // Use source `thisArg` if available.
  7263. if (srcBitmask & WRAP_BIND_FLAG) {
  7264. data[2] = source[2];
  7265. // Set when currying a bound function.
  7266. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7267. }
  7268. // Compose partial arguments.
  7269. var value = source[3];
  7270. if (value) {
  7271. var partials = data[3];
  7272. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7273. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7274. }
  7275. // Compose partial right arguments.
  7276. value = source[5];
  7277. if (value) {
  7278. partials = data[5];
  7279. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7280. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7281. }
  7282. // Use source `argPos` if available.
  7283. value = source[7];
  7284. if (value) {
  7285. data[7] = value;
  7286. }
  7287. // Use source `ary` if it's smaller.
  7288. if (srcBitmask & WRAP_ARY_FLAG) {
  7289. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7290. }
  7291. // Use source `arity` if one is not provided.
  7292. if (data[9] == null) {
  7293. data[9] = source[9];
  7294. }
  7295. // Use source `func` and merge bitmasks.
  7296. data[0] = source[0];
  7297. data[1] = newBitmask;
  7298. return data;
  7299. }
  7300. /**
  7301. * This function is like
  7302. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7303. * except that it includes inherited enumerable properties.
  7304. *
  7305. * @private
  7306. * @param {Object} object The object to query.
  7307. * @returns {Array} Returns the array of property names.
  7308. */
  7309. function nativeKeysIn(object) {
  7310. var result = [];
  7311. if (object != null) {
  7312. for (var key in Object(object)) {
  7313. result.push(key);
  7314. }
  7315. }
  7316. return result;
  7317. }
  7318. /**
  7319. * Converts `value` to a string using `Object.prototype.toString`.
  7320. *
  7321. * @private
  7322. * @param {*} value The value to convert.
  7323. * @returns {string} Returns the converted string.
  7324. */
  7325. function objectToString(value) {
  7326. return nativeObjectToString.call(value);
  7327. }
  7328. /**
  7329. * A specialized version of `baseRest` which transforms the rest array.
  7330. *
  7331. * @private
  7332. * @param {Function} func The function to apply a rest parameter to.
  7333. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7334. * @param {Function} transform The rest array transform.
  7335. * @returns {Function} Returns the new function.
  7336. */
  7337. function overRest(func, start, transform) {
  7338. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7339. return function() {
  7340. var args = arguments,
  7341. index = -1,
  7342. length = nativeMax(args.length - start, 0),
  7343. array = Array(length);
  7344. while (++index < length) {
  7345. array[index] = args[start + index];
  7346. }
  7347. index = -1;
  7348. var otherArgs = Array(start + 1);
  7349. while (++index < start) {
  7350. otherArgs[index] = args[index];
  7351. }
  7352. otherArgs[start] = transform(array);
  7353. return apply(func, this, otherArgs);
  7354. };
  7355. }
  7356. /**
  7357. * Gets the parent value at `path` of `object`.
  7358. *
  7359. * @private
  7360. * @param {Object} object The object to query.
  7361. * @param {Array} path The path to get the parent value of.
  7362. * @returns {*} Returns the parent value.
  7363. */
  7364. function parent(object, path) {
  7365. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7366. }
  7367. /**
  7368. * Reorder `array` according to the specified indexes where the element at
  7369. * the first index is assigned as the first element, the element at
  7370. * the second index is assigned as the second element, and so on.
  7371. *
  7372. * @private
  7373. * @param {Array} array The array to reorder.
  7374. * @param {Array} indexes The arranged array indexes.
  7375. * @returns {Array} Returns `array`.
  7376. */
  7377. function reorder(array, indexes) {
  7378. var arrLength = array.length,
  7379. length = nativeMin(indexes.length, arrLength),
  7380. oldArray = copyArray(array);
  7381. while (length--) {
  7382. var index = indexes[length];
  7383. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7384. }
  7385. return array;
  7386. }
  7387. /**
  7388. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7389. *
  7390. * @private
  7391. * @param {Object} object The object to query.
  7392. * @param {string} key The key of the property to get.
  7393. * @returns {*} Returns the property value.
  7394. */
  7395. function safeGet(object, key) {
  7396. if (key === 'constructor' && typeof object[key] === 'function') {
  7397. return;
  7398. }
  7399. if (key == '__proto__') {
  7400. return;
  7401. }
  7402. return object[key];
  7403. }
  7404. /**
  7405. * Sets metadata for `func`.
  7406. *
  7407. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7408. * period of time, it will trip its breaker and transition to an identity
  7409. * function to avoid garbage collection pauses in V8. See
  7410. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7411. * for more details.
  7412. *
  7413. * @private
  7414. * @param {Function} func The function to associate metadata with.
  7415. * @param {*} data The metadata.
  7416. * @returns {Function} Returns `func`.
  7417. */
  7418. var setData = shortOut(baseSetData);
  7419. /**
  7420. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7421. *
  7422. * @private
  7423. * @param {Function} func The function to delay.
  7424. * @param {number} wait The number of milliseconds to delay invocation.
  7425. * @returns {number|Object} Returns the timer id or timeout object.
  7426. */
  7427. var setTimeout = ctxSetTimeout || function(func, wait) {
  7428. return root.setTimeout(func, wait);
  7429. };
  7430. /**
  7431. * Sets the `toString` method of `func` to return `string`.
  7432. *
  7433. * @private
  7434. * @param {Function} func The function to modify.
  7435. * @param {Function} string The `toString` result.
  7436. * @returns {Function} Returns `func`.
  7437. */
  7438. var setToString = shortOut(baseSetToString);
  7439. /**
  7440. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7441. * with wrapper details in a comment at the top of the source body.
  7442. *
  7443. * @private
  7444. * @param {Function} wrapper The function to modify.
  7445. * @param {Function} reference The reference function.
  7446. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7447. * @returns {Function} Returns `wrapper`.
  7448. */
  7449. function setWrapToString(wrapper, reference, bitmask) {
  7450. var source = (reference + '');
  7451. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7452. }
  7453. /**
  7454. * Creates a function that'll short out and invoke `identity` instead
  7455. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7456. * milliseconds.
  7457. *
  7458. * @private
  7459. * @param {Function} func The function to restrict.
  7460. * @returns {Function} Returns the new shortable function.
  7461. */
  7462. function shortOut(func) {
  7463. var count = 0,
  7464. lastCalled = 0;
  7465. return function() {
  7466. var stamp = nativeNow(),
  7467. remaining = HOT_SPAN - (stamp - lastCalled);
  7468. lastCalled = stamp;
  7469. if (remaining > 0) {
  7470. if (++count >= HOT_COUNT) {
  7471. return arguments[0];
  7472. }
  7473. } else {
  7474. count = 0;
  7475. }
  7476. return func.apply(undefined, arguments);
  7477. };
  7478. }
  7479. /**
  7480. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7481. *
  7482. * @private
  7483. * @param {Array} array The array to shuffle.
  7484. * @param {number} [size=array.length] The size of `array`.
  7485. * @returns {Array} Returns `array`.
  7486. */
  7487. function shuffleSelf(array, size) {
  7488. var index = -1,
  7489. length = array.length,
  7490. lastIndex = length - 1;
  7491. size = size === undefined ? length : size;
  7492. while (++index < size) {
  7493. var rand = baseRandom(index, lastIndex),
  7494. value = array[rand];
  7495. array[rand] = array[index];
  7496. array[index] = value;
  7497. }
  7498. array.length = size;
  7499. return array;
  7500. }
  7501. /**
  7502. * Converts `string` to a property path array.
  7503. *
  7504. * @private
  7505. * @param {string} string The string to convert.
  7506. * @returns {Array} Returns the property path array.
  7507. */
  7508. var stringToPath = memoizeCapped(function(string) {
  7509. var result = [];
  7510. if (string.charCodeAt(0) === 46 /* . */) {
  7511. result.push('');
  7512. }
  7513. string.replace(rePropName, function(match, number, quote, subString) {
  7514. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7515. });
  7516. return result;
  7517. });
  7518. /**
  7519. * Converts `value` to a string key if it's not a string or symbol.
  7520. *
  7521. * @private
  7522. * @param {*} value The value to inspect.
  7523. * @returns {string|symbol} Returns the key.
  7524. */
  7525. function toKey(value) {
  7526. if (typeof value == 'string' || isSymbol(value)) {
  7527. return value;
  7528. }
  7529. var result = (value + '');
  7530. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7531. }
  7532. /**
  7533. * Converts `func` to its source code.
  7534. *
  7535. * @private
  7536. * @param {Function} func The function to convert.
  7537. * @returns {string} Returns the source code.
  7538. */
  7539. function toSource(func) {
  7540. if (func != null) {
  7541. try {
  7542. return funcToString.call(func);
  7543. } catch (e) {}
  7544. try {
  7545. return (func + '');
  7546. } catch (e) {}
  7547. }
  7548. return '';
  7549. }
  7550. /**
  7551. * Updates wrapper `details` based on `bitmask` flags.
  7552. *
  7553. * @private
  7554. * @returns {Array} details The details to modify.
  7555. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7556. * @returns {Array} Returns `details`.
  7557. */
  7558. function updateWrapDetails(details, bitmask) {
  7559. arrayEach(wrapFlags, function(pair) {
  7560. var value = '_.' + pair[0];
  7561. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7562. details.push(value);
  7563. }
  7564. });
  7565. return details.sort();
  7566. }
  7567. /**
  7568. * Creates a clone of `wrapper`.
  7569. *
  7570. * @private
  7571. * @param {Object} wrapper The wrapper to clone.
  7572. * @returns {Object} Returns the cloned wrapper.
  7573. */
  7574. function wrapperClone(wrapper) {
  7575. if (wrapper instanceof LazyWrapper) {
  7576. return wrapper.clone();
  7577. }
  7578. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7579. result.__actions__ = copyArray(wrapper.__actions__);
  7580. result.__index__ = wrapper.__index__;
  7581. result.__values__ = wrapper.__values__;
  7582. return result;
  7583. }
  7584. /*------------------------------------------------------------------------*/
  7585. /**
  7586. * Creates an array of elements split into groups the length of `size`.
  7587. * If `array` can't be split evenly, the final chunk will be the remaining
  7588. * elements.
  7589. *
  7590. * @static
  7591. * @memberOf _
  7592. * @since 3.0.0
  7593. * @category Array
  7594. * @param {Array} array The array to process.
  7595. * @param {number} [size=1] The length of each chunk
  7596. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7597. * @returns {Array} Returns the new array of chunks.
  7598. * @example
  7599. *
  7600. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7601. * // => [['a', 'b'], ['c', 'd']]
  7602. *
  7603. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7604. * // => [['a', 'b', 'c'], ['d']]
  7605. */
  7606. function chunk(array, size, guard) {
  7607. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7608. size = 1;
  7609. } else {
  7610. size = nativeMax(toInteger(size), 0);
  7611. }
  7612. var length = array == null ? 0 : array.length;
  7613. if (!length || size < 1) {
  7614. return [];
  7615. }
  7616. var index = 0,
  7617. resIndex = 0,
  7618. result = Array(nativeCeil(length / size));
  7619. while (index < length) {
  7620. result[resIndex++] = baseSlice(array, index, (index += size));
  7621. }
  7622. return result;
  7623. }
  7624. /**
  7625. * Creates an array with all falsey values removed. The values `false`, `null`,
  7626. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7627. *
  7628. * @static
  7629. * @memberOf _
  7630. * @since 0.1.0
  7631. * @category Array
  7632. * @param {Array} array The array to compact.
  7633. * @returns {Array} Returns the new array of filtered values.
  7634. * @example
  7635. *
  7636. * _.compact([0, 1, false, 2, '', 3]);
  7637. * // => [1, 2, 3]
  7638. */
  7639. function compact(array) {
  7640. var index = -1,
  7641. length = array == null ? 0 : array.length,
  7642. resIndex = 0,
  7643. result = [];
  7644. while (++index < length) {
  7645. var value = array[index];
  7646. if (value) {
  7647. result[resIndex++] = value;
  7648. }
  7649. }
  7650. return result;
  7651. }
  7652. /**
  7653. * Creates a new array concatenating `array` with any additional arrays
  7654. * and/or values.
  7655. *
  7656. * @static
  7657. * @memberOf _
  7658. * @since 4.0.0
  7659. * @category Array
  7660. * @param {Array} array The array to concatenate.
  7661. * @param {...*} [values] The values to concatenate.
  7662. * @returns {Array} Returns the new concatenated array.
  7663. * @example
  7664. *
  7665. * var array = [1];
  7666. * var other = _.concat(array, 2, [3], [[4]]);
  7667. *
  7668. * console.log(other);
  7669. * // => [1, 2, 3, [4]]
  7670. *
  7671. * console.log(array);
  7672. * // => [1]
  7673. */
  7674. function concat() {
  7675. var length = arguments.length;
  7676. if (!length) {
  7677. return [];
  7678. }
  7679. var args = Array(length - 1),
  7680. array = arguments[0],
  7681. index = length;
  7682. while (index--) {
  7683. args[index - 1] = arguments[index];
  7684. }
  7685. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7686. }
  7687. /**
  7688. * Creates an array of `array` values not included in the other given arrays
  7689. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7690. * for equality comparisons. The order and references of result values are
  7691. * determined by the first array.
  7692. *
  7693. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7694. *
  7695. * @static
  7696. * @memberOf _
  7697. * @since 0.1.0
  7698. * @category Array
  7699. * @param {Array} array The array to inspect.
  7700. * @param {...Array} [values] The values to exclude.
  7701. * @returns {Array} Returns the new array of filtered values.
  7702. * @see _.without, _.xor
  7703. * @example
  7704. *
  7705. * _.difference([2, 1], [2, 3]);
  7706. * // => [1]
  7707. */
  7708. var difference = baseRest(function(array, values) {
  7709. return isArrayLikeObject(array)
  7710. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7711. : [];
  7712. });
  7713. /**
  7714. * This method is like `_.difference` except that it accepts `iteratee` which
  7715. * is invoked for each element of `array` and `values` to generate the criterion
  7716. * by which they're compared. The order and references of result values are
  7717. * determined by the first array. The iteratee is invoked with one argument:
  7718. * (value).
  7719. *
  7720. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7721. *
  7722. * @static
  7723. * @memberOf _
  7724. * @since 4.0.0
  7725. * @category Array
  7726. * @param {Array} array The array to inspect.
  7727. * @param {...Array} [values] The values to exclude.
  7728. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7729. * @returns {Array} Returns the new array of filtered values.
  7730. * @example
  7731. *
  7732. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7733. * // => [1.2]
  7734. *
  7735. * // The `_.property` iteratee shorthand.
  7736. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7737. * // => [{ 'x': 2 }]
  7738. */
  7739. var differenceBy = baseRest(function(array, values) {
  7740. var iteratee = last(values);
  7741. if (isArrayLikeObject(iteratee)) {
  7742. iteratee = undefined;
  7743. }
  7744. return isArrayLikeObject(array)
  7745. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7746. : [];
  7747. });
  7748. /**
  7749. * This method is like `_.difference` except that it accepts `comparator`
  7750. * which is invoked to compare elements of `array` to `values`. The order and
  7751. * references of result values are determined by the first array. The comparator
  7752. * is invoked with two arguments: (arrVal, othVal).
  7753. *
  7754. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7755. *
  7756. * @static
  7757. * @memberOf _
  7758. * @since 4.0.0
  7759. * @category Array
  7760. * @param {Array} array The array to inspect.
  7761. * @param {...Array} [values] The values to exclude.
  7762. * @param {Function} [comparator] The comparator invoked per element.
  7763. * @returns {Array} Returns the new array of filtered values.
  7764. * @example
  7765. *
  7766. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7767. *
  7768. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7769. * // => [{ 'x': 2, 'y': 1 }]
  7770. */
  7771. var differenceWith = baseRest(function(array, values) {
  7772. var comparator = last(values);
  7773. if (isArrayLikeObject(comparator)) {
  7774. comparator = undefined;
  7775. }
  7776. return isArrayLikeObject(array)
  7777. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7778. : [];
  7779. });
  7780. /**
  7781. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7782. *
  7783. * @static
  7784. * @memberOf _
  7785. * @since 0.5.0
  7786. * @category Array
  7787. * @param {Array} array The array to query.
  7788. * @param {number} [n=1] The number of elements to drop.
  7789. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7790. * @returns {Array} Returns the slice of `array`.
  7791. * @example
  7792. *
  7793. * _.drop([1, 2, 3]);
  7794. * // => [2, 3]
  7795. *
  7796. * _.drop([1, 2, 3], 2);
  7797. * // => [3]
  7798. *
  7799. * _.drop([1, 2, 3], 5);
  7800. * // => []
  7801. *
  7802. * _.drop([1, 2, 3], 0);
  7803. * // => [1, 2, 3]
  7804. */
  7805. function drop(array, n, guard) {
  7806. var length = array == null ? 0 : array.length;
  7807. if (!length) {
  7808. return [];
  7809. }
  7810. n = (guard || n === undefined) ? 1 : toInteger(n);
  7811. return baseSlice(array, n < 0 ? 0 : n, length);
  7812. }
  7813. /**
  7814. * Creates a slice of `array` with `n` elements dropped from the end.
  7815. *
  7816. * @static
  7817. * @memberOf _
  7818. * @since 3.0.0
  7819. * @category Array
  7820. * @param {Array} array The array to query.
  7821. * @param {number} [n=1] The number of elements to drop.
  7822. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7823. * @returns {Array} Returns the slice of `array`.
  7824. * @example
  7825. *
  7826. * _.dropRight([1, 2, 3]);
  7827. * // => [1, 2]
  7828. *
  7829. * _.dropRight([1, 2, 3], 2);
  7830. * // => [1]
  7831. *
  7832. * _.dropRight([1, 2, 3], 5);
  7833. * // => []
  7834. *
  7835. * _.dropRight([1, 2, 3], 0);
  7836. * // => [1, 2, 3]
  7837. */
  7838. function dropRight(array, n, guard) {
  7839. var length = array == null ? 0 : array.length;
  7840. if (!length) {
  7841. return [];
  7842. }
  7843. n = (guard || n === undefined) ? 1 : toInteger(n);
  7844. n = length - n;
  7845. return baseSlice(array, 0, n < 0 ? 0 : n);
  7846. }
  7847. /**
  7848. * Creates a slice of `array` excluding elements dropped from the end.
  7849. * Elements are dropped until `predicate` returns falsey. The predicate is
  7850. * invoked with three arguments: (value, index, array).
  7851. *
  7852. * @static
  7853. * @memberOf _
  7854. * @since 3.0.0
  7855. * @category Array
  7856. * @param {Array} array The array to query.
  7857. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7858. * @returns {Array} Returns the slice of `array`.
  7859. * @example
  7860. *
  7861. * var users = [
  7862. * { 'user': 'barney', 'active': true },
  7863. * { 'user': 'fred', 'active': false },
  7864. * { 'user': 'pebbles', 'active': false }
  7865. * ];
  7866. *
  7867. * _.dropRightWhile(users, function(o) { return !o.active; });
  7868. * // => objects for ['barney']
  7869. *
  7870. * // The `_.matches` iteratee shorthand.
  7871. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7872. * // => objects for ['barney', 'fred']
  7873. *
  7874. * // The `_.matchesProperty` iteratee shorthand.
  7875. * _.dropRightWhile(users, ['active', false]);
  7876. * // => objects for ['barney']
  7877. *
  7878. * // The `_.property` iteratee shorthand.
  7879. * _.dropRightWhile(users, 'active');
  7880. * // => objects for ['barney', 'fred', 'pebbles']
  7881. */
  7882. function dropRightWhile(array, predicate) {
  7883. return (array && array.length)
  7884. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7885. : [];
  7886. }
  7887. /**
  7888. * Creates a slice of `array` excluding elements dropped from the beginning.
  7889. * Elements are dropped until `predicate` returns falsey. The predicate is
  7890. * invoked with three arguments: (value, index, array).
  7891. *
  7892. * @static
  7893. * @memberOf _
  7894. * @since 3.0.0
  7895. * @category Array
  7896. * @param {Array} array The array to query.
  7897. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7898. * @returns {Array} Returns the slice of `array`.
  7899. * @example
  7900. *
  7901. * var users = [
  7902. * { 'user': 'barney', 'active': false },
  7903. * { 'user': 'fred', 'active': false },
  7904. * { 'user': 'pebbles', 'active': true }
  7905. * ];
  7906. *
  7907. * _.dropWhile(users, function(o) { return !o.active; });
  7908. * // => objects for ['pebbles']
  7909. *
  7910. * // The `_.matches` iteratee shorthand.
  7911. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7912. * // => objects for ['fred', 'pebbles']
  7913. *
  7914. * // The `_.matchesProperty` iteratee shorthand.
  7915. * _.dropWhile(users, ['active', false]);
  7916. * // => objects for ['pebbles']
  7917. *
  7918. * // The `_.property` iteratee shorthand.
  7919. * _.dropWhile(users, 'active');
  7920. * // => objects for ['barney', 'fred', 'pebbles']
  7921. */
  7922. function dropWhile(array, predicate) {
  7923. return (array && array.length)
  7924. ? baseWhile(array, getIteratee(predicate, 3), true)
  7925. : [];
  7926. }
  7927. /**
  7928. * Fills elements of `array` with `value` from `start` up to, but not
  7929. * including, `end`.
  7930. *
  7931. * **Note:** This method mutates `array`.
  7932. *
  7933. * @static
  7934. * @memberOf _
  7935. * @since 3.2.0
  7936. * @category Array
  7937. * @param {Array} array The array to fill.
  7938. * @param {*} value The value to fill `array` with.
  7939. * @param {number} [start=0] The start position.
  7940. * @param {number} [end=array.length] The end position.
  7941. * @returns {Array} Returns `array`.
  7942. * @example
  7943. *
  7944. * var array = [1, 2, 3];
  7945. *
  7946. * _.fill(array, 'a');
  7947. * console.log(array);
  7948. * // => ['a', 'a', 'a']
  7949. *
  7950. * _.fill(Array(3), 2);
  7951. * // => [2, 2, 2]
  7952. *
  7953. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7954. * // => [4, '*', '*', 10]
  7955. */
  7956. function fill(array, value, start, end) {
  7957. var length = array == null ? 0 : array.length;
  7958. if (!length) {
  7959. return [];
  7960. }
  7961. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7962. start = 0;
  7963. end = length;
  7964. }
  7965. return baseFill(array, value, start, end);
  7966. }
  7967. /**
  7968. * This method is like `_.find` except that it returns the index of the first
  7969. * element `predicate` returns truthy for instead of the element itself.
  7970. *
  7971. * @static
  7972. * @memberOf _
  7973. * @since 1.1.0
  7974. * @category Array
  7975. * @param {Array} array The array to inspect.
  7976. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7977. * @param {number} [fromIndex=0] The index to search from.
  7978. * @returns {number} Returns the index of the found element, else `-1`.
  7979. * @example
  7980. *
  7981. * var users = [
  7982. * { 'user': 'barney', 'active': false },
  7983. * { 'user': 'fred', 'active': false },
  7984. * { 'user': 'pebbles', 'active': true }
  7985. * ];
  7986. *
  7987. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7988. * // => 0
  7989. *
  7990. * // The `_.matches` iteratee shorthand.
  7991. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7992. * // => 1
  7993. *
  7994. * // The `_.matchesProperty` iteratee shorthand.
  7995. * _.findIndex(users, ['active', false]);
  7996. * // => 0
  7997. *
  7998. * // The `_.property` iteratee shorthand.
  7999. * _.findIndex(users, 'active');
  8000. * // => 2
  8001. */
  8002. function findIndex(array, predicate, fromIndex) {
  8003. var length = array == null ? 0 : array.length;
  8004. if (!length) {
  8005. return -1;
  8006. }
  8007. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8008. if (index < 0) {
  8009. index = nativeMax(length + index, 0);
  8010. }
  8011. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8012. }
  8013. /**
  8014. * This method is like `_.findIndex` except that it iterates over elements
  8015. * of `collection` from right to left.
  8016. *
  8017. * @static
  8018. * @memberOf _
  8019. * @since 2.0.0
  8020. * @category Array
  8021. * @param {Array} array The array to inspect.
  8022. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8023. * @param {number} [fromIndex=array.length-1] The index to search from.
  8024. * @returns {number} Returns the index of the found element, else `-1`.
  8025. * @example
  8026. *
  8027. * var users = [
  8028. * { 'user': 'barney', 'active': true },
  8029. * { 'user': 'fred', 'active': false },
  8030. * { 'user': 'pebbles', 'active': false }
  8031. * ];
  8032. *
  8033. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8034. * // => 2
  8035. *
  8036. * // The `_.matches` iteratee shorthand.
  8037. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8038. * // => 0
  8039. *
  8040. * // The `_.matchesProperty` iteratee shorthand.
  8041. * _.findLastIndex(users, ['active', false]);
  8042. * // => 2
  8043. *
  8044. * // The `_.property` iteratee shorthand.
  8045. * _.findLastIndex(users, 'active');
  8046. * // => 0
  8047. */
  8048. function findLastIndex(array, predicate, fromIndex) {
  8049. var length = array == null ? 0 : array.length;
  8050. if (!length) {
  8051. return -1;
  8052. }
  8053. var index = length - 1;
  8054. if (fromIndex !== undefined) {
  8055. index = toInteger(fromIndex);
  8056. index = fromIndex < 0
  8057. ? nativeMax(length + index, 0)
  8058. : nativeMin(index, length - 1);
  8059. }
  8060. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8061. }
  8062. /**
  8063. * Flattens `array` a single level deep.
  8064. *
  8065. * @static
  8066. * @memberOf _
  8067. * @since 0.1.0
  8068. * @category Array
  8069. * @param {Array} array The array to flatten.
  8070. * @returns {Array} Returns the new flattened array.
  8071. * @example
  8072. *
  8073. * _.flatten([1, [2, [3, [4]], 5]]);
  8074. * // => [1, 2, [3, [4]], 5]
  8075. */
  8076. function flatten(array) {
  8077. var length = array == null ? 0 : array.length;
  8078. return length ? baseFlatten(array, 1) : [];
  8079. }
  8080. /**
  8081. * Recursively flattens `array`.
  8082. *
  8083. * @static
  8084. * @memberOf _
  8085. * @since 3.0.0
  8086. * @category Array
  8087. * @param {Array} array The array to flatten.
  8088. * @returns {Array} Returns the new flattened array.
  8089. * @example
  8090. *
  8091. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8092. * // => [1, 2, 3, 4, 5]
  8093. */
  8094. function flattenDeep(array) {
  8095. var length = array == null ? 0 : array.length;
  8096. return length ? baseFlatten(array, INFINITY) : [];
  8097. }
  8098. /**
  8099. * Recursively flatten `array` up to `depth` times.
  8100. *
  8101. * @static
  8102. * @memberOf _
  8103. * @since 4.4.0
  8104. * @category Array
  8105. * @param {Array} array The array to flatten.
  8106. * @param {number} [depth=1] The maximum recursion depth.
  8107. * @returns {Array} Returns the new flattened array.
  8108. * @example
  8109. *
  8110. * var array = [1, [2, [3, [4]], 5]];
  8111. *
  8112. * _.flattenDepth(array, 1);
  8113. * // => [1, 2, [3, [4]], 5]
  8114. *
  8115. * _.flattenDepth(array, 2);
  8116. * // => [1, 2, 3, [4], 5]
  8117. */
  8118. function flattenDepth(array, depth) {
  8119. var length = array == null ? 0 : array.length;
  8120. if (!length) {
  8121. return [];
  8122. }
  8123. depth = depth === undefined ? 1 : toInteger(depth);
  8124. return baseFlatten(array, depth);
  8125. }
  8126. /**
  8127. * The inverse of `_.toPairs`; this method returns an object composed
  8128. * from key-value `pairs`.
  8129. *
  8130. * @static
  8131. * @memberOf _
  8132. * @since 4.0.0
  8133. * @category Array
  8134. * @param {Array} pairs The key-value pairs.
  8135. * @returns {Object} Returns the new object.
  8136. * @example
  8137. *
  8138. * _.fromPairs([['a', 1], ['b', 2]]);
  8139. * // => { 'a': 1, 'b': 2 }
  8140. */
  8141. function fromPairs(pairs) {
  8142. var index = -1,
  8143. length = pairs == null ? 0 : pairs.length,
  8144. result = {};
  8145. while (++index < length) {
  8146. var pair = pairs[index];
  8147. result[pair[0]] = pair[1];
  8148. }
  8149. return result;
  8150. }
  8151. /**
  8152. * Gets the first element of `array`.
  8153. *
  8154. * @static
  8155. * @memberOf _
  8156. * @since 0.1.0
  8157. * @alias first
  8158. * @category Array
  8159. * @param {Array} array The array to query.
  8160. * @returns {*} Returns the first element of `array`.
  8161. * @example
  8162. *
  8163. * _.head([1, 2, 3]);
  8164. * // => 1
  8165. *
  8166. * _.head([]);
  8167. * // => undefined
  8168. */
  8169. function head(array) {
  8170. return (array && array.length) ? array[0] : undefined;
  8171. }
  8172. /**
  8173. * Gets the index at which the first occurrence of `value` is found in `array`
  8174. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8175. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8176. * offset from the end of `array`.
  8177. *
  8178. * @static
  8179. * @memberOf _
  8180. * @since 0.1.0
  8181. * @category Array
  8182. * @param {Array} array The array to inspect.
  8183. * @param {*} value The value to search for.
  8184. * @param {number} [fromIndex=0] The index to search from.
  8185. * @returns {number} Returns the index of the matched value, else `-1`.
  8186. * @example
  8187. *
  8188. * _.indexOf([1, 2, 1, 2], 2);
  8189. * // => 1
  8190. *
  8191. * // Search from the `fromIndex`.
  8192. * _.indexOf([1, 2, 1, 2], 2, 2);
  8193. * // => 3
  8194. */
  8195. function indexOf(array, value, fromIndex) {
  8196. var length = array == null ? 0 : array.length;
  8197. if (!length) {
  8198. return -1;
  8199. }
  8200. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8201. if (index < 0) {
  8202. index = nativeMax(length + index, 0);
  8203. }
  8204. return baseIndexOf(array, value, index);
  8205. }
  8206. /**
  8207. * Gets all but the last element of `array`.
  8208. *
  8209. * @static
  8210. * @memberOf _
  8211. * @since 0.1.0
  8212. * @category Array
  8213. * @param {Array} array The array to query.
  8214. * @returns {Array} Returns the slice of `array`.
  8215. * @example
  8216. *
  8217. * _.initial([1, 2, 3]);
  8218. * // => [1, 2]
  8219. */
  8220. function initial(array) {
  8221. var length = array == null ? 0 : array.length;
  8222. return length ? baseSlice(array, 0, -1) : [];
  8223. }
  8224. /**
  8225. * Creates an array of unique values that are included in all given arrays
  8226. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8227. * for equality comparisons. The order and references of result values are
  8228. * determined by the first array.
  8229. *
  8230. * @static
  8231. * @memberOf _
  8232. * @since 0.1.0
  8233. * @category Array
  8234. * @param {...Array} [arrays] The arrays to inspect.
  8235. * @returns {Array} Returns the new array of intersecting values.
  8236. * @example
  8237. *
  8238. * _.intersection([2, 1], [2, 3]);
  8239. * // => [2]
  8240. */
  8241. var intersection = baseRest(function(arrays) {
  8242. var mapped = arrayMap(arrays, castArrayLikeObject);
  8243. return (mapped.length && mapped[0] === arrays[0])
  8244. ? baseIntersection(mapped)
  8245. : [];
  8246. });
  8247. /**
  8248. * This method is like `_.intersection` except that it accepts `iteratee`
  8249. * which is invoked for each element of each `arrays` to generate the criterion
  8250. * by which they're compared. The order and references of result values are
  8251. * determined by the first array. The iteratee is invoked with one argument:
  8252. * (value).
  8253. *
  8254. * @static
  8255. * @memberOf _
  8256. * @since 4.0.0
  8257. * @category Array
  8258. * @param {...Array} [arrays] The arrays to inspect.
  8259. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8260. * @returns {Array} Returns the new array of intersecting values.
  8261. * @example
  8262. *
  8263. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8264. * // => [2.1]
  8265. *
  8266. * // The `_.property` iteratee shorthand.
  8267. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8268. * // => [{ 'x': 1 }]
  8269. */
  8270. var intersectionBy = baseRest(function(arrays) {
  8271. var iteratee = last(arrays),
  8272. mapped = arrayMap(arrays, castArrayLikeObject);
  8273. if (iteratee === last(mapped)) {
  8274. iteratee = undefined;
  8275. } else {
  8276. mapped.pop();
  8277. }
  8278. return (mapped.length && mapped[0] === arrays[0])
  8279. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8280. : [];
  8281. });
  8282. /**
  8283. * This method is like `_.intersection` except that it accepts `comparator`
  8284. * which is invoked to compare elements of `arrays`. The order and references
  8285. * of result values are determined by the first array. The comparator is
  8286. * invoked with two arguments: (arrVal, othVal).
  8287. *
  8288. * @static
  8289. * @memberOf _
  8290. * @since 4.0.0
  8291. * @category Array
  8292. * @param {...Array} [arrays] The arrays to inspect.
  8293. * @param {Function} [comparator] The comparator invoked per element.
  8294. * @returns {Array} Returns the new array of intersecting values.
  8295. * @example
  8296. *
  8297. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8298. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8299. *
  8300. * _.intersectionWith(objects, others, _.isEqual);
  8301. * // => [{ 'x': 1, 'y': 2 }]
  8302. */
  8303. var intersectionWith = baseRest(function(arrays) {
  8304. var comparator = last(arrays),
  8305. mapped = arrayMap(arrays, castArrayLikeObject);
  8306. comparator = typeof comparator == 'function' ? comparator : undefined;
  8307. if (comparator) {
  8308. mapped.pop();
  8309. }
  8310. return (mapped.length && mapped[0] === arrays[0])
  8311. ? baseIntersection(mapped, undefined, comparator)
  8312. : [];
  8313. });
  8314. /**
  8315. * Converts all elements in `array` into a string separated by `separator`.
  8316. *
  8317. * @static
  8318. * @memberOf _
  8319. * @since 4.0.0
  8320. * @category Array
  8321. * @param {Array} array The array to convert.
  8322. * @param {string} [separator=','] The element separator.
  8323. * @returns {string} Returns the joined string.
  8324. * @example
  8325. *
  8326. * _.join(['a', 'b', 'c'], '~');
  8327. * // => 'a~b~c'
  8328. */
  8329. function join(array, separator) {
  8330. return array == null ? '' : nativeJoin.call(array, separator);
  8331. }
  8332. /**
  8333. * Gets the last element of `array`.
  8334. *
  8335. * @static
  8336. * @memberOf _
  8337. * @since 0.1.0
  8338. * @category Array
  8339. * @param {Array} array The array to query.
  8340. * @returns {*} Returns the last element of `array`.
  8341. * @example
  8342. *
  8343. * _.last([1, 2, 3]);
  8344. * // => 3
  8345. */
  8346. function last(array) {
  8347. var length = array == null ? 0 : array.length;
  8348. return length ? array[length - 1] : undefined;
  8349. }
  8350. /**
  8351. * This method is like `_.indexOf` except that it iterates over elements of
  8352. * `array` from right to left.
  8353. *
  8354. * @static
  8355. * @memberOf _
  8356. * @since 0.1.0
  8357. * @category Array
  8358. * @param {Array} array The array to inspect.
  8359. * @param {*} value The value to search for.
  8360. * @param {number} [fromIndex=array.length-1] The index to search from.
  8361. * @returns {number} Returns the index of the matched value, else `-1`.
  8362. * @example
  8363. *
  8364. * _.lastIndexOf([1, 2, 1, 2], 2);
  8365. * // => 3
  8366. *
  8367. * // Search from the `fromIndex`.
  8368. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8369. * // => 1
  8370. */
  8371. function lastIndexOf(array, value, fromIndex) {
  8372. var length = array == null ? 0 : array.length;
  8373. if (!length) {
  8374. return -1;
  8375. }
  8376. var index = length;
  8377. if (fromIndex !== undefined) {
  8378. index = toInteger(fromIndex);
  8379. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8380. }
  8381. return value === value
  8382. ? strictLastIndexOf(array, value, index)
  8383. : baseFindIndex(array, baseIsNaN, index, true);
  8384. }
  8385. /**
  8386. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8387. * element from the end is returned.
  8388. *
  8389. * @static
  8390. * @memberOf _
  8391. * @since 4.11.0
  8392. * @category Array
  8393. * @param {Array} array The array to query.
  8394. * @param {number} [n=0] The index of the element to return.
  8395. * @returns {*} Returns the nth element of `array`.
  8396. * @example
  8397. *
  8398. * var array = ['a', 'b', 'c', 'd'];
  8399. *
  8400. * _.nth(array, 1);
  8401. * // => 'b'
  8402. *
  8403. * _.nth(array, -2);
  8404. * // => 'c';
  8405. */
  8406. function nth(array, n) {
  8407. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8408. }
  8409. /**
  8410. * Removes all given values from `array` using
  8411. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8412. * for equality comparisons.
  8413. *
  8414. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8415. * to remove elements from an array by predicate.
  8416. *
  8417. * @static
  8418. * @memberOf _
  8419. * @since 2.0.0
  8420. * @category Array
  8421. * @param {Array} array The array to modify.
  8422. * @param {...*} [values] The values to remove.
  8423. * @returns {Array} Returns `array`.
  8424. * @example
  8425. *
  8426. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8427. *
  8428. * _.pull(array, 'a', 'c');
  8429. * console.log(array);
  8430. * // => ['b', 'b']
  8431. */
  8432. var pull = baseRest(pullAll);
  8433. /**
  8434. * This method is like `_.pull` except that it accepts an array of values to remove.
  8435. *
  8436. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8437. *
  8438. * @static
  8439. * @memberOf _
  8440. * @since 4.0.0
  8441. * @category Array
  8442. * @param {Array} array The array to modify.
  8443. * @param {Array} values The values to remove.
  8444. * @returns {Array} Returns `array`.
  8445. * @example
  8446. *
  8447. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8448. *
  8449. * _.pullAll(array, ['a', 'c']);
  8450. * console.log(array);
  8451. * // => ['b', 'b']
  8452. */
  8453. function pullAll(array, values) {
  8454. return (array && array.length && values && values.length)
  8455. ? basePullAll(array, values)
  8456. : array;
  8457. }
  8458. /**
  8459. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8460. * invoked for each element of `array` and `values` to generate the criterion
  8461. * by which they're compared. The iteratee is invoked with one argument: (value).
  8462. *
  8463. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8464. *
  8465. * @static
  8466. * @memberOf _
  8467. * @since 4.0.0
  8468. * @category Array
  8469. * @param {Array} array The array to modify.
  8470. * @param {Array} values The values to remove.
  8471. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8472. * @returns {Array} Returns `array`.
  8473. * @example
  8474. *
  8475. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8476. *
  8477. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8478. * console.log(array);
  8479. * // => [{ 'x': 2 }]
  8480. */
  8481. function pullAllBy(array, values, iteratee) {
  8482. return (array && array.length && values && values.length)
  8483. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8484. : array;
  8485. }
  8486. /**
  8487. * This method is like `_.pullAll` except that it accepts `comparator` which
  8488. * is invoked to compare elements of `array` to `values`. The comparator is
  8489. * invoked with two arguments: (arrVal, othVal).
  8490. *
  8491. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8492. *
  8493. * @static
  8494. * @memberOf _
  8495. * @since 4.6.0
  8496. * @category Array
  8497. * @param {Array} array The array to modify.
  8498. * @param {Array} values The values to remove.
  8499. * @param {Function} [comparator] The comparator invoked per element.
  8500. * @returns {Array} Returns `array`.
  8501. * @example
  8502. *
  8503. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8504. *
  8505. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8506. * console.log(array);
  8507. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8508. */
  8509. function pullAllWith(array, values, comparator) {
  8510. return (array && array.length && values && values.length)
  8511. ? basePullAll(array, values, undefined, comparator)
  8512. : array;
  8513. }
  8514. /**
  8515. * Removes elements from `array` corresponding to `indexes` and returns an
  8516. * array of removed elements.
  8517. *
  8518. * **Note:** Unlike `_.at`, this method mutates `array`.
  8519. *
  8520. * @static
  8521. * @memberOf _
  8522. * @since 3.0.0
  8523. * @category Array
  8524. * @param {Array} array The array to modify.
  8525. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8526. * @returns {Array} Returns the new array of removed elements.
  8527. * @example
  8528. *
  8529. * var array = ['a', 'b', 'c', 'd'];
  8530. * var pulled = _.pullAt(array, [1, 3]);
  8531. *
  8532. * console.log(array);
  8533. * // => ['a', 'c']
  8534. *
  8535. * console.log(pulled);
  8536. * // => ['b', 'd']
  8537. */
  8538. var pullAt = flatRest(function(array, indexes) {
  8539. var length = array == null ? 0 : array.length,
  8540. result = baseAt(array, indexes);
  8541. basePullAt(array, arrayMap(indexes, function(index) {
  8542. return isIndex(index, length) ? +index : index;
  8543. }).sort(compareAscending));
  8544. return result;
  8545. });
  8546. /**
  8547. * Removes all elements from `array` that `predicate` returns truthy for
  8548. * and returns an array of the removed elements. The predicate is invoked
  8549. * with three arguments: (value, index, array).
  8550. *
  8551. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8552. * to pull elements from an array by value.
  8553. *
  8554. * @static
  8555. * @memberOf _
  8556. * @since 2.0.0
  8557. * @category Array
  8558. * @param {Array} array The array to modify.
  8559. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8560. * @returns {Array} Returns the new array of removed elements.
  8561. * @example
  8562. *
  8563. * var array = [1, 2, 3, 4];
  8564. * var evens = _.remove(array, function(n) {
  8565. * return n % 2 == 0;
  8566. * });
  8567. *
  8568. * console.log(array);
  8569. * // => [1, 3]
  8570. *
  8571. * console.log(evens);
  8572. * // => [2, 4]
  8573. */
  8574. function remove(array, predicate) {
  8575. var result = [];
  8576. if (!(array && array.length)) {
  8577. return result;
  8578. }
  8579. var index = -1,
  8580. indexes = [],
  8581. length = array.length;
  8582. predicate = getIteratee(predicate, 3);
  8583. while (++index < length) {
  8584. var value = array[index];
  8585. if (predicate(value, index, array)) {
  8586. result.push(value);
  8587. indexes.push(index);
  8588. }
  8589. }
  8590. basePullAt(array, indexes);
  8591. return result;
  8592. }
  8593. /**
  8594. * Reverses `array` so that the first element becomes the last, the second
  8595. * element becomes the second to last, and so on.
  8596. *
  8597. * **Note:** This method mutates `array` and is based on
  8598. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8599. *
  8600. * @static
  8601. * @memberOf _
  8602. * @since 4.0.0
  8603. * @category Array
  8604. * @param {Array} array The array to modify.
  8605. * @returns {Array} Returns `array`.
  8606. * @example
  8607. *
  8608. * var array = [1, 2, 3];
  8609. *
  8610. * _.reverse(array);
  8611. * // => [3, 2, 1]
  8612. *
  8613. * console.log(array);
  8614. * // => [3, 2, 1]
  8615. */
  8616. function reverse(array) {
  8617. return array == null ? array : nativeReverse.call(array);
  8618. }
  8619. /**
  8620. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8621. *
  8622. * **Note:** This method is used instead of
  8623. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8624. * returned.
  8625. *
  8626. * @static
  8627. * @memberOf _
  8628. * @since 3.0.0
  8629. * @category Array
  8630. * @param {Array} array The array to slice.
  8631. * @param {number} [start=0] The start position.
  8632. * @param {number} [end=array.length] The end position.
  8633. * @returns {Array} Returns the slice of `array`.
  8634. */
  8635. function slice(array, start, end) {
  8636. var length = array == null ? 0 : array.length;
  8637. if (!length) {
  8638. return [];
  8639. }
  8640. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8641. start = 0;
  8642. end = length;
  8643. }
  8644. else {
  8645. start = start == null ? 0 : toInteger(start);
  8646. end = end === undefined ? length : toInteger(end);
  8647. }
  8648. return baseSlice(array, start, end);
  8649. }
  8650. /**
  8651. * Uses a binary search to determine the lowest index at which `value`
  8652. * should be inserted into `array` in order to maintain its sort order.
  8653. *
  8654. * @static
  8655. * @memberOf _
  8656. * @since 0.1.0
  8657. * @category Array
  8658. * @param {Array} array The sorted array to inspect.
  8659. * @param {*} value The value to evaluate.
  8660. * @returns {number} Returns the index at which `value` should be inserted
  8661. * into `array`.
  8662. * @example
  8663. *
  8664. * _.sortedIndex([30, 50], 40);
  8665. * // => 1
  8666. */
  8667. function sortedIndex(array, value) {
  8668. return baseSortedIndex(array, value);
  8669. }
  8670. /**
  8671. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8672. * which is invoked for `value` and each element of `array` to compute their
  8673. * sort ranking. The iteratee is invoked with one argument: (value).
  8674. *
  8675. * @static
  8676. * @memberOf _
  8677. * @since 4.0.0
  8678. * @category Array
  8679. * @param {Array} array The sorted array to inspect.
  8680. * @param {*} value The value to evaluate.
  8681. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8682. * @returns {number} Returns the index at which `value` should be inserted
  8683. * into `array`.
  8684. * @example
  8685. *
  8686. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8687. *
  8688. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8689. * // => 0
  8690. *
  8691. * // The `_.property` iteratee shorthand.
  8692. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8693. * // => 0
  8694. */
  8695. function sortedIndexBy(array, value, iteratee) {
  8696. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8697. }
  8698. /**
  8699. * This method is like `_.indexOf` except that it performs a binary
  8700. * search on a sorted `array`.
  8701. *
  8702. * @static
  8703. * @memberOf _
  8704. * @since 4.0.0
  8705. * @category Array
  8706. * @param {Array} array The array to inspect.
  8707. * @param {*} value The value to search for.
  8708. * @returns {number} Returns the index of the matched value, else `-1`.
  8709. * @example
  8710. *
  8711. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8712. * // => 1
  8713. */
  8714. function sortedIndexOf(array, value) {
  8715. var length = array == null ? 0 : array.length;
  8716. if (length) {
  8717. var index = baseSortedIndex(array, value);
  8718. if (index < length && eq(array[index], value)) {
  8719. return index;
  8720. }
  8721. }
  8722. return -1;
  8723. }
  8724. /**
  8725. * This method is like `_.sortedIndex` except that it returns the highest
  8726. * index at which `value` should be inserted into `array` in order to
  8727. * maintain its sort order.
  8728. *
  8729. * @static
  8730. * @memberOf _
  8731. * @since 3.0.0
  8732. * @category Array
  8733. * @param {Array} array The sorted array to inspect.
  8734. * @param {*} value The value to evaluate.
  8735. * @returns {number} Returns the index at which `value` should be inserted
  8736. * into `array`.
  8737. * @example
  8738. *
  8739. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8740. * // => 4
  8741. */
  8742. function sortedLastIndex(array, value) {
  8743. return baseSortedIndex(array, value, true);
  8744. }
  8745. /**
  8746. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8747. * which is invoked for `value` and each element of `array` to compute their
  8748. * sort ranking. The iteratee is invoked with one argument: (value).
  8749. *
  8750. * @static
  8751. * @memberOf _
  8752. * @since 4.0.0
  8753. * @category Array
  8754. * @param {Array} array The sorted array to inspect.
  8755. * @param {*} value The value to evaluate.
  8756. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8757. * @returns {number} Returns the index at which `value` should be inserted
  8758. * into `array`.
  8759. * @example
  8760. *
  8761. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8762. *
  8763. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8764. * // => 1
  8765. *
  8766. * // The `_.property` iteratee shorthand.
  8767. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8768. * // => 1
  8769. */
  8770. function sortedLastIndexBy(array, value, iteratee) {
  8771. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8772. }
  8773. /**
  8774. * This method is like `_.lastIndexOf` except that it performs a binary
  8775. * search on a sorted `array`.
  8776. *
  8777. * @static
  8778. * @memberOf _
  8779. * @since 4.0.0
  8780. * @category Array
  8781. * @param {Array} array The array to inspect.
  8782. * @param {*} value The value to search for.
  8783. * @returns {number} Returns the index of the matched value, else `-1`.
  8784. * @example
  8785. *
  8786. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8787. * // => 3
  8788. */
  8789. function sortedLastIndexOf(array, value) {
  8790. var length = array == null ? 0 : array.length;
  8791. if (length) {
  8792. var index = baseSortedIndex(array, value, true) - 1;
  8793. if (eq(array[index], value)) {
  8794. return index;
  8795. }
  8796. }
  8797. return -1;
  8798. }
  8799. /**
  8800. * This method is like `_.uniq` except that it's designed and optimized
  8801. * for sorted arrays.
  8802. *
  8803. * @static
  8804. * @memberOf _
  8805. * @since 4.0.0
  8806. * @category Array
  8807. * @param {Array} array The array to inspect.
  8808. * @returns {Array} Returns the new duplicate free array.
  8809. * @example
  8810. *
  8811. * _.sortedUniq([1, 1, 2]);
  8812. * // => [1, 2]
  8813. */
  8814. function sortedUniq(array) {
  8815. return (array && array.length)
  8816. ? baseSortedUniq(array)
  8817. : [];
  8818. }
  8819. /**
  8820. * This method is like `_.uniqBy` except that it's designed and optimized
  8821. * for sorted arrays.
  8822. *
  8823. * @static
  8824. * @memberOf _
  8825. * @since 4.0.0
  8826. * @category Array
  8827. * @param {Array} array The array to inspect.
  8828. * @param {Function} [iteratee] The iteratee invoked per element.
  8829. * @returns {Array} Returns the new duplicate free array.
  8830. * @example
  8831. *
  8832. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8833. * // => [1.1, 2.3]
  8834. */
  8835. function sortedUniqBy(array, iteratee) {
  8836. return (array && array.length)
  8837. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8838. : [];
  8839. }
  8840. /**
  8841. * Gets all but the first element of `array`.
  8842. *
  8843. * @static
  8844. * @memberOf _
  8845. * @since 4.0.0
  8846. * @category Array
  8847. * @param {Array} array The array to query.
  8848. * @returns {Array} Returns the slice of `array`.
  8849. * @example
  8850. *
  8851. * _.tail([1, 2, 3]);
  8852. * // => [2, 3]
  8853. */
  8854. function tail(array) {
  8855. var length = array == null ? 0 : array.length;
  8856. return length ? baseSlice(array, 1, length) : [];
  8857. }
  8858. /**
  8859. * Creates a slice of `array` with `n` elements taken from the beginning.
  8860. *
  8861. * @static
  8862. * @memberOf _
  8863. * @since 0.1.0
  8864. * @category Array
  8865. * @param {Array} array The array to query.
  8866. * @param {number} [n=1] The number of elements to take.
  8867. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8868. * @returns {Array} Returns the slice of `array`.
  8869. * @example
  8870. *
  8871. * _.take([1, 2, 3]);
  8872. * // => [1]
  8873. *
  8874. * _.take([1, 2, 3], 2);
  8875. * // => [1, 2]
  8876. *
  8877. * _.take([1, 2, 3], 5);
  8878. * // => [1, 2, 3]
  8879. *
  8880. * _.take([1, 2, 3], 0);
  8881. * // => []
  8882. */
  8883. function take(array, n, guard) {
  8884. if (!(array && array.length)) {
  8885. return [];
  8886. }
  8887. n = (guard || n === undefined) ? 1 : toInteger(n);
  8888. return baseSlice(array, 0, n < 0 ? 0 : n);
  8889. }
  8890. /**
  8891. * Creates a slice of `array` with `n` elements taken from the end.
  8892. *
  8893. * @static
  8894. * @memberOf _
  8895. * @since 3.0.0
  8896. * @category Array
  8897. * @param {Array} array The array to query.
  8898. * @param {number} [n=1] The number of elements to take.
  8899. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8900. * @returns {Array} Returns the slice of `array`.
  8901. * @example
  8902. *
  8903. * _.takeRight([1, 2, 3]);
  8904. * // => [3]
  8905. *
  8906. * _.takeRight([1, 2, 3], 2);
  8907. * // => [2, 3]
  8908. *
  8909. * _.takeRight([1, 2, 3], 5);
  8910. * // => [1, 2, 3]
  8911. *
  8912. * _.takeRight([1, 2, 3], 0);
  8913. * // => []
  8914. */
  8915. function takeRight(array, n, guard) {
  8916. var length = array == null ? 0 : array.length;
  8917. if (!length) {
  8918. return [];
  8919. }
  8920. n = (guard || n === undefined) ? 1 : toInteger(n);
  8921. n = length - n;
  8922. return baseSlice(array, n < 0 ? 0 : n, length);
  8923. }
  8924. /**
  8925. * Creates a slice of `array` with elements taken from the end. Elements are
  8926. * taken until `predicate` returns falsey. The predicate is invoked with
  8927. * three arguments: (value, index, array).
  8928. *
  8929. * @static
  8930. * @memberOf _
  8931. * @since 3.0.0
  8932. * @category Array
  8933. * @param {Array} array The array to query.
  8934. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8935. * @returns {Array} Returns the slice of `array`.
  8936. * @example
  8937. *
  8938. * var users = [
  8939. * { 'user': 'barney', 'active': true },
  8940. * { 'user': 'fred', 'active': false },
  8941. * { 'user': 'pebbles', 'active': false }
  8942. * ];
  8943. *
  8944. * _.takeRightWhile(users, function(o) { return !o.active; });
  8945. * // => objects for ['fred', 'pebbles']
  8946. *
  8947. * // The `_.matches` iteratee shorthand.
  8948. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8949. * // => objects for ['pebbles']
  8950. *
  8951. * // The `_.matchesProperty` iteratee shorthand.
  8952. * _.takeRightWhile(users, ['active', false]);
  8953. * // => objects for ['fred', 'pebbles']
  8954. *
  8955. * // The `_.property` iteratee shorthand.
  8956. * _.takeRightWhile(users, 'active');
  8957. * // => []
  8958. */
  8959. function takeRightWhile(array, predicate) {
  8960. return (array && array.length)
  8961. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8962. : [];
  8963. }
  8964. /**
  8965. * Creates a slice of `array` with elements taken from the beginning. Elements
  8966. * are taken until `predicate` returns falsey. The predicate is invoked with
  8967. * three arguments: (value, index, array).
  8968. *
  8969. * @static
  8970. * @memberOf _
  8971. * @since 3.0.0
  8972. * @category Array
  8973. * @param {Array} array The array to query.
  8974. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8975. * @returns {Array} Returns the slice of `array`.
  8976. * @example
  8977. *
  8978. * var users = [
  8979. * { 'user': 'barney', 'active': false },
  8980. * { 'user': 'fred', 'active': false },
  8981. * { 'user': 'pebbles', 'active': true }
  8982. * ];
  8983. *
  8984. * _.takeWhile(users, function(o) { return !o.active; });
  8985. * // => objects for ['barney', 'fred']
  8986. *
  8987. * // The `_.matches` iteratee shorthand.
  8988. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8989. * // => objects for ['barney']
  8990. *
  8991. * // The `_.matchesProperty` iteratee shorthand.
  8992. * _.takeWhile(users, ['active', false]);
  8993. * // => objects for ['barney', 'fred']
  8994. *
  8995. * // The `_.property` iteratee shorthand.
  8996. * _.takeWhile(users, 'active');
  8997. * // => []
  8998. */
  8999. function takeWhile(array, predicate) {
  9000. return (array && array.length)
  9001. ? baseWhile(array, getIteratee(predicate, 3))
  9002. : [];
  9003. }
  9004. /**
  9005. * Creates an array of unique values, in order, from all given arrays using
  9006. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9007. * for equality comparisons.
  9008. *
  9009. * @static
  9010. * @memberOf _
  9011. * @since 0.1.0
  9012. * @category Array
  9013. * @param {...Array} [arrays] The arrays to inspect.
  9014. * @returns {Array} Returns the new array of combined values.
  9015. * @example
  9016. *
  9017. * _.union([2], [1, 2]);
  9018. * // => [2, 1]
  9019. */
  9020. var union = baseRest(function(arrays) {
  9021. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9022. });
  9023. /**
  9024. * This method is like `_.union` except that it accepts `iteratee` which is
  9025. * invoked for each element of each `arrays` to generate the criterion by
  9026. * which uniqueness is computed. Result values are chosen from the first
  9027. * array in which the value occurs. The iteratee is invoked with one argument:
  9028. * (value).
  9029. *
  9030. * @static
  9031. * @memberOf _
  9032. * @since 4.0.0
  9033. * @category Array
  9034. * @param {...Array} [arrays] The arrays to inspect.
  9035. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9036. * @returns {Array} Returns the new array of combined values.
  9037. * @example
  9038. *
  9039. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9040. * // => [2.1, 1.2]
  9041. *
  9042. * // The `_.property` iteratee shorthand.
  9043. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9044. * // => [{ 'x': 1 }, { 'x': 2 }]
  9045. */
  9046. var unionBy = baseRest(function(arrays) {
  9047. var iteratee = last(arrays);
  9048. if (isArrayLikeObject(iteratee)) {
  9049. iteratee = undefined;
  9050. }
  9051. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9052. });
  9053. /**
  9054. * This method is like `_.union` except that it accepts `comparator` which
  9055. * is invoked to compare elements of `arrays`. Result values are chosen from
  9056. * the first array in which the value occurs. The comparator is invoked
  9057. * with two arguments: (arrVal, othVal).
  9058. *
  9059. * @static
  9060. * @memberOf _
  9061. * @since 4.0.0
  9062. * @category Array
  9063. * @param {...Array} [arrays] The arrays to inspect.
  9064. * @param {Function} [comparator] The comparator invoked per element.
  9065. * @returns {Array} Returns the new array of combined values.
  9066. * @example
  9067. *
  9068. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9069. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9070. *
  9071. * _.unionWith(objects, others, _.isEqual);
  9072. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9073. */
  9074. var unionWith = baseRest(function(arrays) {
  9075. var comparator = last(arrays);
  9076. comparator = typeof comparator == 'function' ? comparator : undefined;
  9077. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9078. });
  9079. /**
  9080. * Creates a duplicate-free version of an array, using
  9081. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9082. * for equality comparisons, in which only the first occurrence of each element
  9083. * is kept. The order of result values is determined by the order they occur
  9084. * in the array.
  9085. *
  9086. * @static
  9087. * @memberOf _
  9088. * @since 0.1.0
  9089. * @category Array
  9090. * @param {Array} array The array to inspect.
  9091. * @returns {Array} Returns the new duplicate free array.
  9092. * @example
  9093. *
  9094. * _.uniq([2, 1, 2]);
  9095. * // => [2, 1]
  9096. */
  9097. function uniq(array) {
  9098. return (array && array.length) ? baseUniq(array) : [];
  9099. }
  9100. /**
  9101. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9102. * invoked for each element in `array` to generate the criterion by which
  9103. * uniqueness is computed. The order of result values is determined by the
  9104. * order they occur in the array. The iteratee is invoked with one argument:
  9105. * (value).
  9106. *
  9107. * @static
  9108. * @memberOf _
  9109. * @since 4.0.0
  9110. * @category Array
  9111. * @param {Array} array The array to inspect.
  9112. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9113. * @returns {Array} Returns the new duplicate free array.
  9114. * @example
  9115. *
  9116. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9117. * // => [2.1, 1.2]
  9118. *
  9119. * // The `_.property` iteratee shorthand.
  9120. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9121. * // => [{ 'x': 1 }, { 'x': 2 }]
  9122. */
  9123. function uniqBy(array, iteratee) {
  9124. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9125. }
  9126. /**
  9127. * This method is like `_.uniq` except that it accepts `comparator` which
  9128. * is invoked to compare elements of `array`. The order of result values is
  9129. * determined by the order they occur in the array.The comparator is invoked
  9130. * with two arguments: (arrVal, othVal).
  9131. *
  9132. * @static
  9133. * @memberOf _
  9134. * @since 4.0.0
  9135. * @category Array
  9136. * @param {Array} array The array to inspect.
  9137. * @param {Function} [comparator] The comparator invoked per element.
  9138. * @returns {Array} Returns the new duplicate free array.
  9139. * @example
  9140. *
  9141. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9142. *
  9143. * _.uniqWith(objects, _.isEqual);
  9144. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9145. */
  9146. function uniqWith(array, comparator) {
  9147. comparator = typeof comparator == 'function' ? comparator : undefined;
  9148. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9149. }
  9150. /**
  9151. * This method is like `_.zip` except that it accepts an array of grouped
  9152. * elements and creates an array regrouping the elements to their pre-zip
  9153. * configuration.
  9154. *
  9155. * @static
  9156. * @memberOf _
  9157. * @since 1.2.0
  9158. * @category Array
  9159. * @param {Array} array The array of grouped elements to process.
  9160. * @returns {Array} Returns the new array of regrouped elements.
  9161. * @example
  9162. *
  9163. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9164. * // => [['a', 1, true], ['b', 2, false]]
  9165. *
  9166. * _.unzip(zipped);
  9167. * // => [['a', 'b'], [1, 2], [true, false]]
  9168. */
  9169. function unzip(array) {
  9170. if (!(array && array.length)) {
  9171. return [];
  9172. }
  9173. var length = 0;
  9174. array = arrayFilter(array, function(group) {
  9175. if (isArrayLikeObject(group)) {
  9176. length = nativeMax(group.length, length);
  9177. return true;
  9178. }
  9179. });
  9180. return baseTimes(length, function(index) {
  9181. return arrayMap(array, baseProperty(index));
  9182. });
  9183. }
  9184. /**
  9185. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9186. * how regrouped values should be combined. The iteratee is invoked with the
  9187. * elements of each group: (...group).
  9188. *
  9189. * @static
  9190. * @memberOf _
  9191. * @since 3.8.0
  9192. * @category Array
  9193. * @param {Array} array The array of grouped elements to process.
  9194. * @param {Function} [iteratee=_.identity] The function to combine
  9195. * regrouped values.
  9196. * @returns {Array} Returns the new array of regrouped elements.
  9197. * @example
  9198. *
  9199. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9200. * // => [[1, 10, 100], [2, 20, 200]]
  9201. *
  9202. * _.unzipWith(zipped, _.add);
  9203. * // => [3, 30, 300]
  9204. */
  9205. function unzipWith(array, iteratee) {
  9206. if (!(array && array.length)) {
  9207. return [];
  9208. }
  9209. var result = unzip(array);
  9210. if (iteratee == null) {
  9211. return result;
  9212. }
  9213. return arrayMap(result, function(group) {
  9214. return apply(iteratee, undefined, group);
  9215. });
  9216. }
  9217. /**
  9218. * Creates an array excluding all given values using
  9219. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9220. * for equality comparisons.
  9221. *
  9222. * **Note:** Unlike `_.pull`, this method returns a new array.
  9223. *
  9224. * @static
  9225. * @memberOf _
  9226. * @since 0.1.0
  9227. * @category Array
  9228. * @param {Array} array The array to inspect.
  9229. * @param {...*} [values] The values to exclude.
  9230. * @returns {Array} Returns the new array of filtered values.
  9231. * @see _.difference, _.xor
  9232. * @example
  9233. *
  9234. * _.without([2, 1, 2, 3], 1, 2);
  9235. * // => [3]
  9236. */
  9237. var without = baseRest(function(array, values) {
  9238. return isArrayLikeObject(array)
  9239. ? baseDifference(array, values)
  9240. : [];
  9241. });
  9242. /**
  9243. * Creates an array of unique values that is the
  9244. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9245. * of the given arrays. The order of result values is determined by the order
  9246. * they occur in the arrays.
  9247. *
  9248. * @static
  9249. * @memberOf _
  9250. * @since 2.4.0
  9251. * @category Array
  9252. * @param {...Array} [arrays] The arrays to inspect.
  9253. * @returns {Array} Returns the new array of filtered values.
  9254. * @see _.difference, _.without
  9255. * @example
  9256. *
  9257. * _.xor([2, 1], [2, 3]);
  9258. * // => [1, 3]
  9259. */
  9260. var xor = baseRest(function(arrays) {
  9261. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9262. });
  9263. /**
  9264. * This method is like `_.xor` except that it accepts `iteratee` which is
  9265. * invoked for each element of each `arrays` to generate the criterion by
  9266. * which by which they're compared. The order of result values is determined
  9267. * by the order they occur in the arrays. The iteratee is invoked with one
  9268. * argument: (value).
  9269. *
  9270. * @static
  9271. * @memberOf _
  9272. * @since 4.0.0
  9273. * @category Array
  9274. * @param {...Array} [arrays] The arrays to inspect.
  9275. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9276. * @returns {Array} Returns the new array of filtered values.
  9277. * @example
  9278. *
  9279. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9280. * // => [1.2, 3.4]
  9281. *
  9282. * // The `_.property` iteratee shorthand.
  9283. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9284. * // => [{ 'x': 2 }]
  9285. */
  9286. var xorBy = baseRest(function(arrays) {
  9287. var iteratee = last(arrays);
  9288. if (isArrayLikeObject(iteratee)) {
  9289. iteratee = undefined;
  9290. }
  9291. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9292. });
  9293. /**
  9294. * This method is like `_.xor` except that it accepts `comparator` which is
  9295. * invoked to compare elements of `arrays`. The order of result values is
  9296. * determined by the order they occur in the arrays. The comparator is invoked
  9297. * with two arguments: (arrVal, othVal).
  9298. *
  9299. * @static
  9300. * @memberOf _
  9301. * @since 4.0.0
  9302. * @category Array
  9303. * @param {...Array} [arrays] The arrays to inspect.
  9304. * @param {Function} [comparator] The comparator invoked per element.
  9305. * @returns {Array} Returns the new array of filtered values.
  9306. * @example
  9307. *
  9308. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9309. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9310. *
  9311. * _.xorWith(objects, others, _.isEqual);
  9312. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9313. */
  9314. var xorWith = baseRest(function(arrays) {
  9315. var comparator = last(arrays);
  9316. comparator = typeof comparator == 'function' ? comparator : undefined;
  9317. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9318. });
  9319. /**
  9320. * Creates an array of grouped elements, the first of which contains the
  9321. * first elements of the given arrays, the second of which contains the
  9322. * second elements of the given arrays, and so on.
  9323. *
  9324. * @static
  9325. * @memberOf _
  9326. * @since 0.1.0
  9327. * @category Array
  9328. * @param {...Array} [arrays] The arrays to process.
  9329. * @returns {Array} Returns the new array of grouped elements.
  9330. * @example
  9331. *
  9332. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9333. * // => [['a', 1, true], ['b', 2, false]]
  9334. */
  9335. var zip = baseRest(unzip);
  9336. /**
  9337. * This method is like `_.fromPairs` except that it accepts two arrays,
  9338. * one of property identifiers and one of corresponding values.
  9339. *
  9340. * @static
  9341. * @memberOf _
  9342. * @since 0.4.0
  9343. * @category Array
  9344. * @param {Array} [props=[]] The property identifiers.
  9345. * @param {Array} [values=[]] The property values.
  9346. * @returns {Object} Returns the new object.
  9347. * @example
  9348. *
  9349. * _.zipObject(['a', 'b'], [1, 2]);
  9350. * // => { 'a': 1, 'b': 2 }
  9351. */
  9352. function zipObject(props, values) {
  9353. return baseZipObject(props || [], values || [], assignValue);
  9354. }
  9355. /**
  9356. * This method is like `_.zipObject` except that it supports property paths.
  9357. *
  9358. * @static
  9359. * @memberOf _
  9360. * @since 4.1.0
  9361. * @category Array
  9362. * @param {Array} [props=[]] The property identifiers.
  9363. * @param {Array} [values=[]] The property values.
  9364. * @returns {Object} Returns the new object.
  9365. * @example
  9366. *
  9367. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9368. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9369. */
  9370. function zipObjectDeep(props, values) {
  9371. return baseZipObject(props || [], values || [], baseSet);
  9372. }
  9373. /**
  9374. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9375. * how grouped values should be combined. The iteratee is invoked with the
  9376. * elements of each group: (...group).
  9377. *
  9378. * @static
  9379. * @memberOf _
  9380. * @since 3.8.0
  9381. * @category Array
  9382. * @param {...Array} [arrays] The arrays to process.
  9383. * @param {Function} [iteratee=_.identity] The function to combine
  9384. * grouped values.
  9385. * @returns {Array} Returns the new array of grouped elements.
  9386. * @example
  9387. *
  9388. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9389. * return a + b + c;
  9390. * });
  9391. * // => [111, 222]
  9392. */
  9393. var zipWith = baseRest(function(arrays) {
  9394. var length = arrays.length,
  9395. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9396. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9397. return unzipWith(arrays, iteratee);
  9398. });
  9399. /*------------------------------------------------------------------------*/
  9400. /**
  9401. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9402. * chain sequences enabled. The result of such sequences must be unwrapped
  9403. * with `_#value`.
  9404. *
  9405. * @static
  9406. * @memberOf _
  9407. * @since 1.3.0
  9408. * @category Seq
  9409. * @param {*} value The value to wrap.
  9410. * @returns {Object} Returns the new `lodash` wrapper instance.
  9411. * @example
  9412. *
  9413. * var users = [
  9414. * { 'user': 'barney', 'age': 36 },
  9415. * { 'user': 'fred', 'age': 40 },
  9416. * { 'user': 'pebbles', 'age': 1 }
  9417. * ];
  9418. *
  9419. * var youngest = _
  9420. * .chain(users)
  9421. * .sortBy('age')
  9422. * .map(function(o) {
  9423. * return o.user + ' is ' + o.age;
  9424. * })
  9425. * .head()
  9426. * .value();
  9427. * // => 'pebbles is 1'
  9428. */
  9429. function chain(value) {
  9430. var result = lodash(value);
  9431. result.__chain__ = true;
  9432. return result;
  9433. }
  9434. /**
  9435. * This method invokes `interceptor` and returns `value`. The interceptor
  9436. * is invoked with one argument; (value). The purpose of this method is to
  9437. * "tap into" a method chain sequence in order to modify intermediate results.
  9438. *
  9439. * @static
  9440. * @memberOf _
  9441. * @since 0.1.0
  9442. * @category Seq
  9443. * @param {*} value The value to provide to `interceptor`.
  9444. * @param {Function} interceptor The function to invoke.
  9445. * @returns {*} Returns `value`.
  9446. * @example
  9447. *
  9448. * _([1, 2, 3])
  9449. * .tap(function(array) {
  9450. * // Mutate input array.
  9451. * array.pop();
  9452. * })
  9453. * .reverse()
  9454. * .value();
  9455. * // => [2, 1]
  9456. */
  9457. function tap(value, interceptor) {
  9458. interceptor(value);
  9459. return value;
  9460. }
  9461. /**
  9462. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9463. * The purpose of this method is to "pass thru" values replacing intermediate
  9464. * results in a method chain sequence.
  9465. *
  9466. * @static
  9467. * @memberOf _
  9468. * @since 3.0.0
  9469. * @category Seq
  9470. * @param {*} value The value to provide to `interceptor`.
  9471. * @param {Function} interceptor The function to invoke.
  9472. * @returns {*} Returns the result of `interceptor`.
  9473. * @example
  9474. *
  9475. * _(' abc ')
  9476. * .chain()
  9477. * .trim()
  9478. * .thru(function(value) {
  9479. * return [value];
  9480. * })
  9481. * .value();
  9482. * // => ['abc']
  9483. */
  9484. function thru(value, interceptor) {
  9485. return interceptor(value);
  9486. }
  9487. /**
  9488. * This method is the wrapper version of `_.at`.
  9489. *
  9490. * @name at
  9491. * @memberOf _
  9492. * @since 1.0.0
  9493. * @category Seq
  9494. * @param {...(string|string[])} [paths] The property paths to pick.
  9495. * @returns {Object} Returns the new `lodash` wrapper instance.
  9496. * @example
  9497. *
  9498. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9499. *
  9500. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9501. * // => [3, 4]
  9502. */
  9503. var wrapperAt = flatRest(function(paths) {
  9504. var length = paths.length,
  9505. start = length ? paths[0] : 0,
  9506. value = this.__wrapped__,
  9507. interceptor = function(object) { return baseAt(object, paths); };
  9508. if (length > 1 || this.__actions__.length ||
  9509. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9510. return this.thru(interceptor);
  9511. }
  9512. value = value.slice(start, +start + (length ? 1 : 0));
  9513. value.__actions__.push({
  9514. 'func': thru,
  9515. 'args': [interceptor],
  9516. 'thisArg': undefined
  9517. });
  9518. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9519. if (length && !array.length) {
  9520. array.push(undefined);
  9521. }
  9522. return array;
  9523. });
  9524. });
  9525. /**
  9526. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9527. *
  9528. * @name chain
  9529. * @memberOf _
  9530. * @since 0.1.0
  9531. * @category Seq
  9532. * @returns {Object} Returns the new `lodash` wrapper instance.
  9533. * @example
  9534. *
  9535. * var users = [
  9536. * { 'user': 'barney', 'age': 36 },
  9537. * { 'user': 'fred', 'age': 40 }
  9538. * ];
  9539. *
  9540. * // A sequence without explicit chaining.
  9541. * _(users).head();
  9542. * // => { 'user': 'barney', 'age': 36 }
  9543. *
  9544. * // A sequence with explicit chaining.
  9545. * _(users)
  9546. * .chain()
  9547. * .head()
  9548. * .pick('user')
  9549. * .value();
  9550. * // => { 'user': 'barney' }
  9551. */
  9552. function wrapperChain() {
  9553. return chain(this);
  9554. }
  9555. /**
  9556. * Executes the chain sequence and returns the wrapped result.
  9557. *
  9558. * @name commit
  9559. * @memberOf _
  9560. * @since 3.2.0
  9561. * @category Seq
  9562. * @returns {Object} Returns the new `lodash` wrapper instance.
  9563. * @example
  9564. *
  9565. * var array = [1, 2];
  9566. * var wrapped = _(array).push(3);
  9567. *
  9568. * console.log(array);
  9569. * // => [1, 2]
  9570. *
  9571. * wrapped = wrapped.commit();
  9572. * console.log(array);
  9573. * // => [1, 2, 3]
  9574. *
  9575. * wrapped.last();
  9576. * // => 3
  9577. *
  9578. * console.log(array);
  9579. * // => [1, 2, 3]
  9580. */
  9581. function wrapperCommit() {
  9582. return new LodashWrapper(this.value(), this.__chain__);
  9583. }
  9584. /**
  9585. * Gets the next value on a wrapped object following the
  9586. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9587. *
  9588. * @name next
  9589. * @memberOf _
  9590. * @since 4.0.0
  9591. * @category Seq
  9592. * @returns {Object} Returns the next iterator value.
  9593. * @example
  9594. *
  9595. * var wrapped = _([1, 2]);
  9596. *
  9597. * wrapped.next();
  9598. * // => { 'done': false, 'value': 1 }
  9599. *
  9600. * wrapped.next();
  9601. * // => { 'done': false, 'value': 2 }
  9602. *
  9603. * wrapped.next();
  9604. * // => { 'done': true, 'value': undefined }
  9605. */
  9606. function wrapperNext() {
  9607. if (this.__values__ === undefined) {
  9608. this.__values__ = toArray(this.value());
  9609. }
  9610. var done = this.__index__ >= this.__values__.length,
  9611. value = done ? undefined : this.__values__[this.__index__++];
  9612. return { 'done': done, 'value': value };
  9613. }
  9614. /**
  9615. * Enables the wrapper to be iterable.
  9616. *
  9617. * @name Symbol.iterator
  9618. * @memberOf _
  9619. * @since 4.0.0
  9620. * @category Seq
  9621. * @returns {Object} Returns the wrapper object.
  9622. * @example
  9623. *
  9624. * var wrapped = _([1, 2]);
  9625. *
  9626. * wrapped[Symbol.iterator]() === wrapped;
  9627. * // => true
  9628. *
  9629. * Array.from(wrapped);
  9630. * // => [1, 2]
  9631. */
  9632. function wrapperToIterator() {
  9633. return this;
  9634. }
  9635. /**
  9636. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9637. *
  9638. * @name plant
  9639. * @memberOf _
  9640. * @since 3.2.0
  9641. * @category Seq
  9642. * @param {*} value The value to plant.
  9643. * @returns {Object} Returns the new `lodash` wrapper instance.
  9644. * @example
  9645. *
  9646. * function square(n) {
  9647. * return n * n;
  9648. * }
  9649. *
  9650. * var wrapped = _([1, 2]).map(square);
  9651. * var other = wrapped.plant([3, 4]);
  9652. *
  9653. * other.value();
  9654. * // => [9, 16]
  9655. *
  9656. * wrapped.value();
  9657. * // => [1, 4]
  9658. */
  9659. function wrapperPlant(value) {
  9660. var result,
  9661. parent = this;
  9662. while (parent instanceof baseLodash) {
  9663. var clone = wrapperClone(parent);
  9664. clone.__index__ = 0;
  9665. clone.__values__ = undefined;
  9666. if (result) {
  9667. previous.__wrapped__ = clone;
  9668. } else {
  9669. result = clone;
  9670. }
  9671. var previous = clone;
  9672. parent = parent.__wrapped__;
  9673. }
  9674. previous.__wrapped__ = value;
  9675. return result;
  9676. }
  9677. /**
  9678. * This method is the wrapper version of `_.reverse`.
  9679. *
  9680. * **Note:** This method mutates the wrapped array.
  9681. *
  9682. * @name reverse
  9683. * @memberOf _
  9684. * @since 0.1.0
  9685. * @category Seq
  9686. * @returns {Object} Returns the new `lodash` wrapper instance.
  9687. * @example
  9688. *
  9689. * var array = [1, 2, 3];
  9690. *
  9691. * _(array).reverse().value()
  9692. * // => [3, 2, 1]
  9693. *
  9694. * console.log(array);
  9695. * // => [3, 2, 1]
  9696. */
  9697. function wrapperReverse() {
  9698. var value = this.__wrapped__;
  9699. if (value instanceof LazyWrapper) {
  9700. var wrapped = value;
  9701. if (this.__actions__.length) {
  9702. wrapped = new LazyWrapper(this);
  9703. }
  9704. wrapped = wrapped.reverse();
  9705. wrapped.__actions__.push({
  9706. 'func': thru,
  9707. 'args': [reverse],
  9708. 'thisArg': undefined
  9709. });
  9710. return new LodashWrapper(wrapped, this.__chain__);
  9711. }
  9712. return this.thru(reverse);
  9713. }
  9714. /**
  9715. * Executes the chain sequence to resolve the unwrapped value.
  9716. *
  9717. * @name value
  9718. * @memberOf _
  9719. * @since 0.1.0
  9720. * @alias toJSON, valueOf
  9721. * @category Seq
  9722. * @returns {*} Returns the resolved unwrapped value.
  9723. * @example
  9724. *
  9725. * _([1, 2, 3]).value();
  9726. * // => [1, 2, 3]
  9727. */
  9728. function wrapperValue() {
  9729. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9730. }
  9731. /*------------------------------------------------------------------------*/
  9732. /**
  9733. * Creates an object composed of keys generated from the results of running
  9734. * each element of `collection` thru `iteratee`. The corresponding value of
  9735. * each key is the number of times the key was returned by `iteratee`. The
  9736. * iteratee is invoked with one argument: (value).
  9737. *
  9738. * @static
  9739. * @memberOf _
  9740. * @since 0.5.0
  9741. * @category Collection
  9742. * @param {Array|Object} collection The collection to iterate over.
  9743. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9744. * @returns {Object} Returns the composed aggregate object.
  9745. * @example
  9746. *
  9747. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9748. * // => { '4': 1, '6': 2 }
  9749. *
  9750. * // The `_.property` iteratee shorthand.
  9751. * _.countBy(['one', 'two', 'three'], 'length');
  9752. * // => { '3': 2, '5': 1 }
  9753. */
  9754. var countBy = createAggregator(function(result, value, key) {
  9755. if (hasOwnProperty.call(result, key)) {
  9756. ++result[key];
  9757. } else {
  9758. baseAssignValue(result, key, 1);
  9759. }
  9760. });
  9761. /**
  9762. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9763. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9764. * invoked with three arguments: (value, index|key, collection).
  9765. *
  9766. * **Note:** This method returns `true` for
  9767. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9768. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9769. * elements of empty collections.
  9770. *
  9771. * @static
  9772. * @memberOf _
  9773. * @since 0.1.0
  9774. * @category Collection
  9775. * @param {Array|Object} collection The collection to iterate over.
  9776. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9777. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9778. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9779. * else `false`.
  9780. * @example
  9781. *
  9782. * _.every([true, 1, null, 'yes'], Boolean);
  9783. * // => false
  9784. *
  9785. * var users = [
  9786. * { 'user': 'barney', 'age': 36, 'active': false },
  9787. * { 'user': 'fred', 'age': 40, 'active': false }
  9788. * ];
  9789. *
  9790. * // The `_.matches` iteratee shorthand.
  9791. * _.every(users, { 'user': 'barney', 'active': false });
  9792. * // => false
  9793. *
  9794. * // The `_.matchesProperty` iteratee shorthand.
  9795. * _.every(users, ['active', false]);
  9796. * // => true
  9797. *
  9798. * // The `_.property` iteratee shorthand.
  9799. * _.every(users, 'active');
  9800. * // => false
  9801. */
  9802. function every(collection, predicate, guard) {
  9803. var func = isArray(collection) ? arrayEvery : baseEvery;
  9804. if (guard && isIterateeCall(collection, predicate, guard)) {
  9805. predicate = undefined;
  9806. }
  9807. return func(collection, getIteratee(predicate, 3));
  9808. }
  9809. /**
  9810. * Iterates over elements of `collection`, returning an array of all elements
  9811. * `predicate` returns truthy for. The predicate is invoked with three
  9812. * arguments: (value, index|key, collection).
  9813. *
  9814. * **Note:** Unlike `_.remove`, this method returns a new array.
  9815. *
  9816. * @static
  9817. * @memberOf _
  9818. * @since 0.1.0
  9819. * @category Collection
  9820. * @param {Array|Object} collection The collection to iterate over.
  9821. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9822. * @returns {Array} Returns the new filtered array.
  9823. * @see _.reject
  9824. * @example
  9825. *
  9826. * var users = [
  9827. * { 'user': 'barney', 'age': 36, 'active': true },
  9828. * { 'user': 'fred', 'age': 40, 'active': false }
  9829. * ];
  9830. *
  9831. * _.filter(users, function(o) { return !o.active; });
  9832. * // => objects for ['fred']
  9833. *
  9834. * // The `_.matches` iteratee shorthand.
  9835. * _.filter(users, { 'age': 36, 'active': true });
  9836. * // => objects for ['barney']
  9837. *
  9838. * // The `_.matchesProperty` iteratee shorthand.
  9839. * _.filter(users, ['active', false]);
  9840. * // => objects for ['fred']
  9841. *
  9842. * // The `_.property` iteratee shorthand.
  9843. * _.filter(users, 'active');
  9844. * // => objects for ['barney']
  9845. *
  9846. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9847. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9848. * // => objects for ['fred', 'barney']
  9849. */
  9850. function filter(collection, predicate) {
  9851. var func = isArray(collection) ? arrayFilter : baseFilter;
  9852. return func(collection, getIteratee(predicate, 3));
  9853. }
  9854. /**
  9855. * Iterates over elements of `collection`, returning the first element
  9856. * `predicate` returns truthy for. The predicate is invoked with three
  9857. * arguments: (value, index|key, collection).
  9858. *
  9859. * @static
  9860. * @memberOf _
  9861. * @since 0.1.0
  9862. * @category Collection
  9863. * @param {Array|Object} collection The collection to inspect.
  9864. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9865. * @param {number} [fromIndex=0] The index to search from.
  9866. * @returns {*} Returns the matched element, else `undefined`.
  9867. * @example
  9868. *
  9869. * var users = [
  9870. * { 'user': 'barney', 'age': 36, 'active': true },
  9871. * { 'user': 'fred', 'age': 40, 'active': false },
  9872. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9873. * ];
  9874. *
  9875. * _.find(users, function(o) { return o.age < 40; });
  9876. * // => object for 'barney'
  9877. *
  9878. * // The `_.matches` iteratee shorthand.
  9879. * _.find(users, { 'age': 1, 'active': true });
  9880. * // => object for 'pebbles'
  9881. *
  9882. * // The `_.matchesProperty` iteratee shorthand.
  9883. * _.find(users, ['active', false]);
  9884. * // => object for 'fred'
  9885. *
  9886. * // The `_.property` iteratee shorthand.
  9887. * _.find(users, 'active');
  9888. * // => object for 'barney'
  9889. */
  9890. var find = createFind(findIndex);
  9891. /**
  9892. * This method is like `_.find` except that it iterates over elements of
  9893. * `collection` from right to left.
  9894. *
  9895. * @static
  9896. * @memberOf _
  9897. * @since 2.0.0
  9898. * @category Collection
  9899. * @param {Array|Object} collection The collection to inspect.
  9900. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9901. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9902. * @returns {*} Returns the matched element, else `undefined`.
  9903. * @example
  9904. *
  9905. * _.findLast([1, 2, 3, 4], function(n) {
  9906. * return n % 2 == 1;
  9907. * });
  9908. * // => 3
  9909. */
  9910. var findLast = createFind(findLastIndex);
  9911. /**
  9912. * Creates a flattened array of values by running each element in `collection`
  9913. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9914. * with three arguments: (value, index|key, collection).
  9915. *
  9916. * @static
  9917. * @memberOf _
  9918. * @since 4.0.0
  9919. * @category Collection
  9920. * @param {Array|Object} collection The collection to iterate over.
  9921. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9922. * @returns {Array} Returns the new flattened array.
  9923. * @example
  9924. *
  9925. * function duplicate(n) {
  9926. * return [n, n];
  9927. * }
  9928. *
  9929. * _.flatMap([1, 2], duplicate);
  9930. * // => [1, 1, 2, 2]
  9931. */
  9932. function flatMap(collection, iteratee) {
  9933. return baseFlatten(map(collection, iteratee), 1);
  9934. }
  9935. /**
  9936. * This method is like `_.flatMap` except that it recursively flattens the
  9937. * mapped results.
  9938. *
  9939. * @static
  9940. * @memberOf _
  9941. * @since 4.7.0
  9942. * @category Collection
  9943. * @param {Array|Object} collection The collection to iterate over.
  9944. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9945. * @returns {Array} Returns the new flattened array.
  9946. * @example
  9947. *
  9948. * function duplicate(n) {
  9949. * return [[[n, n]]];
  9950. * }
  9951. *
  9952. * _.flatMapDeep([1, 2], duplicate);
  9953. * // => [1, 1, 2, 2]
  9954. */
  9955. function flatMapDeep(collection, iteratee) {
  9956. return baseFlatten(map(collection, iteratee), INFINITY);
  9957. }
  9958. /**
  9959. * This method is like `_.flatMap` except that it recursively flattens the
  9960. * mapped results up to `depth` times.
  9961. *
  9962. * @static
  9963. * @memberOf _
  9964. * @since 4.7.0
  9965. * @category Collection
  9966. * @param {Array|Object} collection The collection to iterate over.
  9967. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9968. * @param {number} [depth=1] The maximum recursion depth.
  9969. * @returns {Array} Returns the new flattened array.
  9970. * @example
  9971. *
  9972. * function duplicate(n) {
  9973. * return [[[n, n]]];
  9974. * }
  9975. *
  9976. * _.flatMapDepth([1, 2], duplicate, 2);
  9977. * // => [[1, 1], [2, 2]]
  9978. */
  9979. function flatMapDepth(collection, iteratee, depth) {
  9980. depth = depth === undefined ? 1 : toInteger(depth);
  9981. return baseFlatten(map(collection, iteratee), depth);
  9982. }
  9983. /**
  9984. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9985. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9986. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9987. *
  9988. * **Note:** As with other "Collections" methods, objects with a "length"
  9989. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9990. * or `_.forOwn` for object iteration.
  9991. *
  9992. * @static
  9993. * @memberOf _
  9994. * @since 0.1.0
  9995. * @alias each
  9996. * @category Collection
  9997. * @param {Array|Object} collection The collection to iterate over.
  9998. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9999. * @returns {Array|Object} Returns `collection`.
  10000. * @see _.forEachRight
  10001. * @example
  10002. *
  10003. * _.forEach([1, 2], function(value) {
  10004. * console.log(value);
  10005. * });
  10006. * // => Logs `1` then `2`.
  10007. *
  10008. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10009. * console.log(key);
  10010. * });
  10011. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10012. */
  10013. function forEach(collection, iteratee) {
  10014. var func = isArray(collection) ? arrayEach : baseEach;
  10015. return func(collection, getIteratee(iteratee, 3));
  10016. }
  10017. /**
  10018. * This method is like `_.forEach` except that it iterates over elements of
  10019. * `collection` from right to left.
  10020. *
  10021. * @static
  10022. * @memberOf _
  10023. * @since 2.0.0
  10024. * @alias eachRight
  10025. * @category Collection
  10026. * @param {Array|Object} collection The collection to iterate over.
  10027. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10028. * @returns {Array|Object} Returns `collection`.
  10029. * @see _.forEach
  10030. * @example
  10031. *
  10032. * _.forEachRight([1, 2], function(value) {
  10033. * console.log(value);
  10034. * });
  10035. * // => Logs `2` then `1`.
  10036. */
  10037. function forEachRight(collection, iteratee) {
  10038. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10039. return func(collection, getIteratee(iteratee, 3));
  10040. }
  10041. /**
  10042. * Creates an object composed of keys generated from the results of running
  10043. * each element of `collection` thru `iteratee`. The order of grouped values
  10044. * is determined by the order they occur in `collection`. The corresponding
  10045. * value of each key is an array of elements responsible for generating the
  10046. * key. The iteratee is invoked with one argument: (value).
  10047. *
  10048. * @static
  10049. * @memberOf _
  10050. * @since 0.1.0
  10051. * @category Collection
  10052. * @param {Array|Object} collection The collection to iterate over.
  10053. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10054. * @returns {Object} Returns the composed aggregate object.
  10055. * @example
  10056. *
  10057. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10058. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10059. *
  10060. * // The `_.property` iteratee shorthand.
  10061. * _.groupBy(['one', 'two', 'three'], 'length');
  10062. * // => { '3': ['one', 'two'], '5': ['three'] }
  10063. */
  10064. var groupBy = createAggregator(function(result, value, key) {
  10065. if (hasOwnProperty.call(result, key)) {
  10066. result[key].push(value);
  10067. } else {
  10068. baseAssignValue(result, key, [value]);
  10069. }
  10070. });
  10071. /**
  10072. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10073. * checked for a substring of `value`, otherwise
  10074. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10075. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10076. * the offset from the end of `collection`.
  10077. *
  10078. * @static
  10079. * @memberOf _
  10080. * @since 0.1.0
  10081. * @category Collection
  10082. * @param {Array|Object|string} collection The collection to inspect.
  10083. * @param {*} value The value to search for.
  10084. * @param {number} [fromIndex=0] The index to search from.
  10085. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10086. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10087. * @example
  10088. *
  10089. * _.includes([1, 2, 3], 1);
  10090. * // => true
  10091. *
  10092. * _.includes([1, 2, 3], 1, 2);
  10093. * // => false
  10094. *
  10095. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10096. * // => true
  10097. *
  10098. * _.includes('abcd', 'bc');
  10099. * // => true
  10100. */
  10101. function includes(collection, value, fromIndex, guard) {
  10102. collection = isArrayLike(collection) ? collection : values(collection);
  10103. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10104. var length = collection.length;
  10105. if (fromIndex < 0) {
  10106. fromIndex = nativeMax(length + fromIndex, 0);
  10107. }
  10108. return isString(collection)
  10109. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10110. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10111. }
  10112. /**
  10113. * Invokes the method at `path` of each element in `collection`, returning
  10114. * an array of the results of each invoked method. Any additional arguments
  10115. * are provided to each invoked method. If `path` is a function, it's invoked
  10116. * for, and `this` bound to, each element in `collection`.
  10117. *
  10118. * @static
  10119. * @memberOf _
  10120. * @since 4.0.0
  10121. * @category Collection
  10122. * @param {Array|Object} collection The collection to iterate over.
  10123. * @param {Array|Function|string} path The path of the method to invoke or
  10124. * the function invoked per iteration.
  10125. * @param {...*} [args] The arguments to invoke each method with.
  10126. * @returns {Array} Returns the array of results.
  10127. * @example
  10128. *
  10129. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10130. * // => [[1, 5, 7], [1, 2, 3]]
  10131. *
  10132. * _.invokeMap([123, 456], String.prototype.split, '');
  10133. * // => [['1', '2', '3'], ['4', '5', '6']]
  10134. */
  10135. var invokeMap = baseRest(function(collection, path, args) {
  10136. var index = -1,
  10137. isFunc = typeof path == 'function',
  10138. result = isArrayLike(collection) ? Array(collection.length) : [];
  10139. baseEach(collection, function(value) {
  10140. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10141. });
  10142. return result;
  10143. });
  10144. /**
  10145. * Creates an object composed of keys generated from the results of running
  10146. * each element of `collection` thru `iteratee`. The corresponding value of
  10147. * each key is the last element responsible for generating the key. The
  10148. * iteratee is invoked with one argument: (value).
  10149. *
  10150. * @static
  10151. * @memberOf _
  10152. * @since 4.0.0
  10153. * @category Collection
  10154. * @param {Array|Object} collection The collection to iterate over.
  10155. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10156. * @returns {Object} Returns the composed aggregate object.
  10157. * @example
  10158. *
  10159. * var array = [
  10160. * { 'dir': 'left', 'code': 97 },
  10161. * { 'dir': 'right', 'code': 100 }
  10162. * ];
  10163. *
  10164. * _.keyBy(array, function(o) {
  10165. * return String.fromCharCode(o.code);
  10166. * });
  10167. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10168. *
  10169. * _.keyBy(array, 'dir');
  10170. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10171. */
  10172. var keyBy = createAggregator(function(result, value, key) {
  10173. baseAssignValue(result, key, value);
  10174. });
  10175. /**
  10176. * Creates an array of values by running each element in `collection` thru
  10177. * `iteratee`. The iteratee is invoked with three arguments:
  10178. * (value, index|key, collection).
  10179. *
  10180. * Many lodash methods are guarded to work as iteratees for methods like
  10181. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10182. *
  10183. * The guarded methods are:
  10184. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10185. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10186. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10187. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10188. *
  10189. * @static
  10190. * @memberOf _
  10191. * @since 0.1.0
  10192. * @category Collection
  10193. * @param {Array|Object} collection The collection to iterate over.
  10194. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10195. * @returns {Array} Returns the new mapped array.
  10196. * @example
  10197. *
  10198. * function square(n) {
  10199. * return n * n;
  10200. * }
  10201. *
  10202. * _.map([4, 8], square);
  10203. * // => [16, 64]
  10204. *
  10205. * _.map({ 'a': 4, 'b': 8 }, square);
  10206. * // => [16, 64] (iteration order is not guaranteed)
  10207. *
  10208. * var users = [
  10209. * { 'user': 'barney' },
  10210. * { 'user': 'fred' }
  10211. * ];
  10212. *
  10213. * // The `_.property` iteratee shorthand.
  10214. * _.map(users, 'user');
  10215. * // => ['barney', 'fred']
  10216. */
  10217. function map(collection, iteratee) {
  10218. var func = isArray(collection) ? arrayMap : baseMap;
  10219. return func(collection, getIteratee(iteratee, 3));
  10220. }
  10221. /**
  10222. * This method is like `_.sortBy` except that it allows specifying the sort
  10223. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10224. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10225. * descending or "asc" for ascending sort order of corresponding values.
  10226. *
  10227. * @static
  10228. * @memberOf _
  10229. * @since 4.0.0
  10230. * @category Collection
  10231. * @param {Array|Object} collection The collection to iterate over.
  10232. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10233. * The iteratees to sort by.
  10234. * @param {string[]} [orders] The sort orders of `iteratees`.
  10235. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10236. * @returns {Array} Returns the new sorted array.
  10237. * @example
  10238. *
  10239. * var users = [
  10240. * { 'user': 'fred', 'age': 48 },
  10241. * { 'user': 'barney', 'age': 34 },
  10242. * { 'user': 'fred', 'age': 40 },
  10243. * { 'user': 'barney', 'age': 36 }
  10244. * ];
  10245. *
  10246. * // Sort by `user` in ascending order and by `age` in descending order.
  10247. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10248. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10249. */
  10250. function orderBy(collection, iteratees, orders, guard) {
  10251. if (collection == null) {
  10252. return [];
  10253. }
  10254. if (!isArray(iteratees)) {
  10255. iteratees = iteratees == null ? [] : [iteratees];
  10256. }
  10257. orders = guard ? undefined : orders;
  10258. if (!isArray(orders)) {
  10259. orders = orders == null ? [] : [orders];
  10260. }
  10261. return baseOrderBy(collection, iteratees, orders);
  10262. }
  10263. /**
  10264. * Creates an array of elements split into two groups, the first of which
  10265. * contains elements `predicate` returns truthy for, the second of which
  10266. * contains elements `predicate` returns falsey for. The predicate is
  10267. * invoked with one argument: (value).
  10268. *
  10269. * @static
  10270. * @memberOf _
  10271. * @since 3.0.0
  10272. * @category Collection
  10273. * @param {Array|Object} collection The collection to iterate over.
  10274. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10275. * @returns {Array} Returns the array of grouped elements.
  10276. * @example
  10277. *
  10278. * var users = [
  10279. * { 'user': 'barney', 'age': 36, 'active': false },
  10280. * { 'user': 'fred', 'age': 40, 'active': true },
  10281. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10282. * ];
  10283. *
  10284. * _.partition(users, function(o) { return o.active; });
  10285. * // => objects for [['fred'], ['barney', 'pebbles']]
  10286. *
  10287. * // The `_.matches` iteratee shorthand.
  10288. * _.partition(users, { 'age': 1, 'active': false });
  10289. * // => objects for [['pebbles'], ['barney', 'fred']]
  10290. *
  10291. * // The `_.matchesProperty` iteratee shorthand.
  10292. * _.partition(users, ['active', false]);
  10293. * // => objects for [['barney', 'pebbles'], ['fred']]
  10294. *
  10295. * // The `_.property` iteratee shorthand.
  10296. * _.partition(users, 'active');
  10297. * // => objects for [['fred'], ['barney', 'pebbles']]
  10298. */
  10299. var partition = createAggregator(function(result, value, key) {
  10300. result[key ? 0 : 1].push(value);
  10301. }, function() { return [[], []]; });
  10302. /**
  10303. * Reduces `collection` to a value which is the accumulated result of running
  10304. * each element in `collection` thru `iteratee`, where each successive
  10305. * invocation is supplied the return value of the previous. If `accumulator`
  10306. * is not given, the first element of `collection` is used as the initial
  10307. * value. The iteratee is invoked with four arguments:
  10308. * (accumulator, value, index|key, collection).
  10309. *
  10310. * Many lodash methods are guarded to work as iteratees for methods like
  10311. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10312. *
  10313. * The guarded methods are:
  10314. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10315. * and `sortBy`
  10316. *
  10317. * @static
  10318. * @memberOf _
  10319. * @since 0.1.0
  10320. * @category Collection
  10321. * @param {Array|Object} collection The collection to iterate over.
  10322. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10323. * @param {*} [accumulator] The initial value.
  10324. * @returns {*} Returns the accumulated value.
  10325. * @see _.reduceRight
  10326. * @example
  10327. *
  10328. * _.reduce([1, 2], function(sum, n) {
  10329. * return sum + n;
  10330. * }, 0);
  10331. * // => 3
  10332. *
  10333. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10334. * (result[value] || (result[value] = [])).push(key);
  10335. * return result;
  10336. * }, {});
  10337. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10338. */
  10339. function reduce(collection, iteratee, accumulator) {
  10340. var func = isArray(collection) ? arrayReduce : baseReduce,
  10341. initAccum = arguments.length < 3;
  10342. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10343. }
  10344. /**
  10345. * This method is like `_.reduce` except that it iterates over elements of
  10346. * `collection` from right to left.
  10347. *
  10348. * @static
  10349. * @memberOf _
  10350. * @since 0.1.0
  10351. * @category Collection
  10352. * @param {Array|Object} collection The collection to iterate over.
  10353. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10354. * @param {*} [accumulator] The initial value.
  10355. * @returns {*} Returns the accumulated value.
  10356. * @see _.reduce
  10357. * @example
  10358. *
  10359. * var array = [[0, 1], [2, 3], [4, 5]];
  10360. *
  10361. * _.reduceRight(array, function(flattened, other) {
  10362. * return flattened.concat(other);
  10363. * }, []);
  10364. * // => [4, 5, 2, 3, 0, 1]
  10365. */
  10366. function reduceRight(collection, iteratee, accumulator) {
  10367. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10368. initAccum = arguments.length < 3;
  10369. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10370. }
  10371. /**
  10372. * The opposite of `_.filter`; this method returns the elements of `collection`
  10373. * that `predicate` does **not** return truthy for.
  10374. *
  10375. * @static
  10376. * @memberOf _
  10377. * @since 0.1.0
  10378. * @category Collection
  10379. * @param {Array|Object} collection The collection to iterate over.
  10380. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10381. * @returns {Array} Returns the new filtered array.
  10382. * @see _.filter
  10383. * @example
  10384. *
  10385. * var users = [
  10386. * { 'user': 'barney', 'age': 36, 'active': false },
  10387. * { 'user': 'fred', 'age': 40, 'active': true }
  10388. * ];
  10389. *
  10390. * _.reject(users, function(o) { return !o.active; });
  10391. * // => objects for ['fred']
  10392. *
  10393. * // The `_.matches` iteratee shorthand.
  10394. * _.reject(users, { 'age': 40, 'active': true });
  10395. * // => objects for ['barney']
  10396. *
  10397. * // The `_.matchesProperty` iteratee shorthand.
  10398. * _.reject(users, ['active', false]);
  10399. * // => objects for ['fred']
  10400. *
  10401. * // The `_.property` iteratee shorthand.
  10402. * _.reject(users, 'active');
  10403. * // => objects for ['barney']
  10404. */
  10405. function reject(collection, predicate) {
  10406. var func = isArray(collection) ? arrayFilter : baseFilter;
  10407. return func(collection, negate(getIteratee(predicate, 3)));
  10408. }
  10409. /**
  10410. * Gets a random element from `collection`.
  10411. *
  10412. * @static
  10413. * @memberOf _
  10414. * @since 2.0.0
  10415. * @category Collection
  10416. * @param {Array|Object} collection The collection to sample.
  10417. * @returns {*} Returns the random element.
  10418. * @example
  10419. *
  10420. * _.sample([1, 2, 3, 4]);
  10421. * // => 2
  10422. */
  10423. function sample(collection) {
  10424. var func = isArray(collection) ? arraySample : baseSample;
  10425. return func(collection);
  10426. }
  10427. /**
  10428. * Gets `n` random elements at unique keys from `collection` up to the
  10429. * size of `collection`.
  10430. *
  10431. * @static
  10432. * @memberOf _
  10433. * @since 4.0.0
  10434. * @category Collection
  10435. * @param {Array|Object} collection The collection to sample.
  10436. * @param {number} [n=1] The number of elements to sample.
  10437. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10438. * @returns {Array} Returns the random elements.
  10439. * @example
  10440. *
  10441. * _.sampleSize([1, 2, 3], 2);
  10442. * // => [3, 1]
  10443. *
  10444. * _.sampleSize([1, 2, 3], 4);
  10445. * // => [2, 3, 1]
  10446. */
  10447. function sampleSize(collection, n, guard) {
  10448. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10449. n = 1;
  10450. } else {
  10451. n = toInteger(n);
  10452. }
  10453. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10454. return func(collection, n);
  10455. }
  10456. /**
  10457. * Creates an array of shuffled values, using a version of the
  10458. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10459. *
  10460. * @static
  10461. * @memberOf _
  10462. * @since 0.1.0
  10463. * @category Collection
  10464. * @param {Array|Object} collection The collection to shuffle.
  10465. * @returns {Array} Returns the new shuffled array.
  10466. * @example
  10467. *
  10468. * _.shuffle([1, 2, 3, 4]);
  10469. * // => [4, 1, 3, 2]
  10470. */
  10471. function shuffle(collection) {
  10472. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10473. return func(collection);
  10474. }
  10475. /**
  10476. * Gets the size of `collection` by returning its length for array-like
  10477. * values or the number of own enumerable string keyed properties for objects.
  10478. *
  10479. * @static
  10480. * @memberOf _
  10481. * @since 0.1.0
  10482. * @category Collection
  10483. * @param {Array|Object|string} collection The collection to inspect.
  10484. * @returns {number} Returns the collection size.
  10485. * @example
  10486. *
  10487. * _.size([1, 2, 3]);
  10488. * // => 3
  10489. *
  10490. * _.size({ 'a': 1, 'b': 2 });
  10491. * // => 2
  10492. *
  10493. * _.size('pebbles');
  10494. * // => 7
  10495. */
  10496. function size(collection) {
  10497. if (collection == null) {
  10498. return 0;
  10499. }
  10500. if (isArrayLike(collection)) {
  10501. return isString(collection) ? stringSize(collection) : collection.length;
  10502. }
  10503. var tag = getTag(collection);
  10504. if (tag == mapTag || tag == setTag) {
  10505. return collection.size;
  10506. }
  10507. return baseKeys(collection).length;
  10508. }
  10509. /**
  10510. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10511. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10512. * invoked with three arguments: (value, index|key, collection).
  10513. *
  10514. * @static
  10515. * @memberOf _
  10516. * @since 0.1.0
  10517. * @category Collection
  10518. * @param {Array|Object} collection The collection to iterate over.
  10519. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10520. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10521. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10522. * else `false`.
  10523. * @example
  10524. *
  10525. * _.some([null, 0, 'yes', false], Boolean);
  10526. * // => true
  10527. *
  10528. * var users = [
  10529. * { 'user': 'barney', 'active': true },
  10530. * { 'user': 'fred', 'active': false }
  10531. * ];
  10532. *
  10533. * // The `_.matches` iteratee shorthand.
  10534. * _.some(users, { 'user': 'barney', 'active': false });
  10535. * // => false
  10536. *
  10537. * // The `_.matchesProperty` iteratee shorthand.
  10538. * _.some(users, ['active', false]);
  10539. * // => true
  10540. *
  10541. * // The `_.property` iteratee shorthand.
  10542. * _.some(users, 'active');
  10543. * // => true
  10544. */
  10545. function some(collection, predicate, guard) {
  10546. var func = isArray(collection) ? arraySome : baseSome;
  10547. if (guard && isIterateeCall(collection, predicate, guard)) {
  10548. predicate = undefined;
  10549. }
  10550. return func(collection, getIteratee(predicate, 3));
  10551. }
  10552. /**
  10553. * Creates an array of elements, sorted in ascending order by the results of
  10554. * running each element in a collection thru each iteratee. This method
  10555. * performs a stable sort, that is, it preserves the original sort order of
  10556. * equal elements. The iteratees are invoked with one argument: (value).
  10557. *
  10558. * @static
  10559. * @memberOf _
  10560. * @since 0.1.0
  10561. * @category Collection
  10562. * @param {Array|Object} collection The collection to iterate over.
  10563. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10564. * The iteratees to sort by.
  10565. * @returns {Array} Returns the new sorted array.
  10566. * @example
  10567. *
  10568. * var users = [
  10569. * { 'user': 'fred', 'age': 48 },
  10570. * { 'user': 'barney', 'age': 36 },
  10571. * { 'user': 'fred', 'age': 30 },
  10572. * { 'user': 'barney', 'age': 34 }
  10573. * ];
  10574. *
  10575. * _.sortBy(users, [function(o) { return o.user; }]);
  10576. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10577. *
  10578. * _.sortBy(users, ['user', 'age']);
  10579. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10580. */
  10581. var sortBy = baseRest(function(collection, iteratees) {
  10582. if (collection == null) {
  10583. return [];
  10584. }
  10585. var length = iteratees.length;
  10586. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10587. iteratees = [];
  10588. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10589. iteratees = [iteratees[0]];
  10590. }
  10591. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10592. });
  10593. /*------------------------------------------------------------------------*/
  10594. /**
  10595. * Gets the timestamp of the number of milliseconds that have elapsed since
  10596. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10597. *
  10598. * @static
  10599. * @memberOf _
  10600. * @since 2.4.0
  10601. * @category Date
  10602. * @returns {number} Returns the timestamp.
  10603. * @example
  10604. *
  10605. * _.defer(function(stamp) {
  10606. * console.log(_.now() - stamp);
  10607. * }, _.now());
  10608. * // => Logs the number of milliseconds it took for the deferred invocation.
  10609. */
  10610. var now = ctxNow || function() {
  10611. return root.Date.now();
  10612. };
  10613. /*------------------------------------------------------------------------*/
  10614. /**
  10615. * The opposite of `_.before`; this method creates a function that invokes
  10616. * `func` once it's called `n` or more times.
  10617. *
  10618. * @static
  10619. * @memberOf _
  10620. * @since 0.1.0
  10621. * @category Function
  10622. * @param {number} n The number of calls before `func` is invoked.
  10623. * @param {Function} func The function to restrict.
  10624. * @returns {Function} Returns the new restricted function.
  10625. * @example
  10626. *
  10627. * var saves = ['profile', 'settings'];
  10628. *
  10629. * var done = _.after(saves.length, function() {
  10630. * console.log('done saving!');
  10631. * });
  10632. *
  10633. * _.forEach(saves, function(type) {
  10634. * asyncSave({ 'type': type, 'complete': done });
  10635. * });
  10636. * // => Logs 'done saving!' after the two async saves have completed.
  10637. */
  10638. function after(n, func) {
  10639. if (typeof func != 'function') {
  10640. throw new TypeError(FUNC_ERROR_TEXT);
  10641. }
  10642. n = toInteger(n);
  10643. return function() {
  10644. if (--n < 1) {
  10645. return func.apply(this, arguments);
  10646. }
  10647. };
  10648. }
  10649. /**
  10650. * Creates a function that invokes `func`, with up to `n` arguments,
  10651. * ignoring any additional arguments.
  10652. *
  10653. * @static
  10654. * @memberOf _
  10655. * @since 3.0.0
  10656. * @category Function
  10657. * @param {Function} func The function to cap arguments for.
  10658. * @param {number} [n=func.length] The arity cap.
  10659. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10660. * @returns {Function} Returns the new capped function.
  10661. * @example
  10662. *
  10663. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10664. * // => [6, 8, 10]
  10665. */
  10666. function ary(func, n, guard) {
  10667. n = guard ? undefined : n;
  10668. n = (func && n == null) ? func.length : n;
  10669. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10670. }
  10671. /**
  10672. * Creates a function that invokes `func`, with the `this` binding and arguments
  10673. * of the created function, while it's called less than `n` times. Subsequent
  10674. * calls to the created function return the result of the last `func` invocation.
  10675. *
  10676. * @static
  10677. * @memberOf _
  10678. * @since 3.0.0
  10679. * @category Function
  10680. * @param {number} n The number of calls at which `func` is no longer invoked.
  10681. * @param {Function} func The function to restrict.
  10682. * @returns {Function} Returns the new restricted function.
  10683. * @example
  10684. *
  10685. * jQuery(element).on('click', _.before(5, addContactToList));
  10686. * // => Allows adding up to 4 contacts to the list.
  10687. */
  10688. function before(n, func) {
  10689. var result;
  10690. if (typeof func != 'function') {
  10691. throw new TypeError(FUNC_ERROR_TEXT);
  10692. }
  10693. n = toInteger(n);
  10694. return function() {
  10695. if (--n > 0) {
  10696. result = func.apply(this, arguments);
  10697. }
  10698. if (n <= 1) {
  10699. func = undefined;
  10700. }
  10701. return result;
  10702. };
  10703. }
  10704. /**
  10705. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10706. * and `partials` prepended to the arguments it receives.
  10707. *
  10708. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10709. * may be used as a placeholder for partially applied arguments.
  10710. *
  10711. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10712. * property of bound functions.
  10713. *
  10714. * @static
  10715. * @memberOf _
  10716. * @since 0.1.0
  10717. * @category Function
  10718. * @param {Function} func The function to bind.
  10719. * @param {*} thisArg The `this` binding of `func`.
  10720. * @param {...*} [partials] The arguments to be partially applied.
  10721. * @returns {Function} Returns the new bound function.
  10722. * @example
  10723. *
  10724. * function greet(greeting, punctuation) {
  10725. * return greeting + ' ' + this.user + punctuation;
  10726. * }
  10727. *
  10728. * var object = { 'user': 'fred' };
  10729. *
  10730. * var bound = _.bind(greet, object, 'hi');
  10731. * bound('!');
  10732. * // => 'hi fred!'
  10733. *
  10734. * // Bound with placeholders.
  10735. * var bound = _.bind(greet, object, _, '!');
  10736. * bound('hi');
  10737. * // => 'hi fred!'
  10738. */
  10739. var bind = baseRest(function(func, thisArg, partials) {
  10740. var bitmask = WRAP_BIND_FLAG;
  10741. if (partials.length) {
  10742. var holders = replaceHolders(partials, getHolder(bind));
  10743. bitmask |= WRAP_PARTIAL_FLAG;
  10744. }
  10745. return createWrap(func, bitmask, thisArg, partials, holders);
  10746. });
  10747. /**
  10748. * Creates a function that invokes the method at `object[key]` with `partials`
  10749. * prepended to the arguments it receives.
  10750. *
  10751. * This method differs from `_.bind` by allowing bound functions to reference
  10752. * methods that may be redefined or don't yet exist. See
  10753. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10754. * for more details.
  10755. *
  10756. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10757. * builds, may be used as a placeholder for partially applied arguments.
  10758. *
  10759. * @static
  10760. * @memberOf _
  10761. * @since 0.10.0
  10762. * @category Function
  10763. * @param {Object} object The object to invoke the method on.
  10764. * @param {string} key The key of the method.
  10765. * @param {...*} [partials] The arguments to be partially applied.
  10766. * @returns {Function} Returns the new bound function.
  10767. * @example
  10768. *
  10769. * var object = {
  10770. * 'user': 'fred',
  10771. * 'greet': function(greeting, punctuation) {
  10772. * return greeting + ' ' + this.user + punctuation;
  10773. * }
  10774. * };
  10775. *
  10776. * var bound = _.bindKey(object, 'greet', 'hi');
  10777. * bound('!');
  10778. * // => 'hi fred!'
  10779. *
  10780. * object.greet = function(greeting, punctuation) {
  10781. * return greeting + 'ya ' + this.user + punctuation;
  10782. * };
  10783. *
  10784. * bound('!');
  10785. * // => 'hiya fred!'
  10786. *
  10787. * // Bound with placeholders.
  10788. * var bound = _.bindKey(object, 'greet', _, '!');
  10789. * bound('hi');
  10790. * // => 'hiya fred!'
  10791. */
  10792. var bindKey = baseRest(function(object, key, partials) {
  10793. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10794. if (partials.length) {
  10795. var holders = replaceHolders(partials, getHolder(bindKey));
  10796. bitmask |= WRAP_PARTIAL_FLAG;
  10797. }
  10798. return createWrap(key, bitmask, object, partials, holders);
  10799. });
  10800. /**
  10801. * Creates a function that accepts arguments of `func` and either invokes
  10802. * `func` returning its result, if at least `arity` number of arguments have
  10803. * been provided, or returns a function that accepts the remaining `func`
  10804. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10805. * is not sufficient.
  10806. *
  10807. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10808. * may be used as a placeholder for provided arguments.
  10809. *
  10810. * **Note:** This method doesn't set the "length" property of curried functions.
  10811. *
  10812. * @static
  10813. * @memberOf _
  10814. * @since 2.0.0
  10815. * @category Function
  10816. * @param {Function} func The function to curry.
  10817. * @param {number} [arity=func.length] The arity of `func`.
  10818. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10819. * @returns {Function} Returns the new curried function.
  10820. * @example
  10821. *
  10822. * var abc = function(a, b, c) {
  10823. * return [a, b, c];
  10824. * };
  10825. *
  10826. * var curried = _.curry(abc);
  10827. *
  10828. * curried(1)(2)(3);
  10829. * // => [1, 2, 3]
  10830. *
  10831. * curried(1, 2)(3);
  10832. * // => [1, 2, 3]
  10833. *
  10834. * curried(1, 2, 3);
  10835. * // => [1, 2, 3]
  10836. *
  10837. * // Curried with placeholders.
  10838. * curried(1)(_, 3)(2);
  10839. * // => [1, 2, 3]
  10840. */
  10841. function curry(func, arity, guard) {
  10842. arity = guard ? undefined : arity;
  10843. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10844. result.placeholder = curry.placeholder;
  10845. return result;
  10846. }
  10847. /**
  10848. * This method is like `_.curry` except that arguments are applied to `func`
  10849. * in the manner of `_.partialRight` instead of `_.partial`.
  10850. *
  10851. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10852. * builds, may be used as a placeholder for provided arguments.
  10853. *
  10854. * **Note:** This method doesn't set the "length" property of curried functions.
  10855. *
  10856. * @static
  10857. * @memberOf _
  10858. * @since 3.0.0
  10859. * @category Function
  10860. * @param {Function} func The function to curry.
  10861. * @param {number} [arity=func.length] The arity of `func`.
  10862. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10863. * @returns {Function} Returns the new curried function.
  10864. * @example
  10865. *
  10866. * var abc = function(a, b, c) {
  10867. * return [a, b, c];
  10868. * };
  10869. *
  10870. * var curried = _.curryRight(abc);
  10871. *
  10872. * curried(3)(2)(1);
  10873. * // => [1, 2, 3]
  10874. *
  10875. * curried(2, 3)(1);
  10876. * // => [1, 2, 3]
  10877. *
  10878. * curried(1, 2, 3);
  10879. * // => [1, 2, 3]
  10880. *
  10881. * // Curried with placeholders.
  10882. * curried(3)(1, _)(2);
  10883. * // => [1, 2, 3]
  10884. */
  10885. function curryRight(func, arity, guard) {
  10886. arity = guard ? undefined : arity;
  10887. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10888. result.placeholder = curryRight.placeholder;
  10889. return result;
  10890. }
  10891. /**
  10892. * Creates a debounced function that delays invoking `func` until after `wait`
  10893. * milliseconds have elapsed since the last time the debounced function was
  10894. * invoked. The debounced function comes with a `cancel` method to cancel
  10895. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10896. * Provide `options` to indicate whether `func` should be invoked on the
  10897. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10898. * with the last arguments provided to the debounced function. Subsequent
  10899. * calls to the debounced function return the result of the last `func`
  10900. * invocation.
  10901. *
  10902. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10903. * invoked on the trailing edge of the timeout only if the debounced function
  10904. * is invoked more than once during the `wait` timeout.
  10905. *
  10906. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10907. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10908. *
  10909. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10910. * for details over the differences between `_.debounce` and `_.throttle`.
  10911. *
  10912. * @static
  10913. * @memberOf _
  10914. * @since 0.1.0
  10915. * @category Function
  10916. * @param {Function} func The function to debounce.
  10917. * @param {number} [wait=0] The number of milliseconds to delay.
  10918. * @param {Object} [options={}] The options object.
  10919. * @param {boolean} [options.leading=false]
  10920. * Specify invoking on the leading edge of the timeout.
  10921. * @param {number} [options.maxWait]
  10922. * The maximum time `func` is allowed to be delayed before it's invoked.
  10923. * @param {boolean} [options.trailing=true]
  10924. * Specify invoking on the trailing edge of the timeout.
  10925. * @returns {Function} Returns the new debounced function.
  10926. * @example
  10927. *
  10928. * // Avoid costly calculations while the window size is in flux.
  10929. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10930. *
  10931. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10932. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10933. * 'leading': true,
  10934. * 'trailing': false
  10935. * }));
  10936. *
  10937. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10938. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10939. * var source = new EventSource('/stream');
  10940. * jQuery(source).on('message', debounced);
  10941. *
  10942. * // Cancel the trailing debounced invocation.
  10943. * jQuery(window).on('popstate', debounced.cancel);
  10944. */
  10945. function debounce(func, wait, options) {
  10946. var lastArgs,
  10947. lastThis,
  10948. maxWait,
  10949. result,
  10950. timerId,
  10951. lastCallTime,
  10952. lastInvokeTime = 0,
  10953. leading = false,
  10954. maxing = false,
  10955. trailing = true;
  10956. if (typeof func != 'function') {
  10957. throw new TypeError(FUNC_ERROR_TEXT);
  10958. }
  10959. wait = toNumber(wait) || 0;
  10960. if (isObject(options)) {
  10961. leading = !!options.leading;
  10962. maxing = 'maxWait' in options;
  10963. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10964. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10965. }
  10966. function invokeFunc(time) {
  10967. var args = lastArgs,
  10968. thisArg = lastThis;
  10969. lastArgs = lastThis = undefined;
  10970. lastInvokeTime = time;
  10971. result = func.apply(thisArg, args);
  10972. return result;
  10973. }
  10974. function leadingEdge(time) {
  10975. // Reset any `maxWait` timer.
  10976. lastInvokeTime = time;
  10977. // Start the timer for the trailing edge.
  10978. timerId = setTimeout(timerExpired, wait);
  10979. // Invoke the leading edge.
  10980. return leading ? invokeFunc(time) : result;
  10981. }
  10982. function remainingWait(time) {
  10983. var timeSinceLastCall = time - lastCallTime,
  10984. timeSinceLastInvoke = time - lastInvokeTime,
  10985. timeWaiting = wait - timeSinceLastCall;
  10986. return maxing
  10987. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10988. : timeWaiting;
  10989. }
  10990. function shouldInvoke(time) {
  10991. var timeSinceLastCall = time - lastCallTime,
  10992. timeSinceLastInvoke = time - lastInvokeTime;
  10993. // Either this is the first call, activity has stopped and we're at the
  10994. // trailing edge, the system time has gone backwards and we're treating
  10995. // it as the trailing edge, or we've hit the `maxWait` limit.
  10996. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10997. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10998. }
  10999. function timerExpired() {
  11000. var time = now();
  11001. if (shouldInvoke(time)) {
  11002. return trailingEdge(time);
  11003. }
  11004. // Restart the timer.
  11005. timerId = setTimeout(timerExpired, remainingWait(time));
  11006. }
  11007. function trailingEdge(time) {
  11008. timerId = undefined;
  11009. // Only invoke if we have `lastArgs` which means `func` has been
  11010. // debounced at least once.
  11011. if (trailing && lastArgs) {
  11012. return invokeFunc(time);
  11013. }
  11014. lastArgs = lastThis = undefined;
  11015. return result;
  11016. }
  11017. function cancel() {
  11018. if (timerId !== undefined) {
  11019. clearTimeout(timerId);
  11020. }
  11021. lastInvokeTime = 0;
  11022. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11023. }
  11024. function flush() {
  11025. return timerId === undefined ? result : trailingEdge(now());
  11026. }
  11027. function debounced() {
  11028. var time = now(),
  11029. isInvoking = shouldInvoke(time);
  11030. lastArgs = arguments;
  11031. lastThis = this;
  11032. lastCallTime = time;
  11033. if (isInvoking) {
  11034. if (timerId === undefined) {
  11035. return leadingEdge(lastCallTime);
  11036. }
  11037. if (maxing) {
  11038. // Handle invocations in a tight loop.
  11039. clearTimeout(timerId);
  11040. timerId = setTimeout(timerExpired, wait);
  11041. return invokeFunc(lastCallTime);
  11042. }
  11043. }
  11044. if (timerId === undefined) {
  11045. timerId = setTimeout(timerExpired, wait);
  11046. }
  11047. return result;
  11048. }
  11049. debounced.cancel = cancel;
  11050. debounced.flush = flush;
  11051. return debounced;
  11052. }
  11053. /**
  11054. * Defers invoking the `func` until the current call stack has cleared. Any
  11055. * additional arguments are provided to `func` when it's invoked.
  11056. *
  11057. * @static
  11058. * @memberOf _
  11059. * @since 0.1.0
  11060. * @category Function
  11061. * @param {Function} func The function to defer.
  11062. * @param {...*} [args] The arguments to invoke `func` with.
  11063. * @returns {number} Returns the timer id.
  11064. * @example
  11065. *
  11066. * _.defer(function(text) {
  11067. * console.log(text);
  11068. * }, 'deferred');
  11069. * // => Logs 'deferred' after one millisecond.
  11070. */
  11071. var defer = baseRest(function(func, args) {
  11072. return baseDelay(func, 1, args);
  11073. });
  11074. /**
  11075. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11076. * provided to `func` when it's invoked.
  11077. *
  11078. * @static
  11079. * @memberOf _
  11080. * @since 0.1.0
  11081. * @category Function
  11082. * @param {Function} func The function to delay.
  11083. * @param {number} wait The number of milliseconds to delay invocation.
  11084. * @param {...*} [args] The arguments to invoke `func` with.
  11085. * @returns {number} Returns the timer id.
  11086. * @example
  11087. *
  11088. * _.delay(function(text) {
  11089. * console.log(text);
  11090. * }, 1000, 'later');
  11091. * // => Logs 'later' after one second.
  11092. */
  11093. var delay = baseRest(function(func, wait, args) {
  11094. return baseDelay(func, toNumber(wait) || 0, args);
  11095. });
  11096. /**
  11097. * Creates a function that invokes `func` with arguments reversed.
  11098. *
  11099. * @static
  11100. * @memberOf _
  11101. * @since 4.0.0
  11102. * @category Function
  11103. * @param {Function} func The function to flip arguments for.
  11104. * @returns {Function} Returns the new flipped function.
  11105. * @example
  11106. *
  11107. * var flipped = _.flip(function() {
  11108. * return _.toArray(arguments);
  11109. * });
  11110. *
  11111. * flipped('a', 'b', 'c', 'd');
  11112. * // => ['d', 'c', 'b', 'a']
  11113. */
  11114. function flip(func) {
  11115. return createWrap(func, WRAP_FLIP_FLAG);
  11116. }
  11117. /**
  11118. * Creates a function that memoizes the result of `func`. If `resolver` is
  11119. * provided, it determines the cache key for storing the result based on the
  11120. * arguments provided to the memoized function. By default, the first argument
  11121. * provided to the memoized function is used as the map cache key. The `func`
  11122. * is invoked with the `this` binding of the memoized function.
  11123. *
  11124. * **Note:** The cache is exposed as the `cache` property on the memoized
  11125. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11126. * constructor with one whose instances implement the
  11127. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11128. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11129. *
  11130. * @static
  11131. * @memberOf _
  11132. * @since 0.1.0
  11133. * @category Function
  11134. * @param {Function} func The function to have its output memoized.
  11135. * @param {Function} [resolver] The function to resolve the cache key.
  11136. * @returns {Function} Returns the new memoized function.
  11137. * @example
  11138. *
  11139. * var object = { 'a': 1, 'b': 2 };
  11140. * var other = { 'c': 3, 'd': 4 };
  11141. *
  11142. * var values = _.memoize(_.values);
  11143. * values(object);
  11144. * // => [1, 2]
  11145. *
  11146. * values(other);
  11147. * // => [3, 4]
  11148. *
  11149. * object.a = 2;
  11150. * values(object);
  11151. * // => [1, 2]
  11152. *
  11153. * // Modify the result cache.
  11154. * values.cache.set(object, ['a', 'b']);
  11155. * values(object);
  11156. * // => ['a', 'b']
  11157. *
  11158. * // Replace `_.memoize.Cache`.
  11159. * _.memoize.Cache = WeakMap;
  11160. */
  11161. function memoize(func, resolver) {
  11162. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11163. throw new TypeError(FUNC_ERROR_TEXT);
  11164. }
  11165. var memoized = function() {
  11166. var args = arguments,
  11167. key = resolver ? resolver.apply(this, args) : args[0],
  11168. cache = memoized.cache;
  11169. if (cache.has(key)) {
  11170. return cache.get(key);
  11171. }
  11172. var result = func.apply(this, args);
  11173. memoized.cache = cache.set(key, result) || cache;
  11174. return result;
  11175. };
  11176. memoized.cache = new (memoize.Cache || MapCache);
  11177. return memoized;
  11178. }
  11179. // Expose `MapCache`.
  11180. memoize.Cache = MapCache;
  11181. /**
  11182. * Creates a function that negates the result of the predicate `func`. The
  11183. * `func` predicate is invoked with the `this` binding and arguments of the
  11184. * created function.
  11185. *
  11186. * @static
  11187. * @memberOf _
  11188. * @since 3.0.0
  11189. * @category Function
  11190. * @param {Function} predicate The predicate to negate.
  11191. * @returns {Function} Returns the new negated function.
  11192. * @example
  11193. *
  11194. * function isEven(n) {
  11195. * return n % 2 == 0;
  11196. * }
  11197. *
  11198. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11199. * // => [1, 3, 5]
  11200. */
  11201. function negate(predicate) {
  11202. if (typeof predicate != 'function') {
  11203. throw new TypeError(FUNC_ERROR_TEXT);
  11204. }
  11205. return function() {
  11206. var args = arguments;
  11207. switch (args.length) {
  11208. case 0: return !predicate.call(this);
  11209. case 1: return !predicate.call(this, args[0]);
  11210. case 2: return !predicate.call(this, args[0], args[1]);
  11211. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11212. }
  11213. return !predicate.apply(this, args);
  11214. };
  11215. }
  11216. /**
  11217. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11218. * to the function return the value of the first invocation. The `func` is
  11219. * invoked with the `this` binding and arguments of the created function.
  11220. *
  11221. * @static
  11222. * @memberOf _
  11223. * @since 0.1.0
  11224. * @category Function
  11225. * @param {Function} func The function to restrict.
  11226. * @returns {Function} Returns the new restricted function.
  11227. * @example
  11228. *
  11229. * var initialize = _.once(createApplication);
  11230. * initialize();
  11231. * initialize();
  11232. * // => `createApplication` is invoked once
  11233. */
  11234. function once(func) {
  11235. return before(2, func);
  11236. }
  11237. /**
  11238. * Creates a function that invokes `func` with its arguments transformed.
  11239. *
  11240. * @static
  11241. * @since 4.0.0
  11242. * @memberOf _
  11243. * @category Function
  11244. * @param {Function} func The function to wrap.
  11245. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11246. * The argument transforms.
  11247. * @returns {Function} Returns the new function.
  11248. * @example
  11249. *
  11250. * function doubled(n) {
  11251. * return n * 2;
  11252. * }
  11253. *
  11254. * function square(n) {
  11255. * return n * n;
  11256. * }
  11257. *
  11258. * var func = _.overArgs(function(x, y) {
  11259. * return [x, y];
  11260. * }, [square, doubled]);
  11261. *
  11262. * func(9, 3);
  11263. * // => [81, 6]
  11264. *
  11265. * func(10, 5);
  11266. * // => [100, 10]
  11267. */
  11268. var overArgs = castRest(function(func, transforms) {
  11269. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11270. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11271. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11272. var funcsLength = transforms.length;
  11273. return baseRest(function(args) {
  11274. var index = -1,
  11275. length = nativeMin(args.length, funcsLength);
  11276. while (++index < length) {
  11277. args[index] = transforms[index].call(this, args[index]);
  11278. }
  11279. return apply(func, this, args);
  11280. });
  11281. });
  11282. /**
  11283. * Creates a function that invokes `func` with `partials` prepended to the
  11284. * arguments it receives. This method is like `_.bind` except it does **not**
  11285. * alter the `this` binding.
  11286. *
  11287. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11288. * builds, may be used as a placeholder for partially applied arguments.
  11289. *
  11290. * **Note:** This method doesn't set the "length" property of partially
  11291. * applied functions.
  11292. *
  11293. * @static
  11294. * @memberOf _
  11295. * @since 0.2.0
  11296. * @category Function
  11297. * @param {Function} func The function to partially apply arguments to.
  11298. * @param {...*} [partials] The arguments to be partially applied.
  11299. * @returns {Function} Returns the new partially applied function.
  11300. * @example
  11301. *
  11302. * function greet(greeting, name) {
  11303. * return greeting + ' ' + name;
  11304. * }
  11305. *
  11306. * var sayHelloTo = _.partial(greet, 'hello');
  11307. * sayHelloTo('fred');
  11308. * // => 'hello fred'
  11309. *
  11310. * // Partially applied with placeholders.
  11311. * var greetFred = _.partial(greet, _, 'fred');
  11312. * greetFred('hi');
  11313. * // => 'hi fred'
  11314. */
  11315. var partial = baseRest(function(func, partials) {
  11316. var holders = replaceHolders(partials, getHolder(partial));
  11317. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11318. });
  11319. /**
  11320. * This method is like `_.partial` except that partially applied arguments
  11321. * are appended to the arguments it receives.
  11322. *
  11323. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11324. * builds, may be used as a placeholder for partially applied arguments.
  11325. *
  11326. * **Note:** This method doesn't set the "length" property of partially
  11327. * applied functions.
  11328. *
  11329. * @static
  11330. * @memberOf _
  11331. * @since 1.0.0
  11332. * @category Function
  11333. * @param {Function} func The function to partially apply arguments to.
  11334. * @param {...*} [partials] The arguments to be partially applied.
  11335. * @returns {Function} Returns the new partially applied function.
  11336. * @example
  11337. *
  11338. * function greet(greeting, name) {
  11339. * return greeting + ' ' + name;
  11340. * }
  11341. *
  11342. * var greetFred = _.partialRight(greet, 'fred');
  11343. * greetFred('hi');
  11344. * // => 'hi fred'
  11345. *
  11346. * // Partially applied with placeholders.
  11347. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11348. * sayHelloTo('fred');
  11349. * // => 'hello fred'
  11350. */
  11351. var partialRight = baseRest(function(func, partials) {
  11352. var holders = replaceHolders(partials, getHolder(partialRight));
  11353. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11354. });
  11355. /**
  11356. * Creates a function that invokes `func` with arguments arranged according
  11357. * to the specified `indexes` where the argument value at the first index is
  11358. * provided as the first argument, the argument value at the second index is
  11359. * provided as the second argument, and so on.
  11360. *
  11361. * @static
  11362. * @memberOf _
  11363. * @since 3.0.0
  11364. * @category Function
  11365. * @param {Function} func The function to rearrange arguments for.
  11366. * @param {...(number|number[])} indexes The arranged argument indexes.
  11367. * @returns {Function} Returns the new function.
  11368. * @example
  11369. *
  11370. * var rearged = _.rearg(function(a, b, c) {
  11371. * return [a, b, c];
  11372. * }, [2, 0, 1]);
  11373. *
  11374. * rearged('b', 'c', 'a')
  11375. * // => ['a', 'b', 'c']
  11376. */
  11377. var rearg = flatRest(function(func, indexes) {
  11378. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11379. });
  11380. /**
  11381. * Creates a function that invokes `func` with the `this` binding of the
  11382. * created function and arguments from `start` and beyond provided as
  11383. * an array.
  11384. *
  11385. * **Note:** This method is based on the
  11386. * [rest parameter](https://mdn.io/rest_parameters).
  11387. *
  11388. * @static
  11389. * @memberOf _
  11390. * @since 4.0.0
  11391. * @category Function
  11392. * @param {Function} func The function to apply a rest parameter to.
  11393. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11394. * @returns {Function} Returns the new function.
  11395. * @example
  11396. *
  11397. * var say = _.rest(function(what, names) {
  11398. * return what + ' ' + _.initial(names).join(', ') +
  11399. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11400. * });
  11401. *
  11402. * say('hello', 'fred', 'barney', 'pebbles');
  11403. * // => 'hello fred, barney, & pebbles'
  11404. */
  11405. function rest(func, start) {
  11406. if (typeof func != 'function') {
  11407. throw new TypeError(FUNC_ERROR_TEXT);
  11408. }
  11409. start = start === undefined ? start : toInteger(start);
  11410. return baseRest(func, start);
  11411. }
  11412. /**
  11413. * Creates a function that invokes `func` with the `this` binding of the
  11414. * create function and an array of arguments much like
  11415. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11416. *
  11417. * **Note:** This method is based on the
  11418. * [spread operator](https://mdn.io/spread_operator).
  11419. *
  11420. * @static
  11421. * @memberOf _
  11422. * @since 3.2.0
  11423. * @category Function
  11424. * @param {Function} func The function to spread arguments over.
  11425. * @param {number} [start=0] The start position of the spread.
  11426. * @returns {Function} Returns the new function.
  11427. * @example
  11428. *
  11429. * var say = _.spread(function(who, what) {
  11430. * return who + ' says ' + what;
  11431. * });
  11432. *
  11433. * say(['fred', 'hello']);
  11434. * // => 'fred says hello'
  11435. *
  11436. * var numbers = Promise.all([
  11437. * Promise.resolve(40),
  11438. * Promise.resolve(36)
  11439. * ]);
  11440. *
  11441. * numbers.then(_.spread(function(x, y) {
  11442. * return x + y;
  11443. * }));
  11444. * // => a Promise of 76
  11445. */
  11446. function spread(func, start) {
  11447. if (typeof func != 'function') {
  11448. throw new TypeError(FUNC_ERROR_TEXT);
  11449. }
  11450. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11451. return baseRest(function(args) {
  11452. var array = args[start],
  11453. otherArgs = castSlice(args, 0, start);
  11454. if (array) {
  11455. arrayPush(otherArgs, array);
  11456. }
  11457. return apply(func, this, otherArgs);
  11458. });
  11459. }
  11460. /**
  11461. * Creates a throttled function that only invokes `func` at most once per
  11462. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11463. * method to cancel delayed `func` invocations and a `flush` method to
  11464. * immediately invoke them. Provide `options` to indicate whether `func`
  11465. * should be invoked on the leading and/or trailing edge of the `wait`
  11466. * timeout. The `func` is invoked with the last arguments provided to the
  11467. * throttled function. Subsequent calls to the throttled function return the
  11468. * result of the last `func` invocation.
  11469. *
  11470. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11471. * invoked on the trailing edge of the timeout only if the throttled function
  11472. * is invoked more than once during the `wait` timeout.
  11473. *
  11474. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11475. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11476. *
  11477. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11478. * for details over the differences between `_.throttle` and `_.debounce`.
  11479. *
  11480. * @static
  11481. * @memberOf _
  11482. * @since 0.1.0
  11483. * @category Function
  11484. * @param {Function} func The function to throttle.
  11485. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11486. * @param {Object} [options={}] The options object.
  11487. * @param {boolean} [options.leading=true]
  11488. * Specify invoking on the leading edge of the timeout.
  11489. * @param {boolean} [options.trailing=true]
  11490. * Specify invoking on the trailing edge of the timeout.
  11491. * @returns {Function} Returns the new throttled function.
  11492. * @example
  11493. *
  11494. * // Avoid excessively updating the position while scrolling.
  11495. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11496. *
  11497. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11498. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11499. * jQuery(element).on('click', throttled);
  11500. *
  11501. * // Cancel the trailing throttled invocation.
  11502. * jQuery(window).on('popstate', throttled.cancel);
  11503. */
  11504. function throttle(func, wait, options) {
  11505. var leading = true,
  11506. trailing = true;
  11507. if (typeof func != 'function') {
  11508. throw new TypeError(FUNC_ERROR_TEXT);
  11509. }
  11510. if (isObject(options)) {
  11511. leading = 'leading' in options ? !!options.leading : leading;
  11512. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11513. }
  11514. return debounce(func, wait, {
  11515. 'leading': leading,
  11516. 'maxWait': wait,
  11517. 'trailing': trailing
  11518. });
  11519. }
  11520. /**
  11521. * Creates a function that accepts up to one argument, ignoring any
  11522. * additional arguments.
  11523. *
  11524. * @static
  11525. * @memberOf _
  11526. * @since 4.0.0
  11527. * @category Function
  11528. * @param {Function} func The function to cap arguments for.
  11529. * @returns {Function} Returns the new capped function.
  11530. * @example
  11531. *
  11532. * _.map(['6', '8', '10'], _.unary(parseInt));
  11533. * // => [6, 8, 10]
  11534. */
  11535. function unary(func) {
  11536. return ary(func, 1);
  11537. }
  11538. /**
  11539. * Creates a function that provides `value` to `wrapper` as its first
  11540. * argument. Any additional arguments provided to the function are appended
  11541. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11542. * binding of the created function.
  11543. *
  11544. * @static
  11545. * @memberOf _
  11546. * @since 0.1.0
  11547. * @category Function
  11548. * @param {*} value The value to wrap.
  11549. * @param {Function} [wrapper=identity] The wrapper function.
  11550. * @returns {Function} Returns the new function.
  11551. * @example
  11552. *
  11553. * var p = _.wrap(_.escape, function(func, text) {
  11554. * return '<p>' + func(text) + '</p>';
  11555. * });
  11556. *
  11557. * p('fred, barney, & pebbles');
  11558. * // => '<p>fred, barney, &amp; pebbles</p>'
  11559. */
  11560. function wrap(value, wrapper) {
  11561. return partial(castFunction(wrapper), value);
  11562. }
  11563. /*------------------------------------------------------------------------*/
  11564. /**
  11565. * Casts `value` as an array if it's not one.
  11566. *
  11567. * @static
  11568. * @memberOf _
  11569. * @since 4.4.0
  11570. * @category Lang
  11571. * @param {*} value The value to inspect.
  11572. * @returns {Array} Returns the cast array.
  11573. * @example
  11574. *
  11575. * _.castArray(1);
  11576. * // => [1]
  11577. *
  11578. * _.castArray({ 'a': 1 });
  11579. * // => [{ 'a': 1 }]
  11580. *
  11581. * _.castArray('abc');
  11582. * // => ['abc']
  11583. *
  11584. * _.castArray(null);
  11585. * // => [null]
  11586. *
  11587. * _.castArray(undefined);
  11588. * // => [undefined]
  11589. *
  11590. * _.castArray();
  11591. * // => []
  11592. *
  11593. * var array = [1, 2, 3];
  11594. * console.log(_.castArray(array) === array);
  11595. * // => true
  11596. */
  11597. function castArray() {
  11598. if (!arguments.length) {
  11599. return [];
  11600. }
  11601. var value = arguments[0];
  11602. return isArray(value) ? value : [value];
  11603. }
  11604. /**
  11605. * Creates a shallow clone of `value`.
  11606. *
  11607. * **Note:** This method is loosely based on the
  11608. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11609. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11610. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11611. * arrays. The own enumerable properties of `arguments` objects are cloned
  11612. * as plain objects. An empty object is returned for uncloneable values such
  11613. * as error objects, functions, DOM nodes, and WeakMaps.
  11614. *
  11615. * @static
  11616. * @memberOf _
  11617. * @since 0.1.0
  11618. * @category Lang
  11619. * @param {*} value The value to clone.
  11620. * @returns {*} Returns the cloned value.
  11621. * @see _.cloneDeep
  11622. * @example
  11623. *
  11624. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11625. *
  11626. * var shallow = _.clone(objects);
  11627. * console.log(shallow[0] === objects[0]);
  11628. * // => true
  11629. */
  11630. function clone(value) {
  11631. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11632. }
  11633. /**
  11634. * This method is like `_.clone` except that it accepts `customizer` which
  11635. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11636. * cloning is handled by the method instead. The `customizer` is invoked with
  11637. * up to four arguments; (value [, index|key, object, stack]).
  11638. *
  11639. * @static
  11640. * @memberOf _
  11641. * @since 4.0.0
  11642. * @category Lang
  11643. * @param {*} value The value to clone.
  11644. * @param {Function} [customizer] The function to customize cloning.
  11645. * @returns {*} Returns the cloned value.
  11646. * @see _.cloneDeepWith
  11647. * @example
  11648. *
  11649. * function customizer(value) {
  11650. * if (_.isElement(value)) {
  11651. * return value.cloneNode(false);
  11652. * }
  11653. * }
  11654. *
  11655. * var el = _.cloneWith(document.body, customizer);
  11656. *
  11657. * console.log(el === document.body);
  11658. * // => false
  11659. * console.log(el.nodeName);
  11660. * // => 'BODY'
  11661. * console.log(el.childNodes.length);
  11662. * // => 0
  11663. */
  11664. function cloneWith(value, customizer) {
  11665. customizer = typeof customizer == 'function' ? customizer : undefined;
  11666. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11667. }
  11668. /**
  11669. * This method is like `_.clone` except that it recursively clones `value`.
  11670. *
  11671. * @static
  11672. * @memberOf _
  11673. * @since 1.0.0
  11674. * @category Lang
  11675. * @param {*} value The value to recursively clone.
  11676. * @returns {*} Returns the deep cloned value.
  11677. * @see _.clone
  11678. * @example
  11679. *
  11680. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11681. *
  11682. * var deep = _.cloneDeep(objects);
  11683. * console.log(deep[0] === objects[0]);
  11684. * // => false
  11685. */
  11686. function cloneDeep(value) {
  11687. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11688. }
  11689. /**
  11690. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11691. *
  11692. * @static
  11693. * @memberOf _
  11694. * @since 4.0.0
  11695. * @category Lang
  11696. * @param {*} value The value to recursively clone.
  11697. * @param {Function} [customizer] The function to customize cloning.
  11698. * @returns {*} Returns the deep cloned value.
  11699. * @see _.cloneWith
  11700. * @example
  11701. *
  11702. * function customizer(value) {
  11703. * if (_.isElement(value)) {
  11704. * return value.cloneNode(true);
  11705. * }
  11706. * }
  11707. *
  11708. * var el = _.cloneDeepWith(document.body, customizer);
  11709. *
  11710. * console.log(el === document.body);
  11711. * // => false
  11712. * console.log(el.nodeName);
  11713. * // => 'BODY'
  11714. * console.log(el.childNodes.length);
  11715. * // => 20
  11716. */
  11717. function cloneDeepWith(value, customizer) {
  11718. customizer = typeof customizer == 'function' ? customizer : undefined;
  11719. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11720. }
  11721. /**
  11722. * Checks if `object` conforms to `source` by invoking the predicate
  11723. * properties of `source` with the corresponding property values of `object`.
  11724. *
  11725. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11726. * partially applied.
  11727. *
  11728. * @static
  11729. * @memberOf _
  11730. * @since 4.14.0
  11731. * @category Lang
  11732. * @param {Object} object The object to inspect.
  11733. * @param {Object} source The object of property predicates to conform to.
  11734. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11735. * @example
  11736. *
  11737. * var object = { 'a': 1, 'b': 2 };
  11738. *
  11739. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11740. * // => true
  11741. *
  11742. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11743. * // => false
  11744. */
  11745. function conformsTo(object, source) {
  11746. return source == null || baseConformsTo(object, source, keys(source));
  11747. }
  11748. /**
  11749. * Performs a
  11750. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11751. * comparison between two values to determine if they are equivalent.
  11752. *
  11753. * @static
  11754. * @memberOf _
  11755. * @since 4.0.0
  11756. * @category Lang
  11757. * @param {*} value The value to compare.
  11758. * @param {*} other The other value to compare.
  11759. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11760. * @example
  11761. *
  11762. * var object = { 'a': 1 };
  11763. * var other = { 'a': 1 };
  11764. *
  11765. * _.eq(object, object);
  11766. * // => true
  11767. *
  11768. * _.eq(object, other);
  11769. * // => false
  11770. *
  11771. * _.eq('a', 'a');
  11772. * // => true
  11773. *
  11774. * _.eq('a', Object('a'));
  11775. * // => false
  11776. *
  11777. * _.eq(NaN, NaN);
  11778. * // => true
  11779. */
  11780. function eq(value, other) {
  11781. return value === other || (value !== value && other !== other);
  11782. }
  11783. /**
  11784. * Checks if `value` is greater than `other`.
  11785. *
  11786. * @static
  11787. * @memberOf _
  11788. * @since 3.9.0
  11789. * @category Lang
  11790. * @param {*} value The value to compare.
  11791. * @param {*} other The other value to compare.
  11792. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11793. * else `false`.
  11794. * @see _.lt
  11795. * @example
  11796. *
  11797. * _.gt(3, 1);
  11798. * // => true
  11799. *
  11800. * _.gt(3, 3);
  11801. * // => false
  11802. *
  11803. * _.gt(1, 3);
  11804. * // => false
  11805. */
  11806. var gt = createRelationalOperation(baseGt);
  11807. /**
  11808. * Checks if `value` is greater than or equal to `other`.
  11809. *
  11810. * @static
  11811. * @memberOf _
  11812. * @since 3.9.0
  11813. * @category Lang
  11814. * @param {*} value The value to compare.
  11815. * @param {*} other The other value to compare.
  11816. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11817. * `other`, else `false`.
  11818. * @see _.lte
  11819. * @example
  11820. *
  11821. * _.gte(3, 1);
  11822. * // => true
  11823. *
  11824. * _.gte(3, 3);
  11825. * // => true
  11826. *
  11827. * _.gte(1, 3);
  11828. * // => false
  11829. */
  11830. var gte = createRelationalOperation(function(value, other) {
  11831. return value >= other;
  11832. });
  11833. /**
  11834. * Checks if `value` is likely an `arguments` object.
  11835. *
  11836. * @static
  11837. * @memberOf _
  11838. * @since 0.1.0
  11839. * @category Lang
  11840. * @param {*} value The value to check.
  11841. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11842. * else `false`.
  11843. * @example
  11844. *
  11845. * _.isArguments(function() { return arguments; }());
  11846. * // => true
  11847. *
  11848. * _.isArguments([1, 2, 3]);
  11849. * // => false
  11850. */
  11851. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11852. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11853. !propertyIsEnumerable.call(value, 'callee');
  11854. };
  11855. /**
  11856. * Checks if `value` is classified as an `Array` object.
  11857. *
  11858. * @static
  11859. * @memberOf _
  11860. * @since 0.1.0
  11861. * @category Lang
  11862. * @param {*} value The value to check.
  11863. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11864. * @example
  11865. *
  11866. * _.isArray([1, 2, 3]);
  11867. * // => true
  11868. *
  11869. * _.isArray(document.body.children);
  11870. * // => false
  11871. *
  11872. * _.isArray('abc');
  11873. * // => false
  11874. *
  11875. * _.isArray(_.noop);
  11876. * // => false
  11877. */
  11878. var isArray = Array.isArray;
  11879. /**
  11880. * Checks if `value` is classified as an `ArrayBuffer` object.
  11881. *
  11882. * @static
  11883. * @memberOf _
  11884. * @since 4.3.0
  11885. * @category Lang
  11886. * @param {*} value The value to check.
  11887. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11888. * @example
  11889. *
  11890. * _.isArrayBuffer(new ArrayBuffer(2));
  11891. * // => true
  11892. *
  11893. * _.isArrayBuffer(new Array(2));
  11894. * // => false
  11895. */
  11896. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11897. /**
  11898. * Checks if `value` is array-like. A value is considered array-like if it's
  11899. * not a function and has a `value.length` that's an integer greater than or
  11900. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11901. *
  11902. * @static
  11903. * @memberOf _
  11904. * @since 4.0.0
  11905. * @category Lang
  11906. * @param {*} value The value to check.
  11907. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11908. * @example
  11909. *
  11910. * _.isArrayLike([1, 2, 3]);
  11911. * // => true
  11912. *
  11913. * _.isArrayLike(document.body.children);
  11914. * // => true
  11915. *
  11916. * _.isArrayLike('abc');
  11917. * // => true
  11918. *
  11919. * _.isArrayLike(_.noop);
  11920. * // => false
  11921. */
  11922. function isArrayLike(value) {
  11923. return value != null && isLength(value.length) && !isFunction(value);
  11924. }
  11925. /**
  11926. * This method is like `_.isArrayLike` except that it also checks if `value`
  11927. * is an object.
  11928. *
  11929. * @static
  11930. * @memberOf _
  11931. * @since 4.0.0
  11932. * @category Lang
  11933. * @param {*} value The value to check.
  11934. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11935. * else `false`.
  11936. * @example
  11937. *
  11938. * _.isArrayLikeObject([1, 2, 3]);
  11939. * // => true
  11940. *
  11941. * _.isArrayLikeObject(document.body.children);
  11942. * // => true
  11943. *
  11944. * _.isArrayLikeObject('abc');
  11945. * // => false
  11946. *
  11947. * _.isArrayLikeObject(_.noop);
  11948. * // => false
  11949. */
  11950. function isArrayLikeObject(value) {
  11951. return isObjectLike(value) && isArrayLike(value);
  11952. }
  11953. /**
  11954. * Checks if `value` is classified as a boolean primitive or object.
  11955. *
  11956. * @static
  11957. * @memberOf _
  11958. * @since 0.1.0
  11959. * @category Lang
  11960. * @param {*} value The value to check.
  11961. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11962. * @example
  11963. *
  11964. * _.isBoolean(false);
  11965. * // => true
  11966. *
  11967. * _.isBoolean(null);
  11968. * // => false
  11969. */
  11970. function isBoolean(value) {
  11971. return value === true || value === false ||
  11972. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11973. }
  11974. /**
  11975. * Checks if `value` is a buffer.
  11976. *
  11977. * @static
  11978. * @memberOf _
  11979. * @since 4.3.0
  11980. * @category Lang
  11981. * @param {*} value The value to check.
  11982. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11983. * @example
  11984. *
  11985. * _.isBuffer(new Buffer(2));
  11986. * // => true
  11987. *
  11988. * _.isBuffer(new Uint8Array(2));
  11989. * // => false
  11990. */
  11991. var isBuffer = nativeIsBuffer || stubFalse;
  11992. /**
  11993. * Checks if `value` is classified as a `Date` object.
  11994. *
  11995. * @static
  11996. * @memberOf _
  11997. * @since 0.1.0
  11998. * @category Lang
  11999. * @param {*} value The value to check.
  12000. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12001. * @example
  12002. *
  12003. * _.isDate(new Date);
  12004. * // => true
  12005. *
  12006. * _.isDate('Mon April 23 2012');
  12007. * // => false
  12008. */
  12009. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12010. /**
  12011. * Checks if `value` is likely a DOM element.
  12012. *
  12013. * @static
  12014. * @memberOf _
  12015. * @since 0.1.0
  12016. * @category Lang
  12017. * @param {*} value The value to check.
  12018. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12019. * @example
  12020. *
  12021. * _.isElement(document.body);
  12022. * // => true
  12023. *
  12024. * _.isElement('<body>');
  12025. * // => false
  12026. */
  12027. function isElement(value) {
  12028. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12029. }
  12030. /**
  12031. * Checks if `value` is an empty object, collection, map, or set.
  12032. *
  12033. * Objects are considered empty if they have no own enumerable string keyed
  12034. * properties.
  12035. *
  12036. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12037. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12038. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12039. *
  12040. * @static
  12041. * @memberOf _
  12042. * @since 0.1.0
  12043. * @category Lang
  12044. * @param {*} value The value to check.
  12045. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12046. * @example
  12047. *
  12048. * _.isEmpty(null);
  12049. * // => true
  12050. *
  12051. * _.isEmpty(true);
  12052. * // => true
  12053. *
  12054. * _.isEmpty(1);
  12055. * // => true
  12056. *
  12057. * _.isEmpty([1, 2, 3]);
  12058. * // => false
  12059. *
  12060. * _.isEmpty({ 'a': 1 });
  12061. * // => false
  12062. */
  12063. function isEmpty(value) {
  12064. if (value == null) {
  12065. return true;
  12066. }
  12067. if (isArrayLike(value) &&
  12068. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12069. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12070. return !value.length;
  12071. }
  12072. var tag = getTag(value);
  12073. if (tag == mapTag || tag == setTag) {
  12074. return !value.size;
  12075. }
  12076. if (isPrototype(value)) {
  12077. return !baseKeys(value).length;
  12078. }
  12079. for (var key in value) {
  12080. if (hasOwnProperty.call(value, key)) {
  12081. return false;
  12082. }
  12083. }
  12084. return true;
  12085. }
  12086. /**
  12087. * Performs a deep comparison between two values to determine if they are
  12088. * equivalent.
  12089. *
  12090. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12091. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12092. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12093. * by their own, not inherited, enumerable properties. Functions and DOM
  12094. * nodes are compared by strict equality, i.e. `===`.
  12095. *
  12096. * @static
  12097. * @memberOf _
  12098. * @since 0.1.0
  12099. * @category Lang
  12100. * @param {*} value The value to compare.
  12101. * @param {*} other The other value to compare.
  12102. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12103. * @example
  12104. *
  12105. * var object = { 'a': 1 };
  12106. * var other = { 'a': 1 };
  12107. *
  12108. * _.isEqual(object, other);
  12109. * // => true
  12110. *
  12111. * object === other;
  12112. * // => false
  12113. */
  12114. function isEqual(value, other) {
  12115. return baseIsEqual(value, other);
  12116. }
  12117. /**
  12118. * This method is like `_.isEqual` except that it accepts `customizer` which
  12119. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12120. * are handled by the method instead. The `customizer` is invoked with up to
  12121. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12122. *
  12123. * @static
  12124. * @memberOf _
  12125. * @since 4.0.0
  12126. * @category Lang
  12127. * @param {*} value The value to compare.
  12128. * @param {*} other The other value to compare.
  12129. * @param {Function} [customizer] The function to customize comparisons.
  12130. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12131. * @example
  12132. *
  12133. * function isGreeting(value) {
  12134. * return /^h(?:i|ello)$/.test(value);
  12135. * }
  12136. *
  12137. * function customizer(objValue, othValue) {
  12138. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12139. * return true;
  12140. * }
  12141. * }
  12142. *
  12143. * var array = ['hello', 'goodbye'];
  12144. * var other = ['hi', 'goodbye'];
  12145. *
  12146. * _.isEqualWith(array, other, customizer);
  12147. * // => true
  12148. */
  12149. function isEqualWith(value, other, customizer) {
  12150. customizer = typeof customizer == 'function' ? customizer : undefined;
  12151. var result = customizer ? customizer(value, other) : undefined;
  12152. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12153. }
  12154. /**
  12155. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12156. * `SyntaxError`, `TypeError`, or `URIError` object.
  12157. *
  12158. * @static
  12159. * @memberOf _
  12160. * @since 3.0.0
  12161. * @category Lang
  12162. * @param {*} value The value to check.
  12163. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12164. * @example
  12165. *
  12166. * _.isError(new Error);
  12167. * // => true
  12168. *
  12169. * _.isError(Error);
  12170. * // => false
  12171. */
  12172. function isError(value) {
  12173. if (!isObjectLike(value)) {
  12174. return false;
  12175. }
  12176. var tag = baseGetTag(value);
  12177. return tag == errorTag || tag == domExcTag ||
  12178. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12179. }
  12180. /**
  12181. * Checks if `value` is a finite primitive number.
  12182. *
  12183. * **Note:** This method is based on
  12184. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12185. *
  12186. * @static
  12187. * @memberOf _
  12188. * @since 0.1.0
  12189. * @category Lang
  12190. * @param {*} value The value to check.
  12191. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12192. * @example
  12193. *
  12194. * _.isFinite(3);
  12195. * // => true
  12196. *
  12197. * _.isFinite(Number.MIN_VALUE);
  12198. * // => true
  12199. *
  12200. * _.isFinite(Infinity);
  12201. * // => false
  12202. *
  12203. * _.isFinite('3');
  12204. * // => false
  12205. */
  12206. function isFinite(value) {
  12207. return typeof value == 'number' && nativeIsFinite(value);
  12208. }
  12209. /**
  12210. * Checks if `value` is classified as a `Function` object.
  12211. *
  12212. * @static
  12213. * @memberOf _
  12214. * @since 0.1.0
  12215. * @category Lang
  12216. * @param {*} value The value to check.
  12217. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12218. * @example
  12219. *
  12220. * _.isFunction(_);
  12221. * // => true
  12222. *
  12223. * _.isFunction(/abc/);
  12224. * // => false
  12225. */
  12226. function isFunction(value) {
  12227. if (!isObject(value)) {
  12228. return false;
  12229. }
  12230. // The use of `Object#toString` avoids issues with the `typeof` operator
  12231. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12232. var tag = baseGetTag(value);
  12233. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12234. }
  12235. /**
  12236. * Checks if `value` is an integer.
  12237. *
  12238. * **Note:** This method is based on
  12239. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12240. *
  12241. * @static
  12242. * @memberOf _
  12243. * @since 4.0.0
  12244. * @category Lang
  12245. * @param {*} value The value to check.
  12246. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12247. * @example
  12248. *
  12249. * _.isInteger(3);
  12250. * // => true
  12251. *
  12252. * _.isInteger(Number.MIN_VALUE);
  12253. * // => false
  12254. *
  12255. * _.isInteger(Infinity);
  12256. * // => false
  12257. *
  12258. * _.isInteger('3');
  12259. * // => false
  12260. */
  12261. function isInteger(value) {
  12262. return typeof value == 'number' && value == toInteger(value);
  12263. }
  12264. /**
  12265. * Checks if `value` is a valid array-like length.
  12266. *
  12267. * **Note:** This method is loosely based on
  12268. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12269. *
  12270. * @static
  12271. * @memberOf _
  12272. * @since 4.0.0
  12273. * @category Lang
  12274. * @param {*} value The value to check.
  12275. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12276. * @example
  12277. *
  12278. * _.isLength(3);
  12279. * // => true
  12280. *
  12281. * _.isLength(Number.MIN_VALUE);
  12282. * // => false
  12283. *
  12284. * _.isLength(Infinity);
  12285. * // => false
  12286. *
  12287. * _.isLength('3');
  12288. * // => false
  12289. */
  12290. function isLength(value) {
  12291. return typeof value == 'number' &&
  12292. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12293. }
  12294. /**
  12295. * Checks if `value` is the
  12296. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12297. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12298. *
  12299. * @static
  12300. * @memberOf _
  12301. * @since 0.1.0
  12302. * @category Lang
  12303. * @param {*} value The value to check.
  12304. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12305. * @example
  12306. *
  12307. * _.isObject({});
  12308. * // => true
  12309. *
  12310. * _.isObject([1, 2, 3]);
  12311. * // => true
  12312. *
  12313. * _.isObject(_.noop);
  12314. * // => true
  12315. *
  12316. * _.isObject(null);
  12317. * // => false
  12318. */
  12319. function isObject(value) {
  12320. var type = typeof value;
  12321. return value != null && (type == 'object' || type == 'function');
  12322. }
  12323. /**
  12324. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12325. * and has a `typeof` result of "object".
  12326. *
  12327. * @static
  12328. * @memberOf _
  12329. * @since 4.0.0
  12330. * @category Lang
  12331. * @param {*} value The value to check.
  12332. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12333. * @example
  12334. *
  12335. * _.isObjectLike({});
  12336. * // => true
  12337. *
  12338. * _.isObjectLike([1, 2, 3]);
  12339. * // => true
  12340. *
  12341. * _.isObjectLike(_.noop);
  12342. * // => false
  12343. *
  12344. * _.isObjectLike(null);
  12345. * // => false
  12346. */
  12347. function isObjectLike(value) {
  12348. return value != null && typeof value == 'object';
  12349. }
  12350. /**
  12351. * Checks if `value` is classified as a `Map` object.
  12352. *
  12353. * @static
  12354. * @memberOf _
  12355. * @since 4.3.0
  12356. * @category Lang
  12357. * @param {*} value The value to check.
  12358. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12359. * @example
  12360. *
  12361. * _.isMap(new Map);
  12362. * // => true
  12363. *
  12364. * _.isMap(new WeakMap);
  12365. * // => false
  12366. */
  12367. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12368. /**
  12369. * Performs a partial deep comparison between `object` and `source` to
  12370. * determine if `object` contains equivalent property values.
  12371. *
  12372. * **Note:** This method is equivalent to `_.matches` when `source` is
  12373. * partially applied.
  12374. *
  12375. * Partial comparisons will match empty array and empty object `source`
  12376. * values against any array or object value, respectively. See `_.isEqual`
  12377. * for a list of supported value comparisons.
  12378. *
  12379. * @static
  12380. * @memberOf _
  12381. * @since 3.0.0
  12382. * @category Lang
  12383. * @param {Object} object The object to inspect.
  12384. * @param {Object} source The object of property values to match.
  12385. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12386. * @example
  12387. *
  12388. * var object = { 'a': 1, 'b': 2 };
  12389. *
  12390. * _.isMatch(object, { 'b': 2 });
  12391. * // => true
  12392. *
  12393. * _.isMatch(object, { 'b': 1 });
  12394. * // => false
  12395. */
  12396. function isMatch(object, source) {
  12397. return object === source || baseIsMatch(object, source, getMatchData(source));
  12398. }
  12399. /**
  12400. * This method is like `_.isMatch` except that it accepts `customizer` which
  12401. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12402. * are handled by the method instead. The `customizer` is invoked with five
  12403. * arguments: (objValue, srcValue, index|key, object, source).
  12404. *
  12405. * @static
  12406. * @memberOf _
  12407. * @since 4.0.0
  12408. * @category Lang
  12409. * @param {Object} object The object to inspect.
  12410. * @param {Object} source The object of property values to match.
  12411. * @param {Function} [customizer] The function to customize comparisons.
  12412. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12413. * @example
  12414. *
  12415. * function isGreeting(value) {
  12416. * return /^h(?:i|ello)$/.test(value);
  12417. * }
  12418. *
  12419. * function customizer(objValue, srcValue) {
  12420. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12421. * return true;
  12422. * }
  12423. * }
  12424. *
  12425. * var object = { 'greeting': 'hello' };
  12426. * var source = { 'greeting': 'hi' };
  12427. *
  12428. * _.isMatchWith(object, source, customizer);
  12429. * // => true
  12430. */
  12431. function isMatchWith(object, source, customizer) {
  12432. customizer = typeof customizer == 'function' ? customizer : undefined;
  12433. return baseIsMatch(object, source, getMatchData(source), customizer);
  12434. }
  12435. /**
  12436. * Checks if `value` is `NaN`.
  12437. *
  12438. * **Note:** This method is based on
  12439. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12440. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12441. * `undefined` and other non-number values.
  12442. *
  12443. * @static
  12444. * @memberOf _
  12445. * @since 0.1.0
  12446. * @category Lang
  12447. * @param {*} value The value to check.
  12448. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12449. * @example
  12450. *
  12451. * _.isNaN(NaN);
  12452. * // => true
  12453. *
  12454. * _.isNaN(new Number(NaN));
  12455. * // => true
  12456. *
  12457. * isNaN(undefined);
  12458. * // => true
  12459. *
  12460. * _.isNaN(undefined);
  12461. * // => false
  12462. */
  12463. function isNaN(value) {
  12464. // An `NaN` primitive is the only value that is not equal to itself.
  12465. // Perform the `toStringTag` check first to avoid errors with some
  12466. // ActiveX objects in IE.
  12467. return isNumber(value) && value != +value;
  12468. }
  12469. /**
  12470. * Checks if `value` is a pristine native function.
  12471. *
  12472. * **Note:** This method can't reliably detect native functions in the presence
  12473. * of the core-js package because core-js circumvents this kind of detection.
  12474. * Despite multiple requests, the core-js maintainer has made it clear: any
  12475. * attempt to fix the detection will be obstructed. As a result, we're left
  12476. * with little choice but to throw an error. Unfortunately, this also affects
  12477. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12478. * which rely on core-js.
  12479. *
  12480. * @static
  12481. * @memberOf _
  12482. * @since 3.0.0
  12483. * @category Lang
  12484. * @param {*} value The value to check.
  12485. * @returns {boolean} Returns `true` if `value` is a native function,
  12486. * else `false`.
  12487. * @example
  12488. *
  12489. * _.isNative(Array.prototype.push);
  12490. * // => true
  12491. *
  12492. * _.isNative(_);
  12493. * // => false
  12494. */
  12495. function isNative(value) {
  12496. if (isMaskable(value)) {
  12497. throw new Error(CORE_ERROR_TEXT);
  12498. }
  12499. return baseIsNative(value);
  12500. }
  12501. /**
  12502. * Checks if `value` is `null`.
  12503. *
  12504. * @static
  12505. * @memberOf _
  12506. * @since 0.1.0
  12507. * @category Lang
  12508. * @param {*} value The value to check.
  12509. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12510. * @example
  12511. *
  12512. * _.isNull(null);
  12513. * // => true
  12514. *
  12515. * _.isNull(void 0);
  12516. * // => false
  12517. */
  12518. function isNull(value) {
  12519. return value === null;
  12520. }
  12521. /**
  12522. * Checks if `value` is `null` or `undefined`.
  12523. *
  12524. * @static
  12525. * @memberOf _
  12526. * @since 4.0.0
  12527. * @category Lang
  12528. * @param {*} value The value to check.
  12529. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12530. * @example
  12531. *
  12532. * _.isNil(null);
  12533. * // => true
  12534. *
  12535. * _.isNil(void 0);
  12536. * // => true
  12537. *
  12538. * _.isNil(NaN);
  12539. * // => false
  12540. */
  12541. function isNil(value) {
  12542. return value == null;
  12543. }
  12544. /**
  12545. * Checks if `value` is classified as a `Number` primitive or object.
  12546. *
  12547. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12548. * classified as numbers, use the `_.isFinite` method.
  12549. *
  12550. * @static
  12551. * @memberOf _
  12552. * @since 0.1.0
  12553. * @category Lang
  12554. * @param {*} value The value to check.
  12555. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12556. * @example
  12557. *
  12558. * _.isNumber(3);
  12559. * // => true
  12560. *
  12561. * _.isNumber(Number.MIN_VALUE);
  12562. * // => true
  12563. *
  12564. * _.isNumber(Infinity);
  12565. * // => true
  12566. *
  12567. * _.isNumber('3');
  12568. * // => false
  12569. */
  12570. function isNumber(value) {
  12571. return typeof value == 'number' ||
  12572. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12573. }
  12574. /**
  12575. * Checks if `value` is a plain object, that is, an object created by the
  12576. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12577. *
  12578. * @static
  12579. * @memberOf _
  12580. * @since 0.8.0
  12581. * @category Lang
  12582. * @param {*} value The value to check.
  12583. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12584. * @example
  12585. *
  12586. * function Foo() {
  12587. * this.a = 1;
  12588. * }
  12589. *
  12590. * _.isPlainObject(new Foo);
  12591. * // => false
  12592. *
  12593. * _.isPlainObject([1, 2, 3]);
  12594. * // => false
  12595. *
  12596. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12597. * // => true
  12598. *
  12599. * _.isPlainObject(Object.create(null));
  12600. * // => true
  12601. */
  12602. function isPlainObject(value) {
  12603. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12604. return false;
  12605. }
  12606. var proto = getPrototype(value);
  12607. if (proto === null) {
  12608. return true;
  12609. }
  12610. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12611. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12612. funcToString.call(Ctor) == objectCtorString;
  12613. }
  12614. /**
  12615. * Checks if `value` is classified as a `RegExp` object.
  12616. *
  12617. * @static
  12618. * @memberOf _
  12619. * @since 0.1.0
  12620. * @category Lang
  12621. * @param {*} value The value to check.
  12622. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12623. * @example
  12624. *
  12625. * _.isRegExp(/abc/);
  12626. * // => true
  12627. *
  12628. * _.isRegExp('/abc/');
  12629. * // => false
  12630. */
  12631. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12632. /**
  12633. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12634. * double precision number which isn't the result of a rounded unsafe integer.
  12635. *
  12636. * **Note:** This method is based on
  12637. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12638. *
  12639. * @static
  12640. * @memberOf _
  12641. * @since 4.0.0
  12642. * @category Lang
  12643. * @param {*} value The value to check.
  12644. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12645. * @example
  12646. *
  12647. * _.isSafeInteger(3);
  12648. * // => true
  12649. *
  12650. * _.isSafeInteger(Number.MIN_VALUE);
  12651. * // => false
  12652. *
  12653. * _.isSafeInteger(Infinity);
  12654. * // => false
  12655. *
  12656. * _.isSafeInteger('3');
  12657. * // => false
  12658. */
  12659. function isSafeInteger(value) {
  12660. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12661. }
  12662. /**
  12663. * Checks if `value` is classified as a `Set` object.
  12664. *
  12665. * @static
  12666. * @memberOf _
  12667. * @since 4.3.0
  12668. * @category Lang
  12669. * @param {*} value The value to check.
  12670. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12671. * @example
  12672. *
  12673. * _.isSet(new Set);
  12674. * // => true
  12675. *
  12676. * _.isSet(new WeakSet);
  12677. * // => false
  12678. */
  12679. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12680. /**
  12681. * Checks if `value` is classified as a `String` primitive or object.
  12682. *
  12683. * @static
  12684. * @since 0.1.0
  12685. * @memberOf _
  12686. * @category Lang
  12687. * @param {*} value The value to check.
  12688. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12689. * @example
  12690. *
  12691. * _.isString('abc');
  12692. * // => true
  12693. *
  12694. * _.isString(1);
  12695. * // => false
  12696. */
  12697. function isString(value) {
  12698. return typeof value == 'string' ||
  12699. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12700. }
  12701. /**
  12702. * Checks if `value` is classified as a `Symbol` primitive or object.
  12703. *
  12704. * @static
  12705. * @memberOf _
  12706. * @since 4.0.0
  12707. * @category Lang
  12708. * @param {*} value The value to check.
  12709. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12710. * @example
  12711. *
  12712. * _.isSymbol(Symbol.iterator);
  12713. * // => true
  12714. *
  12715. * _.isSymbol('abc');
  12716. * // => false
  12717. */
  12718. function isSymbol(value) {
  12719. return typeof value == 'symbol' ||
  12720. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12721. }
  12722. /**
  12723. * Checks if `value` is classified as a typed array.
  12724. *
  12725. * @static
  12726. * @memberOf _
  12727. * @since 3.0.0
  12728. * @category Lang
  12729. * @param {*} value The value to check.
  12730. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12731. * @example
  12732. *
  12733. * _.isTypedArray(new Uint8Array);
  12734. * // => true
  12735. *
  12736. * _.isTypedArray([]);
  12737. * // => false
  12738. */
  12739. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12740. /**
  12741. * Checks if `value` is `undefined`.
  12742. *
  12743. * @static
  12744. * @since 0.1.0
  12745. * @memberOf _
  12746. * @category Lang
  12747. * @param {*} value The value to check.
  12748. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12749. * @example
  12750. *
  12751. * _.isUndefined(void 0);
  12752. * // => true
  12753. *
  12754. * _.isUndefined(null);
  12755. * // => false
  12756. */
  12757. function isUndefined(value) {
  12758. return value === undefined;
  12759. }
  12760. /**
  12761. * Checks if `value` is classified as a `WeakMap` object.
  12762. *
  12763. * @static
  12764. * @memberOf _
  12765. * @since 4.3.0
  12766. * @category Lang
  12767. * @param {*} value The value to check.
  12768. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12769. * @example
  12770. *
  12771. * _.isWeakMap(new WeakMap);
  12772. * // => true
  12773. *
  12774. * _.isWeakMap(new Map);
  12775. * // => false
  12776. */
  12777. function isWeakMap(value) {
  12778. return isObjectLike(value) && getTag(value) == weakMapTag;
  12779. }
  12780. /**
  12781. * Checks if `value` is classified as a `WeakSet` object.
  12782. *
  12783. * @static
  12784. * @memberOf _
  12785. * @since 4.3.0
  12786. * @category Lang
  12787. * @param {*} value The value to check.
  12788. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12789. * @example
  12790. *
  12791. * _.isWeakSet(new WeakSet);
  12792. * // => true
  12793. *
  12794. * _.isWeakSet(new Set);
  12795. * // => false
  12796. */
  12797. function isWeakSet(value) {
  12798. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12799. }
  12800. /**
  12801. * Checks if `value` is less than `other`.
  12802. *
  12803. * @static
  12804. * @memberOf _
  12805. * @since 3.9.0
  12806. * @category Lang
  12807. * @param {*} value The value to compare.
  12808. * @param {*} other The other value to compare.
  12809. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12810. * else `false`.
  12811. * @see _.gt
  12812. * @example
  12813. *
  12814. * _.lt(1, 3);
  12815. * // => true
  12816. *
  12817. * _.lt(3, 3);
  12818. * // => false
  12819. *
  12820. * _.lt(3, 1);
  12821. * // => false
  12822. */
  12823. var lt = createRelationalOperation(baseLt);
  12824. /**
  12825. * Checks if `value` is less than or equal to `other`.
  12826. *
  12827. * @static
  12828. * @memberOf _
  12829. * @since 3.9.0
  12830. * @category Lang
  12831. * @param {*} value The value to compare.
  12832. * @param {*} other The other value to compare.
  12833. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12834. * `other`, else `false`.
  12835. * @see _.gte
  12836. * @example
  12837. *
  12838. * _.lte(1, 3);
  12839. * // => true
  12840. *
  12841. * _.lte(3, 3);
  12842. * // => true
  12843. *
  12844. * _.lte(3, 1);
  12845. * // => false
  12846. */
  12847. var lte = createRelationalOperation(function(value, other) {
  12848. return value <= other;
  12849. });
  12850. /**
  12851. * Converts `value` to an array.
  12852. *
  12853. * @static
  12854. * @since 0.1.0
  12855. * @memberOf _
  12856. * @category Lang
  12857. * @param {*} value The value to convert.
  12858. * @returns {Array} Returns the converted array.
  12859. * @example
  12860. *
  12861. * _.toArray({ 'a': 1, 'b': 2 });
  12862. * // => [1, 2]
  12863. *
  12864. * _.toArray('abc');
  12865. * // => ['a', 'b', 'c']
  12866. *
  12867. * _.toArray(1);
  12868. * // => []
  12869. *
  12870. * _.toArray(null);
  12871. * // => []
  12872. */
  12873. function toArray(value) {
  12874. if (!value) {
  12875. return [];
  12876. }
  12877. if (isArrayLike(value)) {
  12878. return isString(value) ? stringToArray(value) : copyArray(value);
  12879. }
  12880. if (symIterator && value[symIterator]) {
  12881. return iteratorToArray(value[symIterator]());
  12882. }
  12883. var tag = getTag(value),
  12884. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12885. return func(value);
  12886. }
  12887. /**
  12888. * Converts `value` to a finite number.
  12889. *
  12890. * @static
  12891. * @memberOf _
  12892. * @since 4.12.0
  12893. * @category Lang
  12894. * @param {*} value The value to convert.
  12895. * @returns {number} Returns the converted number.
  12896. * @example
  12897. *
  12898. * _.toFinite(3.2);
  12899. * // => 3.2
  12900. *
  12901. * _.toFinite(Number.MIN_VALUE);
  12902. * // => 5e-324
  12903. *
  12904. * _.toFinite(Infinity);
  12905. * // => 1.7976931348623157e+308
  12906. *
  12907. * _.toFinite('3.2');
  12908. * // => 3.2
  12909. */
  12910. function toFinite(value) {
  12911. if (!value) {
  12912. return value === 0 ? value : 0;
  12913. }
  12914. value = toNumber(value);
  12915. if (value === INFINITY || value === -INFINITY) {
  12916. var sign = (value < 0 ? -1 : 1);
  12917. return sign * MAX_INTEGER;
  12918. }
  12919. return value === value ? value : 0;
  12920. }
  12921. /**
  12922. * Converts `value` to an integer.
  12923. *
  12924. * **Note:** This method is loosely based on
  12925. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12926. *
  12927. * @static
  12928. * @memberOf _
  12929. * @since 4.0.0
  12930. * @category Lang
  12931. * @param {*} value The value to convert.
  12932. * @returns {number} Returns the converted integer.
  12933. * @example
  12934. *
  12935. * _.toInteger(3.2);
  12936. * // => 3
  12937. *
  12938. * _.toInteger(Number.MIN_VALUE);
  12939. * // => 0
  12940. *
  12941. * _.toInteger(Infinity);
  12942. * // => 1.7976931348623157e+308
  12943. *
  12944. * _.toInteger('3.2');
  12945. * // => 3
  12946. */
  12947. function toInteger(value) {
  12948. var result = toFinite(value),
  12949. remainder = result % 1;
  12950. return result === result ? (remainder ? result - remainder : result) : 0;
  12951. }
  12952. /**
  12953. * Converts `value` to an integer suitable for use as the length of an
  12954. * array-like object.
  12955. *
  12956. * **Note:** This method is based on
  12957. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12958. *
  12959. * @static
  12960. * @memberOf _
  12961. * @since 4.0.0
  12962. * @category Lang
  12963. * @param {*} value The value to convert.
  12964. * @returns {number} Returns the converted integer.
  12965. * @example
  12966. *
  12967. * _.toLength(3.2);
  12968. * // => 3
  12969. *
  12970. * _.toLength(Number.MIN_VALUE);
  12971. * // => 0
  12972. *
  12973. * _.toLength(Infinity);
  12974. * // => 4294967295
  12975. *
  12976. * _.toLength('3.2');
  12977. * // => 3
  12978. */
  12979. function toLength(value) {
  12980. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12981. }
  12982. /**
  12983. * Converts `value` to a number.
  12984. *
  12985. * @static
  12986. * @memberOf _
  12987. * @since 4.0.0
  12988. * @category Lang
  12989. * @param {*} value The value to process.
  12990. * @returns {number} Returns the number.
  12991. * @example
  12992. *
  12993. * _.toNumber(3.2);
  12994. * // => 3.2
  12995. *
  12996. * _.toNumber(Number.MIN_VALUE);
  12997. * // => 5e-324
  12998. *
  12999. * _.toNumber(Infinity);
  13000. * // => Infinity
  13001. *
  13002. * _.toNumber('3.2');
  13003. * // => 3.2
  13004. */
  13005. function toNumber(value) {
  13006. if (typeof value == 'number') {
  13007. return value;
  13008. }
  13009. if (isSymbol(value)) {
  13010. return NAN;
  13011. }
  13012. if (isObject(value)) {
  13013. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13014. value = isObject(other) ? (other + '') : other;
  13015. }
  13016. if (typeof value != 'string') {
  13017. return value === 0 ? value : +value;
  13018. }
  13019. value = baseTrim(value);
  13020. var isBinary = reIsBinary.test(value);
  13021. return (isBinary || reIsOctal.test(value))
  13022. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13023. : (reIsBadHex.test(value) ? NAN : +value);
  13024. }
  13025. /**
  13026. * Converts `value` to a plain object flattening inherited enumerable string
  13027. * keyed properties of `value` to own properties of the plain object.
  13028. *
  13029. * @static
  13030. * @memberOf _
  13031. * @since 3.0.0
  13032. * @category Lang
  13033. * @param {*} value The value to convert.
  13034. * @returns {Object} Returns the converted plain object.
  13035. * @example
  13036. *
  13037. * function Foo() {
  13038. * this.b = 2;
  13039. * }
  13040. *
  13041. * Foo.prototype.c = 3;
  13042. *
  13043. * _.assign({ 'a': 1 }, new Foo);
  13044. * // => { 'a': 1, 'b': 2 }
  13045. *
  13046. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13047. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13048. */
  13049. function toPlainObject(value) {
  13050. return copyObject(value, keysIn(value));
  13051. }
  13052. /**
  13053. * Converts `value` to a safe integer. A safe integer can be compared and
  13054. * represented correctly.
  13055. *
  13056. * @static
  13057. * @memberOf _
  13058. * @since 4.0.0
  13059. * @category Lang
  13060. * @param {*} value The value to convert.
  13061. * @returns {number} Returns the converted integer.
  13062. * @example
  13063. *
  13064. * _.toSafeInteger(3.2);
  13065. * // => 3
  13066. *
  13067. * _.toSafeInteger(Number.MIN_VALUE);
  13068. * // => 0
  13069. *
  13070. * _.toSafeInteger(Infinity);
  13071. * // => 9007199254740991
  13072. *
  13073. * _.toSafeInteger('3.2');
  13074. * // => 3
  13075. */
  13076. function toSafeInteger(value) {
  13077. return value
  13078. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13079. : (value === 0 ? value : 0);
  13080. }
  13081. /**
  13082. * Converts `value` to a string. An empty string is returned for `null`
  13083. * and `undefined` values. The sign of `-0` is preserved.
  13084. *
  13085. * @static
  13086. * @memberOf _
  13087. * @since 4.0.0
  13088. * @category Lang
  13089. * @param {*} value The value to convert.
  13090. * @returns {string} Returns the converted string.
  13091. * @example
  13092. *
  13093. * _.toString(null);
  13094. * // => ''
  13095. *
  13096. * _.toString(-0);
  13097. * // => '-0'
  13098. *
  13099. * _.toString([1, 2, 3]);
  13100. * // => '1,2,3'
  13101. */
  13102. function toString(value) {
  13103. return value == null ? '' : baseToString(value);
  13104. }
  13105. /*------------------------------------------------------------------------*/
  13106. /**
  13107. * Assigns own enumerable string keyed properties of source objects to the
  13108. * destination object. Source objects are applied from left to right.
  13109. * Subsequent sources overwrite property assignments of previous sources.
  13110. *
  13111. * **Note:** This method mutates `object` and is loosely based on
  13112. * [`Object.assign`](https://mdn.io/Object/assign).
  13113. *
  13114. * @static
  13115. * @memberOf _
  13116. * @since 0.10.0
  13117. * @category Object
  13118. * @param {Object} object The destination object.
  13119. * @param {...Object} [sources] The source objects.
  13120. * @returns {Object} Returns `object`.
  13121. * @see _.assignIn
  13122. * @example
  13123. *
  13124. * function Foo() {
  13125. * this.a = 1;
  13126. * }
  13127. *
  13128. * function Bar() {
  13129. * this.c = 3;
  13130. * }
  13131. *
  13132. * Foo.prototype.b = 2;
  13133. * Bar.prototype.d = 4;
  13134. *
  13135. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13136. * // => { 'a': 1, 'c': 3 }
  13137. */
  13138. var assign = createAssigner(function(object, source) {
  13139. if (isPrototype(source) || isArrayLike(source)) {
  13140. copyObject(source, keys(source), object);
  13141. return;
  13142. }
  13143. for (var key in source) {
  13144. if (hasOwnProperty.call(source, key)) {
  13145. assignValue(object, key, source[key]);
  13146. }
  13147. }
  13148. });
  13149. /**
  13150. * This method is like `_.assign` except that it iterates over own and
  13151. * inherited source properties.
  13152. *
  13153. * **Note:** This method mutates `object`.
  13154. *
  13155. * @static
  13156. * @memberOf _
  13157. * @since 4.0.0
  13158. * @alias extend
  13159. * @category Object
  13160. * @param {Object} object The destination object.
  13161. * @param {...Object} [sources] The source objects.
  13162. * @returns {Object} Returns `object`.
  13163. * @see _.assign
  13164. * @example
  13165. *
  13166. * function Foo() {
  13167. * this.a = 1;
  13168. * }
  13169. *
  13170. * function Bar() {
  13171. * this.c = 3;
  13172. * }
  13173. *
  13174. * Foo.prototype.b = 2;
  13175. * Bar.prototype.d = 4;
  13176. *
  13177. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13178. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13179. */
  13180. var assignIn = createAssigner(function(object, source) {
  13181. copyObject(source, keysIn(source), object);
  13182. });
  13183. /**
  13184. * This method is like `_.assignIn` except that it accepts `customizer`
  13185. * which is invoked to produce the assigned values. If `customizer` returns
  13186. * `undefined`, assignment is handled by the method instead. The `customizer`
  13187. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13188. *
  13189. * **Note:** This method mutates `object`.
  13190. *
  13191. * @static
  13192. * @memberOf _
  13193. * @since 4.0.0
  13194. * @alias extendWith
  13195. * @category Object
  13196. * @param {Object} object The destination object.
  13197. * @param {...Object} sources The source objects.
  13198. * @param {Function} [customizer] The function to customize assigned values.
  13199. * @returns {Object} Returns `object`.
  13200. * @see _.assignWith
  13201. * @example
  13202. *
  13203. * function customizer(objValue, srcValue) {
  13204. * return _.isUndefined(objValue) ? srcValue : objValue;
  13205. * }
  13206. *
  13207. * var defaults = _.partialRight(_.assignInWith, customizer);
  13208. *
  13209. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13210. * // => { 'a': 1, 'b': 2 }
  13211. */
  13212. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13213. copyObject(source, keysIn(source), object, customizer);
  13214. });
  13215. /**
  13216. * This method is like `_.assign` except that it accepts `customizer`
  13217. * which is invoked to produce the assigned values. If `customizer` returns
  13218. * `undefined`, assignment is handled by the method instead. The `customizer`
  13219. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13220. *
  13221. * **Note:** This method mutates `object`.
  13222. *
  13223. * @static
  13224. * @memberOf _
  13225. * @since 4.0.0
  13226. * @category Object
  13227. * @param {Object} object The destination object.
  13228. * @param {...Object} sources The source objects.
  13229. * @param {Function} [customizer] The function to customize assigned values.
  13230. * @returns {Object} Returns `object`.
  13231. * @see _.assignInWith
  13232. * @example
  13233. *
  13234. * function customizer(objValue, srcValue) {
  13235. * return _.isUndefined(objValue) ? srcValue : objValue;
  13236. * }
  13237. *
  13238. * var defaults = _.partialRight(_.assignWith, customizer);
  13239. *
  13240. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13241. * // => { 'a': 1, 'b': 2 }
  13242. */
  13243. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13244. copyObject(source, keys(source), object, customizer);
  13245. });
  13246. /**
  13247. * Creates an array of values corresponding to `paths` of `object`.
  13248. *
  13249. * @static
  13250. * @memberOf _
  13251. * @since 1.0.0
  13252. * @category Object
  13253. * @param {Object} object The object to iterate over.
  13254. * @param {...(string|string[])} [paths] The property paths to pick.
  13255. * @returns {Array} Returns the picked values.
  13256. * @example
  13257. *
  13258. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13259. *
  13260. * _.at(object, ['a[0].b.c', 'a[1]']);
  13261. * // => [3, 4]
  13262. */
  13263. var at = flatRest(baseAt);
  13264. /**
  13265. * Creates an object that inherits from the `prototype` object. If a
  13266. * `properties` object is given, its own enumerable string keyed properties
  13267. * are assigned to the created object.
  13268. *
  13269. * @static
  13270. * @memberOf _
  13271. * @since 2.3.0
  13272. * @category Object
  13273. * @param {Object} prototype The object to inherit from.
  13274. * @param {Object} [properties] The properties to assign to the object.
  13275. * @returns {Object} Returns the new object.
  13276. * @example
  13277. *
  13278. * function Shape() {
  13279. * this.x = 0;
  13280. * this.y = 0;
  13281. * }
  13282. *
  13283. * function Circle() {
  13284. * Shape.call(this);
  13285. * }
  13286. *
  13287. * Circle.prototype = _.create(Shape.prototype, {
  13288. * 'constructor': Circle
  13289. * });
  13290. *
  13291. * var circle = new Circle;
  13292. * circle instanceof Circle;
  13293. * // => true
  13294. *
  13295. * circle instanceof Shape;
  13296. * // => true
  13297. */
  13298. function create(prototype, properties) {
  13299. var result = baseCreate(prototype);
  13300. return properties == null ? result : baseAssign(result, properties);
  13301. }
  13302. /**
  13303. * Assigns own and inherited enumerable string keyed properties of source
  13304. * objects to the destination object for all destination properties that
  13305. * resolve to `undefined`. Source objects are applied from left to right.
  13306. * Once a property is set, additional values of the same property are ignored.
  13307. *
  13308. * **Note:** This method mutates `object`.
  13309. *
  13310. * @static
  13311. * @since 0.1.0
  13312. * @memberOf _
  13313. * @category Object
  13314. * @param {Object} object The destination object.
  13315. * @param {...Object} [sources] The source objects.
  13316. * @returns {Object} Returns `object`.
  13317. * @see _.defaultsDeep
  13318. * @example
  13319. *
  13320. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13321. * // => { 'a': 1, 'b': 2 }
  13322. */
  13323. var defaults = baseRest(function(object, sources) {
  13324. object = Object(object);
  13325. var index = -1;
  13326. var length = sources.length;
  13327. var guard = length > 2 ? sources[2] : undefined;
  13328. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13329. length = 1;
  13330. }
  13331. while (++index < length) {
  13332. var source = sources[index];
  13333. var props = keysIn(source);
  13334. var propsIndex = -1;
  13335. var propsLength = props.length;
  13336. while (++propsIndex < propsLength) {
  13337. var key = props[propsIndex];
  13338. var value = object[key];
  13339. if (value === undefined ||
  13340. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13341. object[key] = source[key];
  13342. }
  13343. }
  13344. }
  13345. return object;
  13346. });
  13347. /**
  13348. * This method is like `_.defaults` except that it recursively assigns
  13349. * default properties.
  13350. *
  13351. * **Note:** This method mutates `object`.
  13352. *
  13353. * @static
  13354. * @memberOf _
  13355. * @since 3.10.0
  13356. * @category Object
  13357. * @param {Object} object The destination object.
  13358. * @param {...Object} [sources] The source objects.
  13359. * @returns {Object} Returns `object`.
  13360. * @see _.defaults
  13361. * @example
  13362. *
  13363. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13364. * // => { 'a': { 'b': 2, 'c': 3 } }
  13365. */
  13366. var defaultsDeep = baseRest(function(args) {
  13367. args.push(undefined, customDefaultsMerge);
  13368. return apply(mergeWith, undefined, args);
  13369. });
  13370. /**
  13371. * This method is like `_.find` except that it returns the key of the first
  13372. * element `predicate` returns truthy for instead of the element itself.
  13373. *
  13374. * @static
  13375. * @memberOf _
  13376. * @since 1.1.0
  13377. * @category Object
  13378. * @param {Object} object The object to inspect.
  13379. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13380. * @returns {string|undefined} Returns the key of the matched element,
  13381. * else `undefined`.
  13382. * @example
  13383. *
  13384. * var users = {
  13385. * 'barney': { 'age': 36, 'active': true },
  13386. * 'fred': { 'age': 40, 'active': false },
  13387. * 'pebbles': { 'age': 1, 'active': true }
  13388. * };
  13389. *
  13390. * _.findKey(users, function(o) { return o.age < 40; });
  13391. * // => 'barney' (iteration order is not guaranteed)
  13392. *
  13393. * // The `_.matches` iteratee shorthand.
  13394. * _.findKey(users, { 'age': 1, 'active': true });
  13395. * // => 'pebbles'
  13396. *
  13397. * // The `_.matchesProperty` iteratee shorthand.
  13398. * _.findKey(users, ['active', false]);
  13399. * // => 'fred'
  13400. *
  13401. * // The `_.property` iteratee shorthand.
  13402. * _.findKey(users, 'active');
  13403. * // => 'barney'
  13404. */
  13405. function findKey(object, predicate) {
  13406. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13407. }
  13408. /**
  13409. * This method is like `_.findKey` except that it iterates over elements of
  13410. * a collection in the opposite order.
  13411. *
  13412. * @static
  13413. * @memberOf _
  13414. * @since 2.0.0
  13415. * @category Object
  13416. * @param {Object} object The object to inspect.
  13417. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13418. * @returns {string|undefined} Returns the key of the matched element,
  13419. * else `undefined`.
  13420. * @example
  13421. *
  13422. * var users = {
  13423. * 'barney': { 'age': 36, 'active': true },
  13424. * 'fred': { 'age': 40, 'active': false },
  13425. * 'pebbles': { 'age': 1, 'active': true }
  13426. * };
  13427. *
  13428. * _.findLastKey(users, function(o) { return o.age < 40; });
  13429. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13430. *
  13431. * // The `_.matches` iteratee shorthand.
  13432. * _.findLastKey(users, { 'age': 36, 'active': true });
  13433. * // => 'barney'
  13434. *
  13435. * // The `_.matchesProperty` iteratee shorthand.
  13436. * _.findLastKey(users, ['active', false]);
  13437. * // => 'fred'
  13438. *
  13439. * // The `_.property` iteratee shorthand.
  13440. * _.findLastKey(users, 'active');
  13441. * // => 'pebbles'
  13442. */
  13443. function findLastKey(object, predicate) {
  13444. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13445. }
  13446. /**
  13447. * Iterates over own and inherited enumerable string keyed properties of an
  13448. * object and invokes `iteratee` for each property. The iteratee is invoked
  13449. * with three arguments: (value, key, object). Iteratee functions may exit
  13450. * iteration early by explicitly returning `false`.
  13451. *
  13452. * @static
  13453. * @memberOf _
  13454. * @since 0.3.0
  13455. * @category Object
  13456. * @param {Object} object The object to iterate over.
  13457. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13458. * @returns {Object} Returns `object`.
  13459. * @see _.forInRight
  13460. * @example
  13461. *
  13462. * function Foo() {
  13463. * this.a = 1;
  13464. * this.b = 2;
  13465. * }
  13466. *
  13467. * Foo.prototype.c = 3;
  13468. *
  13469. * _.forIn(new Foo, function(value, key) {
  13470. * console.log(key);
  13471. * });
  13472. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13473. */
  13474. function forIn(object, iteratee) {
  13475. return object == null
  13476. ? object
  13477. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13478. }
  13479. /**
  13480. * This method is like `_.forIn` except that it iterates over properties of
  13481. * `object` in the opposite order.
  13482. *
  13483. * @static
  13484. * @memberOf _
  13485. * @since 2.0.0
  13486. * @category Object
  13487. * @param {Object} object The object to iterate over.
  13488. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13489. * @returns {Object} Returns `object`.
  13490. * @see _.forIn
  13491. * @example
  13492. *
  13493. * function Foo() {
  13494. * this.a = 1;
  13495. * this.b = 2;
  13496. * }
  13497. *
  13498. * Foo.prototype.c = 3;
  13499. *
  13500. * _.forInRight(new Foo, function(value, key) {
  13501. * console.log(key);
  13502. * });
  13503. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13504. */
  13505. function forInRight(object, iteratee) {
  13506. return object == null
  13507. ? object
  13508. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13509. }
  13510. /**
  13511. * Iterates over own enumerable string keyed properties of an object and
  13512. * invokes `iteratee` for each property. The iteratee is invoked with three
  13513. * arguments: (value, key, object). Iteratee functions may exit iteration
  13514. * early by explicitly returning `false`.
  13515. *
  13516. * @static
  13517. * @memberOf _
  13518. * @since 0.3.0
  13519. * @category Object
  13520. * @param {Object} object The object to iterate over.
  13521. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13522. * @returns {Object} Returns `object`.
  13523. * @see _.forOwnRight
  13524. * @example
  13525. *
  13526. * function Foo() {
  13527. * this.a = 1;
  13528. * this.b = 2;
  13529. * }
  13530. *
  13531. * Foo.prototype.c = 3;
  13532. *
  13533. * _.forOwn(new Foo, function(value, key) {
  13534. * console.log(key);
  13535. * });
  13536. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13537. */
  13538. function forOwn(object, iteratee) {
  13539. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13540. }
  13541. /**
  13542. * This method is like `_.forOwn` except that it iterates over properties of
  13543. * `object` in the opposite order.
  13544. *
  13545. * @static
  13546. * @memberOf _
  13547. * @since 2.0.0
  13548. * @category Object
  13549. * @param {Object} object The object to iterate over.
  13550. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13551. * @returns {Object} Returns `object`.
  13552. * @see _.forOwn
  13553. * @example
  13554. *
  13555. * function Foo() {
  13556. * this.a = 1;
  13557. * this.b = 2;
  13558. * }
  13559. *
  13560. * Foo.prototype.c = 3;
  13561. *
  13562. * _.forOwnRight(new Foo, function(value, key) {
  13563. * console.log(key);
  13564. * });
  13565. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13566. */
  13567. function forOwnRight(object, iteratee) {
  13568. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13569. }
  13570. /**
  13571. * Creates an array of function property names from own enumerable properties
  13572. * of `object`.
  13573. *
  13574. * @static
  13575. * @since 0.1.0
  13576. * @memberOf _
  13577. * @category Object
  13578. * @param {Object} object The object to inspect.
  13579. * @returns {Array} Returns the function names.
  13580. * @see _.functionsIn
  13581. * @example
  13582. *
  13583. * function Foo() {
  13584. * this.a = _.constant('a');
  13585. * this.b = _.constant('b');
  13586. * }
  13587. *
  13588. * Foo.prototype.c = _.constant('c');
  13589. *
  13590. * _.functions(new Foo);
  13591. * // => ['a', 'b']
  13592. */
  13593. function functions(object) {
  13594. return object == null ? [] : baseFunctions(object, keys(object));
  13595. }
  13596. /**
  13597. * Creates an array of function property names from own and inherited
  13598. * enumerable properties of `object`.
  13599. *
  13600. * @static
  13601. * @memberOf _
  13602. * @since 4.0.0
  13603. * @category Object
  13604. * @param {Object} object The object to inspect.
  13605. * @returns {Array} Returns the function names.
  13606. * @see _.functions
  13607. * @example
  13608. *
  13609. * function Foo() {
  13610. * this.a = _.constant('a');
  13611. * this.b = _.constant('b');
  13612. * }
  13613. *
  13614. * Foo.prototype.c = _.constant('c');
  13615. *
  13616. * _.functionsIn(new Foo);
  13617. * // => ['a', 'b', 'c']
  13618. */
  13619. function functionsIn(object) {
  13620. return object == null ? [] : baseFunctions(object, keysIn(object));
  13621. }
  13622. /**
  13623. * Gets the value at `path` of `object`. If the resolved value is
  13624. * `undefined`, the `defaultValue` is returned in its place.
  13625. *
  13626. * @static
  13627. * @memberOf _
  13628. * @since 3.7.0
  13629. * @category Object
  13630. * @param {Object} object The object to query.
  13631. * @param {Array|string} path The path of the property to get.
  13632. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13633. * @returns {*} Returns the resolved value.
  13634. * @example
  13635. *
  13636. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13637. *
  13638. * _.get(object, 'a[0].b.c');
  13639. * // => 3
  13640. *
  13641. * _.get(object, ['a', '0', 'b', 'c']);
  13642. * // => 3
  13643. *
  13644. * _.get(object, 'a.b.c', 'default');
  13645. * // => 'default'
  13646. */
  13647. function get(object, path, defaultValue) {
  13648. var result = object == null ? undefined : baseGet(object, path);
  13649. return result === undefined ? defaultValue : result;
  13650. }
  13651. /**
  13652. * Checks if `path` is a direct property of `object`.
  13653. *
  13654. * @static
  13655. * @since 0.1.0
  13656. * @memberOf _
  13657. * @category Object
  13658. * @param {Object} object The object to query.
  13659. * @param {Array|string} path The path to check.
  13660. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13661. * @example
  13662. *
  13663. * var object = { 'a': { 'b': 2 } };
  13664. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13665. *
  13666. * _.has(object, 'a');
  13667. * // => true
  13668. *
  13669. * _.has(object, 'a.b');
  13670. * // => true
  13671. *
  13672. * _.has(object, ['a', 'b']);
  13673. * // => true
  13674. *
  13675. * _.has(other, 'a');
  13676. * // => false
  13677. */
  13678. function has(object, path) {
  13679. return object != null && hasPath(object, path, baseHas);
  13680. }
  13681. /**
  13682. * Checks if `path` is a direct or inherited property of `object`.
  13683. *
  13684. * @static
  13685. * @memberOf _
  13686. * @since 4.0.0
  13687. * @category Object
  13688. * @param {Object} object The object to query.
  13689. * @param {Array|string} path The path to check.
  13690. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13691. * @example
  13692. *
  13693. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13694. *
  13695. * _.hasIn(object, 'a');
  13696. * // => true
  13697. *
  13698. * _.hasIn(object, 'a.b');
  13699. * // => true
  13700. *
  13701. * _.hasIn(object, ['a', 'b']);
  13702. * // => true
  13703. *
  13704. * _.hasIn(object, 'b');
  13705. * // => false
  13706. */
  13707. function hasIn(object, path) {
  13708. return object != null && hasPath(object, path, baseHasIn);
  13709. }
  13710. /**
  13711. * Creates an object composed of the inverted keys and values of `object`.
  13712. * If `object` contains duplicate values, subsequent values overwrite
  13713. * property assignments of previous values.
  13714. *
  13715. * @static
  13716. * @memberOf _
  13717. * @since 0.7.0
  13718. * @category Object
  13719. * @param {Object} object The object to invert.
  13720. * @returns {Object} Returns the new inverted object.
  13721. * @example
  13722. *
  13723. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13724. *
  13725. * _.invert(object);
  13726. * // => { '1': 'c', '2': 'b' }
  13727. */
  13728. var invert = createInverter(function(result, value, key) {
  13729. if (value != null &&
  13730. typeof value.toString != 'function') {
  13731. value = nativeObjectToString.call(value);
  13732. }
  13733. result[value] = key;
  13734. }, constant(identity));
  13735. /**
  13736. * This method is like `_.invert` except that the inverted object is generated
  13737. * from the results of running each element of `object` thru `iteratee`. The
  13738. * corresponding inverted value of each inverted key is an array of keys
  13739. * responsible for generating the inverted value. The iteratee is invoked
  13740. * with one argument: (value).
  13741. *
  13742. * @static
  13743. * @memberOf _
  13744. * @since 4.1.0
  13745. * @category Object
  13746. * @param {Object} object The object to invert.
  13747. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13748. * @returns {Object} Returns the new inverted object.
  13749. * @example
  13750. *
  13751. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13752. *
  13753. * _.invertBy(object);
  13754. * // => { '1': ['a', 'c'], '2': ['b'] }
  13755. *
  13756. * _.invertBy(object, function(value) {
  13757. * return 'group' + value;
  13758. * });
  13759. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13760. */
  13761. var invertBy = createInverter(function(result, value, key) {
  13762. if (value != null &&
  13763. typeof value.toString != 'function') {
  13764. value = nativeObjectToString.call(value);
  13765. }
  13766. if (hasOwnProperty.call(result, value)) {
  13767. result[value].push(key);
  13768. } else {
  13769. result[value] = [key];
  13770. }
  13771. }, getIteratee);
  13772. /**
  13773. * Invokes the method at `path` of `object`.
  13774. *
  13775. * @static
  13776. * @memberOf _
  13777. * @since 4.0.0
  13778. * @category Object
  13779. * @param {Object} object The object to query.
  13780. * @param {Array|string} path The path of the method to invoke.
  13781. * @param {...*} [args] The arguments to invoke the method with.
  13782. * @returns {*} Returns the result of the invoked method.
  13783. * @example
  13784. *
  13785. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13786. *
  13787. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13788. * // => [2, 3]
  13789. */
  13790. var invoke = baseRest(baseInvoke);
  13791. /**
  13792. * Creates an array of the own enumerable property names of `object`.
  13793. *
  13794. * **Note:** Non-object values are coerced to objects. See the
  13795. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13796. * for more details.
  13797. *
  13798. * @static
  13799. * @since 0.1.0
  13800. * @memberOf _
  13801. * @category Object
  13802. * @param {Object} object The object to query.
  13803. * @returns {Array} Returns the array of property names.
  13804. * @example
  13805. *
  13806. * function Foo() {
  13807. * this.a = 1;
  13808. * this.b = 2;
  13809. * }
  13810. *
  13811. * Foo.prototype.c = 3;
  13812. *
  13813. * _.keys(new Foo);
  13814. * // => ['a', 'b'] (iteration order is not guaranteed)
  13815. *
  13816. * _.keys('hi');
  13817. * // => ['0', '1']
  13818. */
  13819. function keys(object) {
  13820. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13821. }
  13822. /**
  13823. * Creates an array of the own and inherited enumerable property names of `object`.
  13824. *
  13825. * **Note:** Non-object values are coerced to objects.
  13826. *
  13827. * @static
  13828. * @memberOf _
  13829. * @since 3.0.0
  13830. * @category Object
  13831. * @param {Object} object The object to query.
  13832. * @returns {Array} Returns the array of property names.
  13833. * @example
  13834. *
  13835. * function Foo() {
  13836. * this.a = 1;
  13837. * this.b = 2;
  13838. * }
  13839. *
  13840. * Foo.prototype.c = 3;
  13841. *
  13842. * _.keysIn(new Foo);
  13843. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13844. */
  13845. function keysIn(object) {
  13846. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13847. }
  13848. /**
  13849. * The opposite of `_.mapValues`; this method creates an object with the
  13850. * same values as `object` and keys generated by running each own enumerable
  13851. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13852. * with three arguments: (value, key, object).
  13853. *
  13854. * @static
  13855. * @memberOf _
  13856. * @since 3.8.0
  13857. * @category Object
  13858. * @param {Object} object The object to iterate over.
  13859. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13860. * @returns {Object} Returns the new mapped object.
  13861. * @see _.mapValues
  13862. * @example
  13863. *
  13864. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13865. * return key + value;
  13866. * });
  13867. * // => { 'a1': 1, 'b2': 2 }
  13868. */
  13869. function mapKeys(object, iteratee) {
  13870. var result = {};
  13871. iteratee = getIteratee(iteratee, 3);
  13872. baseForOwn(object, function(value, key, object) {
  13873. baseAssignValue(result, iteratee(value, key, object), value);
  13874. });
  13875. return result;
  13876. }
  13877. /**
  13878. * Creates an object with the same keys as `object` and values generated
  13879. * by running each own enumerable string keyed property of `object` thru
  13880. * `iteratee`. The iteratee is invoked with three arguments:
  13881. * (value, key, object).
  13882. *
  13883. * @static
  13884. * @memberOf _
  13885. * @since 2.4.0
  13886. * @category Object
  13887. * @param {Object} object The object to iterate over.
  13888. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13889. * @returns {Object} Returns the new mapped object.
  13890. * @see _.mapKeys
  13891. * @example
  13892. *
  13893. * var users = {
  13894. * 'fred': { 'user': 'fred', 'age': 40 },
  13895. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13896. * };
  13897. *
  13898. * _.mapValues(users, function(o) { return o.age; });
  13899. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13900. *
  13901. * // The `_.property` iteratee shorthand.
  13902. * _.mapValues(users, 'age');
  13903. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13904. */
  13905. function mapValues(object, iteratee) {
  13906. var result = {};
  13907. iteratee = getIteratee(iteratee, 3);
  13908. baseForOwn(object, function(value, key, object) {
  13909. baseAssignValue(result, key, iteratee(value, key, object));
  13910. });
  13911. return result;
  13912. }
  13913. /**
  13914. * This method is like `_.assign` except that it recursively merges own and
  13915. * inherited enumerable string keyed properties of source objects into the
  13916. * destination object. Source properties that resolve to `undefined` are
  13917. * skipped if a destination value exists. Array and plain object properties
  13918. * are merged recursively. Other objects and value types are overridden by
  13919. * assignment. Source objects are applied from left to right. Subsequent
  13920. * sources overwrite property assignments of previous sources.
  13921. *
  13922. * **Note:** This method mutates `object`.
  13923. *
  13924. * @static
  13925. * @memberOf _
  13926. * @since 0.5.0
  13927. * @category Object
  13928. * @param {Object} object The destination object.
  13929. * @param {...Object} [sources] The source objects.
  13930. * @returns {Object} Returns `object`.
  13931. * @example
  13932. *
  13933. * var object = {
  13934. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13935. * };
  13936. *
  13937. * var other = {
  13938. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13939. * };
  13940. *
  13941. * _.merge(object, other);
  13942. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13943. */
  13944. var merge = createAssigner(function(object, source, srcIndex) {
  13945. baseMerge(object, source, srcIndex);
  13946. });
  13947. /**
  13948. * This method is like `_.merge` except that it accepts `customizer` which
  13949. * is invoked to produce the merged values of the destination and source
  13950. * properties. If `customizer` returns `undefined`, merging is handled by the
  13951. * method instead. The `customizer` is invoked with six arguments:
  13952. * (objValue, srcValue, key, object, source, stack).
  13953. *
  13954. * **Note:** This method mutates `object`.
  13955. *
  13956. * @static
  13957. * @memberOf _
  13958. * @since 4.0.0
  13959. * @category Object
  13960. * @param {Object} object The destination object.
  13961. * @param {...Object} sources The source objects.
  13962. * @param {Function} customizer The function to customize assigned values.
  13963. * @returns {Object} Returns `object`.
  13964. * @example
  13965. *
  13966. * function customizer(objValue, srcValue) {
  13967. * if (_.isArray(objValue)) {
  13968. * return objValue.concat(srcValue);
  13969. * }
  13970. * }
  13971. *
  13972. * var object = { 'a': [1], 'b': [2] };
  13973. * var other = { 'a': [3], 'b': [4] };
  13974. *
  13975. * _.mergeWith(object, other, customizer);
  13976. * // => { 'a': [1, 3], 'b': [2, 4] }
  13977. */
  13978. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13979. baseMerge(object, source, srcIndex, customizer);
  13980. });
  13981. /**
  13982. * The opposite of `_.pick`; this method creates an object composed of the
  13983. * own and inherited enumerable property paths of `object` that are not omitted.
  13984. *
  13985. * **Note:** This method is considerably slower than `_.pick`.
  13986. *
  13987. * @static
  13988. * @since 0.1.0
  13989. * @memberOf _
  13990. * @category Object
  13991. * @param {Object} object The source object.
  13992. * @param {...(string|string[])} [paths] The property paths to omit.
  13993. * @returns {Object} Returns the new object.
  13994. * @example
  13995. *
  13996. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13997. *
  13998. * _.omit(object, ['a', 'c']);
  13999. * // => { 'b': '2' }
  14000. */
  14001. var omit = flatRest(function(object, paths) {
  14002. var result = {};
  14003. if (object == null) {
  14004. return result;
  14005. }
  14006. var isDeep = false;
  14007. paths = arrayMap(paths, function(path) {
  14008. path = castPath(path, object);
  14009. isDeep || (isDeep = path.length > 1);
  14010. return path;
  14011. });
  14012. copyObject(object, getAllKeysIn(object), result);
  14013. if (isDeep) {
  14014. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14015. }
  14016. var length = paths.length;
  14017. while (length--) {
  14018. baseUnset(result, paths[length]);
  14019. }
  14020. return result;
  14021. });
  14022. /**
  14023. * The opposite of `_.pickBy`; this method creates an object composed of
  14024. * the own and inherited enumerable string keyed properties of `object` that
  14025. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14026. * arguments: (value, key).
  14027. *
  14028. * @static
  14029. * @memberOf _
  14030. * @since 4.0.0
  14031. * @category Object
  14032. * @param {Object} object The source object.
  14033. * @param {Function} [predicate=_.identity] The function invoked per property.
  14034. * @returns {Object} Returns the new object.
  14035. * @example
  14036. *
  14037. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14038. *
  14039. * _.omitBy(object, _.isNumber);
  14040. * // => { 'b': '2' }
  14041. */
  14042. function omitBy(object, predicate) {
  14043. return pickBy(object, negate(getIteratee(predicate)));
  14044. }
  14045. /**
  14046. * Creates an object composed of the picked `object` properties.
  14047. *
  14048. * @static
  14049. * @since 0.1.0
  14050. * @memberOf _
  14051. * @category Object
  14052. * @param {Object} object The source object.
  14053. * @param {...(string|string[])} [paths] The property paths to pick.
  14054. * @returns {Object} Returns the new object.
  14055. * @example
  14056. *
  14057. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14058. *
  14059. * _.pick(object, ['a', 'c']);
  14060. * // => { 'a': 1, 'c': 3 }
  14061. */
  14062. var pick = flatRest(function(object, paths) {
  14063. return object == null ? {} : basePick(object, paths);
  14064. });
  14065. /**
  14066. * Creates an object composed of the `object` properties `predicate` returns
  14067. * truthy for. The predicate is invoked with two arguments: (value, key).
  14068. *
  14069. * @static
  14070. * @memberOf _
  14071. * @since 4.0.0
  14072. * @category Object
  14073. * @param {Object} object The source object.
  14074. * @param {Function} [predicate=_.identity] The function invoked per property.
  14075. * @returns {Object} Returns the new object.
  14076. * @example
  14077. *
  14078. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14079. *
  14080. * _.pickBy(object, _.isNumber);
  14081. * // => { 'a': 1, 'c': 3 }
  14082. */
  14083. function pickBy(object, predicate) {
  14084. if (object == null) {
  14085. return {};
  14086. }
  14087. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14088. return [prop];
  14089. });
  14090. predicate = getIteratee(predicate);
  14091. return basePickBy(object, props, function(value, path) {
  14092. return predicate(value, path[0]);
  14093. });
  14094. }
  14095. /**
  14096. * This method is like `_.get` except that if the resolved value is a
  14097. * function it's invoked with the `this` binding of its parent object and
  14098. * its result is returned.
  14099. *
  14100. * @static
  14101. * @since 0.1.0
  14102. * @memberOf _
  14103. * @category Object
  14104. * @param {Object} object The object to query.
  14105. * @param {Array|string} path The path of the property to resolve.
  14106. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14107. * @returns {*} Returns the resolved value.
  14108. * @example
  14109. *
  14110. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14111. *
  14112. * _.result(object, 'a[0].b.c1');
  14113. * // => 3
  14114. *
  14115. * _.result(object, 'a[0].b.c2');
  14116. * // => 4
  14117. *
  14118. * _.result(object, 'a[0].b.c3', 'default');
  14119. * // => 'default'
  14120. *
  14121. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14122. * // => 'default'
  14123. */
  14124. function result(object, path, defaultValue) {
  14125. path = castPath(path, object);
  14126. var index = -1,
  14127. length = path.length;
  14128. // Ensure the loop is entered when path is empty.
  14129. if (!length) {
  14130. length = 1;
  14131. object = undefined;
  14132. }
  14133. while (++index < length) {
  14134. var value = object == null ? undefined : object[toKey(path[index])];
  14135. if (value === undefined) {
  14136. index = length;
  14137. value = defaultValue;
  14138. }
  14139. object = isFunction(value) ? value.call(object) : value;
  14140. }
  14141. return object;
  14142. }
  14143. /**
  14144. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14145. * it's created. Arrays are created for missing index properties while objects
  14146. * are created for all other missing properties. Use `_.setWith` to customize
  14147. * `path` creation.
  14148. *
  14149. * **Note:** This method mutates `object`.
  14150. *
  14151. * @static
  14152. * @memberOf _
  14153. * @since 3.7.0
  14154. * @category Object
  14155. * @param {Object} object The object to modify.
  14156. * @param {Array|string} path The path of the property to set.
  14157. * @param {*} value The value to set.
  14158. * @returns {Object} Returns `object`.
  14159. * @example
  14160. *
  14161. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14162. *
  14163. * _.set(object, 'a[0].b.c', 4);
  14164. * console.log(object.a[0].b.c);
  14165. * // => 4
  14166. *
  14167. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14168. * console.log(object.x[0].y.z);
  14169. * // => 5
  14170. */
  14171. function set(object, path, value) {
  14172. return object == null ? object : baseSet(object, path, value);
  14173. }
  14174. /**
  14175. * This method is like `_.set` except that it accepts `customizer` which is
  14176. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14177. * path creation is handled by the method instead. The `customizer` is invoked
  14178. * with three arguments: (nsValue, key, nsObject).
  14179. *
  14180. * **Note:** This method mutates `object`.
  14181. *
  14182. * @static
  14183. * @memberOf _
  14184. * @since 4.0.0
  14185. * @category Object
  14186. * @param {Object} object The object to modify.
  14187. * @param {Array|string} path The path of the property to set.
  14188. * @param {*} value The value to set.
  14189. * @param {Function} [customizer] The function to customize assigned values.
  14190. * @returns {Object} Returns `object`.
  14191. * @example
  14192. *
  14193. * var object = {};
  14194. *
  14195. * _.setWith(object, '[0][1]', 'a', Object);
  14196. * // => { '0': { '1': 'a' } }
  14197. */
  14198. function setWith(object, path, value, customizer) {
  14199. customizer = typeof customizer == 'function' ? customizer : undefined;
  14200. return object == null ? object : baseSet(object, path, value, customizer);
  14201. }
  14202. /**
  14203. * Creates an array of own enumerable string keyed-value pairs for `object`
  14204. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14205. * entries are returned.
  14206. *
  14207. * @static
  14208. * @memberOf _
  14209. * @since 4.0.0
  14210. * @alias entries
  14211. * @category Object
  14212. * @param {Object} object The object to query.
  14213. * @returns {Array} Returns the key-value pairs.
  14214. * @example
  14215. *
  14216. * function Foo() {
  14217. * this.a = 1;
  14218. * this.b = 2;
  14219. * }
  14220. *
  14221. * Foo.prototype.c = 3;
  14222. *
  14223. * _.toPairs(new Foo);
  14224. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14225. */
  14226. var toPairs = createToPairs(keys);
  14227. /**
  14228. * Creates an array of own and inherited enumerable string keyed-value pairs
  14229. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14230. * or set, its entries are returned.
  14231. *
  14232. * @static
  14233. * @memberOf _
  14234. * @since 4.0.0
  14235. * @alias entriesIn
  14236. * @category Object
  14237. * @param {Object} object The object to query.
  14238. * @returns {Array} Returns the key-value pairs.
  14239. * @example
  14240. *
  14241. * function Foo() {
  14242. * this.a = 1;
  14243. * this.b = 2;
  14244. * }
  14245. *
  14246. * Foo.prototype.c = 3;
  14247. *
  14248. * _.toPairsIn(new Foo);
  14249. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14250. */
  14251. var toPairsIn = createToPairs(keysIn);
  14252. /**
  14253. * An alternative to `_.reduce`; this method transforms `object` to a new
  14254. * `accumulator` object which is the result of running each of its own
  14255. * enumerable string keyed properties thru `iteratee`, with each invocation
  14256. * potentially mutating the `accumulator` object. If `accumulator` is not
  14257. * provided, a new object with the same `[[Prototype]]` will be used. The
  14258. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14259. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14260. *
  14261. * @static
  14262. * @memberOf _
  14263. * @since 1.3.0
  14264. * @category Object
  14265. * @param {Object} object The object to iterate over.
  14266. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14267. * @param {*} [accumulator] The custom accumulator value.
  14268. * @returns {*} Returns the accumulated value.
  14269. * @example
  14270. *
  14271. * _.transform([2, 3, 4], function(result, n) {
  14272. * result.push(n *= n);
  14273. * return n % 2 == 0;
  14274. * }, []);
  14275. * // => [4, 9]
  14276. *
  14277. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14278. * (result[value] || (result[value] = [])).push(key);
  14279. * }, {});
  14280. * // => { '1': ['a', 'c'], '2': ['b'] }
  14281. */
  14282. function transform(object, iteratee, accumulator) {
  14283. var isArr = isArray(object),
  14284. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14285. iteratee = getIteratee(iteratee, 4);
  14286. if (accumulator == null) {
  14287. var Ctor = object && object.constructor;
  14288. if (isArrLike) {
  14289. accumulator = isArr ? new Ctor : [];
  14290. }
  14291. else if (isObject(object)) {
  14292. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14293. }
  14294. else {
  14295. accumulator = {};
  14296. }
  14297. }
  14298. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14299. return iteratee(accumulator, value, index, object);
  14300. });
  14301. return accumulator;
  14302. }
  14303. /**
  14304. * Removes the property at `path` of `object`.
  14305. *
  14306. * **Note:** This method mutates `object`.
  14307. *
  14308. * @static
  14309. * @memberOf _
  14310. * @since 4.0.0
  14311. * @category Object
  14312. * @param {Object} object The object to modify.
  14313. * @param {Array|string} path The path of the property to unset.
  14314. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14315. * @example
  14316. *
  14317. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14318. * _.unset(object, 'a[0].b.c');
  14319. * // => true
  14320. *
  14321. * console.log(object);
  14322. * // => { 'a': [{ 'b': {} }] };
  14323. *
  14324. * _.unset(object, ['a', '0', 'b', 'c']);
  14325. * // => true
  14326. *
  14327. * console.log(object);
  14328. * // => { 'a': [{ 'b': {} }] };
  14329. */
  14330. function unset(object, path) {
  14331. return object == null ? true : baseUnset(object, path);
  14332. }
  14333. /**
  14334. * This method is like `_.set` except that accepts `updater` to produce the
  14335. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14336. * is invoked with one argument: (value).
  14337. *
  14338. * **Note:** This method mutates `object`.
  14339. *
  14340. * @static
  14341. * @memberOf _
  14342. * @since 4.6.0
  14343. * @category Object
  14344. * @param {Object} object The object to modify.
  14345. * @param {Array|string} path The path of the property to set.
  14346. * @param {Function} updater The function to produce the updated value.
  14347. * @returns {Object} Returns `object`.
  14348. * @example
  14349. *
  14350. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14351. *
  14352. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14353. * console.log(object.a[0].b.c);
  14354. * // => 9
  14355. *
  14356. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14357. * console.log(object.x[0].y.z);
  14358. * // => 0
  14359. */
  14360. function update(object, path, updater) {
  14361. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14362. }
  14363. /**
  14364. * This method is like `_.update` except that it accepts `customizer` which is
  14365. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14366. * path creation is handled by the method instead. The `customizer` is invoked
  14367. * with three arguments: (nsValue, key, nsObject).
  14368. *
  14369. * **Note:** This method mutates `object`.
  14370. *
  14371. * @static
  14372. * @memberOf _
  14373. * @since 4.6.0
  14374. * @category Object
  14375. * @param {Object} object The object to modify.
  14376. * @param {Array|string} path The path of the property to set.
  14377. * @param {Function} updater The function to produce the updated value.
  14378. * @param {Function} [customizer] The function to customize assigned values.
  14379. * @returns {Object} Returns `object`.
  14380. * @example
  14381. *
  14382. * var object = {};
  14383. *
  14384. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14385. * // => { '0': { '1': 'a' } }
  14386. */
  14387. function updateWith(object, path, updater, customizer) {
  14388. customizer = typeof customizer == 'function' ? customizer : undefined;
  14389. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14390. }
  14391. /**
  14392. * Creates an array of the own enumerable string keyed property values of `object`.
  14393. *
  14394. * **Note:** Non-object values are coerced to objects.
  14395. *
  14396. * @static
  14397. * @since 0.1.0
  14398. * @memberOf _
  14399. * @category Object
  14400. * @param {Object} object The object to query.
  14401. * @returns {Array} Returns the array of property values.
  14402. * @example
  14403. *
  14404. * function Foo() {
  14405. * this.a = 1;
  14406. * this.b = 2;
  14407. * }
  14408. *
  14409. * Foo.prototype.c = 3;
  14410. *
  14411. * _.values(new Foo);
  14412. * // => [1, 2] (iteration order is not guaranteed)
  14413. *
  14414. * _.values('hi');
  14415. * // => ['h', 'i']
  14416. */
  14417. function values(object) {
  14418. return object == null ? [] : baseValues(object, keys(object));
  14419. }
  14420. /**
  14421. * Creates an array of the own and inherited enumerable string keyed property
  14422. * values of `object`.
  14423. *
  14424. * **Note:** Non-object values are coerced to objects.
  14425. *
  14426. * @static
  14427. * @memberOf _
  14428. * @since 3.0.0
  14429. * @category Object
  14430. * @param {Object} object The object to query.
  14431. * @returns {Array} Returns the array of property values.
  14432. * @example
  14433. *
  14434. * function Foo() {
  14435. * this.a = 1;
  14436. * this.b = 2;
  14437. * }
  14438. *
  14439. * Foo.prototype.c = 3;
  14440. *
  14441. * _.valuesIn(new Foo);
  14442. * // => [1, 2, 3] (iteration order is not guaranteed)
  14443. */
  14444. function valuesIn(object) {
  14445. return object == null ? [] : baseValues(object, keysIn(object));
  14446. }
  14447. /*------------------------------------------------------------------------*/
  14448. /**
  14449. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14450. *
  14451. * @static
  14452. * @memberOf _
  14453. * @since 4.0.0
  14454. * @category Number
  14455. * @param {number} number The number to clamp.
  14456. * @param {number} [lower] The lower bound.
  14457. * @param {number} upper The upper bound.
  14458. * @returns {number} Returns the clamped number.
  14459. * @example
  14460. *
  14461. * _.clamp(-10, -5, 5);
  14462. * // => -5
  14463. *
  14464. * _.clamp(10, -5, 5);
  14465. * // => 5
  14466. */
  14467. function clamp(number, lower, upper) {
  14468. if (upper === undefined) {
  14469. upper = lower;
  14470. lower = undefined;
  14471. }
  14472. if (upper !== undefined) {
  14473. upper = toNumber(upper);
  14474. upper = upper === upper ? upper : 0;
  14475. }
  14476. if (lower !== undefined) {
  14477. lower = toNumber(lower);
  14478. lower = lower === lower ? lower : 0;
  14479. }
  14480. return baseClamp(toNumber(number), lower, upper);
  14481. }
  14482. /**
  14483. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14484. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14485. * If `start` is greater than `end` the params are swapped to support
  14486. * negative ranges.
  14487. *
  14488. * @static
  14489. * @memberOf _
  14490. * @since 3.3.0
  14491. * @category Number
  14492. * @param {number} number The number to check.
  14493. * @param {number} [start=0] The start of the range.
  14494. * @param {number} end The end of the range.
  14495. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14496. * @see _.range, _.rangeRight
  14497. * @example
  14498. *
  14499. * _.inRange(3, 2, 4);
  14500. * // => true
  14501. *
  14502. * _.inRange(4, 8);
  14503. * // => true
  14504. *
  14505. * _.inRange(4, 2);
  14506. * // => false
  14507. *
  14508. * _.inRange(2, 2);
  14509. * // => false
  14510. *
  14511. * _.inRange(1.2, 2);
  14512. * // => true
  14513. *
  14514. * _.inRange(5.2, 4);
  14515. * // => false
  14516. *
  14517. * _.inRange(-3, -2, -6);
  14518. * // => true
  14519. */
  14520. function inRange(number, start, end) {
  14521. start = toFinite(start);
  14522. if (end === undefined) {
  14523. end = start;
  14524. start = 0;
  14525. } else {
  14526. end = toFinite(end);
  14527. }
  14528. number = toNumber(number);
  14529. return baseInRange(number, start, end);
  14530. }
  14531. /**
  14532. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14533. * If only one argument is provided a number between `0` and the given number
  14534. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14535. * floats, a floating-point number is returned instead of an integer.
  14536. *
  14537. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14538. * floating-point values which can produce unexpected results.
  14539. *
  14540. * @static
  14541. * @memberOf _
  14542. * @since 0.7.0
  14543. * @category Number
  14544. * @param {number} [lower=0] The lower bound.
  14545. * @param {number} [upper=1] The upper bound.
  14546. * @param {boolean} [floating] Specify returning a floating-point number.
  14547. * @returns {number} Returns the random number.
  14548. * @example
  14549. *
  14550. * _.random(0, 5);
  14551. * // => an integer between 0 and 5
  14552. *
  14553. * _.random(5);
  14554. * // => also an integer between 0 and 5
  14555. *
  14556. * _.random(5, true);
  14557. * // => a floating-point number between 0 and 5
  14558. *
  14559. * _.random(1.2, 5.2);
  14560. * // => a floating-point number between 1.2 and 5.2
  14561. */
  14562. function random(lower, upper, floating) {
  14563. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14564. upper = floating = undefined;
  14565. }
  14566. if (floating === undefined) {
  14567. if (typeof upper == 'boolean') {
  14568. floating = upper;
  14569. upper = undefined;
  14570. }
  14571. else if (typeof lower == 'boolean') {
  14572. floating = lower;
  14573. lower = undefined;
  14574. }
  14575. }
  14576. if (lower === undefined && upper === undefined) {
  14577. lower = 0;
  14578. upper = 1;
  14579. }
  14580. else {
  14581. lower = toFinite(lower);
  14582. if (upper === undefined) {
  14583. upper = lower;
  14584. lower = 0;
  14585. } else {
  14586. upper = toFinite(upper);
  14587. }
  14588. }
  14589. if (lower > upper) {
  14590. var temp = lower;
  14591. lower = upper;
  14592. upper = temp;
  14593. }
  14594. if (floating || lower % 1 || upper % 1) {
  14595. var rand = nativeRandom();
  14596. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14597. }
  14598. return baseRandom(lower, upper);
  14599. }
  14600. /*------------------------------------------------------------------------*/
  14601. /**
  14602. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14603. *
  14604. * @static
  14605. * @memberOf _
  14606. * @since 3.0.0
  14607. * @category String
  14608. * @param {string} [string=''] The string to convert.
  14609. * @returns {string} Returns the camel cased string.
  14610. * @example
  14611. *
  14612. * _.camelCase('Foo Bar');
  14613. * // => 'fooBar'
  14614. *
  14615. * _.camelCase('--foo-bar--');
  14616. * // => 'fooBar'
  14617. *
  14618. * _.camelCase('__FOO_BAR__');
  14619. * // => 'fooBar'
  14620. */
  14621. var camelCase = createCompounder(function(result, word, index) {
  14622. word = word.toLowerCase();
  14623. return result + (index ? capitalize(word) : word);
  14624. });
  14625. /**
  14626. * Converts the first character of `string` to upper case and the remaining
  14627. * to lower case.
  14628. *
  14629. * @static
  14630. * @memberOf _
  14631. * @since 3.0.0
  14632. * @category String
  14633. * @param {string} [string=''] The string to capitalize.
  14634. * @returns {string} Returns the capitalized string.
  14635. * @example
  14636. *
  14637. * _.capitalize('FRED');
  14638. * // => 'Fred'
  14639. */
  14640. function capitalize(string) {
  14641. return upperFirst(toString(string).toLowerCase());
  14642. }
  14643. /**
  14644. * Deburrs `string` by converting
  14645. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14646. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14647. * letters to basic Latin letters and removing
  14648. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14649. *
  14650. * @static
  14651. * @memberOf _
  14652. * @since 3.0.0
  14653. * @category String
  14654. * @param {string} [string=''] The string to deburr.
  14655. * @returns {string} Returns the deburred string.
  14656. * @example
  14657. *
  14658. * _.deburr('déjà vu');
  14659. * // => 'deja vu'
  14660. */
  14661. function deburr(string) {
  14662. string = toString(string);
  14663. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14664. }
  14665. /**
  14666. * Checks if `string` ends with the given target string.
  14667. *
  14668. * @static
  14669. * @memberOf _
  14670. * @since 3.0.0
  14671. * @category String
  14672. * @param {string} [string=''] The string to inspect.
  14673. * @param {string} [target] The string to search for.
  14674. * @param {number} [position=string.length] The position to search up to.
  14675. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14676. * else `false`.
  14677. * @example
  14678. *
  14679. * _.endsWith('abc', 'c');
  14680. * // => true
  14681. *
  14682. * _.endsWith('abc', 'b');
  14683. * // => false
  14684. *
  14685. * _.endsWith('abc', 'b', 2);
  14686. * // => true
  14687. */
  14688. function endsWith(string, target, position) {
  14689. string = toString(string);
  14690. target = baseToString(target);
  14691. var length = string.length;
  14692. position = position === undefined
  14693. ? length
  14694. : baseClamp(toInteger(position), 0, length);
  14695. var end = position;
  14696. position -= target.length;
  14697. return position >= 0 && string.slice(position, end) == target;
  14698. }
  14699. /**
  14700. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14701. * corresponding HTML entities.
  14702. *
  14703. * **Note:** No other characters are escaped. To escape additional
  14704. * characters use a third-party library like [_he_](https://mths.be/he).
  14705. *
  14706. * Though the ">" character is escaped for symmetry, characters like
  14707. * ">" and "/" don't need escaping in HTML and have no special meaning
  14708. * unless they're part of a tag or unquoted attribute value. See
  14709. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14710. * (under "semi-related fun fact") for more details.
  14711. *
  14712. * When working with HTML you should always
  14713. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14714. * XSS vectors.
  14715. *
  14716. * @static
  14717. * @since 0.1.0
  14718. * @memberOf _
  14719. * @category String
  14720. * @param {string} [string=''] The string to escape.
  14721. * @returns {string} Returns the escaped string.
  14722. * @example
  14723. *
  14724. * _.escape('fred, barney, & pebbles');
  14725. * // => 'fred, barney, &amp; pebbles'
  14726. */
  14727. function escape(string) {
  14728. string = toString(string);
  14729. return (string && reHasUnescapedHtml.test(string))
  14730. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14731. : string;
  14732. }
  14733. /**
  14734. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14735. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14736. *
  14737. * @static
  14738. * @memberOf _
  14739. * @since 3.0.0
  14740. * @category String
  14741. * @param {string} [string=''] The string to escape.
  14742. * @returns {string} Returns the escaped string.
  14743. * @example
  14744. *
  14745. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14746. * // => '\[lodash\]\(https://lodash\.com/\)'
  14747. */
  14748. function escapeRegExp(string) {
  14749. string = toString(string);
  14750. return (string && reHasRegExpChar.test(string))
  14751. ? string.replace(reRegExpChar, '\\$&')
  14752. : string;
  14753. }
  14754. /**
  14755. * Converts `string` to
  14756. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14757. *
  14758. * @static
  14759. * @memberOf _
  14760. * @since 3.0.0
  14761. * @category String
  14762. * @param {string} [string=''] The string to convert.
  14763. * @returns {string} Returns the kebab cased string.
  14764. * @example
  14765. *
  14766. * _.kebabCase('Foo Bar');
  14767. * // => 'foo-bar'
  14768. *
  14769. * _.kebabCase('fooBar');
  14770. * // => 'foo-bar'
  14771. *
  14772. * _.kebabCase('__FOO_BAR__');
  14773. * // => 'foo-bar'
  14774. */
  14775. var kebabCase = createCompounder(function(result, word, index) {
  14776. return result + (index ? '-' : '') + word.toLowerCase();
  14777. });
  14778. /**
  14779. * Converts `string`, as space separated words, to lower case.
  14780. *
  14781. * @static
  14782. * @memberOf _
  14783. * @since 4.0.0
  14784. * @category String
  14785. * @param {string} [string=''] The string to convert.
  14786. * @returns {string} Returns the lower cased string.
  14787. * @example
  14788. *
  14789. * _.lowerCase('--Foo-Bar--');
  14790. * // => 'foo bar'
  14791. *
  14792. * _.lowerCase('fooBar');
  14793. * // => 'foo bar'
  14794. *
  14795. * _.lowerCase('__FOO_BAR__');
  14796. * // => 'foo bar'
  14797. */
  14798. var lowerCase = createCompounder(function(result, word, index) {
  14799. return result + (index ? ' ' : '') + word.toLowerCase();
  14800. });
  14801. /**
  14802. * Converts the first character of `string` to lower case.
  14803. *
  14804. * @static
  14805. * @memberOf _
  14806. * @since 4.0.0
  14807. * @category String
  14808. * @param {string} [string=''] The string to convert.
  14809. * @returns {string} Returns the converted string.
  14810. * @example
  14811. *
  14812. * _.lowerFirst('Fred');
  14813. * // => 'fred'
  14814. *
  14815. * _.lowerFirst('FRED');
  14816. * // => 'fRED'
  14817. */
  14818. var lowerFirst = createCaseFirst('toLowerCase');
  14819. /**
  14820. * Pads `string` on the left and right sides if it's shorter than `length`.
  14821. * Padding characters are truncated if they can't be evenly divided by `length`.
  14822. *
  14823. * @static
  14824. * @memberOf _
  14825. * @since 3.0.0
  14826. * @category String
  14827. * @param {string} [string=''] The string to pad.
  14828. * @param {number} [length=0] The padding length.
  14829. * @param {string} [chars=' '] The string used as padding.
  14830. * @returns {string} Returns the padded string.
  14831. * @example
  14832. *
  14833. * _.pad('abc', 8);
  14834. * // => ' abc '
  14835. *
  14836. * _.pad('abc', 8, '_-');
  14837. * // => '_-abc_-_'
  14838. *
  14839. * _.pad('abc', 3);
  14840. * // => 'abc'
  14841. */
  14842. function pad(string, length, chars) {
  14843. string = toString(string);
  14844. length = toInteger(length);
  14845. var strLength = length ? stringSize(string) : 0;
  14846. if (!length || strLength >= length) {
  14847. return string;
  14848. }
  14849. var mid = (length - strLength) / 2;
  14850. return (
  14851. createPadding(nativeFloor(mid), chars) +
  14852. string +
  14853. createPadding(nativeCeil(mid), chars)
  14854. );
  14855. }
  14856. /**
  14857. * Pads `string` on the right side if it's shorter than `length`. Padding
  14858. * characters are truncated if they exceed `length`.
  14859. *
  14860. * @static
  14861. * @memberOf _
  14862. * @since 4.0.0
  14863. * @category String
  14864. * @param {string} [string=''] The string to pad.
  14865. * @param {number} [length=0] The padding length.
  14866. * @param {string} [chars=' '] The string used as padding.
  14867. * @returns {string} Returns the padded string.
  14868. * @example
  14869. *
  14870. * _.padEnd('abc', 6);
  14871. * // => 'abc '
  14872. *
  14873. * _.padEnd('abc', 6, '_-');
  14874. * // => 'abc_-_'
  14875. *
  14876. * _.padEnd('abc', 3);
  14877. * // => 'abc'
  14878. */
  14879. function padEnd(string, length, chars) {
  14880. string = toString(string);
  14881. length = toInteger(length);
  14882. var strLength = length ? stringSize(string) : 0;
  14883. return (length && strLength < length)
  14884. ? (string + createPadding(length - strLength, chars))
  14885. : string;
  14886. }
  14887. /**
  14888. * Pads `string` on the left side if it's shorter than `length`. Padding
  14889. * characters are truncated if they exceed `length`.
  14890. *
  14891. * @static
  14892. * @memberOf _
  14893. * @since 4.0.0
  14894. * @category String
  14895. * @param {string} [string=''] The string to pad.
  14896. * @param {number} [length=0] The padding length.
  14897. * @param {string} [chars=' '] The string used as padding.
  14898. * @returns {string} Returns the padded string.
  14899. * @example
  14900. *
  14901. * _.padStart('abc', 6);
  14902. * // => ' abc'
  14903. *
  14904. * _.padStart('abc', 6, '_-');
  14905. * // => '_-_abc'
  14906. *
  14907. * _.padStart('abc', 3);
  14908. * // => 'abc'
  14909. */
  14910. function padStart(string, length, chars) {
  14911. string = toString(string);
  14912. length = toInteger(length);
  14913. var strLength = length ? stringSize(string) : 0;
  14914. return (length && strLength < length)
  14915. ? (createPadding(length - strLength, chars) + string)
  14916. : string;
  14917. }
  14918. /**
  14919. * Converts `string` to an integer of the specified radix. If `radix` is
  14920. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14921. * hexadecimal, in which case a `radix` of `16` is used.
  14922. *
  14923. * **Note:** This method aligns with the
  14924. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14925. *
  14926. * @static
  14927. * @memberOf _
  14928. * @since 1.1.0
  14929. * @category String
  14930. * @param {string} string The string to convert.
  14931. * @param {number} [radix=10] The radix to interpret `value` by.
  14932. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14933. * @returns {number} Returns the converted integer.
  14934. * @example
  14935. *
  14936. * _.parseInt('08');
  14937. * // => 8
  14938. *
  14939. * _.map(['6', '08', '10'], _.parseInt);
  14940. * // => [6, 8, 10]
  14941. */
  14942. function parseInt(string, radix, guard) {
  14943. if (guard || radix == null) {
  14944. radix = 0;
  14945. } else if (radix) {
  14946. radix = +radix;
  14947. }
  14948. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14949. }
  14950. /**
  14951. * Repeats the given string `n` times.
  14952. *
  14953. * @static
  14954. * @memberOf _
  14955. * @since 3.0.0
  14956. * @category String
  14957. * @param {string} [string=''] The string to repeat.
  14958. * @param {number} [n=1] The number of times to repeat the string.
  14959. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14960. * @returns {string} Returns the repeated string.
  14961. * @example
  14962. *
  14963. * _.repeat('*', 3);
  14964. * // => '***'
  14965. *
  14966. * _.repeat('abc', 2);
  14967. * // => 'abcabc'
  14968. *
  14969. * _.repeat('abc', 0);
  14970. * // => ''
  14971. */
  14972. function repeat(string, n, guard) {
  14973. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14974. n = 1;
  14975. } else {
  14976. n = toInteger(n);
  14977. }
  14978. return baseRepeat(toString(string), n);
  14979. }
  14980. /**
  14981. * Replaces matches for `pattern` in `string` with `replacement`.
  14982. *
  14983. * **Note:** This method is based on
  14984. * [`String#replace`](https://mdn.io/String/replace).
  14985. *
  14986. * @static
  14987. * @memberOf _
  14988. * @since 4.0.0
  14989. * @category String
  14990. * @param {string} [string=''] The string to modify.
  14991. * @param {RegExp|string} pattern The pattern to replace.
  14992. * @param {Function|string} replacement The match replacement.
  14993. * @returns {string} Returns the modified string.
  14994. * @example
  14995. *
  14996. * _.replace('Hi Fred', 'Fred', 'Barney');
  14997. * // => 'Hi Barney'
  14998. */
  14999. function replace() {
  15000. var args = arguments,
  15001. string = toString(args[0]);
  15002. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15003. }
  15004. /**
  15005. * Converts `string` to
  15006. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15007. *
  15008. * @static
  15009. * @memberOf _
  15010. * @since 3.0.0
  15011. * @category String
  15012. * @param {string} [string=''] The string to convert.
  15013. * @returns {string} Returns the snake cased string.
  15014. * @example
  15015. *
  15016. * _.snakeCase('Foo Bar');
  15017. * // => 'foo_bar'
  15018. *
  15019. * _.snakeCase('fooBar');
  15020. * // => 'foo_bar'
  15021. *
  15022. * _.snakeCase('--FOO-BAR--');
  15023. * // => 'foo_bar'
  15024. */
  15025. var snakeCase = createCompounder(function(result, word, index) {
  15026. return result + (index ? '_' : '') + word.toLowerCase();
  15027. });
  15028. /**
  15029. * Splits `string` by `separator`.
  15030. *
  15031. * **Note:** This method is based on
  15032. * [`String#split`](https://mdn.io/String/split).
  15033. *
  15034. * @static
  15035. * @memberOf _
  15036. * @since 4.0.0
  15037. * @category String
  15038. * @param {string} [string=''] The string to split.
  15039. * @param {RegExp|string} separator The separator pattern to split by.
  15040. * @param {number} [limit] The length to truncate results to.
  15041. * @returns {Array} Returns the string segments.
  15042. * @example
  15043. *
  15044. * _.split('a-b-c', '-', 2);
  15045. * // => ['a', 'b']
  15046. */
  15047. function split(string, separator, limit) {
  15048. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15049. separator = limit = undefined;
  15050. }
  15051. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15052. if (!limit) {
  15053. return [];
  15054. }
  15055. string = toString(string);
  15056. if (string && (
  15057. typeof separator == 'string' ||
  15058. (separator != null && !isRegExp(separator))
  15059. )) {
  15060. separator = baseToString(separator);
  15061. if (!separator && hasUnicode(string)) {
  15062. return castSlice(stringToArray(string), 0, limit);
  15063. }
  15064. }
  15065. return string.split(separator, limit);
  15066. }
  15067. /**
  15068. * Converts `string` to
  15069. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15070. *
  15071. * @static
  15072. * @memberOf _
  15073. * @since 3.1.0
  15074. * @category String
  15075. * @param {string} [string=''] The string to convert.
  15076. * @returns {string} Returns the start cased string.
  15077. * @example
  15078. *
  15079. * _.startCase('--foo-bar--');
  15080. * // => 'Foo Bar'
  15081. *
  15082. * _.startCase('fooBar');
  15083. * // => 'Foo Bar'
  15084. *
  15085. * _.startCase('__FOO_BAR__');
  15086. * // => 'FOO BAR'
  15087. */
  15088. var startCase = createCompounder(function(result, word, index) {
  15089. return result + (index ? ' ' : '') + upperFirst(word);
  15090. });
  15091. /**
  15092. * Checks if `string` starts with the given target string.
  15093. *
  15094. * @static
  15095. * @memberOf _
  15096. * @since 3.0.0
  15097. * @category String
  15098. * @param {string} [string=''] The string to inspect.
  15099. * @param {string} [target] The string to search for.
  15100. * @param {number} [position=0] The position to search from.
  15101. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15102. * else `false`.
  15103. * @example
  15104. *
  15105. * _.startsWith('abc', 'a');
  15106. * // => true
  15107. *
  15108. * _.startsWith('abc', 'b');
  15109. * // => false
  15110. *
  15111. * _.startsWith('abc', 'b', 1);
  15112. * // => true
  15113. */
  15114. function startsWith(string, target, position) {
  15115. string = toString(string);
  15116. position = position == null
  15117. ? 0
  15118. : baseClamp(toInteger(position), 0, string.length);
  15119. target = baseToString(target);
  15120. return string.slice(position, position + target.length) == target;
  15121. }
  15122. /**
  15123. * Creates a compiled template function that can interpolate data properties
  15124. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15125. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15126. * properties may be accessed as free variables in the template. If a setting
  15127. * object is given, it takes precedence over `_.templateSettings` values.
  15128. *
  15129. * **Note:** In the development build `_.template` utilizes
  15130. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15131. * for easier debugging.
  15132. *
  15133. * For more information on precompiling templates see
  15134. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15135. *
  15136. * For more information on Chrome extension sandboxes see
  15137. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15138. *
  15139. * @static
  15140. * @since 0.1.0
  15141. * @memberOf _
  15142. * @category String
  15143. * @param {string} [string=''] The template string.
  15144. * @param {Object} [options={}] The options object.
  15145. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15146. * The HTML "escape" delimiter.
  15147. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15148. * The "evaluate" delimiter.
  15149. * @param {Object} [options.imports=_.templateSettings.imports]
  15150. * An object to import into the template as free variables.
  15151. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15152. * The "interpolate" delimiter.
  15153. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15154. * The sourceURL of the compiled template.
  15155. * @param {string} [options.variable='obj']
  15156. * The data object variable name.
  15157. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15158. * @returns {Function} Returns the compiled template function.
  15159. * @example
  15160. *
  15161. * // Use the "interpolate" delimiter to create a compiled template.
  15162. * var compiled = _.template('hello <%= user %>!');
  15163. * compiled({ 'user': 'fred' });
  15164. * // => 'hello fred!'
  15165. *
  15166. * // Use the HTML "escape" delimiter to escape data property values.
  15167. * var compiled = _.template('<b><%- value %></b>');
  15168. * compiled({ 'value': '<script>' });
  15169. * // => '<b>&lt;script&gt;</b>'
  15170. *
  15171. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15172. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15173. * compiled({ 'users': ['fred', 'barney'] });
  15174. * // => '<li>fred</li><li>barney</li>'
  15175. *
  15176. * // Use the internal `print` function in "evaluate" delimiters.
  15177. * var compiled = _.template('<% print("hello " + user); %>!');
  15178. * compiled({ 'user': 'barney' });
  15179. * // => 'hello barney!'
  15180. *
  15181. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15182. * // Disable support by replacing the "interpolate" delimiter.
  15183. * var compiled = _.template('hello ${ user }!');
  15184. * compiled({ 'user': 'pebbles' });
  15185. * // => 'hello pebbles!'
  15186. *
  15187. * // Use backslashes to treat delimiters as plain text.
  15188. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15189. * compiled({ 'value': 'ignored' });
  15190. * // => '<%- value %>'
  15191. *
  15192. * // Use the `imports` option to import `jQuery` as `jq`.
  15193. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15194. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15195. * compiled({ 'users': ['fred', 'barney'] });
  15196. * // => '<li>fred</li><li>barney</li>'
  15197. *
  15198. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15199. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15200. * compiled(data);
  15201. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15202. *
  15203. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15204. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15205. * compiled.source;
  15206. * // => function(data) {
  15207. * // var __t, __p = '';
  15208. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15209. * // return __p;
  15210. * // }
  15211. *
  15212. * // Use custom template delimiters.
  15213. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15214. * var compiled = _.template('hello {{ user }}!');
  15215. * compiled({ 'user': 'mustache' });
  15216. * // => 'hello mustache!'
  15217. *
  15218. * // Use the `source` property to inline compiled templates for meaningful
  15219. * // line numbers in error messages and stack traces.
  15220. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15221. * var JST = {\
  15222. * "main": ' + _.template(mainText).source + '\
  15223. * };\
  15224. * ');
  15225. */
  15226. function template(string, options, guard) {
  15227. // Based on John Resig's `tmpl` implementation
  15228. // (http://ejohn.org/blog/javascript-micro-templating/)
  15229. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15230. var settings = lodash.templateSettings;
  15231. if (guard && isIterateeCall(string, options, guard)) {
  15232. options = undefined;
  15233. }
  15234. string = toString(string);
  15235. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15236. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15237. importsKeys = keys(imports),
  15238. importsValues = baseValues(imports, importsKeys);
  15239. var isEscaping,
  15240. isEvaluating,
  15241. index = 0,
  15242. interpolate = options.interpolate || reNoMatch,
  15243. source = "__p += '";
  15244. // Compile the regexp to match each delimiter.
  15245. var reDelimiters = RegExp(
  15246. (options.escape || reNoMatch).source + '|' +
  15247. interpolate.source + '|' +
  15248. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15249. (options.evaluate || reNoMatch).source + '|$'
  15250. , 'g');
  15251. // Use a sourceURL for easier debugging.
  15252. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15253. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15254. // and escape the comment, thus injecting code that gets evaled.
  15255. var sourceURL = '//# sourceURL=' +
  15256. (hasOwnProperty.call(options, 'sourceURL')
  15257. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15258. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15259. ) + '\n';
  15260. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15261. interpolateValue || (interpolateValue = esTemplateValue);
  15262. // Escape characters that can't be included in string literals.
  15263. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15264. // Replace delimiters with snippets.
  15265. if (escapeValue) {
  15266. isEscaping = true;
  15267. source += "' +\n__e(" + escapeValue + ") +\n'";
  15268. }
  15269. if (evaluateValue) {
  15270. isEvaluating = true;
  15271. source += "';\n" + evaluateValue + ";\n__p += '";
  15272. }
  15273. if (interpolateValue) {
  15274. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15275. }
  15276. index = offset + match.length;
  15277. // The JS engine embedded in Adobe products needs `match` returned in
  15278. // order to produce the correct `offset` value.
  15279. return match;
  15280. });
  15281. source += "';\n";
  15282. // If `variable` is not specified wrap a with-statement around the generated
  15283. // code to add the data object to the top of the scope chain.
  15284. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15285. if (!variable) {
  15286. source = 'with (obj) {\n' + source + '\n}\n';
  15287. }
  15288. // Throw an error if a forbidden character was found in `variable`, to prevent
  15289. // potential command injection attacks.
  15290. else if (reForbiddenIdentifierChars.test(variable)) {
  15291. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15292. }
  15293. // Cleanup code by stripping empty strings.
  15294. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15295. .replace(reEmptyStringMiddle, '$1')
  15296. .replace(reEmptyStringTrailing, '$1;');
  15297. // Frame code as the function body.
  15298. source = 'function(' + (variable || 'obj') + ') {\n' +
  15299. (variable
  15300. ? ''
  15301. : 'obj || (obj = {});\n'
  15302. ) +
  15303. "var __t, __p = ''" +
  15304. (isEscaping
  15305. ? ', __e = _.escape'
  15306. : ''
  15307. ) +
  15308. (isEvaluating
  15309. ? ', __j = Array.prototype.join;\n' +
  15310. "function print() { __p += __j.call(arguments, '') }\n"
  15311. : ';\n'
  15312. ) +
  15313. source +
  15314. 'return __p\n}';
  15315. var result = attempt(function() {
  15316. return Function(importsKeys, sourceURL + 'return ' + source)
  15317. .apply(undefined, importsValues);
  15318. });
  15319. // Provide the compiled function's source by its `toString` method or
  15320. // the `source` property as a convenience for inlining compiled templates.
  15321. result.source = source;
  15322. if (isError(result)) {
  15323. throw result;
  15324. }
  15325. return result;
  15326. }
  15327. /**
  15328. * Converts `string`, as a whole, to lower case just like
  15329. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15330. *
  15331. * @static
  15332. * @memberOf _
  15333. * @since 4.0.0
  15334. * @category String
  15335. * @param {string} [string=''] The string to convert.
  15336. * @returns {string} Returns the lower cased string.
  15337. * @example
  15338. *
  15339. * _.toLower('--Foo-Bar--');
  15340. * // => '--foo-bar--'
  15341. *
  15342. * _.toLower('fooBar');
  15343. * // => 'foobar'
  15344. *
  15345. * _.toLower('__FOO_BAR__');
  15346. * // => '__foo_bar__'
  15347. */
  15348. function toLower(value) {
  15349. return toString(value).toLowerCase();
  15350. }
  15351. /**
  15352. * Converts `string`, as a whole, to upper case just like
  15353. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15354. *
  15355. * @static
  15356. * @memberOf _
  15357. * @since 4.0.0
  15358. * @category String
  15359. * @param {string} [string=''] The string to convert.
  15360. * @returns {string} Returns the upper cased string.
  15361. * @example
  15362. *
  15363. * _.toUpper('--foo-bar--');
  15364. * // => '--FOO-BAR--'
  15365. *
  15366. * _.toUpper('fooBar');
  15367. * // => 'FOOBAR'
  15368. *
  15369. * _.toUpper('__foo_bar__');
  15370. * // => '__FOO_BAR__'
  15371. */
  15372. function toUpper(value) {
  15373. return toString(value).toUpperCase();
  15374. }
  15375. /**
  15376. * Removes leading and trailing whitespace or specified characters from `string`.
  15377. *
  15378. * @static
  15379. * @memberOf _
  15380. * @since 3.0.0
  15381. * @category String
  15382. * @param {string} [string=''] The string to trim.
  15383. * @param {string} [chars=whitespace] The characters to trim.
  15384. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15385. * @returns {string} Returns the trimmed string.
  15386. * @example
  15387. *
  15388. * _.trim(' abc ');
  15389. * // => 'abc'
  15390. *
  15391. * _.trim('-_-abc-_-', '_-');
  15392. * // => 'abc'
  15393. *
  15394. * _.map([' foo ', ' bar '], _.trim);
  15395. * // => ['foo', 'bar']
  15396. */
  15397. function trim(string, chars, guard) {
  15398. string = toString(string);
  15399. if (string && (guard || chars === undefined)) {
  15400. return baseTrim(string);
  15401. }
  15402. if (!string || !(chars = baseToString(chars))) {
  15403. return string;
  15404. }
  15405. var strSymbols = stringToArray(string),
  15406. chrSymbols = stringToArray(chars),
  15407. start = charsStartIndex(strSymbols, chrSymbols),
  15408. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15409. return castSlice(strSymbols, start, end).join('');
  15410. }
  15411. /**
  15412. * Removes trailing whitespace or specified characters from `string`.
  15413. *
  15414. * @static
  15415. * @memberOf _
  15416. * @since 4.0.0
  15417. * @category String
  15418. * @param {string} [string=''] The string to trim.
  15419. * @param {string} [chars=whitespace] The characters to trim.
  15420. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15421. * @returns {string} Returns the trimmed string.
  15422. * @example
  15423. *
  15424. * _.trimEnd(' abc ');
  15425. * // => ' abc'
  15426. *
  15427. * _.trimEnd('-_-abc-_-', '_-');
  15428. * // => '-_-abc'
  15429. */
  15430. function trimEnd(string, chars, guard) {
  15431. string = toString(string);
  15432. if (string && (guard || chars === undefined)) {
  15433. return string.slice(0, trimmedEndIndex(string) + 1);
  15434. }
  15435. if (!string || !(chars = baseToString(chars))) {
  15436. return string;
  15437. }
  15438. var strSymbols = stringToArray(string),
  15439. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15440. return castSlice(strSymbols, 0, end).join('');
  15441. }
  15442. /**
  15443. * Removes leading whitespace or specified characters from `string`.
  15444. *
  15445. * @static
  15446. * @memberOf _
  15447. * @since 4.0.0
  15448. * @category String
  15449. * @param {string} [string=''] The string to trim.
  15450. * @param {string} [chars=whitespace] The characters to trim.
  15451. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15452. * @returns {string} Returns the trimmed string.
  15453. * @example
  15454. *
  15455. * _.trimStart(' abc ');
  15456. * // => 'abc '
  15457. *
  15458. * _.trimStart('-_-abc-_-', '_-');
  15459. * // => 'abc-_-'
  15460. */
  15461. function trimStart(string, chars, guard) {
  15462. string = toString(string);
  15463. if (string && (guard || chars === undefined)) {
  15464. return string.replace(reTrimStart, '');
  15465. }
  15466. if (!string || !(chars = baseToString(chars))) {
  15467. return string;
  15468. }
  15469. var strSymbols = stringToArray(string),
  15470. start = charsStartIndex(strSymbols, stringToArray(chars));
  15471. return castSlice(strSymbols, start).join('');
  15472. }
  15473. /**
  15474. * Truncates `string` if it's longer than the given maximum string length.
  15475. * The last characters of the truncated string are replaced with the omission
  15476. * string which defaults to "...".
  15477. *
  15478. * @static
  15479. * @memberOf _
  15480. * @since 4.0.0
  15481. * @category String
  15482. * @param {string} [string=''] The string to truncate.
  15483. * @param {Object} [options={}] The options object.
  15484. * @param {number} [options.length=30] The maximum string length.
  15485. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15486. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15487. * @returns {string} Returns the truncated string.
  15488. * @example
  15489. *
  15490. * _.truncate('hi-diddly-ho there, neighborino');
  15491. * // => 'hi-diddly-ho there, neighbo...'
  15492. *
  15493. * _.truncate('hi-diddly-ho there, neighborino', {
  15494. * 'length': 24,
  15495. * 'separator': ' '
  15496. * });
  15497. * // => 'hi-diddly-ho there,...'
  15498. *
  15499. * _.truncate('hi-diddly-ho there, neighborino', {
  15500. * 'length': 24,
  15501. * 'separator': /,? +/
  15502. * });
  15503. * // => 'hi-diddly-ho there...'
  15504. *
  15505. * _.truncate('hi-diddly-ho there, neighborino', {
  15506. * 'omission': ' [...]'
  15507. * });
  15508. * // => 'hi-diddly-ho there, neig [...]'
  15509. */
  15510. function truncate(string, options) {
  15511. var length = DEFAULT_TRUNC_LENGTH,
  15512. omission = DEFAULT_TRUNC_OMISSION;
  15513. if (isObject(options)) {
  15514. var separator = 'separator' in options ? options.separator : separator;
  15515. length = 'length' in options ? toInteger(options.length) : length;
  15516. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15517. }
  15518. string = toString(string);
  15519. var strLength = string.length;
  15520. if (hasUnicode(string)) {
  15521. var strSymbols = stringToArray(string);
  15522. strLength = strSymbols.length;
  15523. }
  15524. if (length >= strLength) {
  15525. return string;
  15526. }
  15527. var end = length - stringSize(omission);
  15528. if (end < 1) {
  15529. return omission;
  15530. }
  15531. var result = strSymbols
  15532. ? castSlice(strSymbols, 0, end).join('')
  15533. : string.slice(0, end);
  15534. if (separator === undefined) {
  15535. return result + omission;
  15536. }
  15537. if (strSymbols) {
  15538. end += (result.length - end);
  15539. }
  15540. if (isRegExp(separator)) {
  15541. if (string.slice(end).search(separator)) {
  15542. var match,
  15543. substring = result;
  15544. if (!separator.global) {
  15545. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15546. }
  15547. separator.lastIndex = 0;
  15548. while ((match = separator.exec(substring))) {
  15549. var newEnd = match.index;
  15550. }
  15551. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15552. }
  15553. } else if (string.indexOf(baseToString(separator), end) != end) {
  15554. var index = result.lastIndexOf(separator);
  15555. if (index > -1) {
  15556. result = result.slice(0, index);
  15557. }
  15558. }
  15559. return result + omission;
  15560. }
  15561. /**
  15562. * The inverse of `_.escape`; this method converts the HTML entities
  15563. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15564. * their corresponding characters.
  15565. *
  15566. * **Note:** No other HTML entities are unescaped. To unescape additional
  15567. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15568. *
  15569. * @static
  15570. * @memberOf _
  15571. * @since 0.6.0
  15572. * @category String
  15573. * @param {string} [string=''] The string to unescape.
  15574. * @returns {string} Returns the unescaped string.
  15575. * @example
  15576. *
  15577. * _.unescape('fred, barney, &amp; pebbles');
  15578. * // => 'fred, barney, & pebbles'
  15579. */
  15580. function unescape(string) {
  15581. string = toString(string);
  15582. return (string && reHasEscapedHtml.test(string))
  15583. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15584. : string;
  15585. }
  15586. /**
  15587. * Converts `string`, as space separated words, to upper case.
  15588. *
  15589. * @static
  15590. * @memberOf _
  15591. * @since 4.0.0
  15592. * @category String
  15593. * @param {string} [string=''] The string to convert.
  15594. * @returns {string} Returns the upper cased string.
  15595. * @example
  15596. *
  15597. * _.upperCase('--foo-bar');
  15598. * // => 'FOO BAR'
  15599. *
  15600. * _.upperCase('fooBar');
  15601. * // => 'FOO BAR'
  15602. *
  15603. * _.upperCase('__foo_bar__');
  15604. * // => 'FOO BAR'
  15605. */
  15606. var upperCase = createCompounder(function(result, word, index) {
  15607. return result + (index ? ' ' : '') + word.toUpperCase();
  15608. });
  15609. /**
  15610. * Converts the first character of `string` to upper case.
  15611. *
  15612. * @static
  15613. * @memberOf _
  15614. * @since 4.0.0
  15615. * @category String
  15616. * @param {string} [string=''] The string to convert.
  15617. * @returns {string} Returns the converted string.
  15618. * @example
  15619. *
  15620. * _.upperFirst('fred');
  15621. * // => 'Fred'
  15622. *
  15623. * _.upperFirst('FRED');
  15624. * // => 'FRED'
  15625. */
  15626. var upperFirst = createCaseFirst('toUpperCase');
  15627. /**
  15628. * Splits `string` into an array of its words.
  15629. *
  15630. * @static
  15631. * @memberOf _
  15632. * @since 3.0.0
  15633. * @category String
  15634. * @param {string} [string=''] The string to inspect.
  15635. * @param {RegExp|string} [pattern] The pattern to match words.
  15636. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15637. * @returns {Array} Returns the words of `string`.
  15638. * @example
  15639. *
  15640. * _.words('fred, barney, & pebbles');
  15641. * // => ['fred', 'barney', 'pebbles']
  15642. *
  15643. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15644. * // => ['fred', 'barney', '&', 'pebbles']
  15645. */
  15646. function words(string, pattern, guard) {
  15647. string = toString(string);
  15648. pattern = guard ? undefined : pattern;
  15649. if (pattern === undefined) {
  15650. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15651. }
  15652. return string.match(pattern) || [];
  15653. }
  15654. /*------------------------------------------------------------------------*/
  15655. /**
  15656. * Attempts to invoke `func`, returning either the result or the caught error
  15657. * object. Any additional arguments are provided to `func` when it's invoked.
  15658. *
  15659. * @static
  15660. * @memberOf _
  15661. * @since 3.0.0
  15662. * @category Util
  15663. * @param {Function} func The function to attempt.
  15664. * @param {...*} [args] The arguments to invoke `func` with.
  15665. * @returns {*} Returns the `func` result or error object.
  15666. * @example
  15667. *
  15668. * // Avoid throwing errors for invalid selectors.
  15669. * var elements = _.attempt(function(selector) {
  15670. * return document.querySelectorAll(selector);
  15671. * }, '>_>');
  15672. *
  15673. * if (_.isError(elements)) {
  15674. * elements = [];
  15675. * }
  15676. */
  15677. var attempt = baseRest(function(func, args) {
  15678. try {
  15679. return apply(func, undefined, args);
  15680. } catch (e) {
  15681. return isError(e) ? e : new Error(e);
  15682. }
  15683. });
  15684. /**
  15685. * Binds methods of an object to the object itself, overwriting the existing
  15686. * method.
  15687. *
  15688. * **Note:** This method doesn't set the "length" property of bound functions.
  15689. *
  15690. * @static
  15691. * @since 0.1.0
  15692. * @memberOf _
  15693. * @category Util
  15694. * @param {Object} object The object to bind and assign the bound methods to.
  15695. * @param {...(string|string[])} methodNames The object method names to bind.
  15696. * @returns {Object} Returns `object`.
  15697. * @example
  15698. *
  15699. * var view = {
  15700. * 'label': 'docs',
  15701. * 'click': function() {
  15702. * console.log('clicked ' + this.label);
  15703. * }
  15704. * };
  15705. *
  15706. * _.bindAll(view, ['click']);
  15707. * jQuery(element).on('click', view.click);
  15708. * // => Logs 'clicked docs' when clicked.
  15709. */
  15710. var bindAll = flatRest(function(object, methodNames) {
  15711. arrayEach(methodNames, function(key) {
  15712. key = toKey(key);
  15713. baseAssignValue(object, key, bind(object[key], object));
  15714. });
  15715. return object;
  15716. });
  15717. /**
  15718. * Creates a function that iterates over `pairs` and invokes the corresponding
  15719. * function of the first predicate to return truthy. The predicate-function
  15720. * pairs are invoked with the `this` binding and arguments of the created
  15721. * function.
  15722. *
  15723. * @static
  15724. * @memberOf _
  15725. * @since 4.0.0
  15726. * @category Util
  15727. * @param {Array} pairs The predicate-function pairs.
  15728. * @returns {Function} Returns the new composite function.
  15729. * @example
  15730. *
  15731. * var func = _.cond([
  15732. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15733. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15734. * [_.stubTrue, _.constant('no match')]
  15735. * ]);
  15736. *
  15737. * func({ 'a': 1, 'b': 2 });
  15738. * // => 'matches A'
  15739. *
  15740. * func({ 'a': 0, 'b': 1 });
  15741. * // => 'matches B'
  15742. *
  15743. * func({ 'a': '1', 'b': '2' });
  15744. * // => 'no match'
  15745. */
  15746. function cond(pairs) {
  15747. var length = pairs == null ? 0 : pairs.length,
  15748. toIteratee = getIteratee();
  15749. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15750. if (typeof pair[1] != 'function') {
  15751. throw new TypeError(FUNC_ERROR_TEXT);
  15752. }
  15753. return [toIteratee(pair[0]), pair[1]];
  15754. });
  15755. return baseRest(function(args) {
  15756. var index = -1;
  15757. while (++index < length) {
  15758. var pair = pairs[index];
  15759. if (apply(pair[0], this, args)) {
  15760. return apply(pair[1], this, args);
  15761. }
  15762. }
  15763. });
  15764. }
  15765. /**
  15766. * Creates a function that invokes the predicate properties of `source` with
  15767. * the corresponding property values of a given object, returning `true` if
  15768. * all predicates return truthy, else `false`.
  15769. *
  15770. * **Note:** The created function is equivalent to `_.conformsTo` with
  15771. * `source` partially applied.
  15772. *
  15773. * @static
  15774. * @memberOf _
  15775. * @since 4.0.0
  15776. * @category Util
  15777. * @param {Object} source The object of property predicates to conform to.
  15778. * @returns {Function} Returns the new spec function.
  15779. * @example
  15780. *
  15781. * var objects = [
  15782. * { 'a': 2, 'b': 1 },
  15783. * { 'a': 1, 'b': 2 }
  15784. * ];
  15785. *
  15786. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15787. * // => [{ 'a': 1, 'b': 2 }]
  15788. */
  15789. function conforms(source) {
  15790. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15791. }
  15792. /**
  15793. * Creates a function that returns `value`.
  15794. *
  15795. * @static
  15796. * @memberOf _
  15797. * @since 2.4.0
  15798. * @category Util
  15799. * @param {*} value The value to return from the new function.
  15800. * @returns {Function} Returns the new constant function.
  15801. * @example
  15802. *
  15803. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15804. *
  15805. * console.log(objects);
  15806. * // => [{ 'a': 1 }, { 'a': 1 }]
  15807. *
  15808. * console.log(objects[0] === objects[1]);
  15809. * // => true
  15810. */
  15811. function constant(value) {
  15812. return function() {
  15813. return value;
  15814. };
  15815. }
  15816. /**
  15817. * Checks `value` to determine whether a default value should be returned in
  15818. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15819. * or `undefined`.
  15820. *
  15821. * @static
  15822. * @memberOf _
  15823. * @since 4.14.0
  15824. * @category Util
  15825. * @param {*} value The value to check.
  15826. * @param {*} defaultValue The default value.
  15827. * @returns {*} Returns the resolved value.
  15828. * @example
  15829. *
  15830. * _.defaultTo(1, 10);
  15831. * // => 1
  15832. *
  15833. * _.defaultTo(undefined, 10);
  15834. * // => 10
  15835. */
  15836. function defaultTo(value, defaultValue) {
  15837. return (value == null || value !== value) ? defaultValue : value;
  15838. }
  15839. /**
  15840. * Creates a function that returns the result of invoking the given functions
  15841. * with the `this` binding of the created function, where each successive
  15842. * invocation is supplied the return value of the previous.
  15843. *
  15844. * @static
  15845. * @memberOf _
  15846. * @since 3.0.0
  15847. * @category Util
  15848. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15849. * @returns {Function} Returns the new composite function.
  15850. * @see _.flowRight
  15851. * @example
  15852. *
  15853. * function square(n) {
  15854. * return n * n;
  15855. * }
  15856. *
  15857. * var addSquare = _.flow([_.add, square]);
  15858. * addSquare(1, 2);
  15859. * // => 9
  15860. */
  15861. var flow = createFlow();
  15862. /**
  15863. * This method is like `_.flow` except that it creates a function that
  15864. * invokes the given functions from right to left.
  15865. *
  15866. * @static
  15867. * @since 3.0.0
  15868. * @memberOf _
  15869. * @category Util
  15870. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15871. * @returns {Function} Returns the new composite function.
  15872. * @see _.flow
  15873. * @example
  15874. *
  15875. * function square(n) {
  15876. * return n * n;
  15877. * }
  15878. *
  15879. * var addSquare = _.flowRight([square, _.add]);
  15880. * addSquare(1, 2);
  15881. * // => 9
  15882. */
  15883. var flowRight = createFlow(true);
  15884. /**
  15885. * This method returns the first argument it receives.
  15886. *
  15887. * @static
  15888. * @since 0.1.0
  15889. * @memberOf _
  15890. * @category Util
  15891. * @param {*} value Any value.
  15892. * @returns {*} Returns `value`.
  15893. * @example
  15894. *
  15895. * var object = { 'a': 1 };
  15896. *
  15897. * console.log(_.identity(object) === object);
  15898. * // => true
  15899. */
  15900. function identity(value) {
  15901. return value;
  15902. }
  15903. /**
  15904. * Creates a function that invokes `func` with the arguments of the created
  15905. * function. If `func` is a property name, the created function returns the
  15906. * property value for a given element. If `func` is an array or object, the
  15907. * created function returns `true` for elements that contain the equivalent
  15908. * source properties, otherwise it returns `false`.
  15909. *
  15910. * @static
  15911. * @since 4.0.0
  15912. * @memberOf _
  15913. * @category Util
  15914. * @param {*} [func=_.identity] The value to convert to a callback.
  15915. * @returns {Function} Returns the callback.
  15916. * @example
  15917. *
  15918. * var users = [
  15919. * { 'user': 'barney', 'age': 36, 'active': true },
  15920. * { 'user': 'fred', 'age': 40, 'active': false }
  15921. * ];
  15922. *
  15923. * // The `_.matches` iteratee shorthand.
  15924. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15925. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15926. *
  15927. * // The `_.matchesProperty` iteratee shorthand.
  15928. * _.filter(users, _.iteratee(['user', 'fred']));
  15929. * // => [{ 'user': 'fred', 'age': 40 }]
  15930. *
  15931. * // The `_.property` iteratee shorthand.
  15932. * _.map(users, _.iteratee('user'));
  15933. * // => ['barney', 'fred']
  15934. *
  15935. * // Create custom iteratee shorthands.
  15936. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15937. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15938. * return func.test(string);
  15939. * };
  15940. * });
  15941. *
  15942. * _.filter(['abc', 'def'], /ef/);
  15943. * // => ['def']
  15944. */
  15945. function iteratee(func) {
  15946. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15947. }
  15948. /**
  15949. * Creates a function that performs a partial deep comparison between a given
  15950. * object and `source`, returning `true` if the given object has equivalent
  15951. * property values, else `false`.
  15952. *
  15953. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15954. * partially applied.
  15955. *
  15956. * Partial comparisons will match empty array and empty object `source`
  15957. * values against any array or object value, respectively. See `_.isEqual`
  15958. * for a list of supported value comparisons.
  15959. *
  15960. * **Note:** Multiple values can be checked by combining several matchers
  15961. * using `_.overSome`
  15962. *
  15963. * @static
  15964. * @memberOf _
  15965. * @since 3.0.0
  15966. * @category Util
  15967. * @param {Object} source The object of property values to match.
  15968. * @returns {Function} Returns the new spec function.
  15969. * @example
  15970. *
  15971. * var objects = [
  15972. * { 'a': 1, 'b': 2, 'c': 3 },
  15973. * { 'a': 4, 'b': 5, 'c': 6 }
  15974. * ];
  15975. *
  15976. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15977. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15978. *
  15979. * // Checking for several possible values
  15980. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15981. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15982. */
  15983. function matches(source) {
  15984. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15985. }
  15986. /**
  15987. * Creates a function that performs a partial deep comparison between the
  15988. * value at `path` of a given object to `srcValue`, returning `true` if the
  15989. * object value is equivalent, else `false`.
  15990. *
  15991. * **Note:** Partial comparisons will match empty array and empty object
  15992. * `srcValue` values against any array or object value, respectively. See
  15993. * `_.isEqual` for a list of supported value comparisons.
  15994. *
  15995. * **Note:** Multiple values can be checked by combining several matchers
  15996. * using `_.overSome`
  15997. *
  15998. * @static
  15999. * @memberOf _
  16000. * @since 3.2.0
  16001. * @category Util
  16002. * @param {Array|string} path The path of the property to get.
  16003. * @param {*} srcValue The value to match.
  16004. * @returns {Function} Returns the new spec function.
  16005. * @example
  16006. *
  16007. * var objects = [
  16008. * { 'a': 1, 'b': 2, 'c': 3 },
  16009. * { 'a': 4, 'b': 5, 'c': 6 }
  16010. * ];
  16011. *
  16012. * _.find(objects, _.matchesProperty('a', 4));
  16013. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16014. *
  16015. * // Checking for several possible values
  16016. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16017. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16018. */
  16019. function matchesProperty(path, srcValue) {
  16020. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16021. }
  16022. /**
  16023. * Creates a function that invokes the method at `path` of a given object.
  16024. * Any additional arguments are provided to the invoked method.
  16025. *
  16026. * @static
  16027. * @memberOf _
  16028. * @since 3.7.0
  16029. * @category Util
  16030. * @param {Array|string} path The path of the method to invoke.
  16031. * @param {...*} [args] The arguments to invoke the method with.
  16032. * @returns {Function} Returns the new invoker function.
  16033. * @example
  16034. *
  16035. * var objects = [
  16036. * { 'a': { 'b': _.constant(2) } },
  16037. * { 'a': { 'b': _.constant(1) } }
  16038. * ];
  16039. *
  16040. * _.map(objects, _.method('a.b'));
  16041. * // => [2, 1]
  16042. *
  16043. * _.map(objects, _.method(['a', 'b']));
  16044. * // => [2, 1]
  16045. */
  16046. var method = baseRest(function(path, args) {
  16047. return function(object) {
  16048. return baseInvoke(object, path, args);
  16049. };
  16050. });
  16051. /**
  16052. * The opposite of `_.method`; this method creates a function that invokes
  16053. * the method at a given path of `object`. Any additional arguments are
  16054. * provided to the invoked method.
  16055. *
  16056. * @static
  16057. * @memberOf _
  16058. * @since 3.7.0
  16059. * @category Util
  16060. * @param {Object} object The object to query.
  16061. * @param {...*} [args] The arguments to invoke the method with.
  16062. * @returns {Function} Returns the new invoker function.
  16063. * @example
  16064. *
  16065. * var array = _.times(3, _.constant),
  16066. * object = { 'a': array, 'b': array, 'c': array };
  16067. *
  16068. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16069. * // => [2, 0]
  16070. *
  16071. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16072. * // => [2, 0]
  16073. */
  16074. var methodOf = baseRest(function(object, args) {
  16075. return function(path) {
  16076. return baseInvoke(object, path, args);
  16077. };
  16078. });
  16079. /**
  16080. * Adds all own enumerable string keyed function properties of a source
  16081. * object to the destination object. If `object` is a function, then methods
  16082. * are added to its prototype as well.
  16083. *
  16084. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16085. * avoid conflicts caused by modifying the original.
  16086. *
  16087. * @static
  16088. * @since 0.1.0
  16089. * @memberOf _
  16090. * @category Util
  16091. * @param {Function|Object} [object=lodash] The destination object.
  16092. * @param {Object} source The object of functions to add.
  16093. * @param {Object} [options={}] The options object.
  16094. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16095. * @returns {Function|Object} Returns `object`.
  16096. * @example
  16097. *
  16098. * function vowels(string) {
  16099. * return _.filter(string, function(v) {
  16100. * return /[aeiou]/i.test(v);
  16101. * });
  16102. * }
  16103. *
  16104. * _.mixin({ 'vowels': vowels });
  16105. * _.vowels('fred');
  16106. * // => ['e']
  16107. *
  16108. * _('fred').vowels().value();
  16109. * // => ['e']
  16110. *
  16111. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16112. * _('fred').vowels();
  16113. * // => ['e']
  16114. */
  16115. function mixin(object, source, options) {
  16116. var props = keys(source),
  16117. methodNames = baseFunctions(source, props);
  16118. if (options == null &&
  16119. !(isObject(source) && (methodNames.length || !props.length))) {
  16120. options = source;
  16121. source = object;
  16122. object = this;
  16123. methodNames = baseFunctions(source, keys(source));
  16124. }
  16125. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16126. isFunc = isFunction(object);
  16127. arrayEach(methodNames, function(methodName) {
  16128. var func = source[methodName];
  16129. object[methodName] = func;
  16130. if (isFunc) {
  16131. object.prototype[methodName] = function() {
  16132. var chainAll = this.__chain__;
  16133. if (chain || chainAll) {
  16134. var result = object(this.__wrapped__),
  16135. actions = result.__actions__ = copyArray(this.__actions__);
  16136. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16137. result.__chain__ = chainAll;
  16138. return result;
  16139. }
  16140. return func.apply(object, arrayPush([this.value()], arguments));
  16141. };
  16142. }
  16143. });
  16144. return object;
  16145. }
  16146. /**
  16147. * Reverts the `_` variable to its previous value and returns a reference to
  16148. * the `lodash` function.
  16149. *
  16150. * @static
  16151. * @since 0.1.0
  16152. * @memberOf _
  16153. * @category Util
  16154. * @returns {Function} Returns the `lodash` function.
  16155. * @example
  16156. *
  16157. * var lodash = _.noConflict();
  16158. */
  16159. function noConflict() {
  16160. if (root._ === this) {
  16161. root._ = oldDash;
  16162. }
  16163. return this;
  16164. }
  16165. /**
  16166. * This method returns `undefined`.
  16167. *
  16168. * @static
  16169. * @memberOf _
  16170. * @since 2.3.0
  16171. * @category Util
  16172. * @example
  16173. *
  16174. * _.times(2, _.noop);
  16175. * // => [undefined, undefined]
  16176. */
  16177. function noop() {
  16178. // No operation performed.
  16179. }
  16180. /**
  16181. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16182. * the nth argument from the end is returned.
  16183. *
  16184. * @static
  16185. * @memberOf _
  16186. * @since 4.0.0
  16187. * @category Util
  16188. * @param {number} [n=0] The index of the argument to return.
  16189. * @returns {Function} Returns the new pass-thru function.
  16190. * @example
  16191. *
  16192. * var func = _.nthArg(1);
  16193. * func('a', 'b', 'c', 'd');
  16194. * // => 'b'
  16195. *
  16196. * var func = _.nthArg(-2);
  16197. * func('a', 'b', 'c', 'd');
  16198. * // => 'c'
  16199. */
  16200. function nthArg(n) {
  16201. n = toInteger(n);
  16202. return baseRest(function(args) {
  16203. return baseNth(args, n);
  16204. });
  16205. }
  16206. /**
  16207. * Creates a function that invokes `iteratees` with the arguments it receives
  16208. * and returns their results.
  16209. *
  16210. * @static
  16211. * @memberOf _
  16212. * @since 4.0.0
  16213. * @category Util
  16214. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16215. * The iteratees to invoke.
  16216. * @returns {Function} Returns the new function.
  16217. * @example
  16218. *
  16219. * var func = _.over([Math.max, Math.min]);
  16220. *
  16221. * func(1, 2, 3, 4);
  16222. * // => [4, 1]
  16223. */
  16224. var over = createOver(arrayMap);
  16225. /**
  16226. * Creates a function that checks if **all** of the `predicates` return
  16227. * truthy when invoked with the arguments it receives.
  16228. *
  16229. * Following shorthands are possible for providing predicates.
  16230. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16231. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16232. *
  16233. * @static
  16234. * @memberOf _
  16235. * @since 4.0.0
  16236. * @category Util
  16237. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16238. * The predicates to check.
  16239. * @returns {Function} Returns the new function.
  16240. * @example
  16241. *
  16242. * var func = _.overEvery([Boolean, isFinite]);
  16243. *
  16244. * func('1');
  16245. * // => true
  16246. *
  16247. * func(null);
  16248. * // => false
  16249. *
  16250. * func(NaN);
  16251. * // => false
  16252. */
  16253. var overEvery = createOver(arrayEvery);
  16254. /**
  16255. * Creates a function that checks if **any** of the `predicates` return
  16256. * truthy when invoked with the arguments it receives.
  16257. *
  16258. * Following shorthands are possible for providing predicates.
  16259. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16260. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16261. *
  16262. * @static
  16263. * @memberOf _
  16264. * @since 4.0.0
  16265. * @category Util
  16266. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16267. * The predicates to check.
  16268. * @returns {Function} Returns the new function.
  16269. * @example
  16270. *
  16271. * var func = _.overSome([Boolean, isFinite]);
  16272. *
  16273. * func('1');
  16274. * // => true
  16275. *
  16276. * func(null);
  16277. * // => true
  16278. *
  16279. * func(NaN);
  16280. * // => false
  16281. *
  16282. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16283. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16284. */
  16285. var overSome = createOver(arraySome);
  16286. /**
  16287. * Creates a function that returns the value at `path` of a given object.
  16288. *
  16289. * @static
  16290. * @memberOf _
  16291. * @since 2.4.0
  16292. * @category Util
  16293. * @param {Array|string} path The path of the property to get.
  16294. * @returns {Function} Returns the new accessor function.
  16295. * @example
  16296. *
  16297. * var objects = [
  16298. * { 'a': { 'b': 2 } },
  16299. * { 'a': { 'b': 1 } }
  16300. * ];
  16301. *
  16302. * _.map(objects, _.property('a.b'));
  16303. * // => [2, 1]
  16304. *
  16305. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16306. * // => [1, 2]
  16307. */
  16308. function property(path) {
  16309. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16310. }
  16311. /**
  16312. * The opposite of `_.property`; this method creates a function that returns
  16313. * the value at a given path of `object`.
  16314. *
  16315. * @static
  16316. * @memberOf _
  16317. * @since 3.0.0
  16318. * @category Util
  16319. * @param {Object} object The object to query.
  16320. * @returns {Function} Returns the new accessor function.
  16321. * @example
  16322. *
  16323. * var array = [0, 1, 2],
  16324. * object = { 'a': array, 'b': array, 'c': array };
  16325. *
  16326. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16327. * // => [2, 0]
  16328. *
  16329. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16330. * // => [2, 0]
  16331. */
  16332. function propertyOf(object) {
  16333. return function(path) {
  16334. return object == null ? undefined : baseGet(object, path);
  16335. };
  16336. }
  16337. /**
  16338. * Creates an array of numbers (positive and/or negative) progressing from
  16339. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16340. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16341. * it's set to `start` with `start` then set to `0`.
  16342. *
  16343. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16344. * floating-point values which can produce unexpected results.
  16345. *
  16346. * @static
  16347. * @since 0.1.0
  16348. * @memberOf _
  16349. * @category Util
  16350. * @param {number} [start=0] The start of the range.
  16351. * @param {number} end The end of the range.
  16352. * @param {number} [step=1] The value to increment or decrement by.
  16353. * @returns {Array} Returns the range of numbers.
  16354. * @see _.inRange, _.rangeRight
  16355. * @example
  16356. *
  16357. * _.range(4);
  16358. * // => [0, 1, 2, 3]
  16359. *
  16360. * _.range(-4);
  16361. * // => [0, -1, -2, -3]
  16362. *
  16363. * _.range(1, 5);
  16364. * // => [1, 2, 3, 4]
  16365. *
  16366. * _.range(0, 20, 5);
  16367. * // => [0, 5, 10, 15]
  16368. *
  16369. * _.range(0, -4, -1);
  16370. * // => [0, -1, -2, -3]
  16371. *
  16372. * _.range(1, 4, 0);
  16373. * // => [1, 1, 1]
  16374. *
  16375. * _.range(0);
  16376. * // => []
  16377. */
  16378. var range = createRange();
  16379. /**
  16380. * This method is like `_.range` except that it populates values in
  16381. * descending order.
  16382. *
  16383. * @static
  16384. * @memberOf _
  16385. * @since 4.0.0
  16386. * @category Util
  16387. * @param {number} [start=0] The start of the range.
  16388. * @param {number} end The end of the range.
  16389. * @param {number} [step=1] The value to increment or decrement by.
  16390. * @returns {Array} Returns the range of numbers.
  16391. * @see _.inRange, _.range
  16392. * @example
  16393. *
  16394. * _.rangeRight(4);
  16395. * // => [3, 2, 1, 0]
  16396. *
  16397. * _.rangeRight(-4);
  16398. * // => [-3, -2, -1, 0]
  16399. *
  16400. * _.rangeRight(1, 5);
  16401. * // => [4, 3, 2, 1]
  16402. *
  16403. * _.rangeRight(0, 20, 5);
  16404. * // => [15, 10, 5, 0]
  16405. *
  16406. * _.rangeRight(0, -4, -1);
  16407. * // => [-3, -2, -1, 0]
  16408. *
  16409. * _.rangeRight(1, 4, 0);
  16410. * // => [1, 1, 1]
  16411. *
  16412. * _.rangeRight(0);
  16413. * // => []
  16414. */
  16415. var rangeRight = createRange(true);
  16416. /**
  16417. * This method returns a new empty array.
  16418. *
  16419. * @static
  16420. * @memberOf _
  16421. * @since 4.13.0
  16422. * @category Util
  16423. * @returns {Array} Returns the new empty array.
  16424. * @example
  16425. *
  16426. * var arrays = _.times(2, _.stubArray);
  16427. *
  16428. * console.log(arrays);
  16429. * // => [[], []]
  16430. *
  16431. * console.log(arrays[0] === arrays[1]);
  16432. * // => false
  16433. */
  16434. function stubArray() {
  16435. return [];
  16436. }
  16437. /**
  16438. * This method returns `false`.
  16439. *
  16440. * @static
  16441. * @memberOf _
  16442. * @since 4.13.0
  16443. * @category Util
  16444. * @returns {boolean} Returns `false`.
  16445. * @example
  16446. *
  16447. * _.times(2, _.stubFalse);
  16448. * // => [false, false]
  16449. */
  16450. function stubFalse() {
  16451. return false;
  16452. }
  16453. /**
  16454. * This method returns a new empty object.
  16455. *
  16456. * @static
  16457. * @memberOf _
  16458. * @since 4.13.0
  16459. * @category Util
  16460. * @returns {Object} Returns the new empty object.
  16461. * @example
  16462. *
  16463. * var objects = _.times(2, _.stubObject);
  16464. *
  16465. * console.log(objects);
  16466. * // => [{}, {}]
  16467. *
  16468. * console.log(objects[0] === objects[1]);
  16469. * // => false
  16470. */
  16471. function stubObject() {
  16472. return {};
  16473. }
  16474. /**
  16475. * This method returns an empty string.
  16476. *
  16477. * @static
  16478. * @memberOf _
  16479. * @since 4.13.0
  16480. * @category Util
  16481. * @returns {string} Returns the empty string.
  16482. * @example
  16483. *
  16484. * _.times(2, _.stubString);
  16485. * // => ['', '']
  16486. */
  16487. function stubString() {
  16488. return '';
  16489. }
  16490. /**
  16491. * This method returns `true`.
  16492. *
  16493. * @static
  16494. * @memberOf _
  16495. * @since 4.13.0
  16496. * @category Util
  16497. * @returns {boolean} Returns `true`.
  16498. * @example
  16499. *
  16500. * _.times(2, _.stubTrue);
  16501. * // => [true, true]
  16502. */
  16503. function stubTrue() {
  16504. return true;
  16505. }
  16506. /**
  16507. * Invokes the iteratee `n` times, returning an array of the results of
  16508. * each invocation. The iteratee is invoked with one argument; (index).
  16509. *
  16510. * @static
  16511. * @since 0.1.0
  16512. * @memberOf _
  16513. * @category Util
  16514. * @param {number} n The number of times to invoke `iteratee`.
  16515. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16516. * @returns {Array} Returns the array of results.
  16517. * @example
  16518. *
  16519. * _.times(3, String);
  16520. * // => ['0', '1', '2']
  16521. *
  16522. * _.times(4, _.constant(0));
  16523. * // => [0, 0, 0, 0]
  16524. */
  16525. function times(n, iteratee) {
  16526. n = toInteger(n);
  16527. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16528. return [];
  16529. }
  16530. var index = MAX_ARRAY_LENGTH,
  16531. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16532. iteratee = getIteratee(iteratee);
  16533. n -= MAX_ARRAY_LENGTH;
  16534. var result = baseTimes(length, iteratee);
  16535. while (++index < n) {
  16536. iteratee(index);
  16537. }
  16538. return result;
  16539. }
  16540. /**
  16541. * Converts `value` to a property path array.
  16542. *
  16543. * @static
  16544. * @memberOf _
  16545. * @since 4.0.0
  16546. * @category Util
  16547. * @param {*} value The value to convert.
  16548. * @returns {Array} Returns the new property path array.
  16549. * @example
  16550. *
  16551. * _.toPath('a.b.c');
  16552. * // => ['a', 'b', 'c']
  16553. *
  16554. * _.toPath('a[0].b.c');
  16555. * // => ['a', '0', 'b', 'c']
  16556. */
  16557. function toPath(value) {
  16558. if (isArray(value)) {
  16559. return arrayMap(value, toKey);
  16560. }
  16561. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16562. }
  16563. /**
  16564. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16565. *
  16566. * @static
  16567. * @since 0.1.0
  16568. * @memberOf _
  16569. * @category Util
  16570. * @param {string} [prefix=''] The value to prefix the ID with.
  16571. * @returns {string} Returns the unique ID.
  16572. * @example
  16573. *
  16574. * _.uniqueId('contact_');
  16575. * // => 'contact_104'
  16576. *
  16577. * _.uniqueId();
  16578. * // => '105'
  16579. */
  16580. function uniqueId(prefix) {
  16581. var id = ++idCounter;
  16582. return toString(prefix) + id;
  16583. }
  16584. /*------------------------------------------------------------------------*/
  16585. /**
  16586. * Adds two numbers.
  16587. *
  16588. * @static
  16589. * @memberOf _
  16590. * @since 3.4.0
  16591. * @category Math
  16592. * @param {number} augend The first number in an addition.
  16593. * @param {number} addend The second number in an addition.
  16594. * @returns {number} Returns the total.
  16595. * @example
  16596. *
  16597. * _.add(6, 4);
  16598. * // => 10
  16599. */
  16600. var add = createMathOperation(function(augend, addend) {
  16601. return augend + addend;
  16602. }, 0);
  16603. /**
  16604. * Computes `number` rounded up to `precision`.
  16605. *
  16606. * @static
  16607. * @memberOf _
  16608. * @since 3.10.0
  16609. * @category Math
  16610. * @param {number} number The number to round up.
  16611. * @param {number} [precision=0] The precision to round up to.
  16612. * @returns {number} Returns the rounded up number.
  16613. * @example
  16614. *
  16615. * _.ceil(4.006);
  16616. * // => 5
  16617. *
  16618. * _.ceil(6.004, 2);
  16619. * // => 6.01
  16620. *
  16621. * _.ceil(6040, -2);
  16622. * // => 6100
  16623. */
  16624. var ceil = createRound('ceil');
  16625. /**
  16626. * Divide two numbers.
  16627. *
  16628. * @static
  16629. * @memberOf _
  16630. * @since 4.7.0
  16631. * @category Math
  16632. * @param {number} dividend The first number in a division.
  16633. * @param {number} divisor The second number in a division.
  16634. * @returns {number} Returns the quotient.
  16635. * @example
  16636. *
  16637. * _.divide(6, 4);
  16638. * // => 1.5
  16639. */
  16640. var divide = createMathOperation(function(dividend, divisor) {
  16641. return dividend / divisor;
  16642. }, 1);
  16643. /**
  16644. * Computes `number` rounded down to `precision`.
  16645. *
  16646. * @static
  16647. * @memberOf _
  16648. * @since 3.10.0
  16649. * @category Math
  16650. * @param {number} number The number to round down.
  16651. * @param {number} [precision=0] The precision to round down to.
  16652. * @returns {number} Returns the rounded down number.
  16653. * @example
  16654. *
  16655. * _.floor(4.006);
  16656. * // => 4
  16657. *
  16658. * _.floor(0.046, 2);
  16659. * // => 0.04
  16660. *
  16661. * _.floor(4060, -2);
  16662. * // => 4000
  16663. */
  16664. var floor = createRound('floor');
  16665. /**
  16666. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16667. * `undefined` is returned.
  16668. *
  16669. * @static
  16670. * @since 0.1.0
  16671. * @memberOf _
  16672. * @category Math
  16673. * @param {Array} array The array to iterate over.
  16674. * @returns {*} Returns the maximum value.
  16675. * @example
  16676. *
  16677. * _.max([4, 2, 8, 6]);
  16678. * // => 8
  16679. *
  16680. * _.max([]);
  16681. * // => undefined
  16682. */
  16683. function max(array) {
  16684. return (array && array.length)
  16685. ? baseExtremum(array, identity, baseGt)
  16686. : undefined;
  16687. }
  16688. /**
  16689. * This method is like `_.max` except that it accepts `iteratee` which is
  16690. * invoked for each element in `array` to generate the criterion by which
  16691. * the value is ranked. The iteratee is invoked with one argument: (value).
  16692. *
  16693. * @static
  16694. * @memberOf _
  16695. * @since 4.0.0
  16696. * @category Math
  16697. * @param {Array} array The array to iterate over.
  16698. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16699. * @returns {*} Returns the maximum value.
  16700. * @example
  16701. *
  16702. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16703. *
  16704. * _.maxBy(objects, function(o) { return o.n; });
  16705. * // => { 'n': 2 }
  16706. *
  16707. * // The `_.property` iteratee shorthand.
  16708. * _.maxBy(objects, 'n');
  16709. * // => { 'n': 2 }
  16710. */
  16711. function maxBy(array, iteratee) {
  16712. return (array && array.length)
  16713. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16714. : undefined;
  16715. }
  16716. /**
  16717. * Computes the mean of the values in `array`.
  16718. *
  16719. * @static
  16720. * @memberOf _
  16721. * @since 4.0.0
  16722. * @category Math
  16723. * @param {Array} array The array to iterate over.
  16724. * @returns {number} Returns the mean.
  16725. * @example
  16726. *
  16727. * _.mean([4, 2, 8, 6]);
  16728. * // => 5
  16729. */
  16730. function mean(array) {
  16731. return baseMean(array, identity);
  16732. }
  16733. /**
  16734. * This method is like `_.mean` except that it accepts `iteratee` which is
  16735. * invoked for each element in `array` to generate the value to be averaged.
  16736. * The iteratee is invoked with one argument: (value).
  16737. *
  16738. * @static
  16739. * @memberOf _
  16740. * @since 4.7.0
  16741. * @category Math
  16742. * @param {Array} array The array to iterate over.
  16743. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16744. * @returns {number} Returns the mean.
  16745. * @example
  16746. *
  16747. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16748. *
  16749. * _.meanBy(objects, function(o) { return o.n; });
  16750. * // => 5
  16751. *
  16752. * // The `_.property` iteratee shorthand.
  16753. * _.meanBy(objects, 'n');
  16754. * // => 5
  16755. */
  16756. function meanBy(array, iteratee) {
  16757. return baseMean(array, getIteratee(iteratee, 2));
  16758. }
  16759. /**
  16760. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16761. * `undefined` is returned.
  16762. *
  16763. * @static
  16764. * @since 0.1.0
  16765. * @memberOf _
  16766. * @category Math
  16767. * @param {Array} array The array to iterate over.
  16768. * @returns {*} Returns the minimum value.
  16769. * @example
  16770. *
  16771. * _.min([4, 2, 8, 6]);
  16772. * // => 2
  16773. *
  16774. * _.min([]);
  16775. * // => undefined
  16776. */
  16777. function min(array) {
  16778. return (array && array.length)
  16779. ? baseExtremum(array, identity, baseLt)
  16780. : undefined;
  16781. }
  16782. /**
  16783. * This method is like `_.min` except that it accepts `iteratee` which is
  16784. * invoked for each element in `array` to generate the criterion by which
  16785. * the value is ranked. The iteratee is invoked with one argument: (value).
  16786. *
  16787. * @static
  16788. * @memberOf _
  16789. * @since 4.0.0
  16790. * @category Math
  16791. * @param {Array} array The array to iterate over.
  16792. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16793. * @returns {*} Returns the minimum value.
  16794. * @example
  16795. *
  16796. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16797. *
  16798. * _.minBy(objects, function(o) { return o.n; });
  16799. * // => { 'n': 1 }
  16800. *
  16801. * // The `_.property` iteratee shorthand.
  16802. * _.minBy(objects, 'n');
  16803. * // => { 'n': 1 }
  16804. */
  16805. function minBy(array, iteratee) {
  16806. return (array && array.length)
  16807. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16808. : undefined;
  16809. }
  16810. /**
  16811. * Multiply two numbers.
  16812. *
  16813. * @static
  16814. * @memberOf _
  16815. * @since 4.7.0
  16816. * @category Math
  16817. * @param {number} multiplier The first number in a multiplication.
  16818. * @param {number} multiplicand The second number in a multiplication.
  16819. * @returns {number} Returns the product.
  16820. * @example
  16821. *
  16822. * _.multiply(6, 4);
  16823. * // => 24
  16824. */
  16825. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16826. return multiplier * multiplicand;
  16827. }, 1);
  16828. /**
  16829. * Computes `number` rounded to `precision`.
  16830. *
  16831. * @static
  16832. * @memberOf _
  16833. * @since 3.10.0
  16834. * @category Math
  16835. * @param {number} number The number to round.
  16836. * @param {number} [precision=0] The precision to round to.
  16837. * @returns {number} Returns the rounded number.
  16838. * @example
  16839. *
  16840. * _.round(4.006);
  16841. * // => 4
  16842. *
  16843. * _.round(4.006, 2);
  16844. * // => 4.01
  16845. *
  16846. * _.round(4060, -2);
  16847. * // => 4100
  16848. */
  16849. var round = createRound('round');
  16850. /**
  16851. * Subtract two numbers.
  16852. *
  16853. * @static
  16854. * @memberOf _
  16855. * @since 4.0.0
  16856. * @category Math
  16857. * @param {number} minuend The first number in a subtraction.
  16858. * @param {number} subtrahend The second number in a subtraction.
  16859. * @returns {number} Returns the difference.
  16860. * @example
  16861. *
  16862. * _.subtract(6, 4);
  16863. * // => 2
  16864. */
  16865. var subtract = createMathOperation(function(minuend, subtrahend) {
  16866. return minuend - subtrahend;
  16867. }, 0);
  16868. /**
  16869. * Computes the sum of the values in `array`.
  16870. *
  16871. * @static
  16872. * @memberOf _
  16873. * @since 3.4.0
  16874. * @category Math
  16875. * @param {Array} array The array to iterate over.
  16876. * @returns {number} Returns the sum.
  16877. * @example
  16878. *
  16879. * _.sum([4, 2, 8, 6]);
  16880. * // => 20
  16881. */
  16882. function sum(array) {
  16883. return (array && array.length)
  16884. ? baseSum(array, identity)
  16885. : 0;
  16886. }
  16887. /**
  16888. * This method is like `_.sum` except that it accepts `iteratee` which is
  16889. * invoked for each element in `array` to generate the value to be summed.
  16890. * The iteratee is invoked with one argument: (value).
  16891. *
  16892. * @static
  16893. * @memberOf _
  16894. * @since 4.0.0
  16895. * @category Math
  16896. * @param {Array} array The array to iterate over.
  16897. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16898. * @returns {number} Returns the sum.
  16899. * @example
  16900. *
  16901. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16902. *
  16903. * _.sumBy(objects, function(o) { return o.n; });
  16904. * // => 20
  16905. *
  16906. * // The `_.property` iteratee shorthand.
  16907. * _.sumBy(objects, 'n');
  16908. * // => 20
  16909. */
  16910. function sumBy(array, iteratee) {
  16911. return (array && array.length)
  16912. ? baseSum(array, getIteratee(iteratee, 2))
  16913. : 0;
  16914. }
  16915. /*------------------------------------------------------------------------*/
  16916. // Add methods that return wrapped values in chain sequences.
  16917. lodash.after = after;
  16918. lodash.ary = ary;
  16919. lodash.assign = assign;
  16920. lodash.assignIn = assignIn;
  16921. lodash.assignInWith = assignInWith;
  16922. lodash.assignWith = assignWith;
  16923. lodash.at = at;
  16924. lodash.before = before;
  16925. lodash.bind = bind;
  16926. lodash.bindAll = bindAll;
  16927. lodash.bindKey = bindKey;
  16928. lodash.castArray = castArray;
  16929. lodash.chain = chain;
  16930. lodash.chunk = chunk;
  16931. lodash.compact = compact;
  16932. lodash.concat = concat;
  16933. lodash.cond = cond;
  16934. lodash.conforms = conforms;
  16935. lodash.constant = constant;
  16936. lodash.countBy = countBy;
  16937. lodash.create = create;
  16938. lodash.curry = curry;
  16939. lodash.curryRight = curryRight;
  16940. lodash.debounce = debounce;
  16941. lodash.defaults = defaults;
  16942. lodash.defaultsDeep = defaultsDeep;
  16943. lodash.defer = defer;
  16944. lodash.delay = delay;
  16945. lodash.difference = difference;
  16946. lodash.differenceBy = differenceBy;
  16947. lodash.differenceWith = differenceWith;
  16948. lodash.drop = drop;
  16949. lodash.dropRight = dropRight;
  16950. lodash.dropRightWhile = dropRightWhile;
  16951. lodash.dropWhile = dropWhile;
  16952. lodash.fill = fill;
  16953. lodash.filter = filter;
  16954. lodash.flatMap = flatMap;
  16955. lodash.flatMapDeep = flatMapDeep;
  16956. lodash.flatMapDepth = flatMapDepth;
  16957. lodash.flatten = flatten;
  16958. lodash.flattenDeep = flattenDeep;
  16959. lodash.flattenDepth = flattenDepth;
  16960. lodash.flip = flip;
  16961. lodash.flow = flow;
  16962. lodash.flowRight = flowRight;
  16963. lodash.fromPairs = fromPairs;
  16964. lodash.functions = functions;
  16965. lodash.functionsIn = functionsIn;
  16966. lodash.groupBy = groupBy;
  16967. lodash.initial = initial;
  16968. lodash.intersection = intersection;
  16969. lodash.intersectionBy = intersectionBy;
  16970. lodash.intersectionWith = intersectionWith;
  16971. lodash.invert = invert;
  16972. lodash.invertBy = invertBy;
  16973. lodash.invokeMap = invokeMap;
  16974. lodash.iteratee = iteratee;
  16975. lodash.keyBy = keyBy;
  16976. lodash.keys = keys;
  16977. lodash.keysIn = keysIn;
  16978. lodash.map = map;
  16979. lodash.mapKeys = mapKeys;
  16980. lodash.mapValues = mapValues;
  16981. lodash.matches = matches;
  16982. lodash.matchesProperty = matchesProperty;
  16983. lodash.memoize = memoize;
  16984. lodash.merge = merge;
  16985. lodash.mergeWith = mergeWith;
  16986. lodash.method = method;
  16987. lodash.methodOf = methodOf;
  16988. lodash.mixin = mixin;
  16989. lodash.negate = negate;
  16990. lodash.nthArg = nthArg;
  16991. lodash.omit = omit;
  16992. lodash.omitBy = omitBy;
  16993. lodash.once = once;
  16994. lodash.orderBy = orderBy;
  16995. lodash.over = over;
  16996. lodash.overArgs = overArgs;
  16997. lodash.overEvery = overEvery;
  16998. lodash.overSome = overSome;
  16999. lodash.partial = partial;
  17000. lodash.partialRight = partialRight;
  17001. lodash.partition = partition;
  17002. lodash.pick = pick;
  17003. lodash.pickBy = pickBy;
  17004. lodash.property = property;
  17005. lodash.propertyOf = propertyOf;
  17006. lodash.pull = pull;
  17007. lodash.pullAll = pullAll;
  17008. lodash.pullAllBy = pullAllBy;
  17009. lodash.pullAllWith = pullAllWith;
  17010. lodash.pullAt = pullAt;
  17011. lodash.range = range;
  17012. lodash.rangeRight = rangeRight;
  17013. lodash.rearg = rearg;
  17014. lodash.reject = reject;
  17015. lodash.remove = remove;
  17016. lodash.rest = rest;
  17017. lodash.reverse = reverse;
  17018. lodash.sampleSize = sampleSize;
  17019. lodash.set = set;
  17020. lodash.setWith = setWith;
  17021. lodash.shuffle = shuffle;
  17022. lodash.slice = slice;
  17023. lodash.sortBy = sortBy;
  17024. lodash.sortedUniq = sortedUniq;
  17025. lodash.sortedUniqBy = sortedUniqBy;
  17026. lodash.split = split;
  17027. lodash.spread = spread;
  17028. lodash.tail = tail;
  17029. lodash.take = take;
  17030. lodash.takeRight = takeRight;
  17031. lodash.takeRightWhile = takeRightWhile;
  17032. lodash.takeWhile = takeWhile;
  17033. lodash.tap = tap;
  17034. lodash.throttle = throttle;
  17035. lodash.thru = thru;
  17036. lodash.toArray = toArray;
  17037. lodash.toPairs = toPairs;
  17038. lodash.toPairsIn = toPairsIn;
  17039. lodash.toPath = toPath;
  17040. lodash.toPlainObject = toPlainObject;
  17041. lodash.transform = transform;
  17042. lodash.unary = unary;
  17043. lodash.union = union;
  17044. lodash.unionBy = unionBy;
  17045. lodash.unionWith = unionWith;
  17046. lodash.uniq = uniq;
  17047. lodash.uniqBy = uniqBy;
  17048. lodash.uniqWith = uniqWith;
  17049. lodash.unset = unset;
  17050. lodash.unzip = unzip;
  17051. lodash.unzipWith = unzipWith;
  17052. lodash.update = update;
  17053. lodash.updateWith = updateWith;
  17054. lodash.values = values;
  17055. lodash.valuesIn = valuesIn;
  17056. lodash.without = without;
  17057. lodash.words = words;
  17058. lodash.wrap = wrap;
  17059. lodash.xor = xor;
  17060. lodash.xorBy = xorBy;
  17061. lodash.xorWith = xorWith;
  17062. lodash.zip = zip;
  17063. lodash.zipObject = zipObject;
  17064. lodash.zipObjectDeep = zipObjectDeep;
  17065. lodash.zipWith = zipWith;
  17066. // Add aliases.
  17067. lodash.entries = toPairs;
  17068. lodash.entriesIn = toPairsIn;
  17069. lodash.extend = assignIn;
  17070. lodash.extendWith = assignInWith;
  17071. // Add methods to `lodash.prototype`.
  17072. mixin(lodash, lodash);
  17073. /*------------------------------------------------------------------------*/
  17074. // Add methods that return unwrapped values in chain sequences.
  17075. lodash.add = add;
  17076. lodash.attempt = attempt;
  17077. lodash.camelCase = camelCase;
  17078. lodash.capitalize = capitalize;
  17079. lodash.ceil = ceil;
  17080. lodash.clamp = clamp;
  17081. lodash.clone = clone;
  17082. lodash.cloneDeep = cloneDeep;
  17083. lodash.cloneDeepWith = cloneDeepWith;
  17084. lodash.cloneWith = cloneWith;
  17085. lodash.conformsTo = conformsTo;
  17086. lodash.deburr = deburr;
  17087. lodash.defaultTo = defaultTo;
  17088. lodash.divide = divide;
  17089. lodash.endsWith = endsWith;
  17090. lodash.eq = eq;
  17091. lodash.escape = escape;
  17092. lodash.escapeRegExp = escapeRegExp;
  17093. lodash.every = every;
  17094. lodash.find = find;
  17095. lodash.findIndex = findIndex;
  17096. lodash.findKey = findKey;
  17097. lodash.findLast = findLast;
  17098. lodash.findLastIndex = findLastIndex;
  17099. lodash.findLastKey = findLastKey;
  17100. lodash.floor = floor;
  17101. lodash.forEach = forEach;
  17102. lodash.forEachRight = forEachRight;
  17103. lodash.forIn = forIn;
  17104. lodash.forInRight = forInRight;
  17105. lodash.forOwn = forOwn;
  17106. lodash.forOwnRight = forOwnRight;
  17107. lodash.get = get;
  17108. lodash.gt = gt;
  17109. lodash.gte = gte;
  17110. lodash.has = has;
  17111. lodash.hasIn = hasIn;
  17112. lodash.head = head;
  17113. lodash.identity = identity;
  17114. lodash.includes = includes;
  17115. lodash.indexOf = indexOf;
  17116. lodash.inRange = inRange;
  17117. lodash.invoke = invoke;
  17118. lodash.isArguments = isArguments;
  17119. lodash.isArray = isArray;
  17120. lodash.isArrayBuffer = isArrayBuffer;
  17121. lodash.isArrayLike = isArrayLike;
  17122. lodash.isArrayLikeObject = isArrayLikeObject;
  17123. lodash.isBoolean = isBoolean;
  17124. lodash.isBuffer = isBuffer;
  17125. lodash.isDate = isDate;
  17126. lodash.isElement = isElement;
  17127. lodash.isEmpty = isEmpty;
  17128. lodash.isEqual = isEqual;
  17129. lodash.isEqualWith = isEqualWith;
  17130. lodash.isError = isError;
  17131. lodash.isFinite = isFinite;
  17132. lodash.isFunction = isFunction;
  17133. lodash.isInteger = isInteger;
  17134. lodash.isLength = isLength;
  17135. lodash.isMap = isMap;
  17136. lodash.isMatch = isMatch;
  17137. lodash.isMatchWith = isMatchWith;
  17138. lodash.isNaN = isNaN;
  17139. lodash.isNative = isNative;
  17140. lodash.isNil = isNil;
  17141. lodash.isNull = isNull;
  17142. lodash.isNumber = isNumber;
  17143. lodash.isObject = isObject;
  17144. lodash.isObjectLike = isObjectLike;
  17145. lodash.isPlainObject = isPlainObject;
  17146. lodash.isRegExp = isRegExp;
  17147. lodash.isSafeInteger = isSafeInteger;
  17148. lodash.isSet = isSet;
  17149. lodash.isString = isString;
  17150. lodash.isSymbol = isSymbol;
  17151. lodash.isTypedArray = isTypedArray;
  17152. lodash.isUndefined = isUndefined;
  17153. lodash.isWeakMap = isWeakMap;
  17154. lodash.isWeakSet = isWeakSet;
  17155. lodash.join = join;
  17156. lodash.kebabCase = kebabCase;
  17157. lodash.last = last;
  17158. lodash.lastIndexOf = lastIndexOf;
  17159. lodash.lowerCase = lowerCase;
  17160. lodash.lowerFirst = lowerFirst;
  17161. lodash.lt = lt;
  17162. lodash.lte = lte;
  17163. lodash.max = max;
  17164. lodash.maxBy = maxBy;
  17165. lodash.mean = mean;
  17166. lodash.meanBy = meanBy;
  17167. lodash.min = min;
  17168. lodash.minBy = minBy;
  17169. lodash.stubArray = stubArray;
  17170. lodash.stubFalse = stubFalse;
  17171. lodash.stubObject = stubObject;
  17172. lodash.stubString = stubString;
  17173. lodash.stubTrue = stubTrue;
  17174. lodash.multiply = multiply;
  17175. lodash.nth = nth;
  17176. lodash.noConflict = noConflict;
  17177. lodash.noop = noop;
  17178. lodash.now = now;
  17179. lodash.pad = pad;
  17180. lodash.padEnd = padEnd;
  17181. lodash.padStart = padStart;
  17182. lodash.parseInt = parseInt;
  17183. lodash.random = random;
  17184. lodash.reduce = reduce;
  17185. lodash.reduceRight = reduceRight;
  17186. lodash.repeat = repeat;
  17187. lodash.replace = replace;
  17188. lodash.result = result;
  17189. lodash.round = round;
  17190. lodash.runInContext = runInContext;
  17191. lodash.sample = sample;
  17192. lodash.size = size;
  17193. lodash.snakeCase = snakeCase;
  17194. lodash.some = some;
  17195. lodash.sortedIndex = sortedIndex;
  17196. lodash.sortedIndexBy = sortedIndexBy;
  17197. lodash.sortedIndexOf = sortedIndexOf;
  17198. lodash.sortedLastIndex = sortedLastIndex;
  17199. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17200. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17201. lodash.startCase = startCase;
  17202. lodash.startsWith = startsWith;
  17203. lodash.subtract = subtract;
  17204. lodash.sum = sum;
  17205. lodash.sumBy = sumBy;
  17206. lodash.template = template;
  17207. lodash.times = times;
  17208. lodash.toFinite = toFinite;
  17209. lodash.toInteger = toInteger;
  17210. lodash.toLength = toLength;
  17211. lodash.toLower = toLower;
  17212. lodash.toNumber = toNumber;
  17213. lodash.toSafeInteger = toSafeInteger;
  17214. lodash.toString = toString;
  17215. lodash.toUpper = toUpper;
  17216. lodash.trim = trim;
  17217. lodash.trimEnd = trimEnd;
  17218. lodash.trimStart = trimStart;
  17219. lodash.truncate = truncate;
  17220. lodash.unescape = unescape;
  17221. lodash.uniqueId = uniqueId;
  17222. lodash.upperCase = upperCase;
  17223. lodash.upperFirst = upperFirst;
  17224. // Add aliases.
  17225. lodash.each = forEach;
  17226. lodash.eachRight = forEachRight;
  17227. lodash.first = head;
  17228. mixin(lodash, (function() {
  17229. var source = {};
  17230. baseForOwn(lodash, function(func, methodName) {
  17231. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17232. source[methodName] = func;
  17233. }
  17234. });
  17235. return source;
  17236. }()), { 'chain': false });
  17237. /*------------------------------------------------------------------------*/
  17238. /**
  17239. * The semantic version number.
  17240. *
  17241. * @static
  17242. * @memberOf _
  17243. * @type {string}
  17244. */
  17245. lodash.VERSION = VERSION;
  17246. // Assign default placeholders.
  17247. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17248. lodash[methodName].placeholder = lodash;
  17249. });
  17250. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17251. arrayEach(['drop', 'take'], function(methodName, index) {
  17252. LazyWrapper.prototype[methodName] = function(n) {
  17253. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17254. var result = (this.__filtered__ && !index)
  17255. ? new LazyWrapper(this)
  17256. : this.clone();
  17257. if (result.__filtered__) {
  17258. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17259. } else {
  17260. result.__views__.push({
  17261. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17262. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17263. });
  17264. }
  17265. return result;
  17266. };
  17267. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17268. return this.reverse()[methodName](n).reverse();
  17269. };
  17270. });
  17271. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17272. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17273. var type = index + 1,
  17274. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17275. LazyWrapper.prototype[methodName] = function(iteratee) {
  17276. var result = this.clone();
  17277. result.__iteratees__.push({
  17278. 'iteratee': getIteratee(iteratee, 3),
  17279. 'type': type
  17280. });
  17281. result.__filtered__ = result.__filtered__ || isFilter;
  17282. return result;
  17283. };
  17284. });
  17285. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17286. arrayEach(['head', 'last'], function(methodName, index) {
  17287. var takeName = 'take' + (index ? 'Right' : '');
  17288. LazyWrapper.prototype[methodName] = function() {
  17289. return this[takeName](1).value()[0];
  17290. };
  17291. });
  17292. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17293. arrayEach(['initial', 'tail'], function(methodName, index) {
  17294. var dropName = 'drop' + (index ? '' : 'Right');
  17295. LazyWrapper.prototype[methodName] = function() {
  17296. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17297. };
  17298. });
  17299. LazyWrapper.prototype.compact = function() {
  17300. return this.filter(identity);
  17301. };
  17302. LazyWrapper.prototype.find = function(predicate) {
  17303. return this.filter(predicate).head();
  17304. };
  17305. LazyWrapper.prototype.findLast = function(predicate) {
  17306. return this.reverse().find(predicate);
  17307. };
  17308. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17309. if (typeof path == 'function') {
  17310. return new LazyWrapper(this);
  17311. }
  17312. return this.map(function(value) {
  17313. return baseInvoke(value, path, args);
  17314. });
  17315. });
  17316. LazyWrapper.prototype.reject = function(predicate) {
  17317. return this.filter(negate(getIteratee(predicate)));
  17318. };
  17319. LazyWrapper.prototype.slice = function(start, end) {
  17320. start = toInteger(start);
  17321. var result = this;
  17322. if (result.__filtered__ && (start > 0 || end < 0)) {
  17323. return new LazyWrapper(result);
  17324. }
  17325. if (start < 0) {
  17326. result = result.takeRight(-start);
  17327. } else if (start) {
  17328. result = result.drop(start);
  17329. }
  17330. if (end !== undefined) {
  17331. end = toInteger(end);
  17332. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17333. }
  17334. return result;
  17335. };
  17336. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17337. return this.reverse().takeWhile(predicate).reverse();
  17338. };
  17339. LazyWrapper.prototype.toArray = function() {
  17340. return this.take(MAX_ARRAY_LENGTH);
  17341. };
  17342. // Add `LazyWrapper` methods to `lodash.prototype`.
  17343. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17344. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17345. isTaker = /^(?:head|last)$/.test(methodName),
  17346. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17347. retUnwrapped = isTaker || /^find/.test(methodName);
  17348. if (!lodashFunc) {
  17349. return;
  17350. }
  17351. lodash.prototype[methodName] = function() {
  17352. var value = this.__wrapped__,
  17353. args = isTaker ? [1] : arguments,
  17354. isLazy = value instanceof LazyWrapper,
  17355. iteratee = args[0],
  17356. useLazy = isLazy || isArray(value);
  17357. var interceptor = function(value) {
  17358. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17359. return (isTaker && chainAll) ? result[0] : result;
  17360. };
  17361. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17362. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17363. isLazy = useLazy = false;
  17364. }
  17365. var chainAll = this.__chain__,
  17366. isHybrid = !!this.__actions__.length,
  17367. isUnwrapped = retUnwrapped && !chainAll,
  17368. onlyLazy = isLazy && !isHybrid;
  17369. if (!retUnwrapped && useLazy) {
  17370. value = onlyLazy ? value : new LazyWrapper(this);
  17371. var result = func.apply(value, args);
  17372. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17373. return new LodashWrapper(result, chainAll);
  17374. }
  17375. if (isUnwrapped && onlyLazy) {
  17376. return func.apply(this, args);
  17377. }
  17378. result = this.thru(interceptor);
  17379. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17380. };
  17381. });
  17382. // Add `Array` methods to `lodash.prototype`.
  17383. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17384. var func = arrayProto[methodName],
  17385. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17386. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17387. lodash.prototype[methodName] = function() {
  17388. var args = arguments;
  17389. if (retUnwrapped && !this.__chain__) {
  17390. var value = this.value();
  17391. return func.apply(isArray(value) ? value : [], args);
  17392. }
  17393. return this[chainName](function(value) {
  17394. return func.apply(isArray(value) ? value : [], args);
  17395. });
  17396. };
  17397. });
  17398. // Map minified method names to their real names.
  17399. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17400. var lodashFunc = lodash[methodName];
  17401. if (lodashFunc) {
  17402. var key = lodashFunc.name + '';
  17403. if (!hasOwnProperty.call(realNames, key)) {
  17404. realNames[key] = [];
  17405. }
  17406. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17407. }
  17408. });
  17409. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17410. 'name': 'wrapper',
  17411. 'func': undefined
  17412. }];
  17413. // Add methods to `LazyWrapper`.
  17414. LazyWrapper.prototype.clone = lazyClone;
  17415. LazyWrapper.prototype.reverse = lazyReverse;
  17416. LazyWrapper.prototype.value = lazyValue;
  17417. // Add chain sequence methods to the `lodash` wrapper.
  17418. lodash.prototype.at = wrapperAt;
  17419. lodash.prototype.chain = wrapperChain;
  17420. lodash.prototype.commit = wrapperCommit;
  17421. lodash.prototype.next = wrapperNext;
  17422. lodash.prototype.plant = wrapperPlant;
  17423. lodash.prototype.reverse = wrapperReverse;
  17424. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17425. // Add lazy aliases.
  17426. lodash.prototype.first = lodash.prototype.head;
  17427. if (symIterator) {
  17428. lodash.prototype[symIterator] = wrapperToIterator;
  17429. }
  17430. return lodash;
  17431. });
  17432. /*--------------------------------------------------------------------------*/
  17433. // Export lodash.
  17434. var _ = runInContext();
  17435. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17436. if (true) {
  17437. // Expose Lodash on the global object to prevent errors when Lodash is
  17438. // loaded by a script tag in the presence of an AMD loader.
  17439. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17440. // Use `_.noConflict` to remove Lodash from the global object.
  17441. root._ = _;
  17442. // Define as an anonymous module so, through path mapping, it can be
  17443. // referenced as the "underscore" module.
  17444. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17445. return _;
  17446. }).call(exports, __webpack_require__, exports, module),
  17447. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17448. }
  17449. // Check for `exports` after `define` in case a build optimizer adds it.
  17450. else {}
  17451. }.call(this));
  17452. /***/ }),
  17453. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17454. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17455. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17456. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17457. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17458. "use strict";
  17459. __webpack_require__.r(__webpack_exports__);
  17460. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17461. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17462. /* harmony export */ });
  17463. /* 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");
  17464. /* 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__);
  17465. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17466. var options = {};
  17467. options.insert = "head";
  17468. options.singleton = false;
  17469. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17470. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17471. /***/ }),
  17472. /***/ "./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":
  17473. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17474. !*** ./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 ***!
  17475. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17476. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17477. "use strict";
  17478. __webpack_require__.r(__webpack_exports__);
  17479. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17480. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17481. /* harmony export */ });
  17482. /* harmony import */ var _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");
  17483. /* 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__);
  17484. /* 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");
  17485. var options = {};
  17486. options.insert = "head";
  17487. options.singleton = false;
  17488. 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);
  17489. /* 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 || {});
  17490. /***/ }),
  17491. /***/ "./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":
  17492. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17493. !*** ./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 ***!
  17494. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17495. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17496. "use strict";
  17497. __webpack_require__.r(__webpack_exports__);
  17498. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17499. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17500. /* harmony export */ });
  17501. /* harmony import */ var _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");
  17502. /* 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__);
  17503. /* 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");
  17504. var options = {};
  17505. options.insert = "head";
  17506. options.singleton = false;
  17507. 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);
  17508. /* 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 || {});
  17509. /***/ }),
  17510. /***/ "./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":
  17511. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17512. !*** ./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 ***!
  17513. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17514. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17515. "use strict";
  17516. __webpack_require__.r(__webpack_exports__);
  17517. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17518. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17519. /* harmony export */ });
  17520. /* harmony import */ var _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");
  17521. /* 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__);
  17522. /* 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");
  17523. var options = {};
  17524. options.insert = "head";
  17525. options.singleton = false;
  17526. 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);
  17527. /* 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 || {});
  17528. /***/ }),
  17529. /***/ "./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":
  17530. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17531. !*** ./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 ***!
  17532. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17534. "use strict";
  17535. __webpack_require__.r(__webpack_exports__);
  17536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17537. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17538. /* harmony export */ });
  17539. /* harmony import */ var _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");
  17540. /* 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__);
  17541. /* 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");
  17542. var options = {};
  17543. options.insert = "head";
  17544. options.singleton = false;
  17545. 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);
  17546. /* 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 || {});
  17547. /***/ }),
  17548. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17549. /*!******************************************************!*\
  17550. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17551. \******************************************************/
  17552. /***/ ((__unused_webpack_module, exports) => {
  17553. "use strict";
  17554. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17555. // runtime helper for setting properties on components
  17556. // in a tree-shakable way
  17557. exports["default"] = (sfc, props) => {
  17558. const target = sfc.__vccOpts || sfc;
  17559. for (const [key, val] of props) {
  17560. target[key] = val;
  17561. }
  17562. return target;
  17563. };
  17564. /***/ }),
  17565. /***/ "./resources/js/components/AppButtonLink.vue":
  17566. /*!***************************************************!*\
  17567. !*** ./resources/js/components/AppButtonLink.vue ***!
  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": () => (__WEBPACK_DEFAULT_EXPORT__)
  17574. /* harmony export */ });
  17575. /* 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");
  17576. /* 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");
  17577. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17578. ;
  17579. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17580. /* hot reload */
  17581. if (false) {}
  17582. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17583. /***/ }),
  17584. /***/ "./resources/js/components/AppFooter.vue":
  17585. /*!***********************************************!*\
  17586. !*** ./resources/js/components/AppFooter.vue ***!
  17587. \***********************************************/
  17588. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17589. "use strict";
  17590. __webpack_require__.r(__webpack_exports__);
  17591. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17592. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17593. /* harmony export */ });
  17594. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17595. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17596. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17597. const script = {}
  17598. ;
  17599. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17600. /* hot reload */
  17601. if (false) {}
  17602. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17603. /***/ }),
  17604. /***/ "./resources/js/components/AppMessage.vue":
  17605. /*!************************************************!*\
  17606. !*** ./resources/js/components/AppMessage.vue ***!
  17607. \************************************************/
  17608. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17609. "use strict";
  17610. __webpack_require__.r(__webpack_exports__);
  17611. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17612. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17613. /* harmony export */ });
  17614. /* 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");
  17615. /* 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");
  17616. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17617. ;
  17618. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17619. /* hot reload */
  17620. if (false) {}
  17621. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17622. /***/ }),
  17623. /***/ "./resources/js/components/AppPagination.vue":
  17624. /*!***************************************************!*\
  17625. !*** ./resources/js/components/AppPagination.vue ***!
  17626. \***************************************************/
  17627. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17628. "use strict";
  17629. __webpack_require__.r(__webpack_exports__);
  17630. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17631. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17632. /* harmony export */ });
  17633. /* 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");
  17634. /* 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");
  17635. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17636. ;
  17637. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17638. /* hot reload */
  17639. if (false) {}
  17640. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17641. /***/ }),
  17642. /***/ "./resources/js/components/AppSidebar.vue":
  17643. /*!************************************************!*\
  17644. !*** ./resources/js/components/AppSidebar.vue ***!
  17645. \************************************************/
  17646. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17647. "use strict";
  17648. __webpack_require__.r(__webpack_exports__);
  17649. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17650. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17651. /* harmony export */ });
  17652. /* 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");
  17653. /* 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");
  17654. /* 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");
  17655. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17656. ;
  17657. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17658. /* hot reload */
  17659. if (false) {}
  17660. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17661. /***/ }),
  17662. /***/ "./resources/js/components/AppSubSidebar.vue":
  17663. /*!***************************************************!*\
  17664. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17665. \***************************************************/
  17666. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17667. "use strict";
  17668. __webpack_require__.r(__webpack_exports__);
  17669. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17670. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17671. /* harmony export */ });
  17672. /* 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");
  17673. /* 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");
  17674. /* 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");
  17675. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17676. ;
  17677. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17678. /* hot reload */
  17679. if (false) {}
  17680. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17681. /***/ }),
  17682. /***/ "./resources/js/components/AppTopBar.vue":
  17683. /*!***********************************************!*\
  17684. !*** ./resources/js/components/AppTopBar.vue ***!
  17685. \***********************************************/
  17686. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17687. "use strict";
  17688. __webpack_require__.r(__webpack_exports__);
  17689. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17690. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17691. /* harmony export */ });
  17692. /* 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");
  17693. /* 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");
  17694. /* 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");
  17695. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17696. ;
  17697. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17698. /* hot reload */
  17699. if (false) {}
  17700. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17701. /***/ }),
  17702. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17703. /*!**************************************************!*\
  17704. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17705. \**************************************************/
  17706. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17707. "use strict";
  17708. __webpack_require__.r(__webpack_exports__);
  17709. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17710. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17711. /* harmony export */ });
  17712. /* 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");
  17713. /* 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");
  17714. /* 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");
  17715. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17716. ;
  17717. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17718. /* hot reload */
  17719. if (false) {}
  17720. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17721. /***/ }),
  17722. /***/ "./resources/js/pages/topup/Index.vue":
  17723. /*!********************************************!*\
  17724. !*** ./resources/js/pages/topup/Index.vue ***!
  17725. \********************************************/
  17726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17727. "use strict";
  17728. __webpack_require__.r(__webpack_exports__);
  17729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17730. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17731. /* harmony export */ });
  17732. /* harmony import */ var _Index_vue_vue_type_template_id_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=3bf54f8c */ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c");
  17733. /* 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/topup/Index.vue?vue&type=script&setup=true&lang=js");
  17734. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17735. ;
  17736. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/topup/Index.vue"]])
  17737. /* hot reload */
  17738. if (false) {}
  17739. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17740. /***/ }),
  17741. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17742. /*!**************************************************************************************!*\
  17743. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17744. \**************************************************************************************/
  17745. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17746. "use strict";
  17747. __webpack_require__.r(__webpack_exports__);
  17748. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17749. /* 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"])
  17750. /* harmony export */ });
  17751. /* 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");
  17752. /***/ }),
  17753. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17754. /*!***********************************************************************************!*\
  17755. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17756. \***********************************************************************************/
  17757. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17758. "use strict";
  17759. __webpack_require__.r(__webpack_exports__);
  17760. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17761. /* 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"])
  17762. /* harmony export */ });
  17763. /* 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");
  17764. /***/ }),
  17765. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17766. /*!**************************************************************************************!*\
  17767. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17768. \**************************************************************************************/
  17769. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17770. "use strict";
  17771. __webpack_require__.r(__webpack_exports__);
  17772. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17773. /* 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"])
  17774. /* harmony export */ });
  17775. /* 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");
  17776. /***/ }),
  17777. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17778. /*!***********************************************************************************!*\
  17779. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17780. \***********************************************************************************/
  17781. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17782. "use strict";
  17783. __webpack_require__.r(__webpack_exports__);
  17784. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17785. /* 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"])
  17786. /* harmony export */ });
  17787. /* 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");
  17788. /***/ }),
  17789. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17790. /*!**************************************************************************************!*\
  17791. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17792. \**************************************************************************************/
  17793. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17794. "use strict";
  17795. __webpack_require__.r(__webpack_exports__);
  17796. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17797. /* 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"])
  17798. /* harmony export */ });
  17799. /* 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");
  17800. /***/ }),
  17801. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17802. /*!**********************************************************************************!*\
  17803. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17804. \**********************************************************************************/
  17805. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17806. "use strict";
  17807. __webpack_require__.r(__webpack_exports__);
  17808. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17809. /* 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"])
  17810. /* harmony export */ });
  17811. /* 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");
  17812. /***/ }),
  17813. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17814. /*!*************************************************************************************!*\
  17815. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17816. \*************************************************************************************/
  17817. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17818. "use strict";
  17819. __webpack_require__.r(__webpack_exports__);
  17820. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17821. /* 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"])
  17822. /* harmony export */ });
  17823. /* 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");
  17824. /***/ }),
  17825. /***/ "./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  17826. /*!*******************************************************************************!*\
  17827. !*** ./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  17828. \*******************************************************************************/
  17829. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17830. "use strict";
  17831. __webpack_require__.r(__webpack_exports__);
  17832. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17833. /* 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"])
  17834. /* harmony export */ });
  17835. /* 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/topup/Index.vue?vue&type=script&setup=true&lang=js");
  17836. /***/ }),
  17837. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17838. /*!*********************************************************************************!*\
  17839. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17840. \*********************************************************************************/
  17841. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17842. "use strict";
  17843. __webpack_require__.r(__webpack_exports__);
  17844. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17845. /* 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)
  17846. /* harmony export */ });
  17847. /* 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");
  17848. /***/ }),
  17849. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17850. /*!*****************************************************************************************!*\
  17851. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17852. \*****************************************************************************************/
  17853. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17854. "use strict";
  17855. __webpack_require__.r(__webpack_exports__);
  17856. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17857. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17858. /* harmony export */ });
  17859. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17860. /***/ }),
  17861. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17862. /*!******************************************************************************!*\
  17863. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17864. \******************************************************************************/
  17865. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17866. "use strict";
  17867. __webpack_require__.r(__webpack_exports__);
  17868. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17869. /* 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)
  17870. /* harmony export */ });
  17871. /* 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");
  17872. /***/ }),
  17873. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17874. /*!*********************************************************************************!*\
  17875. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17876. \*********************************************************************************/
  17877. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17878. "use strict";
  17879. __webpack_require__.r(__webpack_exports__);
  17880. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17881. /* 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)
  17882. /* harmony export */ });
  17883. /* 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");
  17884. /***/ }),
  17885. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17886. /*!******************************************************************************************!*\
  17887. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17888. \******************************************************************************************/
  17889. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17890. "use strict";
  17891. __webpack_require__.r(__webpack_exports__);
  17892. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17893. /* 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)
  17894. /* harmony export */ });
  17895. /* 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");
  17896. /***/ }),
  17897. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17898. /*!*********************************************************************************************!*\
  17899. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17900. \*********************************************************************************************/
  17901. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17902. "use strict";
  17903. __webpack_require__.r(__webpack_exports__);
  17904. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17905. /* 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)
  17906. /* harmony export */ });
  17907. /* 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");
  17908. /***/ }),
  17909. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17910. /*!*****************************************************************************************!*\
  17911. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17912. \*****************************************************************************************/
  17913. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17914. "use strict";
  17915. __webpack_require__.r(__webpack_exports__);
  17916. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17917. /* 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)
  17918. /* harmony export */ });
  17919. /* 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");
  17920. /***/ }),
  17921. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17922. /*!********************************************************************************************!*\
  17923. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17924. \********************************************************************************************/
  17925. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17926. "use strict";
  17927. __webpack_require__.r(__webpack_exports__);
  17928. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17929. /* 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)
  17930. /* harmony export */ });
  17931. /* 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");
  17932. /***/ }),
  17933. /***/ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c":
  17934. /*!**************************************************************************!*\
  17935. !*** ./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  17936. \**************************************************************************/
  17937. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17938. "use strict";
  17939. __webpack_require__.r(__webpack_exports__);
  17940. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17941. /* 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_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__.render)
  17942. /* harmony export */ });
  17943. /* 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_3bf54f8c__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=3bf54f8c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/topup/Index.vue?vue&type=template&id=3bf54f8c");
  17944. /***/ }),
  17945. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17946. /*!********************************************************************************************************!*\
  17947. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17948. \********************************************************************************************************/
  17949. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17950. "use strict";
  17951. __webpack_require__.r(__webpack_exports__);
  17952. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17953. /***/ }),
  17954. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17955. /*!*********************************************************************************************************!*\
  17956. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17957. \*********************************************************************************************************/
  17958. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17959. "use strict";
  17960. __webpack_require__.r(__webpack_exports__);
  17961. /* 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");
  17962. /***/ }),
  17963. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17964. /*!************************************************************************************************************!*\
  17965. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17966. \************************************************************************************************************/
  17967. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17968. "use strict";
  17969. __webpack_require__.r(__webpack_exports__);
  17970. /* 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");
  17971. /***/ }),
  17972. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17973. /*!********************************************************************************************************!*\
  17974. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17975. \********************************************************************************************************/
  17976. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17977. "use strict";
  17978. __webpack_require__.r(__webpack_exports__);
  17979. /* 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");
  17980. /***/ }),
  17981. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17982. /*!***********************************************************************************************************!*\
  17983. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17984. \***********************************************************************************************************/
  17985. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17986. "use strict";
  17987. __webpack_require__.r(__webpack_exports__);
  17988. /* 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");
  17989. /***/ })
  17990. }]);