resources_js_pages_topup_Index_vue.js 705KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453
  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.initialSearch),
  290. search = _useSearchText.search;
  291. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter)(props.initialDateRange),
  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, "Profil Saya", -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, "Sign Out", -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. 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"], {
  726. href: "/",
  727. "class": "layout-topbar-logo"
  728. }, {
  729. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  730. return [_hoisted_2, _hoisted_3];
  731. }),
  732. _: 1
  733. /* STABLE */
  734. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  735. "class": "p-link layout-menu-button layout-topbar-button",
  736. onClick: _cache[0] || (_cache[0] = function ($event) {
  737. return _ctx.$emit('menu-toggle', $event);
  738. })
  739. }, _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, {
  740. selector: '@next',
  741. enterClass: 'hidden',
  742. enterActiveClass: 'scalein',
  743. leaveToClass: 'hidden',
  744. leaveActiveClass: 'fadeout',
  745. hideOnOutsideClick: true
  746. }]]), (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
  747. /* TEXT */
  748. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  749. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  750. "class": "p-link layout-topbar-button"
  751. }, {
  752. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  753. return [_hoisted_12, _hoisted_13];
  754. }),
  755. _: 1
  756. /* STABLE */
  757. }, 8
  758. /* PROPS */
  759. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  760. href: _ctx.route('logout'),
  761. as: "button",
  762. method: "post",
  763. "class": "p-link layout-topbar-button"
  764. }, {
  765. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  766. return [_hoisted_14, _hoisted_15];
  767. }),
  768. _: 1
  769. /* STABLE */
  770. }, 8
  771. /* PROPS */
  772. , ["href"])])])]);
  773. }
  774. /***/ }),
  775. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  776. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  777. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  778. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  779. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  780. "use strict";
  781. __webpack_require__.r(__webpack_exports__);
  782. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  783. /* harmony export */ "render": () => (/* binding */ render)
  784. /* harmony export */ });
  785. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  786. var _withScopeId = function _withScopeId(n) {
  787. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  788. };
  789. var _hoisted_1 = {
  790. "class": "layout-sidebar"
  791. };
  792. var _hoisted_2 = {
  793. "class": "layout-main-container"
  794. };
  795. var _hoisted_3 = {
  796. "class": "layout-main"
  797. };
  798. var _hoisted_4 = {
  799. key: 0,
  800. "class": "layout-mask p-component-overlay"
  801. };
  802. function render(_ctx, _cache, $props, $setup, $data, $options) {
  803. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  804. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  805. onClick: $setup.onWrapperClick
  806. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  807. onMenuToggle: $setup.onMenuToggle
  808. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  809. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  810. }, null, 8
  811. /* PROPS */
  812. , ["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, {
  813. name: "layout-mask"
  814. }, {
  815. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  816. 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)];
  817. }),
  818. _: 1
  819. /* STABLE */
  820. })], 2
  821. /* CLASS */
  822. );
  823. }
  824. /***/ }),
  825. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  826. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  827. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  828. \****************************************************************************************************************************************************************************************************************************************************************************/
  829. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  830. "use strict";
  831. __webpack_require__.r(__webpack_exports__);
  832. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  833. /* harmony export */ "render": () => (/* binding */ render)
  834. /* harmony export */ });
  835. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  836. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Top Up", -1
  837. /* HOISTED */
  838. );
  839. var _hoisted_2 = {
  840. "class": "grid"
  841. };
  842. var _hoisted_3 = {
  843. "class": "col-12 md:col-8"
  844. };
  845. var _hoisted_4 = {
  846. "class": "grid"
  847. };
  848. var _hoisted_5 = {
  849. "class": "col-12 md:col-3"
  850. };
  851. var _hoisted_6 = {
  852. "class": "col-12 md:col-3"
  853. };
  854. var _hoisted_7 = {
  855. "class": "col-auto mt-2 ml-2"
  856. };
  857. var _hoisted_8 = {
  858. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  859. };
  860. function render(_ctx, _cache, $props, $setup, $data, $options) {
  861. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  862. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  863. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  864. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  865. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  866. 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"], {
  867. title: "Top Up"
  868. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  869. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  871. "responsive-layout": "scroll",
  872. "column-resize-mode": "expand",
  873. value: $props.topUp.data,
  874. "row-hover": true,
  875. "striped-rows": true
  876. }, {
  877. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  878. 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, {
  879. "class": "w-full",
  880. placeholder: "cari, contoh: 08xx, tina",
  881. modelValue: $setup.search,
  882. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  883. return $setup.search = $event;
  884. })
  885. }, null, 8
  886. /* PROPS */
  887. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  888. "touch-u-i": "",
  889. "class": "w-full",
  890. modelValue: $setup.dates,
  891. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  892. return $setup.dates = $event;
  893. }),
  894. "selection-mode": "range",
  895. placeholder: "filter waktu...",
  896. "date-format": "dd/mm/yy",
  897. "manual-input": false
  898. }, null, 8
  899. /* PROPS */
  900. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  901. label: "reset",
  902. "class": "p-button-link",
  903. onClick: $setup.filterReset
  904. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  905. label: "Top Up",
  906. "class": "p-button-outlined",
  907. icon: "pi pi-pencil",
  908. href: _ctx.route('top-ups.create')
  909. }, null, 8
  910. /* PROPS */
  911. , ["href"])])])];
  912. }),
  913. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  914. 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) {
  915. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  916. field: value.field,
  917. header: value.header,
  918. key: value.field
  919. }, null, 8
  920. /* PROPS */
  921. , ["field", "header"]);
  922. }), 128
  923. /* KEYED_FRAGMENT */
  924. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  925. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  926. var data = _ref.data;
  927. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  928. icon: "pi pi-eye",
  929. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  930. href: _ctx.route('top-ups.show', data.id)
  931. }, null, 8
  932. /* PROPS */
  933. , ["href"])];
  934. }),
  935. _: 1
  936. /* STABLE */
  937. })];
  938. }),
  939. _: 1
  940. /* STABLE */
  941. }, 8
  942. /* PROPS */
  943. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  944. links: $props.topUp.links
  945. }, null, 8
  946. /* PROPS */
  947. , ["links"])];
  948. }),
  949. _: 1
  950. /* STABLE */
  951. })], 64
  952. /* STABLE_FRAGMENT */
  953. );
  954. }
  955. /***/ }),
  956. /***/ "./resources/js/components/useDateRangeFilter.js":
  957. /*!*******************************************************!*\
  958. !*** ./resources/js/components/useDateRangeFilter.js ***!
  959. \*******************************************************/
  960. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  961. "use strict";
  962. __webpack_require__.r(__webpack_exports__);
  963. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  964. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  965. /* harmony export */ });
  966. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  967. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  968. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  969. function useDateRangeFilter() {
  970. var initialDateRage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  971. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  972. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  973. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  974. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  975. if (initialDateRage[0] || initialDateRage[1]) {
  976. if (initialDateRage[1]) {
  977. dates.push([new Date(initialDateRage[0]), new Date(initialDateRage[1])]);
  978. } else {
  979. dates.push([new Date(props.initialDateRage[1]), null]);
  980. }
  981. }
  982. });
  983. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  984. if (dates.value[1]) {
  985. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  986. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  987. } else if (dates.value[0]) {
  988. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  989. endDate.value = null;
  990. }
  991. });
  992. return {
  993. dates: dates,
  994. startDate: startDate,
  995. endDate: endDate
  996. };
  997. }
  998. /***/ }),
  999. /***/ "./resources/js/components/useSearchText.js":
  1000. /*!**************************************************!*\
  1001. !*** ./resources/js/components/useSearchText.js ***!
  1002. \**************************************************/
  1003. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1004. "use strict";
  1005. __webpack_require__.r(__webpack_exports__);
  1006. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1007. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  1008. /* harmony export */ });
  1009. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1010. function useSearchText(initialSearch) {
  1011. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(initialSearch);
  1012. return {
  1013. search: search
  1014. };
  1015. }
  1016. /***/ }),
  1017. /***/ "./resources/js/pages/topup/tableHeader.js":
  1018. /*!*************************************************!*\
  1019. !*** ./resources/js/pages/topup/tableHeader.js ***!
  1020. \*************************************************/
  1021. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1022. "use strict";
  1023. __webpack_require__.r(__webpack_exports__);
  1024. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1025. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1026. /* harmony export */ "topUpTable": () => (/* binding */ topUpTable)
  1027. /* harmony export */ });
  1028. var indexTable = [{
  1029. field: 'updatedAt',
  1030. header: 'Diperbaharui'
  1031. }, {
  1032. field: 'name',
  1033. header: 'Nama'
  1034. }, {
  1035. field: 'phone',
  1036. header: 'Nomor HP'
  1037. }, {
  1038. field: 'platNumber',
  1039. header: 'Plat Kendaraan'
  1040. }, {
  1041. field: 'type',
  1042. header: 'Jenis Member'
  1043. }, {
  1044. field: 'amount',
  1045. header: 'Tarif Member'
  1046. }, {
  1047. field: 'expDate',
  1048. header: 'Berakhir'
  1049. }];
  1050. var topUpTable = [{
  1051. field: 'updatedAt',
  1052. header: 'Diperbaharui'
  1053. }, {
  1054. field: 'name',
  1055. header: 'Nama User'
  1056. }, {
  1057. field: 'phone',
  1058. header: 'Nomor HP User'
  1059. }, {
  1060. field: 'platNumber',
  1061. header: 'Plat Kendaraan'
  1062. }, {
  1063. field: 'type',
  1064. header: 'Jenis Member'
  1065. }, {
  1066. field: 'amount',
  1067. header: 'Tarif Member'
  1068. }, {
  1069. field: 'expDate',
  1070. header: 'Berakhir'
  1071. }];
  1072. /***/ }),
  1073. /***/ "./resources/js/utils/menu.js":
  1074. /*!************************************!*\
  1075. !*** ./resources/js/utils/menu.js ***!
  1076. \************************************/
  1077. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1078. "use strict";
  1079. __webpack_require__.r(__webpack_exports__);
  1080. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1081. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1082. /* harmony export */ });
  1083. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1084. // Admin
  1085. 1: [{
  1086. label: 'Home',
  1087. items: [{
  1088. label: 'Dashboard',
  1089. icon: 'pi pi-home',
  1090. to: '/dashboards',
  1091. component: 'home/Index'
  1092. }]
  1093. }, {
  1094. label: 'Master',
  1095. items: [{
  1096. label: 'User',
  1097. icon: 'pi pi-user',
  1098. to: '/users',
  1099. component: 'user/Index'
  1100. }]
  1101. }],
  1102. // Supervisor
  1103. 2: [{
  1104. label: 'Home',
  1105. items: [{
  1106. label: 'Dashboard',
  1107. icon: 'pi pi-home',
  1108. to: '/dashboards',
  1109. component: 'home/Index'
  1110. }]
  1111. }, {
  1112. label: 'Menu',
  1113. items: [{
  1114. label: 'Pengeluaran',
  1115. icon: 'pi pi-wallet',
  1116. to: '/expenses',
  1117. component: 'expense/Index'
  1118. }, {
  1119. label: 'Laporan',
  1120. icon: 'pi pi-book',
  1121. items: [{
  1122. label: 'Mutasi',
  1123. icon: 'pi pi-circle',
  1124. to: '/reports/mutations',
  1125. component: 'mutation/Report'
  1126. }]
  1127. }]
  1128. }, {
  1129. label: 'Master',
  1130. items: [{
  1131. label: 'Jenis Kendaraan',
  1132. icon: 'pi pi-car',
  1133. to: '/type-vehicles',
  1134. component: 'typevehicle/Index'
  1135. }, {
  1136. label: 'Jenis Member',
  1137. icon: 'pi pi-id-card',
  1138. to: '/type-members',
  1139. component: 'typemember/Index'
  1140. }]
  1141. }, {
  1142. label: 'Pengaturan',
  1143. items: [{
  1144. label: 'Tarif Parkir',
  1145. icon: 'pi pi-car',
  1146. to: '/parking-fees/create',
  1147. component: 'parkingfee/Create'
  1148. }]
  1149. }],
  1150. // Operator
  1151. 3: [{
  1152. label: 'Home',
  1153. items: [{
  1154. label: 'Dashboard',
  1155. icon: 'pi pi-home',
  1156. to: '/dashboards',
  1157. component: 'home/Index'
  1158. }]
  1159. }, {
  1160. label: 'Menu',
  1161. items: [{
  1162. label: 'Pengeluaran',
  1163. icon: 'pi pi-wallet',
  1164. to: '/expenses',
  1165. component: 'expense/Index'
  1166. }, {
  1167. label: 'Member',
  1168. icon: 'pi pi-id-card',
  1169. to: '/members',
  1170. component: 'member/Index'
  1171. }, {
  1172. label: 'Top Up',
  1173. icon: 'pi pi-car',
  1174. to: '/top-ups',
  1175. component: 'topup/Index'
  1176. }]
  1177. }]
  1178. });
  1179. /***/ }),
  1180. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1181. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1182. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1183. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1184. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1185. "use strict";
  1186. __webpack_require__.r(__webpack_exports__);
  1187. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1188. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1189. /* harmony export */ });
  1190. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1191. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1192. // Imports
  1193. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1194. // Module
  1195. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-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}", ""]);
  1196. // Exports
  1197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1198. /***/ }),
  1199. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1200. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1201. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1202. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1203. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1204. "use strict";
  1205. __webpack_require__.r(__webpack_exports__);
  1206. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1207. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1208. /* harmony export */ });
  1209. /* 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");
  1210. /* 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__);
  1211. // Imports
  1212. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1213. // Module
  1214. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1215. // Exports
  1216. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1217. /***/ }),
  1218. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1219. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1220. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1221. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1222. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1223. "use strict";
  1224. __webpack_require__.r(__webpack_exports__);
  1225. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1226. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1227. /* harmony export */ });
  1228. /* 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");
  1229. /* 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__);
  1230. // Imports
  1231. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1232. // Module
  1233. ___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}", ""]);
  1234. // Exports
  1235. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1236. /***/ }),
  1237. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1238. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1239. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1240. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1241. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1242. "use strict";
  1243. __webpack_require__.r(__webpack_exports__);
  1244. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1245. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1246. /* harmony export */ });
  1247. /* 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");
  1248. /* 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__);
  1249. // Imports
  1250. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1251. // Module
  1252. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\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: 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}", ""]);
  1253. // Exports
  1254. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1255. /***/ }),
  1256. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1257. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1258. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1259. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1260. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1261. "use strict";
  1262. __webpack_require__.r(__webpack_exports__);
  1263. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1264. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1265. /* harmony export */ });
  1266. /* 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");
  1267. /* 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__);
  1268. // Imports
  1269. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1270. // Module
  1271. ___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: 999;\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: 998;\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}", ""]);
  1272. // Exports
  1273. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1274. /***/ }),
  1275. /***/ "./node_modules/dayjs/dayjs.min.js":
  1276. /*!*****************************************!*\
  1277. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1278. \*****************************************/
  1279. /***/ (function(module) {
  1280. !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}));
  1281. /***/ }),
  1282. /***/ "./node_modules/lodash/lodash.js":
  1283. /*!***************************************!*\
  1284. !*** ./node_modules/lodash/lodash.js ***!
  1285. \***************************************/
  1286. /***/ (function(module, exports, __webpack_require__) {
  1287. /* module decorator */ module = __webpack_require__.nmd(module);
  1288. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1289. * @license
  1290. * Lodash <https://lodash.com/>
  1291. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1292. * Released under MIT license <https://lodash.com/license>
  1293. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1294. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1295. */
  1296. ;(function() {
  1297. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1298. var undefined;
  1299. /** Used as the semantic version number. */
  1300. var VERSION = '4.17.21';
  1301. /** Used as the size to enable large array optimizations. */
  1302. var LARGE_ARRAY_SIZE = 200;
  1303. /** Error message constants. */
  1304. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1305. FUNC_ERROR_TEXT = 'Expected a function',
  1306. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1307. /** Used to stand-in for `undefined` hash values. */
  1308. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1309. /** Used as the maximum memoize cache size. */
  1310. var MAX_MEMOIZE_SIZE = 500;
  1311. /** Used as the internal argument placeholder. */
  1312. var PLACEHOLDER = '__lodash_placeholder__';
  1313. /** Used to compose bitmasks for cloning. */
  1314. var CLONE_DEEP_FLAG = 1,
  1315. CLONE_FLAT_FLAG = 2,
  1316. CLONE_SYMBOLS_FLAG = 4;
  1317. /** Used to compose bitmasks for value comparisons. */
  1318. var COMPARE_PARTIAL_FLAG = 1,
  1319. COMPARE_UNORDERED_FLAG = 2;
  1320. /** Used to compose bitmasks for function metadata. */
  1321. var WRAP_BIND_FLAG = 1,
  1322. WRAP_BIND_KEY_FLAG = 2,
  1323. WRAP_CURRY_BOUND_FLAG = 4,
  1324. WRAP_CURRY_FLAG = 8,
  1325. WRAP_CURRY_RIGHT_FLAG = 16,
  1326. WRAP_PARTIAL_FLAG = 32,
  1327. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1328. WRAP_ARY_FLAG = 128,
  1329. WRAP_REARG_FLAG = 256,
  1330. WRAP_FLIP_FLAG = 512;
  1331. /** Used as default options for `_.truncate`. */
  1332. var DEFAULT_TRUNC_LENGTH = 30,
  1333. DEFAULT_TRUNC_OMISSION = '...';
  1334. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1335. var HOT_COUNT = 800,
  1336. HOT_SPAN = 16;
  1337. /** Used to indicate the type of lazy iteratees. */
  1338. var LAZY_FILTER_FLAG = 1,
  1339. LAZY_MAP_FLAG = 2,
  1340. LAZY_WHILE_FLAG = 3;
  1341. /** Used as references for various `Number` constants. */
  1342. var INFINITY = 1 / 0,
  1343. MAX_SAFE_INTEGER = 9007199254740991,
  1344. MAX_INTEGER = 1.7976931348623157e+308,
  1345. NAN = 0 / 0;
  1346. /** Used as references for the maximum length and index of an array. */
  1347. var MAX_ARRAY_LENGTH = 4294967295,
  1348. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1349. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1350. /** Used to associate wrap methods with their bit flags. */
  1351. var wrapFlags = [
  1352. ['ary', WRAP_ARY_FLAG],
  1353. ['bind', WRAP_BIND_FLAG],
  1354. ['bindKey', WRAP_BIND_KEY_FLAG],
  1355. ['curry', WRAP_CURRY_FLAG],
  1356. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1357. ['flip', WRAP_FLIP_FLAG],
  1358. ['partial', WRAP_PARTIAL_FLAG],
  1359. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1360. ['rearg', WRAP_REARG_FLAG]
  1361. ];
  1362. /** `Object#toString` result references. */
  1363. var argsTag = '[object Arguments]',
  1364. arrayTag = '[object Array]',
  1365. asyncTag = '[object AsyncFunction]',
  1366. boolTag = '[object Boolean]',
  1367. dateTag = '[object Date]',
  1368. domExcTag = '[object DOMException]',
  1369. errorTag = '[object Error]',
  1370. funcTag = '[object Function]',
  1371. genTag = '[object GeneratorFunction]',
  1372. mapTag = '[object Map]',
  1373. numberTag = '[object Number]',
  1374. nullTag = '[object Null]',
  1375. objectTag = '[object Object]',
  1376. promiseTag = '[object Promise]',
  1377. proxyTag = '[object Proxy]',
  1378. regexpTag = '[object RegExp]',
  1379. setTag = '[object Set]',
  1380. stringTag = '[object String]',
  1381. symbolTag = '[object Symbol]',
  1382. undefinedTag = '[object Undefined]',
  1383. weakMapTag = '[object WeakMap]',
  1384. weakSetTag = '[object WeakSet]';
  1385. var arrayBufferTag = '[object ArrayBuffer]',
  1386. dataViewTag = '[object DataView]',
  1387. float32Tag = '[object Float32Array]',
  1388. float64Tag = '[object Float64Array]',
  1389. int8Tag = '[object Int8Array]',
  1390. int16Tag = '[object Int16Array]',
  1391. int32Tag = '[object Int32Array]',
  1392. uint8Tag = '[object Uint8Array]',
  1393. uint8ClampedTag = '[object Uint8ClampedArray]',
  1394. uint16Tag = '[object Uint16Array]',
  1395. uint32Tag = '[object Uint32Array]';
  1396. /** Used to match empty string literals in compiled template source. */
  1397. var reEmptyStringLeading = /\b__p \+= '';/g,
  1398. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1399. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1400. /** Used to match HTML entities and HTML characters. */
  1401. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1402. reUnescapedHtml = /[&<>"']/g,
  1403. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1404. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1405. /** Used to match template delimiters. */
  1406. var reEscape = /<%-([\s\S]+?)%>/g,
  1407. reEvaluate = /<%([\s\S]+?)%>/g,
  1408. reInterpolate = /<%=([\s\S]+?)%>/g;
  1409. /** Used to match property names within property paths. */
  1410. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1411. reIsPlainProp = /^\w*$/,
  1412. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1413. /**
  1414. * Used to match `RegExp`
  1415. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1416. */
  1417. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1418. reHasRegExpChar = RegExp(reRegExpChar.source);
  1419. /** Used to match leading whitespace. */
  1420. var reTrimStart = /^\s+/;
  1421. /** Used to match a single whitespace character. */
  1422. var reWhitespace = /\s/;
  1423. /** Used to match wrap detail comments. */
  1424. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1425. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1426. reSplitDetails = /,? & /;
  1427. /** Used to match words composed of alphanumeric characters. */
  1428. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1429. /**
  1430. * Used to validate the `validate` option in `_.template` variable.
  1431. *
  1432. * Forbids characters which could potentially change the meaning of the function argument definition:
  1433. * - "()," (modification of function parameters)
  1434. * - "=" (default value)
  1435. * - "[]{}" (destructuring of function parameters)
  1436. * - "/" (beginning of a comment)
  1437. * - whitespace
  1438. */
  1439. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1440. /** Used to match backslashes in property paths. */
  1441. var reEscapeChar = /\\(\\)?/g;
  1442. /**
  1443. * Used to match
  1444. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1445. */
  1446. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1447. /** Used to match `RegExp` flags from their coerced string values. */
  1448. var reFlags = /\w*$/;
  1449. /** Used to detect bad signed hexadecimal string values. */
  1450. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1451. /** Used to detect binary string values. */
  1452. var reIsBinary = /^0b[01]+$/i;
  1453. /** Used to detect host constructors (Safari). */
  1454. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1455. /** Used to detect octal string values. */
  1456. var reIsOctal = /^0o[0-7]+$/i;
  1457. /** Used to detect unsigned integer values. */
  1458. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1459. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1460. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1461. /** Used to ensure capturing order of template delimiters. */
  1462. var reNoMatch = /($^)/;
  1463. /** Used to match unescaped characters in compiled string literals. */
  1464. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1465. /** Used to compose unicode character classes. */
  1466. var rsAstralRange = '\\ud800-\\udfff',
  1467. rsComboMarksRange = '\\u0300-\\u036f',
  1468. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1469. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1470. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1471. rsDingbatRange = '\\u2700-\\u27bf',
  1472. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1473. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1474. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1475. rsPunctuationRange = '\\u2000-\\u206f',
  1476. 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',
  1477. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1478. rsVarRange = '\\ufe0e\\ufe0f',
  1479. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1480. /** Used to compose unicode capture groups. */
  1481. var rsApos = "['\u2019]",
  1482. rsAstral = '[' + rsAstralRange + ']',
  1483. rsBreak = '[' + rsBreakRange + ']',
  1484. rsCombo = '[' + rsComboRange + ']',
  1485. rsDigits = '\\d+',
  1486. rsDingbat = '[' + rsDingbatRange + ']',
  1487. rsLower = '[' + rsLowerRange + ']',
  1488. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1489. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1490. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1491. rsNonAstral = '[^' + rsAstralRange + ']',
  1492. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1493. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1494. rsUpper = '[' + rsUpperRange + ']',
  1495. rsZWJ = '\\u200d';
  1496. /** Used to compose unicode regexes. */
  1497. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1498. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1499. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1500. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1501. reOptMod = rsModifier + '?',
  1502. rsOptVar = '[' + rsVarRange + ']?',
  1503. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1504. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1505. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1506. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1507. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1508. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1509. /** Used to match apostrophes. */
  1510. var reApos = RegExp(rsApos, 'g');
  1511. /**
  1512. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1513. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1514. */
  1515. var reComboMark = RegExp(rsCombo, 'g');
  1516. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1517. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1518. /** Used to match complex or compound words. */
  1519. var reUnicodeWord = RegExp([
  1520. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1521. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1522. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1523. rsUpper + '+' + rsOptContrUpper,
  1524. rsOrdUpper,
  1525. rsOrdLower,
  1526. rsDigits,
  1527. rsEmoji
  1528. ].join('|'), 'g');
  1529. /** 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/). */
  1530. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1531. /** Used to detect strings that need a more robust regexp to match words. */
  1532. 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 ]/;
  1533. /** Used to assign default `context` object properties. */
  1534. var contextProps = [
  1535. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1536. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1537. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1538. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1539. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1540. ];
  1541. /** Used to make template sourceURLs easier to identify. */
  1542. var templateCounter = -1;
  1543. /** Used to identify `toStringTag` values of typed arrays. */
  1544. var typedArrayTags = {};
  1545. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1546. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1547. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1548. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1549. typedArrayTags[uint32Tag] = true;
  1550. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1551. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1552. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1553. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1554. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1555. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1556. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1557. typedArrayTags[weakMapTag] = false;
  1558. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1559. var cloneableTags = {};
  1560. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1561. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1562. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1563. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1564. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1565. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1566. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1567. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1568. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1569. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1570. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1571. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1572. cloneableTags[weakMapTag] = false;
  1573. /** Used to map Latin Unicode letters to basic Latin letters. */
  1574. var deburredLetters = {
  1575. // Latin-1 Supplement block.
  1576. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1577. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1578. '\xc7': 'C', '\xe7': 'c',
  1579. '\xd0': 'D', '\xf0': 'd',
  1580. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1581. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1582. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1583. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1584. '\xd1': 'N', '\xf1': 'n',
  1585. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1586. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1587. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1588. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1589. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1590. '\xc6': 'Ae', '\xe6': 'ae',
  1591. '\xde': 'Th', '\xfe': 'th',
  1592. '\xdf': 'ss',
  1593. // Latin Extended-A block.
  1594. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1595. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1596. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1597. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1598. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1599. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1600. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1601. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1602. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1603. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1604. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1605. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1606. '\u0134': 'J', '\u0135': 'j',
  1607. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1608. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1609. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1610. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1611. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1612. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1613. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1614. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1615. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1616. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1617. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1618. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1619. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1620. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1621. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1622. '\u0174': 'W', '\u0175': 'w',
  1623. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1624. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1625. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1626. '\u0132': 'IJ', '\u0133': 'ij',
  1627. '\u0152': 'Oe', '\u0153': 'oe',
  1628. '\u0149': "'n", '\u017f': 's'
  1629. };
  1630. /** Used to map characters to HTML entities. */
  1631. var htmlEscapes = {
  1632. '&': '&amp;',
  1633. '<': '&lt;',
  1634. '>': '&gt;',
  1635. '"': '&quot;',
  1636. "'": '&#39;'
  1637. };
  1638. /** Used to map HTML entities to characters. */
  1639. var htmlUnescapes = {
  1640. '&amp;': '&',
  1641. '&lt;': '<',
  1642. '&gt;': '>',
  1643. '&quot;': '"',
  1644. '&#39;': "'"
  1645. };
  1646. /** Used to escape characters for inclusion in compiled string literals. */
  1647. var stringEscapes = {
  1648. '\\': '\\',
  1649. "'": "'",
  1650. '\n': 'n',
  1651. '\r': 'r',
  1652. '\u2028': 'u2028',
  1653. '\u2029': 'u2029'
  1654. };
  1655. /** Built-in method references without a dependency on `root`. */
  1656. var freeParseFloat = parseFloat,
  1657. freeParseInt = parseInt;
  1658. /** Detect free variable `global` from Node.js. */
  1659. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1660. /** Detect free variable `self`. */
  1661. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1662. /** Used as a reference to the global object. */
  1663. var root = freeGlobal || freeSelf || Function('return this')();
  1664. /** Detect free variable `exports`. */
  1665. var freeExports = true && exports && !exports.nodeType && exports;
  1666. /** Detect free variable `module`. */
  1667. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1668. /** Detect the popular CommonJS extension `module.exports`. */
  1669. var moduleExports = freeModule && freeModule.exports === freeExports;
  1670. /** Detect free variable `process` from Node.js. */
  1671. var freeProcess = moduleExports && freeGlobal.process;
  1672. /** Used to access faster Node.js helpers. */
  1673. var nodeUtil = (function() {
  1674. try {
  1675. // Use `util.types` for Node.js 10+.
  1676. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1677. if (types) {
  1678. return types;
  1679. }
  1680. // Legacy `process.binding('util')` for Node.js < 10.
  1681. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1682. } catch (e) {}
  1683. }());
  1684. /* Node.js helper references. */
  1685. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1686. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1687. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1688. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1689. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1690. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1691. /*--------------------------------------------------------------------------*/
  1692. /**
  1693. * A faster alternative to `Function#apply`, this function invokes `func`
  1694. * with the `this` binding of `thisArg` and the arguments of `args`.
  1695. *
  1696. * @private
  1697. * @param {Function} func The function to invoke.
  1698. * @param {*} thisArg The `this` binding of `func`.
  1699. * @param {Array} args The arguments to invoke `func` with.
  1700. * @returns {*} Returns the result of `func`.
  1701. */
  1702. function apply(func, thisArg, args) {
  1703. switch (args.length) {
  1704. case 0: return func.call(thisArg);
  1705. case 1: return func.call(thisArg, args[0]);
  1706. case 2: return func.call(thisArg, args[0], args[1]);
  1707. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1708. }
  1709. return func.apply(thisArg, args);
  1710. }
  1711. /**
  1712. * A specialized version of `baseAggregator` for arrays.
  1713. *
  1714. * @private
  1715. * @param {Array} [array] The array to iterate over.
  1716. * @param {Function} setter The function to set `accumulator` values.
  1717. * @param {Function} iteratee The iteratee to transform keys.
  1718. * @param {Object} accumulator The initial aggregated object.
  1719. * @returns {Function} Returns `accumulator`.
  1720. */
  1721. function arrayAggregator(array, setter, iteratee, accumulator) {
  1722. var index = -1,
  1723. length = array == null ? 0 : array.length;
  1724. while (++index < length) {
  1725. var value = array[index];
  1726. setter(accumulator, value, iteratee(value), array);
  1727. }
  1728. return accumulator;
  1729. }
  1730. /**
  1731. * A specialized version of `_.forEach` for arrays without support for
  1732. * iteratee shorthands.
  1733. *
  1734. * @private
  1735. * @param {Array} [array] The array to iterate over.
  1736. * @param {Function} iteratee The function invoked per iteration.
  1737. * @returns {Array} Returns `array`.
  1738. */
  1739. function arrayEach(array, iteratee) {
  1740. var index = -1,
  1741. length = array == null ? 0 : array.length;
  1742. while (++index < length) {
  1743. if (iteratee(array[index], index, array) === false) {
  1744. break;
  1745. }
  1746. }
  1747. return array;
  1748. }
  1749. /**
  1750. * A specialized version of `_.forEachRight` for arrays without support for
  1751. * iteratee shorthands.
  1752. *
  1753. * @private
  1754. * @param {Array} [array] The array to iterate over.
  1755. * @param {Function} iteratee The function invoked per iteration.
  1756. * @returns {Array} Returns `array`.
  1757. */
  1758. function arrayEachRight(array, iteratee) {
  1759. var length = array == null ? 0 : array.length;
  1760. while (length--) {
  1761. if (iteratee(array[length], length, array) === false) {
  1762. break;
  1763. }
  1764. }
  1765. return array;
  1766. }
  1767. /**
  1768. * A specialized version of `_.every` for arrays without support for
  1769. * iteratee shorthands.
  1770. *
  1771. * @private
  1772. * @param {Array} [array] The array to iterate over.
  1773. * @param {Function} predicate The function invoked per iteration.
  1774. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1775. * else `false`.
  1776. */
  1777. function arrayEvery(array, predicate) {
  1778. var index = -1,
  1779. length = array == null ? 0 : array.length;
  1780. while (++index < length) {
  1781. if (!predicate(array[index], index, array)) {
  1782. return false;
  1783. }
  1784. }
  1785. return true;
  1786. }
  1787. /**
  1788. * A specialized version of `_.filter` for arrays without support for
  1789. * iteratee shorthands.
  1790. *
  1791. * @private
  1792. * @param {Array} [array] The array to iterate over.
  1793. * @param {Function} predicate The function invoked per iteration.
  1794. * @returns {Array} Returns the new filtered array.
  1795. */
  1796. function arrayFilter(array, predicate) {
  1797. var index = -1,
  1798. length = array == null ? 0 : array.length,
  1799. resIndex = 0,
  1800. result = [];
  1801. while (++index < length) {
  1802. var value = array[index];
  1803. if (predicate(value, index, array)) {
  1804. result[resIndex++] = value;
  1805. }
  1806. }
  1807. return result;
  1808. }
  1809. /**
  1810. * A specialized version of `_.includes` for arrays without support for
  1811. * specifying an index to search from.
  1812. *
  1813. * @private
  1814. * @param {Array} [array] The array to inspect.
  1815. * @param {*} target The value to search for.
  1816. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1817. */
  1818. function arrayIncludes(array, value) {
  1819. var length = array == null ? 0 : array.length;
  1820. return !!length && baseIndexOf(array, value, 0) > -1;
  1821. }
  1822. /**
  1823. * This function is like `arrayIncludes` except that it accepts a comparator.
  1824. *
  1825. * @private
  1826. * @param {Array} [array] The array to inspect.
  1827. * @param {*} target The value to search for.
  1828. * @param {Function} comparator The comparator invoked per element.
  1829. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1830. */
  1831. function arrayIncludesWith(array, value, comparator) {
  1832. var index = -1,
  1833. length = array == null ? 0 : array.length;
  1834. while (++index < length) {
  1835. if (comparator(value, array[index])) {
  1836. return true;
  1837. }
  1838. }
  1839. return false;
  1840. }
  1841. /**
  1842. * A specialized version of `_.map` for arrays without support for iteratee
  1843. * shorthands.
  1844. *
  1845. * @private
  1846. * @param {Array} [array] The array to iterate over.
  1847. * @param {Function} iteratee The function invoked per iteration.
  1848. * @returns {Array} Returns the new mapped array.
  1849. */
  1850. function arrayMap(array, iteratee) {
  1851. var index = -1,
  1852. length = array == null ? 0 : array.length,
  1853. result = Array(length);
  1854. while (++index < length) {
  1855. result[index] = iteratee(array[index], index, array);
  1856. }
  1857. return result;
  1858. }
  1859. /**
  1860. * Appends the elements of `values` to `array`.
  1861. *
  1862. * @private
  1863. * @param {Array} array The array to modify.
  1864. * @param {Array} values The values to append.
  1865. * @returns {Array} Returns `array`.
  1866. */
  1867. function arrayPush(array, values) {
  1868. var index = -1,
  1869. length = values.length,
  1870. offset = array.length;
  1871. while (++index < length) {
  1872. array[offset + index] = values[index];
  1873. }
  1874. return array;
  1875. }
  1876. /**
  1877. * A specialized version of `_.reduce` for arrays without support for
  1878. * iteratee shorthands.
  1879. *
  1880. * @private
  1881. * @param {Array} [array] The array to iterate over.
  1882. * @param {Function} iteratee The function invoked per iteration.
  1883. * @param {*} [accumulator] The initial value.
  1884. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1885. * the initial value.
  1886. * @returns {*} Returns the accumulated value.
  1887. */
  1888. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1889. var index = -1,
  1890. length = array == null ? 0 : array.length;
  1891. if (initAccum && length) {
  1892. accumulator = array[++index];
  1893. }
  1894. while (++index < length) {
  1895. accumulator = iteratee(accumulator, array[index], index, array);
  1896. }
  1897. return accumulator;
  1898. }
  1899. /**
  1900. * A specialized version of `_.reduceRight` for arrays without support for
  1901. * iteratee shorthands.
  1902. *
  1903. * @private
  1904. * @param {Array} [array] The array to iterate over.
  1905. * @param {Function} iteratee The function invoked per iteration.
  1906. * @param {*} [accumulator] The initial value.
  1907. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1908. * the initial value.
  1909. * @returns {*} Returns the accumulated value.
  1910. */
  1911. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1912. var length = array == null ? 0 : array.length;
  1913. if (initAccum && length) {
  1914. accumulator = array[--length];
  1915. }
  1916. while (length--) {
  1917. accumulator = iteratee(accumulator, array[length], length, array);
  1918. }
  1919. return accumulator;
  1920. }
  1921. /**
  1922. * A specialized version of `_.some` for arrays without support for iteratee
  1923. * shorthands.
  1924. *
  1925. * @private
  1926. * @param {Array} [array] The array to iterate over.
  1927. * @param {Function} predicate The function invoked per iteration.
  1928. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1929. * else `false`.
  1930. */
  1931. function arraySome(array, predicate) {
  1932. var index = -1,
  1933. length = array == null ? 0 : array.length;
  1934. while (++index < length) {
  1935. if (predicate(array[index], index, array)) {
  1936. return true;
  1937. }
  1938. }
  1939. return false;
  1940. }
  1941. /**
  1942. * Gets the size of an ASCII `string`.
  1943. *
  1944. * @private
  1945. * @param {string} string The string inspect.
  1946. * @returns {number} Returns the string size.
  1947. */
  1948. var asciiSize = baseProperty('length');
  1949. /**
  1950. * Converts an ASCII `string` to an array.
  1951. *
  1952. * @private
  1953. * @param {string} string The string to convert.
  1954. * @returns {Array} Returns the converted array.
  1955. */
  1956. function asciiToArray(string) {
  1957. return string.split('');
  1958. }
  1959. /**
  1960. * Splits an ASCII `string` into an array of its words.
  1961. *
  1962. * @private
  1963. * @param {string} The string to inspect.
  1964. * @returns {Array} Returns the words of `string`.
  1965. */
  1966. function asciiWords(string) {
  1967. return string.match(reAsciiWord) || [];
  1968. }
  1969. /**
  1970. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1971. * without support for iteratee shorthands, which iterates over `collection`
  1972. * using `eachFunc`.
  1973. *
  1974. * @private
  1975. * @param {Array|Object} collection The collection to inspect.
  1976. * @param {Function} predicate The function invoked per iteration.
  1977. * @param {Function} eachFunc The function to iterate over `collection`.
  1978. * @returns {*} Returns the found element or its key, else `undefined`.
  1979. */
  1980. function baseFindKey(collection, predicate, eachFunc) {
  1981. var result;
  1982. eachFunc(collection, function(value, key, collection) {
  1983. if (predicate(value, key, collection)) {
  1984. result = key;
  1985. return false;
  1986. }
  1987. });
  1988. return result;
  1989. }
  1990. /**
  1991. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1992. * support for iteratee shorthands.
  1993. *
  1994. * @private
  1995. * @param {Array} array The array to inspect.
  1996. * @param {Function} predicate The function invoked per iteration.
  1997. * @param {number} fromIndex The index to search from.
  1998. * @param {boolean} [fromRight] Specify iterating from right to left.
  1999. * @returns {number} Returns the index of the matched value, else `-1`.
  2000. */
  2001. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2002. var length = array.length,
  2003. index = fromIndex + (fromRight ? 1 : -1);
  2004. while ((fromRight ? index-- : ++index < length)) {
  2005. if (predicate(array[index], index, array)) {
  2006. return index;
  2007. }
  2008. }
  2009. return -1;
  2010. }
  2011. /**
  2012. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2013. *
  2014. * @private
  2015. * @param {Array} array The array to inspect.
  2016. * @param {*} value The value to search for.
  2017. * @param {number} fromIndex The index to search from.
  2018. * @returns {number} Returns the index of the matched value, else `-1`.
  2019. */
  2020. function baseIndexOf(array, value, fromIndex) {
  2021. return value === value
  2022. ? strictIndexOf(array, value, fromIndex)
  2023. : baseFindIndex(array, baseIsNaN, fromIndex);
  2024. }
  2025. /**
  2026. * This function is like `baseIndexOf` except that it accepts a comparator.
  2027. *
  2028. * @private
  2029. * @param {Array} array The array to inspect.
  2030. * @param {*} value The value to search for.
  2031. * @param {number} fromIndex The index to search from.
  2032. * @param {Function} comparator The comparator invoked per element.
  2033. * @returns {number} Returns the index of the matched value, else `-1`.
  2034. */
  2035. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2036. var index = fromIndex - 1,
  2037. length = array.length;
  2038. while (++index < length) {
  2039. if (comparator(array[index], value)) {
  2040. return index;
  2041. }
  2042. }
  2043. return -1;
  2044. }
  2045. /**
  2046. * The base implementation of `_.isNaN` without support for number objects.
  2047. *
  2048. * @private
  2049. * @param {*} value The value to check.
  2050. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2051. */
  2052. function baseIsNaN(value) {
  2053. return value !== value;
  2054. }
  2055. /**
  2056. * The base implementation of `_.mean` and `_.meanBy` without support for
  2057. * iteratee shorthands.
  2058. *
  2059. * @private
  2060. * @param {Array} array The array to iterate over.
  2061. * @param {Function} iteratee The function invoked per iteration.
  2062. * @returns {number} Returns the mean.
  2063. */
  2064. function baseMean(array, iteratee) {
  2065. var length = array == null ? 0 : array.length;
  2066. return length ? (baseSum(array, iteratee) / length) : NAN;
  2067. }
  2068. /**
  2069. * The base implementation of `_.property` without support for deep paths.
  2070. *
  2071. * @private
  2072. * @param {string} key The key of the property to get.
  2073. * @returns {Function} Returns the new accessor function.
  2074. */
  2075. function baseProperty(key) {
  2076. return function(object) {
  2077. return object == null ? undefined : object[key];
  2078. };
  2079. }
  2080. /**
  2081. * The base implementation of `_.propertyOf` without support for deep paths.
  2082. *
  2083. * @private
  2084. * @param {Object} object The object to query.
  2085. * @returns {Function} Returns the new accessor function.
  2086. */
  2087. function basePropertyOf(object) {
  2088. return function(key) {
  2089. return object == null ? undefined : object[key];
  2090. };
  2091. }
  2092. /**
  2093. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2094. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2095. *
  2096. * @private
  2097. * @param {Array|Object} collection The collection to iterate over.
  2098. * @param {Function} iteratee The function invoked per iteration.
  2099. * @param {*} accumulator The initial value.
  2100. * @param {boolean} initAccum Specify using the first or last element of
  2101. * `collection` as the initial value.
  2102. * @param {Function} eachFunc The function to iterate over `collection`.
  2103. * @returns {*} Returns the accumulated value.
  2104. */
  2105. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2106. eachFunc(collection, function(value, index, collection) {
  2107. accumulator = initAccum
  2108. ? (initAccum = false, value)
  2109. : iteratee(accumulator, value, index, collection);
  2110. });
  2111. return accumulator;
  2112. }
  2113. /**
  2114. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2115. * sort order of `array` and replaces criteria objects with their corresponding
  2116. * values.
  2117. *
  2118. * @private
  2119. * @param {Array} array The array to sort.
  2120. * @param {Function} comparer The function to define sort order.
  2121. * @returns {Array} Returns `array`.
  2122. */
  2123. function baseSortBy(array, comparer) {
  2124. var length = array.length;
  2125. array.sort(comparer);
  2126. while (length--) {
  2127. array[length] = array[length].value;
  2128. }
  2129. return array;
  2130. }
  2131. /**
  2132. * The base implementation of `_.sum` and `_.sumBy` without support for
  2133. * iteratee shorthands.
  2134. *
  2135. * @private
  2136. * @param {Array} array The array to iterate over.
  2137. * @param {Function} iteratee The function invoked per iteration.
  2138. * @returns {number} Returns the sum.
  2139. */
  2140. function baseSum(array, iteratee) {
  2141. var result,
  2142. index = -1,
  2143. length = array.length;
  2144. while (++index < length) {
  2145. var current = iteratee(array[index]);
  2146. if (current !== undefined) {
  2147. result = result === undefined ? current : (result + current);
  2148. }
  2149. }
  2150. return result;
  2151. }
  2152. /**
  2153. * The base implementation of `_.times` without support for iteratee shorthands
  2154. * or max array length checks.
  2155. *
  2156. * @private
  2157. * @param {number} n The number of times to invoke `iteratee`.
  2158. * @param {Function} iteratee The function invoked per iteration.
  2159. * @returns {Array} Returns the array of results.
  2160. */
  2161. function baseTimes(n, iteratee) {
  2162. var index = -1,
  2163. result = Array(n);
  2164. while (++index < n) {
  2165. result[index] = iteratee(index);
  2166. }
  2167. return result;
  2168. }
  2169. /**
  2170. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2171. * of key-value pairs for `object` corresponding to the property names of `props`.
  2172. *
  2173. * @private
  2174. * @param {Object} object The object to query.
  2175. * @param {Array} props The property names to get values for.
  2176. * @returns {Object} Returns the key-value pairs.
  2177. */
  2178. function baseToPairs(object, props) {
  2179. return arrayMap(props, function(key) {
  2180. return [key, object[key]];
  2181. });
  2182. }
  2183. /**
  2184. * The base implementation of `_.trim`.
  2185. *
  2186. * @private
  2187. * @param {string} string The string to trim.
  2188. * @returns {string} Returns the trimmed string.
  2189. */
  2190. function baseTrim(string) {
  2191. return string
  2192. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2193. : string;
  2194. }
  2195. /**
  2196. * The base implementation of `_.unary` without support for storing metadata.
  2197. *
  2198. * @private
  2199. * @param {Function} func The function to cap arguments for.
  2200. * @returns {Function} Returns the new capped function.
  2201. */
  2202. function baseUnary(func) {
  2203. return function(value) {
  2204. return func(value);
  2205. };
  2206. }
  2207. /**
  2208. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2209. * array of `object` property values corresponding to the property names
  2210. * of `props`.
  2211. *
  2212. * @private
  2213. * @param {Object} object The object to query.
  2214. * @param {Array} props The property names to get values for.
  2215. * @returns {Object} Returns the array of property values.
  2216. */
  2217. function baseValues(object, props) {
  2218. return arrayMap(props, function(key) {
  2219. return object[key];
  2220. });
  2221. }
  2222. /**
  2223. * Checks if a `cache` value for `key` exists.
  2224. *
  2225. * @private
  2226. * @param {Object} cache The cache to query.
  2227. * @param {string} key The key of the entry to check.
  2228. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2229. */
  2230. function cacheHas(cache, key) {
  2231. return cache.has(key);
  2232. }
  2233. /**
  2234. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2235. * that is not found in the character symbols.
  2236. *
  2237. * @private
  2238. * @param {Array} strSymbols The string symbols to inspect.
  2239. * @param {Array} chrSymbols The character symbols to find.
  2240. * @returns {number} Returns the index of the first unmatched string symbol.
  2241. */
  2242. function charsStartIndex(strSymbols, chrSymbols) {
  2243. var index = -1,
  2244. length = strSymbols.length;
  2245. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2246. return index;
  2247. }
  2248. /**
  2249. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2250. * that is not found in the character symbols.
  2251. *
  2252. * @private
  2253. * @param {Array} strSymbols The string symbols to inspect.
  2254. * @param {Array} chrSymbols The character symbols to find.
  2255. * @returns {number} Returns the index of the last unmatched string symbol.
  2256. */
  2257. function charsEndIndex(strSymbols, chrSymbols) {
  2258. var index = strSymbols.length;
  2259. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2260. return index;
  2261. }
  2262. /**
  2263. * Gets the number of `placeholder` occurrences in `array`.
  2264. *
  2265. * @private
  2266. * @param {Array} array The array to inspect.
  2267. * @param {*} placeholder The placeholder to search for.
  2268. * @returns {number} Returns the placeholder count.
  2269. */
  2270. function countHolders(array, placeholder) {
  2271. var length = array.length,
  2272. result = 0;
  2273. while (length--) {
  2274. if (array[length] === placeholder) {
  2275. ++result;
  2276. }
  2277. }
  2278. return result;
  2279. }
  2280. /**
  2281. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2282. * letters to basic Latin letters.
  2283. *
  2284. * @private
  2285. * @param {string} letter The matched letter to deburr.
  2286. * @returns {string} Returns the deburred letter.
  2287. */
  2288. var deburrLetter = basePropertyOf(deburredLetters);
  2289. /**
  2290. * Used by `_.escape` to convert characters to HTML entities.
  2291. *
  2292. * @private
  2293. * @param {string} chr The matched character to escape.
  2294. * @returns {string} Returns the escaped character.
  2295. */
  2296. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2297. /**
  2298. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2299. *
  2300. * @private
  2301. * @param {string} chr The matched character to escape.
  2302. * @returns {string} Returns the escaped character.
  2303. */
  2304. function escapeStringChar(chr) {
  2305. return '\\' + stringEscapes[chr];
  2306. }
  2307. /**
  2308. * Gets the value at `key` of `object`.
  2309. *
  2310. * @private
  2311. * @param {Object} [object] The object to query.
  2312. * @param {string} key The key of the property to get.
  2313. * @returns {*} Returns the property value.
  2314. */
  2315. function getValue(object, key) {
  2316. return object == null ? undefined : object[key];
  2317. }
  2318. /**
  2319. * Checks if `string` contains Unicode symbols.
  2320. *
  2321. * @private
  2322. * @param {string} string The string to inspect.
  2323. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2324. */
  2325. function hasUnicode(string) {
  2326. return reHasUnicode.test(string);
  2327. }
  2328. /**
  2329. * Checks if `string` contains a word composed of Unicode symbols.
  2330. *
  2331. * @private
  2332. * @param {string} string The string to inspect.
  2333. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2334. */
  2335. function hasUnicodeWord(string) {
  2336. return reHasUnicodeWord.test(string);
  2337. }
  2338. /**
  2339. * Converts `iterator` to an array.
  2340. *
  2341. * @private
  2342. * @param {Object} iterator The iterator to convert.
  2343. * @returns {Array} Returns the converted array.
  2344. */
  2345. function iteratorToArray(iterator) {
  2346. var data,
  2347. result = [];
  2348. while (!(data = iterator.next()).done) {
  2349. result.push(data.value);
  2350. }
  2351. return result;
  2352. }
  2353. /**
  2354. * Converts `map` to its key-value pairs.
  2355. *
  2356. * @private
  2357. * @param {Object} map The map to convert.
  2358. * @returns {Array} Returns the key-value pairs.
  2359. */
  2360. function mapToArray(map) {
  2361. var index = -1,
  2362. result = Array(map.size);
  2363. map.forEach(function(value, key) {
  2364. result[++index] = [key, value];
  2365. });
  2366. return result;
  2367. }
  2368. /**
  2369. * Creates a unary function that invokes `func` with its argument transformed.
  2370. *
  2371. * @private
  2372. * @param {Function} func The function to wrap.
  2373. * @param {Function} transform The argument transform.
  2374. * @returns {Function} Returns the new function.
  2375. */
  2376. function overArg(func, transform) {
  2377. return function(arg) {
  2378. return func(transform(arg));
  2379. };
  2380. }
  2381. /**
  2382. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2383. * and returns an array of their indexes.
  2384. *
  2385. * @private
  2386. * @param {Array} array The array to modify.
  2387. * @param {*} placeholder The placeholder to replace.
  2388. * @returns {Array} Returns the new array of placeholder indexes.
  2389. */
  2390. function replaceHolders(array, placeholder) {
  2391. var index = -1,
  2392. length = array.length,
  2393. resIndex = 0,
  2394. result = [];
  2395. while (++index < length) {
  2396. var value = array[index];
  2397. if (value === placeholder || value === PLACEHOLDER) {
  2398. array[index] = PLACEHOLDER;
  2399. result[resIndex++] = index;
  2400. }
  2401. }
  2402. return result;
  2403. }
  2404. /**
  2405. * Converts `set` to an array of its values.
  2406. *
  2407. * @private
  2408. * @param {Object} set The set to convert.
  2409. * @returns {Array} Returns the values.
  2410. */
  2411. function setToArray(set) {
  2412. var index = -1,
  2413. result = Array(set.size);
  2414. set.forEach(function(value) {
  2415. result[++index] = value;
  2416. });
  2417. return result;
  2418. }
  2419. /**
  2420. * Converts `set` to its value-value pairs.
  2421. *
  2422. * @private
  2423. * @param {Object} set The set to convert.
  2424. * @returns {Array} Returns the value-value pairs.
  2425. */
  2426. function setToPairs(set) {
  2427. var index = -1,
  2428. result = Array(set.size);
  2429. set.forEach(function(value) {
  2430. result[++index] = [value, value];
  2431. });
  2432. return result;
  2433. }
  2434. /**
  2435. * A specialized version of `_.indexOf` which performs strict equality
  2436. * comparisons of values, i.e. `===`.
  2437. *
  2438. * @private
  2439. * @param {Array} array The array to inspect.
  2440. * @param {*} value The value to search for.
  2441. * @param {number} fromIndex The index to search from.
  2442. * @returns {number} Returns the index of the matched value, else `-1`.
  2443. */
  2444. function strictIndexOf(array, value, fromIndex) {
  2445. var index = fromIndex - 1,
  2446. length = array.length;
  2447. while (++index < length) {
  2448. if (array[index] === value) {
  2449. return index;
  2450. }
  2451. }
  2452. return -1;
  2453. }
  2454. /**
  2455. * A specialized version of `_.lastIndexOf` which performs strict equality
  2456. * comparisons of values, i.e. `===`.
  2457. *
  2458. * @private
  2459. * @param {Array} array The array to inspect.
  2460. * @param {*} value The value to search for.
  2461. * @param {number} fromIndex The index to search from.
  2462. * @returns {number} Returns the index of the matched value, else `-1`.
  2463. */
  2464. function strictLastIndexOf(array, value, fromIndex) {
  2465. var index = fromIndex + 1;
  2466. while (index--) {
  2467. if (array[index] === value) {
  2468. return index;
  2469. }
  2470. }
  2471. return index;
  2472. }
  2473. /**
  2474. * Gets the number of symbols in `string`.
  2475. *
  2476. * @private
  2477. * @param {string} string The string to inspect.
  2478. * @returns {number} Returns the string size.
  2479. */
  2480. function stringSize(string) {
  2481. return hasUnicode(string)
  2482. ? unicodeSize(string)
  2483. : asciiSize(string);
  2484. }
  2485. /**
  2486. * Converts `string` to an array.
  2487. *
  2488. * @private
  2489. * @param {string} string The string to convert.
  2490. * @returns {Array} Returns the converted array.
  2491. */
  2492. function stringToArray(string) {
  2493. return hasUnicode(string)
  2494. ? unicodeToArray(string)
  2495. : asciiToArray(string);
  2496. }
  2497. /**
  2498. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2499. * character of `string`.
  2500. *
  2501. * @private
  2502. * @param {string} string The string to inspect.
  2503. * @returns {number} Returns the index of the last non-whitespace character.
  2504. */
  2505. function trimmedEndIndex(string) {
  2506. var index = string.length;
  2507. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2508. return index;
  2509. }
  2510. /**
  2511. * Used by `_.unescape` to convert HTML entities to characters.
  2512. *
  2513. * @private
  2514. * @param {string} chr The matched character to unescape.
  2515. * @returns {string} Returns the unescaped character.
  2516. */
  2517. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2518. /**
  2519. * Gets the size of a Unicode `string`.
  2520. *
  2521. * @private
  2522. * @param {string} string The string inspect.
  2523. * @returns {number} Returns the string size.
  2524. */
  2525. function unicodeSize(string) {
  2526. var result = reUnicode.lastIndex = 0;
  2527. while (reUnicode.test(string)) {
  2528. ++result;
  2529. }
  2530. return result;
  2531. }
  2532. /**
  2533. * Converts a Unicode `string` to an array.
  2534. *
  2535. * @private
  2536. * @param {string} string The string to convert.
  2537. * @returns {Array} Returns the converted array.
  2538. */
  2539. function unicodeToArray(string) {
  2540. return string.match(reUnicode) || [];
  2541. }
  2542. /**
  2543. * Splits a Unicode `string` into an array of its words.
  2544. *
  2545. * @private
  2546. * @param {string} The string to inspect.
  2547. * @returns {Array} Returns the words of `string`.
  2548. */
  2549. function unicodeWords(string) {
  2550. return string.match(reUnicodeWord) || [];
  2551. }
  2552. /*--------------------------------------------------------------------------*/
  2553. /**
  2554. * Create a new pristine `lodash` function using the `context` object.
  2555. *
  2556. * @static
  2557. * @memberOf _
  2558. * @since 1.1.0
  2559. * @category Util
  2560. * @param {Object} [context=root] The context object.
  2561. * @returns {Function} Returns a new `lodash` function.
  2562. * @example
  2563. *
  2564. * _.mixin({ 'foo': _.constant('foo') });
  2565. *
  2566. * var lodash = _.runInContext();
  2567. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2568. *
  2569. * _.isFunction(_.foo);
  2570. * // => true
  2571. * _.isFunction(_.bar);
  2572. * // => false
  2573. *
  2574. * lodash.isFunction(lodash.foo);
  2575. * // => false
  2576. * lodash.isFunction(lodash.bar);
  2577. * // => true
  2578. *
  2579. * // Create a suped-up `defer` in Node.js.
  2580. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2581. */
  2582. var runInContext = (function runInContext(context) {
  2583. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2584. /** Built-in constructor references. */
  2585. var Array = context.Array,
  2586. Date = context.Date,
  2587. Error = context.Error,
  2588. Function = context.Function,
  2589. Math = context.Math,
  2590. Object = context.Object,
  2591. RegExp = context.RegExp,
  2592. String = context.String,
  2593. TypeError = context.TypeError;
  2594. /** Used for built-in method references. */
  2595. var arrayProto = Array.prototype,
  2596. funcProto = Function.prototype,
  2597. objectProto = Object.prototype;
  2598. /** Used to detect overreaching core-js shims. */
  2599. var coreJsData = context['__core-js_shared__'];
  2600. /** Used to resolve the decompiled source of functions. */
  2601. var funcToString = funcProto.toString;
  2602. /** Used to check objects for own properties. */
  2603. var hasOwnProperty = objectProto.hasOwnProperty;
  2604. /** Used to generate unique IDs. */
  2605. var idCounter = 0;
  2606. /** Used to detect methods masquerading as native. */
  2607. var maskSrcKey = (function() {
  2608. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2609. return uid ? ('Symbol(src)_1.' + uid) : '';
  2610. }());
  2611. /**
  2612. * Used to resolve the
  2613. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2614. * of values.
  2615. */
  2616. var nativeObjectToString = objectProto.toString;
  2617. /** Used to infer the `Object` constructor. */
  2618. var objectCtorString = funcToString.call(Object);
  2619. /** Used to restore the original `_` reference in `_.noConflict`. */
  2620. var oldDash = root._;
  2621. /** Used to detect if a method is native. */
  2622. var reIsNative = RegExp('^' +
  2623. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2624. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2625. );
  2626. /** Built-in value references. */
  2627. var Buffer = moduleExports ? context.Buffer : undefined,
  2628. Symbol = context.Symbol,
  2629. Uint8Array = context.Uint8Array,
  2630. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2631. getPrototype = overArg(Object.getPrototypeOf, Object),
  2632. objectCreate = Object.create,
  2633. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2634. splice = arrayProto.splice,
  2635. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2636. symIterator = Symbol ? Symbol.iterator : undefined,
  2637. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2638. var defineProperty = (function() {
  2639. try {
  2640. var func = getNative(Object, 'defineProperty');
  2641. func({}, '', {});
  2642. return func;
  2643. } catch (e) {}
  2644. }());
  2645. /** Mocked built-ins. */
  2646. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2647. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2648. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2649. /* Built-in method references for those with the same name as other `lodash` methods. */
  2650. var nativeCeil = Math.ceil,
  2651. nativeFloor = Math.floor,
  2652. nativeGetSymbols = Object.getOwnPropertySymbols,
  2653. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2654. nativeIsFinite = context.isFinite,
  2655. nativeJoin = arrayProto.join,
  2656. nativeKeys = overArg(Object.keys, Object),
  2657. nativeMax = Math.max,
  2658. nativeMin = Math.min,
  2659. nativeNow = Date.now,
  2660. nativeParseInt = context.parseInt,
  2661. nativeRandom = Math.random,
  2662. nativeReverse = arrayProto.reverse;
  2663. /* Built-in method references that are verified to be native. */
  2664. var DataView = getNative(context, 'DataView'),
  2665. Map = getNative(context, 'Map'),
  2666. Promise = getNative(context, 'Promise'),
  2667. Set = getNative(context, 'Set'),
  2668. WeakMap = getNative(context, 'WeakMap'),
  2669. nativeCreate = getNative(Object, 'create');
  2670. /** Used to store function metadata. */
  2671. var metaMap = WeakMap && new WeakMap;
  2672. /** Used to lookup unminified function names. */
  2673. var realNames = {};
  2674. /** Used to detect maps, sets, and weakmaps. */
  2675. var dataViewCtorString = toSource(DataView),
  2676. mapCtorString = toSource(Map),
  2677. promiseCtorString = toSource(Promise),
  2678. setCtorString = toSource(Set),
  2679. weakMapCtorString = toSource(WeakMap);
  2680. /** Used to convert symbols to primitives and strings. */
  2681. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2682. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2683. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2684. /*------------------------------------------------------------------------*/
  2685. /**
  2686. * Creates a `lodash` object which wraps `value` to enable implicit method
  2687. * chain sequences. Methods that operate on and return arrays, collections,
  2688. * and functions can be chained together. Methods that retrieve a single value
  2689. * or may return a primitive value will automatically end the chain sequence
  2690. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2691. * with `_#value`.
  2692. *
  2693. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2694. * enabled using `_.chain`.
  2695. *
  2696. * The execution of chained methods is lazy, that is, it's deferred until
  2697. * `_#value` is implicitly or explicitly called.
  2698. *
  2699. * Lazy evaluation allows several methods to support shortcut fusion.
  2700. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2701. * the creation of intermediate arrays and can greatly reduce the number of
  2702. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2703. * fusion if the section is applied to an array and iteratees accept only
  2704. * one argument. The heuristic for whether a section qualifies for shortcut
  2705. * fusion is subject to change.
  2706. *
  2707. * Chaining is supported in custom builds as long as the `_#value` method is
  2708. * directly or indirectly included in the build.
  2709. *
  2710. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2711. *
  2712. * The wrapper `Array` methods are:
  2713. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2714. *
  2715. * The wrapper `String` methods are:
  2716. * `replace` and `split`
  2717. *
  2718. * The wrapper methods that support shortcut fusion are:
  2719. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2720. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2721. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2722. *
  2723. * The chainable wrapper methods are:
  2724. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2725. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2726. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2727. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2728. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2729. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2730. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2731. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2732. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2733. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2734. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2735. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2736. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2737. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2738. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2739. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2740. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2741. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2742. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2743. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2744. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2745. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2746. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2747. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2748. *
  2749. * The wrapper methods that are **not** chainable by default are:
  2750. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2751. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2752. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2753. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2754. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2755. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2756. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2757. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2758. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2759. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2760. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2761. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2762. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2763. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2764. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2765. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2766. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2767. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2768. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2769. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2770. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2771. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2772. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2773. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2774. * `upperFirst`, `value`, and `words`
  2775. *
  2776. * @name _
  2777. * @constructor
  2778. * @category Seq
  2779. * @param {*} value The value to wrap in a `lodash` instance.
  2780. * @returns {Object} Returns the new `lodash` wrapper instance.
  2781. * @example
  2782. *
  2783. * function square(n) {
  2784. * return n * n;
  2785. * }
  2786. *
  2787. * var wrapped = _([1, 2, 3]);
  2788. *
  2789. * // Returns an unwrapped value.
  2790. * wrapped.reduce(_.add);
  2791. * // => 6
  2792. *
  2793. * // Returns a wrapped value.
  2794. * var squares = wrapped.map(square);
  2795. *
  2796. * _.isArray(squares);
  2797. * // => false
  2798. *
  2799. * _.isArray(squares.value());
  2800. * // => true
  2801. */
  2802. function lodash(value) {
  2803. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2804. if (value instanceof LodashWrapper) {
  2805. return value;
  2806. }
  2807. if (hasOwnProperty.call(value, '__wrapped__')) {
  2808. return wrapperClone(value);
  2809. }
  2810. }
  2811. return new LodashWrapper(value);
  2812. }
  2813. /**
  2814. * The base implementation of `_.create` without support for assigning
  2815. * properties to the created object.
  2816. *
  2817. * @private
  2818. * @param {Object} proto The object to inherit from.
  2819. * @returns {Object} Returns the new object.
  2820. */
  2821. var baseCreate = (function() {
  2822. function object() {}
  2823. return function(proto) {
  2824. if (!isObject(proto)) {
  2825. return {};
  2826. }
  2827. if (objectCreate) {
  2828. return objectCreate(proto);
  2829. }
  2830. object.prototype = proto;
  2831. var result = new object;
  2832. object.prototype = undefined;
  2833. return result;
  2834. };
  2835. }());
  2836. /**
  2837. * The function whose prototype chain sequence wrappers inherit from.
  2838. *
  2839. * @private
  2840. */
  2841. function baseLodash() {
  2842. // No operation performed.
  2843. }
  2844. /**
  2845. * The base constructor for creating `lodash` wrapper objects.
  2846. *
  2847. * @private
  2848. * @param {*} value The value to wrap.
  2849. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2850. */
  2851. function LodashWrapper(value, chainAll) {
  2852. this.__wrapped__ = value;
  2853. this.__actions__ = [];
  2854. this.__chain__ = !!chainAll;
  2855. this.__index__ = 0;
  2856. this.__values__ = undefined;
  2857. }
  2858. /**
  2859. * By default, the template delimiters used by lodash are like those in
  2860. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2861. * following template settings to use alternative delimiters.
  2862. *
  2863. * @static
  2864. * @memberOf _
  2865. * @type {Object}
  2866. */
  2867. lodash.templateSettings = {
  2868. /**
  2869. * Used to detect `data` property values to be HTML-escaped.
  2870. *
  2871. * @memberOf _.templateSettings
  2872. * @type {RegExp}
  2873. */
  2874. 'escape': reEscape,
  2875. /**
  2876. * Used to detect code to be evaluated.
  2877. *
  2878. * @memberOf _.templateSettings
  2879. * @type {RegExp}
  2880. */
  2881. 'evaluate': reEvaluate,
  2882. /**
  2883. * Used to detect `data` property values to inject.
  2884. *
  2885. * @memberOf _.templateSettings
  2886. * @type {RegExp}
  2887. */
  2888. 'interpolate': reInterpolate,
  2889. /**
  2890. * Used to reference the data object in the template text.
  2891. *
  2892. * @memberOf _.templateSettings
  2893. * @type {string}
  2894. */
  2895. 'variable': '',
  2896. /**
  2897. * Used to import variables into the compiled template.
  2898. *
  2899. * @memberOf _.templateSettings
  2900. * @type {Object}
  2901. */
  2902. 'imports': {
  2903. /**
  2904. * A reference to the `lodash` function.
  2905. *
  2906. * @memberOf _.templateSettings.imports
  2907. * @type {Function}
  2908. */
  2909. '_': lodash
  2910. }
  2911. };
  2912. // Ensure wrappers are instances of `baseLodash`.
  2913. lodash.prototype = baseLodash.prototype;
  2914. lodash.prototype.constructor = lodash;
  2915. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2916. LodashWrapper.prototype.constructor = LodashWrapper;
  2917. /*------------------------------------------------------------------------*/
  2918. /**
  2919. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2920. *
  2921. * @private
  2922. * @constructor
  2923. * @param {*} value The value to wrap.
  2924. */
  2925. function LazyWrapper(value) {
  2926. this.__wrapped__ = value;
  2927. this.__actions__ = [];
  2928. this.__dir__ = 1;
  2929. this.__filtered__ = false;
  2930. this.__iteratees__ = [];
  2931. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2932. this.__views__ = [];
  2933. }
  2934. /**
  2935. * Creates a clone of the lazy wrapper object.
  2936. *
  2937. * @private
  2938. * @name clone
  2939. * @memberOf LazyWrapper
  2940. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2941. */
  2942. function lazyClone() {
  2943. var result = new LazyWrapper(this.__wrapped__);
  2944. result.__actions__ = copyArray(this.__actions__);
  2945. result.__dir__ = this.__dir__;
  2946. result.__filtered__ = this.__filtered__;
  2947. result.__iteratees__ = copyArray(this.__iteratees__);
  2948. result.__takeCount__ = this.__takeCount__;
  2949. result.__views__ = copyArray(this.__views__);
  2950. return result;
  2951. }
  2952. /**
  2953. * Reverses the direction of lazy iteration.
  2954. *
  2955. * @private
  2956. * @name reverse
  2957. * @memberOf LazyWrapper
  2958. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2959. */
  2960. function lazyReverse() {
  2961. if (this.__filtered__) {
  2962. var result = new LazyWrapper(this);
  2963. result.__dir__ = -1;
  2964. result.__filtered__ = true;
  2965. } else {
  2966. result = this.clone();
  2967. result.__dir__ *= -1;
  2968. }
  2969. return result;
  2970. }
  2971. /**
  2972. * Extracts the unwrapped value from its lazy wrapper.
  2973. *
  2974. * @private
  2975. * @name value
  2976. * @memberOf LazyWrapper
  2977. * @returns {*} Returns the unwrapped value.
  2978. */
  2979. function lazyValue() {
  2980. var array = this.__wrapped__.value(),
  2981. dir = this.__dir__,
  2982. isArr = isArray(array),
  2983. isRight = dir < 0,
  2984. arrLength = isArr ? array.length : 0,
  2985. view = getView(0, arrLength, this.__views__),
  2986. start = view.start,
  2987. end = view.end,
  2988. length = end - start,
  2989. index = isRight ? end : (start - 1),
  2990. iteratees = this.__iteratees__,
  2991. iterLength = iteratees.length,
  2992. resIndex = 0,
  2993. takeCount = nativeMin(length, this.__takeCount__);
  2994. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2995. return baseWrapperValue(array, this.__actions__);
  2996. }
  2997. var result = [];
  2998. outer:
  2999. while (length-- && resIndex < takeCount) {
  3000. index += dir;
  3001. var iterIndex = -1,
  3002. value = array[index];
  3003. while (++iterIndex < iterLength) {
  3004. var data = iteratees[iterIndex],
  3005. iteratee = data.iteratee,
  3006. type = data.type,
  3007. computed = iteratee(value);
  3008. if (type == LAZY_MAP_FLAG) {
  3009. value = computed;
  3010. } else if (!computed) {
  3011. if (type == LAZY_FILTER_FLAG) {
  3012. continue outer;
  3013. } else {
  3014. break outer;
  3015. }
  3016. }
  3017. }
  3018. result[resIndex++] = value;
  3019. }
  3020. return result;
  3021. }
  3022. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3023. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3024. LazyWrapper.prototype.constructor = LazyWrapper;
  3025. /*------------------------------------------------------------------------*/
  3026. /**
  3027. * Creates a hash object.
  3028. *
  3029. * @private
  3030. * @constructor
  3031. * @param {Array} [entries] The key-value pairs to cache.
  3032. */
  3033. function Hash(entries) {
  3034. var index = -1,
  3035. length = entries == null ? 0 : entries.length;
  3036. this.clear();
  3037. while (++index < length) {
  3038. var entry = entries[index];
  3039. this.set(entry[0], entry[1]);
  3040. }
  3041. }
  3042. /**
  3043. * Removes all key-value entries from the hash.
  3044. *
  3045. * @private
  3046. * @name clear
  3047. * @memberOf Hash
  3048. */
  3049. function hashClear() {
  3050. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3051. this.size = 0;
  3052. }
  3053. /**
  3054. * Removes `key` and its value from the hash.
  3055. *
  3056. * @private
  3057. * @name delete
  3058. * @memberOf Hash
  3059. * @param {Object} hash The hash to modify.
  3060. * @param {string} key The key of the value to remove.
  3061. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3062. */
  3063. function hashDelete(key) {
  3064. var result = this.has(key) && delete this.__data__[key];
  3065. this.size -= result ? 1 : 0;
  3066. return result;
  3067. }
  3068. /**
  3069. * Gets the hash value for `key`.
  3070. *
  3071. * @private
  3072. * @name get
  3073. * @memberOf Hash
  3074. * @param {string} key The key of the value to get.
  3075. * @returns {*} Returns the entry value.
  3076. */
  3077. function hashGet(key) {
  3078. var data = this.__data__;
  3079. if (nativeCreate) {
  3080. var result = data[key];
  3081. return result === HASH_UNDEFINED ? undefined : result;
  3082. }
  3083. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3084. }
  3085. /**
  3086. * Checks if a hash value for `key` exists.
  3087. *
  3088. * @private
  3089. * @name has
  3090. * @memberOf Hash
  3091. * @param {string} key The key of the entry to check.
  3092. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3093. */
  3094. function hashHas(key) {
  3095. var data = this.__data__;
  3096. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3097. }
  3098. /**
  3099. * Sets the hash `key` to `value`.
  3100. *
  3101. * @private
  3102. * @name set
  3103. * @memberOf Hash
  3104. * @param {string} key The key of the value to set.
  3105. * @param {*} value The value to set.
  3106. * @returns {Object} Returns the hash instance.
  3107. */
  3108. function hashSet(key, value) {
  3109. var data = this.__data__;
  3110. this.size += this.has(key) ? 0 : 1;
  3111. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3112. return this;
  3113. }
  3114. // Add methods to `Hash`.
  3115. Hash.prototype.clear = hashClear;
  3116. Hash.prototype['delete'] = hashDelete;
  3117. Hash.prototype.get = hashGet;
  3118. Hash.prototype.has = hashHas;
  3119. Hash.prototype.set = hashSet;
  3120. /*------------------------------------------------------------------------*/
  3121. /**
  3122. * Creates an list cache object.
  3123. *
  3124. * @private
  3125. * @constructor
  3126. * @param {Array} [entries] The key-value pairs to cache.
  3127. */
  3128. function ListCache(entries) {
  3129. var index = -1,
  3130. length = entries == null ? 0 : entries.length;
  3131. this.clear();
  3132. while (++index < length) {
  3133. var entry = entries[index];
  3134. this.set(entry[0], entry[1]);
  3135. }
  3136. }
  3137. /**
  3138. * Removes all key-value entries from the list cache.
  3139. *
  3140. * @private
  3141. * @name clear
  3142. * @memberOf ListCache
  3143. */
  3144. function listCacheClear() {
  3145. this.__data__ = [];
  3146. this.size = 0;
  3147. }
  3148. /**
  3149. * Removes `key` and its value from the list cache.
  3150. *
  3151. * @private
  3152. * @name delete
  3153. * @memberOf ListCache
  3154. * @param {string} key The key of the value to remove.
  3155. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3156. */
  3157. function listCacheDelete(key) {
  3158. var data = this.__data__,
  3159. index = assocIndexOf(data, key);
  3160. if (index < 0) {
  3161. return false;
  3162. }
  3163. var lastIndex = data.length - 1;
  3164. if (index == lastIndex) {
  3165. data.pop();
  3166. } else {
  3167. splice.call(data, index, 1);
  3168. }
  3169. --this.size;
  3170. return true;
  3171. }
  3172. /**
  3173. * Gets the list cache value for `key`.
  3174. *
  3175. * @private
  3176. * @name get
  3177. * @memberOf ListCache
  3178. * @param {string} key The key of the value to get.
  3179. * @returns {*} Returns the entry value.
  3180. */
  3181. function listCacheGet(key) {
  3182. var data = this.__data__,
  3183. index = assocIndexOf(data, key);
  3184. return index < 0 ? undefined : data[index][1];
  3185. }
  3186. /**
  3187. * Checks if a list cache value for `key` exists.
  3188. *
  3189. * @private
  3190. * @name has
  3191. * @memberOf ListCache
  3192. * @param {string} key The key of the entry to check.
  3193. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3194. */
  3195. function listCacheHas(key) {
  3196. return assocIndexOf(this.__data__, key) > -1;
  3197. }
  3198. /**
  3199. * Sets the list cache `key` to `value`.
  3200. *
  3201. * @private
  3202. * @name set
  3203. * @memberOf ListCache
  3204. * @param {string} key The key of the value to set.
  3205. * @param {*} value The value to set.
  3206. * @returns {Object} Returns the list cache instance.
  3207. */
  3208. function listCacheSet(key, value) {
  3209. var data = this.__data__,
  3210. index = assocIndexOf(data, key);
  3211. if (index < 0) {
  3212. ++this.size;
  3213. data.push([key, value]);
  3214. } else {
  3215. data[index][1] = value;
  3216. }
  3217. return this;
  3218. }
  3219. // Add methods to `ListCache`.
  3220. ListCache.prototype.clear = listCacheClear;
  3221. ListCache.prototype['delete'] = listCacheDelete;
  3222. ListCache.prototype.get = listCacheGet;
  3223. ListCache.prototype.has = listCacheHas;
  3224. ListCache.prototype.set = listCacheSet;
  3225. /*------------------------------------------------------------------------*/
  3226. /**
  3227. * Creates a map cache object to store key-value pairs.
  3228. *
  3229. * @private
  3230. * @constructor
  3231. * @param {Array} [entries] The key-value pairs to cache.
  3232. */
  3233. function MapCache(entries) {
  3234. var index = -1,
  3235. length = entries == null ? 0 : entries.length;
  3236. this.clear();
  3237. while (++index < length) {
  3238. var entry = entries[index];
  3239. this.set(entry[0], entry[1]);
  3240. }
  3241. }
  3242. /**
  3243. * Removes all key-value entries from the map.
  3244. *
  3245. * @private
  3246. * @name clear
  3247. * @memberOf MapCache
  3248. */
  3249. function mapCacheClear() {
  3250. this.size = 0;
  3251. this.__data__ = {
  3252. 'hash': new Hash,
  3253. 'map': new (Map || ListCache),
  3254. 'string': new Hash
  3255. };
  3256. }
  3257. /**
  3258. * Removes `key` and its value from the map.
  3259. *
  3260. * @private
  3261. * @name delete
  3262. * @memberOf MapCache
  3263. * @param {string} key The key of the value to remove.
  3264. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3265. */
  3266. function mapCacheDelete(key) {
  3267. var result = getMapData(this, key)['delete'](key);
  3268. this.size -= result ? 1 : 0;
  3269. return result;
  3270. }
  3271. /**
  3272. * Gets the map value for `key`.
  3273. *
  3274. * @private
  3275. * @name get
  3276. * @memberOf MapCache
  3277. * @param {string} key The key of the value to get.
  3278. * @returns {*} Returns the entry value.
  3279. */
  3280. function mapCacheGet(key) {
  3281. return getMapData(this, key).get(key);
  3282. }
  3283. /**
  3284. * Checks if a map value for `key` exists.
  3285. *
  3286. * @private
  3287. * @name has
  3288. * @memberOf MapCache
  3289. * @param {string} key The key of the entry to check.
  3290. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3291. */
  3292. function mapCacheHas(key) {
  3293. return getMapData(this, key).has(key);
  3294. }
  3295. /**
  3296. * Sets the map `key` to `value`.
  3297. *
  3298. * @private
  3299. * @name set
  3300. * @memberOf MapCache
  3301. * @param {string} key The key of the value to set.
  3302. * @param {*} value The value to set.
  3303. * @returns {Object} Returns the map cache instance.
  3304. */
  3305. function mapCacheSet(key, value) {
  3306. var data = getMapData(this, key),
  3307. size = data.size;
  3308. data.set(key, value);
  3309. this.size += data.size == size ? 0 : 1;
  3310. return this;
  3311. }
  3312. // Add methods to `MapCache`.
  3313. MapCache.prototype.clear = mapCacheClear;
  3314. MapCache.prototype['delete'] = mapCacheDelete;
  3315. MapCache.prototype.get = mapCacheGet;
  3316. MapCache.prototype.has = mapCacheHas;
  3317. MapCache.prototype.set = mapCacheSet;
  3318. /*------------------------------------------------------------------------*/
  3319. /**
  3320. *
  3321. * Creates an array cache object to store unique values.
  3322. *
  3323. * @private
  3324. * @constructor
  3325. * @param {Array} [values] The values to cache.
  3326. */
  3327. function SetCache(values) {
  3328. var index = -1,
  3329. length = values == null ? 0 : values.length;
  3330. this.__data__ = new MapCache;
  3331. while (++index < length) {
  3332. this.add(values[index]);
  3333. }
  3334. }
  3335. /**
  3336. * Adds `value` to the array cache.
  3337. *
  3338. * @private
  3339. * @name add
  3340. * @memberOf SetCache
  3341. * @alias push
  3342. * @param {*} value The value to cache.
  3343. * @returns {Object} Returns the cache instance.
  3344. */
  3345. function setCacheAdd(value) {
  3346. this.__data__.set(value, HASH_UNDEFINED);
  3347. return this;
  3348. }
  3349. /**
  3350. * Checks if `value` is in the array cache.
  3351. *
  3352. * @private
  3353. * @name has
  3354. * @memberOf SetCache
  3355. * @param {*} value The value to search for.
  3356. * @returns {number} Returns `true` if `value` is found, else `false`.
  3357. */
  3358. function setCacheHas(value) {
  3359. return this.__data__.has(value);
  3360. }
  3361. // Add methods to `SetCache`.
  3362. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3363. SetCache.prototype.has = setCacheHas;
  3364. /*------------------------------------------------------------------------*/
  3365. /**
  3366. * Creates a stack cache object to store key-value pairs.
  3367. *
  3368. * @private
  3369. * @constructor
  3370. * @param {Array} [entries] The key-value pairs to cache.
  3371. */
  3372. function Stack(entries) {
  3373. var data = this.__data__ = new ListCache(entries);
  3374. this.size = data.size;
  3375. }
  3376. /**
  3377. * Removes all key-value entries from the stack.
  3378. *
  3379. * @private
  3380. * @name clear
  3381. * @memberOf Stack
  3382. */
  3383. function stackClear() {
  3384. this.__data__ = new ListCache;
  3385. this.size = 0;
  3386. }
  3387. /**
  3388. * Removes `key` and its value from the stack.
  3389. *
  3390. * @private
  3391. * @name delete
  3392. * @memberOf Stack
  3393. * @param {string} key The key of the value to remove.
  3394. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3395. */
  3396. function stackDelete(key) {
  3397. var data = this.__data__,
  3398. result = data['delete'](key);
  3399. this.size = data.size;
  3400. return result;
  3401. }
  3402. /**
  3403. * Gets the stack value for `key`.
  3404. *
  3405. * @private
  3406. * @name get
  3407. * @memberOf Stack
  3408. * @param {string} key The key of the value to get.
  3409. * @returns {*} Returns the entry value.
  3410. */
  3411. function stackGet(key) {
  3412. return this.__data__.get(key);
  3413. }
  3414. /**
  3415. * Checks if a stack value for `key` exists.
  3416. *
  3417. * @private
  3418. * @name has
  3419. * @memberOf Stack
  3420. * @param {string} key The key of the entry to check.
  3421. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3422. */
  3423. function stackHas(key) {
  3424. return this.__data__.has(key);
  3425. }
  3426. /**
  3427. * Sets the stack `key` to `value`.
  3428. *
  3429. * @private
  3430. * @name set
  3431. * @memberOf Stack
  3432. * @param {string} key The key of the value to set.
  3433. * @param {*} value The value to set.
  3434. * @returns {Object} Returns the stack cache instance.
  3435. */
  3436. function stackSet(key, value) {
  3437. var data = this.__data__;
  3438. if (data instanceof ListCache) {
  3439. var pairs = data.__data__;
  3440. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3441. pairs.push([key, value]);
  3442. this.size = ++data.size;
  3443. return this;
  3444. }
  3445. data = this.__data__ = new MapCache(pairs);
  3446. }
  3447. data.set(key, value);
  3448. this.size = data.size;
  3449. return this;
  3450. }
  3451. // Add methods to `Stack`.
  3452. Stack.prototype.clear = stackClear;
  3453. Stack.prototype['delete'] = stackDelete;
  3454. Stack.prototype.get = stackGet;
  3455. Stack.prototype.has = stackHas;
  3456. Stack.prototype.set = stackSet;
  3457. /*------------------------------------------------------------------------*/
  3458. /**
  3459. * Creates an array of the enumerable property names of the array-like `value`.
  3460. *
  3461. * @private
  3462. * @param {*} value The value to query.
  3463. * @param {boolean} inherited Specify returning inherited property names.
  3464. * @returns {Array} Returns the array of property names.
  3465. */
  3466. function arrayLikeKeys(value, inherited) {
  3467. var isArr = isArray(value),
  3468. isArg = !isArr && isArguments(value),
  3469. isBuff = !isArr && !isArg && isBuffer(value),
  3470. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3471. skipIndexes = isArr || isArg || isBuff || isType,
  3472. result = skipIndexes ? baseTimes(value.length, String) : [],
  3473. length = result.length;
  3474. for (var key in value) {
  3475. if ((inherited || hasOwnProperty.call(value, key)) &&
  3476. !(skipIndexes && (
  3477. // Safari 9 has enumerable `arguments.length` in strict mode.
  3478. key == 'length' ||
  3479. // Node.js 0.10 has enumerable non-index properties on buffers.
  3480. (isBuff && (key == 'offset' || key == 'parent')) ||
  3481. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3482. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3483. // Skip index properties.
  3484. isIndex(key, length)
  3485. ))) {
  3486. result.push(key);
  3487. }
  3488. }
  3489. return result;
  3490. }
  3491. /**
  3492. * A specialized version of `_.sample` for arrays.
  3493. *
  3494. * @private
  3495. * @param {Array} array The array to sample.
  3496. * @returns {*} Returns the random element.
  3497. */
  3498. function arraySample(array) {
  3499. var length = array.length;
  3500. return length ? array[baseRandom(0, length - 1)] : undefined;
  3501. }
  3502. /**
  3503. * A specialized version of `_.sampleSize` for arrays.
  3504. *
  3505. * @private
  3506. * @param {Array} array The array to sample.
  3507. * @param {number} n The number of elements to sample.
  3508. * @returns {Array} Returns the random elements.
  3509. */
  3510. function arraySampleSize(array, n) {
  3511. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3512. }
  3513. /**
  3514. * A specialized version of `_.shuffle` for arrays.
  3515. *
  3516. * @private
  3517. * @param {Array} array The array to shuffle.
  3518. * @returns {Array} Returns the new shuffled array.
  3519. */
  3520. function arrayShuffle(array) {
  3521. return shuffleSelf(copyArray(array));
  3522. }
  3523. /**
  3524. * This function is like `assignValue` except that it doesn't assign
  3525. * `undefined` values.
  3526. *
  3527. * @private
  3528. * @param {Object} object The object to modify.
  3529. * @param {string} key The key of the property to assign.
  3530. * @param {*} value The value to assign.
  3531. */
  3532. function assignMergeValue(object, key, value) {
  3533. if ((value !== undefined && !eq(object[key], value)) ||
  3534. (value === undefined && !(key in object))) {
  3535. baseAssignValue(object, key, value);
  3536. }
  3537. }
  3538. /**
  3539. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3540. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3541. * for equality comparisons.
  3542. *
  3543. * @private
  3544. * @param {Object} object The object to modify.
  3545. * @param {string} key The key of the property to assign.
  3546. * @param {*} value The value to assign.
  3547. */
  3548. function assignValue(object, key, value) {
  3549. var objValue = object[key];
  3550. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3551. (value === undefined && !(key in object))) {
  3552. baseAssignValue(object, key, value);
  3553. }
  3554. }
  3555. /**
  3556. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3557. *
  3558. * @private
  3559. * @param {Array} array The array to inspect.
  3560. * @param {*} key The key to search for.
  3561. * @returns {number} Returns the index of the matched value, else `-1`.
  3562. */
  3563. function assocIndexOf(array, key) {
  3564. var length = array.length;
  3565. while (length--) {
  3566. if (eq(array[length][0], key)) {
  3567. return length;
  3568. }
  3569. }
  3570. return -1;
  3571. }
  3572. /**
  3573. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3574. * by `iteratee` and values set by `setter`.
  3575. *
  3576. * @private
  3577. * @param {Array|Object} collection The collection to iterate over.
  3578. * @param {Function} setter The function to set `accumulator` values.
  3579. * @param {Function} iteratee The iteratee to transform keys.
  3580. * @param {Object} accumulator The initial aggregated object.
  3581. * @returns {Function} Returns `accumulator`.
  3582. */
  3583. function baseAggregator(collection, setter, iteratee, accumulator) {
  3584. baseEach(collection, function(value, key, collection) {
  3585. setter(accumulator, value, iteratee(value), collection);
  3586. });
  3587. return accumulator;
  3588. }
  3589. /**
  3590. * The base implementation of `_.assign` without support for multiple sources
  3591. * or `customizer` functions.
  3592. *
  3593. * @private
  3594. * @param {Object} object The destination object.
  3595. * @param {Object} source The source object.
  3596. * @returns {Object} Returns `object`.
  3597. */
  3598. function baseAssign(object, source) {
  3599. return object && copyObject(source, keys(source), object);
  3600. }
  3601. /**
  3602. * The base implementation of `_.assignIn` without support for multiple sources
  3603. * or `customizer` functions.
  3604. *
  3605. * @private
  3606. * @param {Object} object The destination object.
  3607. * @param {Object} source The source object.
  3608. * @returns {Object} Returns `object`.
  3609. */
  3610. function baseAssignIn(object, source) {
  3611. return object && copyObject(source, keysIn(source), object);
  3612. }
  3613. /**
  3614. * The base implementation of `assignValue` and `assignMergeValue` without
  3615. * value checks.
  3616. *
  3617. * @private
  3618. * @param {Object} object The object to modify.
  3619. * @param {string} key The key of the property to assign.
  3620. * @param {*} value The value to assign.
  3621. */
  3622. function baseAssignValue(object, key, value) {
  3623. if (key == '__proto__' && defineProperty) {
  3624. defineProperty(object, key, {
  3625. 'configurable': true,
  3626. 'enumerable': true,
  3627. 'value': value,
  3628. 'writable': true
  3629. });
  3630. } else {
  3631. object[key] = value;
  3632. }
  3633. }
  3634. /**
  3635. * The base implementation of `_.at` without support for individual paths.
  3636. *
  3637. * @private
  3638. * @param {Object} object The object to iterate over.
  3639. * @param {string[]} paths The property paths to pick.
  3640. * @returns {Array} Returns the picked elements.
  3641. */
  3642. function baseAt(object, paths) {
  3643. var index = -1,
  3644. length = paths.length,
  3645. result = Array(length),
  3646. skip = object == null;
  3647. while (++index < length) {
  3648. result[index] = skip ? undefined : get(object, paths[index]);
  3649. }
  3650. return result;
  3651. }
  3652. /**
  3653. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3654. *
  3655. * @private
  3656. * @param {number} number The number to clamp.
  3657. * @param {number} [lower] The lower bound.
  3658. * @param {number} upper The upper bound.
  3659. * @returns {number} Returns the clamped number.
  3660. */
  3661. function baseClamp(number, lower, upper) {
  3662. if (number === number) {
  3663. if (upper !== undefined) {
  3664. number = number <= upper ? number : upper;
  3665. }
  3666. if (lower !== undefined) {
  3667. number = number >= lower ? number : lower;
  3668. }
  3669. }
  3670. return number;
  3671. }
  3672. /**
  3673. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3674. * traversed objects.
  3675. *
  3676. * @private
  3677. * @param {*} value The value to clone.
  3678. * @param {boolean} bitmask The bitmask flags.
  3679. * 1 - Deep clone
  3680. * 2 - Flatten inherited properties
  3681. * 4 - Clone symbols
  3682. * @param {Function} [customizer] The function to customize cloning.
  3683. * @param {string} [key] The key of `value`.
  3684. * @param {Object} [object] The parent object of `value`.
  3685. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3686. * @returns {*} Returns the cloned value.
  3687. */
  3688. function baseClone(value, bitmask, customizer, key, object, stack) {
  3689. var result,
  3690. isDeep = bitmask & CLONE_DEEP_FLAG,
  3691. isFlat = bitmask & CLONE_FLAT_FLAG,
  3692. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3693. if (customizer) {
  3694. result = object ? customizer(value, key, object, stack) : customizer(value);
  3695. }
  3696. if (result !== undefined) {
  3697. return result;
  3698. }
  3699. if (!isObject(value)) {
  3700. return value;
  3701. }
  3702. var isArr = isArray(value);
  3703. if (isArr) {
  3704. result = initCloneArray(value);
  3705. if (!isDeep) {
  3706. return copyArray(value, result);
  3707. }
  3708. } else {
  3709. var tag = getTag(value),
  3710. isFunc = tag == funcTag || tag == genTag;
  3711. if (isBuffer(value)) {
  3712. return cloneBuffer(value, isDeep);
  3713. }
  3714. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3715. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3716. if (!isDeep) {
  3717. return isFlat
  3718. ? copySymbolsIn(value, baseAssignIn(result, value))
  3719. : copySymbols(value, baseAssign(result, value));
  3720. }
  3721. } else {
  3722. if (!cloneableTags[tag]) {
  3723. return object ? value : {};
  3724. }
  3725. result = initCloneByTag(value, tag, isDeep);
  3726. }
  3727. }
  3728. // Check for circular references and return its corresponding clone.
  3729. stack || (stack = new Stack);
  3730. var stacked = stack.get(value);
  3731. if (stacked) {
  3732. return stacked;
  3733. }
  3734. stack.set(value, result);
  3735. if (isSet(value)) {
  3736. value.forEach(function(subValue) {
  3737. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3738. });
  3739. } else if (isMap(value)) {
  3740. value.forEach(function(subValue, key) {
  3741. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3742. });
  3743. }
  3744. var keysFunc = isFull
  3745. ? (isFlat ? getAllKeysIn : getAllKeys)
  3746. : (isFlat ? keysIn : keys);
  3747. var props = isArr ? undefined : keysFunc(value);
  3748. arrayEach(props || value, function(subValue, key) {
  3749. if (props) {
  3750. key = subValue;
  3751. subValue = value[key];
  3752. }
  3753. // Recursively populate clone (susceptible to call stack limits).
  3754. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3755. });
  3756. return result;
  3757. }
  3758. /**
  3759. * The base implementation of `_.conforms` which doesn't clone `source`.
  3760. *
  3761. * @private
  3762. * @param {Object} source The object of property predicates to conform to.
  3763. * @returns {Function} Returns the new spec function.
  3764. */
  3765. function baseConforms(source) {
  3766. var props = keys(source);
  3767. return function(object) {
  3768. return baseConformsTo(object, source, props);
  3769. };
  3770. }
  3771. /**
  3772. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3773. *
  3774. * @private
  3775. * @param {Object} object The object to inspect.
  3776. * @param {Object} source The object of property predicates to conform to.
  3777. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3778. */
  3779. function baseConformsTo(object, source, props) {
  3780. var length = props.length;
  3781. if (object == null) {
  3782. return !length;
  3783. }
  3784. object = Object(object);
  3785. while (length--) {
  3786. var key = props[length],
  3787. predicate = source[key],
  3788. value = object[key];
  3789. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3790. return false;
  3791. }
  3792. }
  3793. return true;
  3794. }
  3795. /**
  3796. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3797. * to provide to `func`.
  3798. *
  3799. * @private
  3800. * @param {Function} func The function to delay.
  3801. * @param {number} wait The number of milliseconds to delay invocation.
  3802. * @param {Array} args The arguments to provide to `func`.
  3803. * @returns {number|Object} Returns the timer id or timeout object.
  3804. */
  3805. function baseDelay(func, wait, args) {
  3806. if (typeof func != 'function') {
  3807. throw new TypeError(FUNC_ERROR_TEXT);
  3808. }
  3809. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3810. }
  3811. /**
  3812. * The base implementation of methods like `_.difference` without support
  3813. * for excluding multiple arrays or iteratee shorthands.
  3814. *
  3815. * @private
  3816. * @param {Array} array The array to inspect.
  3817. * @param {Array} values The values to exclude.
  3818. * @param {Function} [iteratee] The iteratee invoked per element.
  3819. * @param {Function} [comparator] The comparator invoked per element.
  3820. * @returns {Array} Returns the new array of filtered values.
  3821. */
  3822. function baseDifference(array, values, iteratee, comparator) {
  3823. var index = -1,
  3824. includes = arrayIncludes,
  3825. isCommon = true,
  3826. length = array.length,
  3827. result = [],
  3828. valuesLength = values.length;
  3829. if (!length) {
  3830. return result;
  3831. }
  3832. if (iteratee) {
  3833. values = arrayMap(values, baseUnary(iteratee));
  3834. }
  3835. if (comparator) {
  3836. includes = arrayIncludesWith;
  3837. isCommon = false;
  3838. }
  3839. else if (values.length >= LARGE_ARRAY_SIZE) {
  3840. includes = cacheHas;
  3841. isCommon = false;
  3842. values = new SetCache(values);
  3843. }
  3844. outer:
  3845. while (++index < length) {
  3846. var value = array[index],
  3847. computed = iteratee == null ? value : iteratee(value);
  3848. value = (comparator || value !== 0) ? value : 0;
  3849. if (isCommon && computed === computed) {
  3850. var valuesIndex = valuesLength;
  3851. while (valuesIndex--) {
  3852. if (values[valuesIndex] === computed) {
  3853. continue outer;
  3854. }
  3855. }
  3856. result.push(value);
  3857. }
  3858. else if (!includes(values, computed, comparator)) {
  3859. result.push(value);
  3860. }
  3861. }
  3862. return result;
  3863. }
  3864. /**
  3865. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3866. *
  3867. * @private
  3868. * @param {Array|Object} collection The collection to iterate over.
  3869. * @param {Function} iteratee The function invoked per iteration.
  3870. * @returns {Array|Object} Returns `collection`.
  3871. */
  3872. var baseEach = createBaseEach(baseForOwn);
  3873. /**
  3874. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3875. *
  3876. * @private
  3877. * @param {Array|Object} collection The collection to iterate over.
  3878. * @param {Function} iteratee The function invoked per iteration.
  3879. * @returns {Array|Object} Returns `collection`.
  3880. */
  3881. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3882. /**
  3883. * The base implementation of `_.every` without support for iteratee shorthands.
  3884. *
  3885. * @private
  3886. * @param {Array|Object} collection The collection to iterate over.
  3887. * @param {Function} predicate The function invoked per iteration.
  3888. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3889. * else `false`
  3890. */
  3891. function baseEvery(collection, predicate) {
  3892. var result = true;
  3893. baseEach(collection, function(value, index, collection) {
  3894. result = !!predicate(value, index, collection);
  3895. return result;
  3896. });
  3897. return result;
  3898. }
  3899. /**
  3900. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3901. * `comparator` to determine the extremum value.
  3902. *
  3903. * @private
  3904. * @param {Array} array The array to iterate over.
  3905. * @param {Function} iteratee The iteratee invoked per iteration.
  3906. * @param {Function} comparator The comparator used to compare values.
  3907. * @returns {*} Returns the extremum value.
  3908. */
  3909. function baseExtremum(array, iteratee, comparator) {
  3910. var index = -1,
  3911. length = array.length;
  3912. while (++index < length) {
  3913. var value = array[index],
  3914. current = iteratee(value);
  3915. if (current != null && (computed === undefined
  3916. ? (current === current && !isSymbol(current))
  3917. : comparator(current, computed)
  3918. )) {
  3919. var computed = current,
  3920. result = value;
  3921. }
  3922. }
  3923. return result;
  3924. }
  3925. /**
  3926. * The base implementation of `_.fill` without an iteratee call guard.
  3927. *
  3928. * @private
  3929. * @param {Array} array The array to fill.
  3930. * @param {*} value The value to fill `array` with.
  3931. * @param {number} [start=0] The start position.
  3932. * @param {number} [end=array.length] The end position.
  3933. * @returns {Array} Returns `array`.
  3934. */
  3935. function baseFill(array, value, start, end) {
  3936. var length = array.length;
  3937. start = toInteger(start);
  3938. if (start < 0) {
  3939. start = -start > length ? 0 : (length + start);
  3940. }
  3941. end = (end === undefined || end > length) ? length : toInteger(end);
  3942. if (end < 0) {
  3943. end += length;
  3944. }
  3945. end = start > end ? 0 : toLength(end);
  3946. while (start < end) {
  3947. array[start++] = value;
  3948. }
  3949. return array;
  3950. }
  3951. /**
  3952. * The base implementation of `_.filter` without support for iteratee shorthands.
  3953. *
  3954. * @private
  3955. * @param {Array|Object} collection The collection to iterate over.
  3956. * @param {Function} predicate The function invoked per iteration.
  3957. * @returns {Array} Returns the new filtered array.
  3958. */
  3959. function baseFilter(collection, predicate) {
  3960. var result = [];
  3961. baseEach(collection, function(value, index, collection) {
  3962. if (predicate(value, index, collection)) {
  3963. result.push(value);
  3964. }
  3965. });
  3966. return result;
  3967. }
  3968. /**
  3969. * The base implementation of `_.flatten` with support for restricting flattening.
  3970. *
  3971. * @private
  3972. * @param {Array} array The array to flatten.
  3973. * @param {number} depth The maximum recursion depth.
  3974. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3975. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3976. * @param {Array} [result=[]] The initial result value.
  3977. * @returns {Array} Returns the new flattened array.
  3978. */
  3979. function baseFlatten(array, depth, predicate, isStrict, result) {
  3980. var index = -1,
  3981. length = array.length;
  3982. predicate || (predicate = isFlattenable);
  3983. result || (result = []);
  3984. while (++index < length) {
  3985. var value = array[index];
  3986. if (depth > 0 && predicate(value)) {
  3987. if (depth > 1) {
  3988. // Recursively flatten arrays (susceptible to call stack limits).
  3989. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3990. } else {
  3991. arrayPush(result, value);
  3992. }
  3993. } else if (!isStrict) {
  3994. result[result.length] = value;
  3995. }
  3996. }
  3997. return result;
  3998. }
  3999. /**
  4000. * The base implementation of `baseForOwn` which iterates over `object`
  4001. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4002. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4003. *
  4004. * @private
  4005. * @param {Object} object The object to iterate over.
  4006. * @param {Function} iteratee The function invoked per iteration.
  4007. * @param {Function} keysFunc The function to get the keys of `object`.
  4008. * @returns {Object} Returns `object`.
  4009. */
  4010. var baseFor = createBaseFor();
  4011. /**
  4012. * This function is like `baseFor` except that it iterates over properties
  4013. * in the opposite order.
  4014. *
  4015. * @private
  4016. * @param {Object} object The object to iterate over.
  4017. * @param {Function} iteratee The function invoked per iteration.
  4018. * @param {Function} keysFunc The function to get the keys of `object`.
  4019. * @returns {Object} Returns `object`.
  4020. */
  4021. var baseForRight = createBaseFor(true);
  4022. /**
  4023. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4024. *
  4025. * @private
  4026. * @param {Object} object The object to iterate over.
  4027. * @param {Function} iteratee The function invoked per iteration.
  4028. * @returns {Object} Returns `object`.
  4029. */
  4030. function baseForOwn(object, iteratee) {
  4031. return object && baseFor(object, iteratee, keys);
  4032. }
  4033. /**
  4034. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4035. *
  4036. * @private
  4037. * @param {Object} object The object to iterate over.
  4038. * @param {Function} iteratee The function invoked per iteration.
  4039. * @returns {Object} Returns `object`.
  4040. */
  4041. function baseForOwnRight(object, iteratee) {
  4042. return object && baseForRight(object, iteratee, keys);
  4043. }
  4044. /**
  4045. * The base implementation of `_.functions` which creates an array of
  4046. * `object` function property names filtered from `props`.
  4047. *
  4048. * @private
  4049. * @param {Object} object The object to inspect.
  4050. * @param {Array} props The property names to filter.
  4051. * @returns {Array} Returns the function names.
  4052. */
  4053. function baseFunctions(object, props) {
  4054. return arrayFilter(props, function(key) {
  4055. return isFunction(object[key]);
  4056. });
  4057. }
  4058. /**
  4059. * The base implementation of `_.get` without support for default values.
  4060. *
  4061. * @private
  4062. * @param {Object} object The object to query.
  4063. * @param {Array|string} path The path of the property to get.
  4064. * @returns {*} Returns the resolved value.
  4065. */
  4066. function baseGet(object, path) {
  4067. path = castPath(path, object);
  4068. var index = 0,
  4069. length = path.length;
  4070. while (object != null && index < length) {
  4071. object = object[toKey(path[index++])];
  4072. }
  4073. return (index && index == length) ? object : undefined;
  4074. }
  4075. /**
  4076. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4077. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4078. * symbols of `object`.
  4079. *
  4080. * @private
  4081. * @param {Object} object The object to query.
  4082. * @param {Function} keysFunc The function to get the keys of `object`.
  4083. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4084. * @returns {Array} Returns the array of property names and symbols.
  4085. */
  4086. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4087. var result = keysFunc(object);
  4088. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4089. }
  4090. /**
  4091. * The base implementation of `getTag` without fallbacks for buggy environments.
  4092. *
  4093. * @private
  4094. * @param {*} value The value to query.
  4095. * @returns {string} Returns the `toStringTag`.
  4096. */
  4097. function baseGetTag(value) {
  4098. if (value == null) {
  4099. return value === undefined ? undefinedTag : nullTag;
  4100. }
  4101. return (symToStringTag && symToStringTag in Object(value))
  4102. ? getRawTag(value)
  4103. : objectToString(value);
  4104. }
  4105. /**
  4106. * The base implementation of `_.gt` which doesn't coerce arguments.
  4107. *
  4108. * @private
  4109. * @param {*} value The value to compare.
  4110. * @param {*} other The other value to compare.
  4111. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4112. * else `false`.
  4113. */
  4114. function baseGt(value, other) {
  4115. return value > other;
  4116. }
  4117. /**
  4118. * The base implementation of `_.has` without support for deep paths.
  4119. *
  4120. * @private
  4121. * @param {Object} [object] The object to query.
  4122. * @param {Array|string} key The key to check.
  4123. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4124. */
  4125. function baseHas(object, key) {
  4126. return object != null && hasOwnProperty.call(object, key);
  4127. }
  4128. /**
  4129. * The base implementation of `_.hasIn` without support for deep paths.
  4130. *
  4131. * @private
  4132. * @param {Object} [object] The object to query.
  4133. * @param {Array|string} key The key to check.
  4134. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4135. */
  4136. function baseHasIn(object, key) {
  4137. return object != null && key in Object(object);
  4138. }
  4139. /**
  4140. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4141. *
  4142. * @private
  4143. * @param {number} number The number to check.
  4144. * @param {number} start The start of the range.
  4145. * @param {number} end The end of the range.
  4146. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4147. */
  4148. function baseInRange(number, start, end) {
  4149. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4150. }
  4151. /**
  4152. * The base implementation of methods like `_.intersection`, without support
  4153. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4154. *
  4155. * @private
  4156. * @param {Array} arrays The arrays to inspect.
  4157. * @param {Function} [iteratee] The iteratee invoked per element.
  4158. * @param {Function} [comparator] The comparator invoked per element.
  4159. * @returns {Array} Returns the new array of shared values.
  4160. */
  4161. function baseIntersection(arrays, iteratee, comparator) {
  4162. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4163. length = arrays[0].length,
  4164. othLength = arrays.length,
  4165. othIndex = othLength,
  4166. caches = Array(othLength),
  4167. maxLength = Infinity,
  4168. result = [];
  4169. while (othIndex--) {
  4170. var array = arrays[othIndex];
  4171. if (othIndex && iteratee) {
  4172. array = arrayMap(array, baseUnary(iteratee));
  4173. }
  4174. maxLength = nativeMin(array.length, maxLength);
  4175. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4176. ? new SetCache(othIndex && array)
  4177. : undefined;
  4178. }
  4179. array = arrays[0];
  4180. var index = -1,
  4181. seen = caches[0];
  4182. outer:
  4183. while (++index < length && result.length < maxLength) {
  4184. var value = array[index],
  4185. computed = iteratee ? iteratee(value) : value;
  4186. value = (comparator || value !== 0) ? value : 0;
  4187. if (!(seen
  4188. ? cacheHas(seen, computed)
  4189. : includes(result, computed, comparator)
  4190. )) {
  4191. othIndex = othLength;
  4192. while (--othIndex) {
  4193. var cache = caches[othIndex];
  4194. if (!(cache
  4195. ? cacheHas(cache, computed)
  4196. : includes(arrays[othIndex], computed, comparator))
  4197. ) {
  4198. continue outer;
  4199. }
  4200. }
  4201. if (seen) {
  4202. seen.push(computed);
  4203. }
  4204. result.push(value);
  4205. }
  4206. }
  4207. return result;
  4208. }
  4209. /**
  4210. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4211. * `object` with values transformed by `iteratee` and set by `setter`.
  4212. *
  4213. * @private
  4214. * @param {Object} object The object to iterate over.
  4215. * @param {Function} setter The function to set `accumulator` values.
  4216. * @param {Function} iteratee The iteratee to transform values.
  4217. * @param {Object} accumulator The initial inverted object.
  4218. * @returns {Function} Returns `accumulator`.
  4219. */
  4220. function baseInverter(object, setter, iteratee, accumulator) {
  4221. baseForOwn(object, function(value, key, object) {
  4222. setter(accumulator, iteratee(value), key, object);
  4223. });
  4224. return accumulator;
  4225. }
  4226. /**
  4227. * The base implementation of `_.invoke` without support for individual
  4228. * method arguments.
  4229. *
  4230. * @private
  4231. * @param {Object} object The object to query.
  4232. * @param {Array|string} path The path of the method to invoke.
  4233. * @param {Array} args The arguments to invoke the method with.
  4234. * @returns {*} Returns the result of the invoked method.
  4235. */
  4236. function baseInvoke(object, path, args) {
  4237. path = castPath(path, object);
  4238. object = parent(object, path);
  4239. var func = object == null ? object : object[toKey(last(path))];
  4240. return func == null ? undefined : apply(func, object, args);
  4241. }
  4242. /**
  4243. * The base implementation of `_.isArguments`.
  4244. *
  4245. * @private
  4246. * @param {*} value The value to check.
  4247. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4248. */
  4249. function baseIsArguments(value) {
  4250. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4251. }
  4252. /**
  4253. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4254. *
  4255. * @private
  4256. * @param {*} value The value to check.
  4257. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4258. */
  4259. function baseIsArrayBuffer(value) {
  4260. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4261. }
  4262. /**
  4263. * The base implementation of `_.isDate` without Node.js optimizations.
  4264. *
  4265. * @private
  4266. * @param {*} value The value to check.
  4267. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4268. */
  4269. function baseIsDate(value) {
  4270. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4271. }
  4272. /**
  4273. * The base implementation of `_.isEqual` which supports partial comparisons
  4274. * and tracks traversed objects.
  4275. *
  4276. * @private
  4277. * @param {*} value The value to compare.
  4278. * @param {*} other The other value to compare.
  4279. * @param {boolean} bitmask The bitmask flags.
  4280. * 1 - Unordered comparison
  4281. * 2 - Partial comparison
  4282. * @param {Function} [customizer] The function to customize comparisons.
  4283. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4284. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4285. */
  4286. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4287. if (value === other) {
  4288. return true;
  4289. }
  4290. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4291. return value !== value && other !== other;
  4292. }
  4293. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4294. }
  4295. /**
  4296. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4297. * deep comparisons and tracks traversed objects enabling objects with circular
  4298. * references to be compared.
  4299. *
  4300. * @private
  4301. * @param {Object} object The object to compare.
  4302. * @param {Object} other The other object to compare.
  4303. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4304. * @param {Function} customizer The function to customize comparisons.
  4305. * @param {Function} equalFunc The function to determine equivalents of values.
  4306. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4307. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4308. */
  4309. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4310. var objIsArr = isArray(object),
  4311. othIsArr = isArray(other),
  4312. objTag = objIsArr ? arrayTag : getTag(object),
  4313. othTag = othIsArr ? arrayTag : getTag(other);
  4314. objTag = objTag == argsTag ? objectTag : objTag;
  4315. othTag = othTag == argsTag ? objectTag : othTag;
  4316. var objIsObj = objTag == objectTag,
  4317. othIsObj = othTag == objectTag,
  4318. isSameTag = objTag == othTag;
  4319. if (isSameTag && isBuffer(object)) {
  4320. if (!isBuffer(other)) {
  4321. return false;
  4322. }
  4323. objIsArr = true;
  4324. objIsObj = false;
  4325. }
  4326. if (isSameTag && !objIsObj) {
  4327. stack || (stack = new Stack);
  4328. return (objIsArr || isTypedArray(object))
  4329. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4330. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4331. }
  4332. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4333. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4334. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4335. if (objIsWrapped || othIsWrapped) {
  4336. var objUnwrapped = objIsWrapped ? object.value() : object,
  4337. othUnwrapped = othIsWrapped ? other.value() : other;
  4338. stack || (stack = new Stack);
  4339. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4340. }
  4341. }
  4342. if (!isSameTag) {
  4343. return false;
  4344. }
  4345. stack || (stack = new Stack);
  4346. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4347. }
  4348. /**
  4349. * The base implementation of `_.isMap` without Node.js optimizations.
  4350. *
  4351. * @private
  4352. * @param {*} value The value to check.
  4353. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4354. */
  4355. function baseIsMap(value) {
  4356. return isObjectLike(value) && getTag(value) == mapTag;
  4357. }
  4358. /**
  4359. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4360. *
  4361. * @private
  4362. * @param {Object} object The object to inspect.
  4363. * @param {Object} source The object of property values to match.
  4364. * @param {Array} matchData The property names, values, and compare flags to match.
  4365. * @param {Function} [customizer] The function to customize comparisons.
  4366. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4367. */
  4368. function baseIsMatch(object, source, matchData, customizer) {
  4369. var index = matchData.length,
  4370. length = index,
  4371. noCustomizer = !customizer;
  4372. if (object == null) {
  4373. return !length;
  4374. }
  4375. object = Object(object);
  4376. while (index--) {
  4377. var data = matchData[index];
  4378. if ((noCustomizer && data[2])
  4379. ? data[1] !== object[data[0]]
  4380. : !(data[0] in object)
  4381. ) {
  4382. return false;
  4383. }
  4384. }
  4385. while (++index < length) {
  4386. data = matchData[index];
  4387. var key = data[0],
  4388. objValue = object[key],
  4389. srcValue = data[1];
  4390. if (noCustomizer && data[2]) {
  4391. if (objValue === undefined && !(key in object)) {
  4392. return false;
  4393. }
  4394. } else {
  4395. var stack = new Stack;
  4396. if (customizer) {
  4397. var result = customizer(objValue, srcValue, key, object, source, stack);
  4398. }
  4399. if (!(result === undefined
  4400. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4401. : result
  4402. )) {
  4403. return false;
  4404. }
  4405. }
  4406. }
  4407. return true;
  4408. }
  4409. /**
  4410. * The base implementation of `_.isNative` without bad shim checks.
  4411. *
  4412. * @private
  4413. * @param {*} value The value to check.
  4414. * @returns {boolean} Returns `true` if `value` is a native function,
  4415. * else `false`.
  4416. */
  4417. function baseIsNative(value) {
  4418. if (!isObject(value) || isMasked(value)) {
  4419. return false;
  4420. }
  4421. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4422. return pattern.test(toSource(value));
  4423. }
  4424. /**
  4425. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4426. *
  4427. * @private
  4428. * @param {*} value The value to check.
  4429. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4430. */
  4431. function baseIsRegExp(value) {
  4432. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4433. }
  4434. /**
  4435. * The base implementation of `_.isSet` without Node.js optimizations.
  4436. *
  4437. * @private
  4438. * @param {*} value The value to check.
  4439. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4440. */
  4441. function baseIsSet(value) {
  4442. return isObjectLike(value) && getTag(value) == setTag;
  4443. }
  4444. /**
  4445. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4446. *
  4447. * @private
  4448. * @param {*} value The value to check.
  4449. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4450. */
  4451. function baseIsTypedArray(value) {
  4452. return isObjectLike(value) &&
  4453. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4454. }
  4455. /**
  4456. * The base implementation of `_.iteratee`.
  4457. *
  4458. * @private
  4459. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4460. * @returns {Function} Returns the iteratee.
  4461. */
  4462. function baseIteratee(value) {
  4463. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4464. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4465. if (typeof value == 'function') {
  4466. return value;
  4467. }
  4468. if (value == null) {
  4469. return identity;
  4470. }
  4471. if (typeof value == 'object') {
  4472. return isArray(value)
  4473. ? baseMatchesProperty(value[0], value[1])
  4474. : baseMatches(value);
  4475. }
  4476. return property(value);
  4477. }
  4478. /**
  4479. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4480. *
  4481. * @private
  4482. * @param {Object} object The object to query.
  4483. * @returns {Array} Returns the array of property names.
  4484. */
  4485. function baseKeys(object) {
  4486. if (!isPrototype(object)) {
  4487. return nativeKeys(object);
  4488. }
  4489. var result = [];
  4490. for (var key in Object(object)) {
  4491. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4492. result.push(key);
  4493. }
  4494. }
  4495. return result;
  4496. }
  4497. /**
  4498. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4499. *
  4500. * @private
  4501. * @param {Object} object The object to query.
  4502. * @returns {Array} Returns the array of property names.
  4503. */
  4504. function baseKeysIn(object) {
  4505. if (!isObject(object)) {
  4506. return nativeKeysIn(object);
  4507. }
  4508. var isProto = isPrototype(object),
  4509. result = [];
  4510. for (var key in object) {
  4511. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4512. result.push(key);
  4513. }
  4514. }
  4515. return result;
  4516. }
  4517. /**
  4518. * The base implementation of `_.lt` which doesn't coerce arguments.
  4519. *
  4520. * @private
  4521. * @param {*} value The value to compare.
  4522. * @param {*} other The other value to compare.
  4523. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4524. * else `false`.
  4525. */
  4526. function baseLt(value, other) {
  4527. return value < other;
  4528. }
  4529. /**
  4530. * The base implementation of `_.map` without support for iteratee shorthands.
  4531. *
  4532. * @private
  4533. * @param {Array|Object} collection The collection to iterate over.
  4534. * @param {Function} iteratee The function invoked per iteration.
  4535. * @returns {Array} Returns the new mapped array.
  4536. */
  4537. function baseMap(collection, iteratee) {
  4538. var index = -1,
  4539. result = isArrayLike(collection) ? Array(collection.length) : [];
  4540. baseEach(collection, function(value, key, collection) {
  4541. result[++index] = iteratee(value, key, collection);
  4542. });
  4543. return result;
  4544. }
  4545. /**
  4546. * The base implementation of `_.matches` which doesn't clone `source`.
  4547. *
  4548. * @private
  4549. * @param {Object} source The object of property values to match.
  4550. * @returns {Function} Returns the new spec function.
  4551. */
  4552. function baseMatches(source) {
  4553. var matchData = getMatchData(source);
  4554. if (matchData.length == 1 && matchData[0][2]) {
  4555. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4556. }
  4557. return function(object) {
  4558. return object === source || baseIsMatch(object, source, matchData);
  4559. };
  4560. }
  4561. /**
  4562. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4563. *
  4564. * @private
  4565. * @param {string} path The path of the property to get.
  4566. * @param {*} srcValue The value to match.
  4567. * @returns {Function} Returns the new spec function.
  4568. */
  4569. function baseMatchesProperty(path, srcValue) {
  4570. if (isKey(path) && isStrictComparable(srcValue)) {
  4571. return matchesStrictComparable(toKey(path), srcValue);
  4572. }
  4573. return function(object) {
  4574. var objValue = get(object, path);
  4575. return (objValue === undefined && objValue === srcValue)
  4576. ? hasIn(object, path)
  4577. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4578. };
  4579. }
  4580. /**
  4581. * The base implementation of `_.merge` without support for multiple sources.
  4582. *
  4583. * @private
  4584. * @param {Object} object The destination object.
  4585. * @param {Object} source The source object.
  4586. * @param {number} srcIndex The index of `source`.
  4587. * @param {Function} [customizer] The function to customize merged values.
  4588. * @param {Object} [stack] Tracks traversed source values and their merged
  4589. * counterparts.
  4590. */
  4591. function baseMerge(object, source, srcIndex, customizer, stack) {
  4592. if (object === source) {
  4593. return;
  4594. }
  4595. baseFor(source, function(srcValue, key) {
  4596. stack || (stack = new Stack);
  4597. if (isObject(srcValue)) {
  4598. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4599. }
  4600. else {
  4601. var newValue = customizer
  4602. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4603. : undefined;
  4604. if (newValue === undefined) {
  4605. newValue = srcValue;
  4606. }
  4607. assignMergeValue(object, key, newValue);
  4608. }
  4609. }, keysIn);
  4610. }
  4611. /**
  4612. * A specialized version of `baseMerge` for arrays and objects which performs
  4613. * deep merges and tracks traversed objects enabling objects with circular
  4614. * references to be merged.
  4615. *
  4616. * @private
  4617. * @param {Object} object The destination object.
  4618. * @param {Object} source The source object.
  4619. * @param {string} key The key of the value to merge.
  4620. * @param {number} srcIndex The index of `source`.
  4621. * @param {Function} mergeFunc The function to merge values.
  4622. * @param {Function} [customizer] The function to customize assigned values.
  4623. * @param {Object} [stack] Tracks traversed source values and their merged
  4624. * counterparts.
  4625. */
  4626. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4627. var objValue = safeGet(object, key),
  4628. srcValue = safeGet(source, key),
  4629. stacked = stack.get(srcValue);
  4630. if (stacked) {
  4631. assignMergeValue(object, key, stacked);
  4632. return;
  4633. }
  4634. var newValue = customizer
  4635. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4636. : undefined;
  4637. var isCommon = newValue === undefined;
  4638. if (isCommon) {
  4639. var isArr = isArray(srcValue),
  4640. isBuff = !isArr && isBuffer(srcValue),
  4641. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4642. newValue = srcValue;
  4643. if (isArr || isBuff || isTyped) {
  4644. if (isArray(objValue)) {
  4645. newValue = objValue;
  4646. }
  4647. else if (isArrayLikeObject(objValue)) {
  4648. newValue = copyArray(objValue);
  4649. }
  4650. else if (isBuff) {
  4651. isCommon = false;
  4652. newValue = cloneBuffer(srcValue, true);
  4653. }
  4654. else if (isTyped) {
  4655. isCommon = false;
  4656. newValue = cloneTypedArray(srcValue, true);
  4657. }
  4658. else {
  4659. newValue = [];
  4660. }
  4661. }
  4662. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4663. newValue = objValue;
  4664. if (isArguments(objValue)) {
  4665. newValue = toPlainObject(objValue);
  4666. }
  4667. else if (!isObject(objValue) || isFunction(objValue)) {
  4668. newValue = initCloneObject(srcValue);
  4669. }
  4670. }
  4671. else {
  4672. isCommon = false;
  4673. }
  4674. }
  4675. if (isCommon) {
  4676. // Recursively merge objects and arrays (susceptible to call stack limits).
  4677. stack.set(srcValue, newValue);
  4678. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4679. stack['delete'](srcValue);
  4680. }
  4681. assignMergeValue(object, key, newValue);
  4682. }
  4683. /**
  4684. * The base implementation of `_.nth` which doesn't coerce arguments.
  4685. *
  4686. * @private
  4687. * @param {Array} array The array to query.
  4688. * @param {number} n The index of the element to return.
  4689. * @returns {*} Returns the nth element of `array`.
  4690. */
  4691. function baseNth(array, n) {
  4692. var length = array.length;
  4693. if (!length) {
  4694. return;
  4695. }
  4696. n += n < 0 ? length : 0;
  4697. return isIndex(n, length) ? array[n] : undefined;
  4698. }
  4699. /**
  4700. * The base implementation of `_.orderBy` without param guards.
  4701. *
  4702. * @private
  4703. * @param {Array|Object} collection The collection to iterate over.
  4704. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4705. * @param {string[]} orders The sort orders of `iteratees`.
  4706. * @returns {Array} Returns the new sorted array.
  4707. */
  4708. function baseOrderBy(collection, iteratees, orders) {
  4709. if (iteratees.length) {
  4710. iteratees = arrayMap(iteratees, function(iteratee) {
  4711. if (isArray(iteratee)) {
  4712. return function(value) {
  4713. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4714. }
  4715. }
  4716. return iteratee;
  4717. });
  4718. } else {
  4719. iteratees = [identity];
  4720. }
  4721. var index = -1;
  4722. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4723. var result = baseMap(collection, function(value, key, collection) {
  4724. var criteria = arrayMap(iteratees, function(iteratee) {
  4725. return iteratee(value);
  4726. });
  4727. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4728. });
  4729. return baseSortBy(result, function(object, other) {
  4730. return compareMultiple(object, other, orders);
  4731. });
  4732. }
  4733. /**
  4734. * The base implementation of `_.pick` without support for individual
  4735. * property identifiers.
  4736. *
  4737. * @private
  4738. * @param {Object} object The source object.
  4739. * @param {string[]} paths The property paths to pick.
  4740. * @returns {Object} Returns the new object.
  4741. */
  4742. function basePick(object, paths) {
  4743. return basePickBy(object, paths, function(value, path) {
  4744. return hasIn(object, path);
  4745. });
  4746. }
  4747. /**
  4748. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4749. *
  4750. * @private
  4751. * @param {Object} object The source object.
  4752. * @param {string[]} paths The property paths to pick.
  4753. * @param {Function} predicate The function invoked per property.
  4754. * @returns {Object} Returns the new object.
  4755. */
  4756. function basePickBy(object, paths, predicate) {
  4757. var index = -1,
  4758. length = paths.length,
  4759. result = {};
  4760. while (++index < length) {
  4761. var path = paths[index],
  4762. value = baseGet(object, path);
  4763. if (predicate(value, path)) {
  4764. baseSet(result, castPath(path, object), value);
  4765. }
  4766. }
  4767. return result;
  4768. }
  4769. /**
  4770. * A specialized version of `baseProperty` which supports deep paths.
  4771. *
  4772. * @private
  4773. * @param {Array|string} path The path of the property to get.
  4774. * @returns {Function} Returns the new accessor function.
  4775. */
  4776. function basePropertyDeep(path) {
  4777. return function(object) {
  4778. return baseGet(object, path);
  4779. };
  4780. }
  4781. /**
  4782. * The base implementation of `_.pullAllBy` without support for iteratee
  4783. * shorthands.
  4784. *
  4785. * @private
  4786. * @param {Array} array The array to modify.
  4787. * @param {Array} values The values to remove.
  4788. * @param {Function} [iteratee] The iteratee invoked per element.
  4789. * @param {Function} [comparator] The comparator invoked per element.
  4790. * @returns {Array} Returns `array`.
  4791. */
  4792. function basePullAll(array, values, iteratee, comparator) {
  4793. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4794. index = -1,
  4795. length = values.length,
  4796. seen = array;
  4797. if (array === values) {
  4798. values = copyArray(values);
  4799. }
  4800. if (iteratee) {
  4801. seen = arrayMap(array, baseUnary(iteratee));
  4802. }
  4803. while (++index < length) {
  4804. var fromIndex = 0,
  4805. value = values[index],
  4806. computed = iteratee ? iteratee(value) : value;
  4807. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4808. if (seen !== array) {
  4809. splice.call(seen, fromIndex, 1);
  4810. }
  4811. splice.call(array, fromIndex, 1);
  4812. }
  4813. }
  4814. return array;
  4815. }
  4816. /**
  4817. * The base implementation of `_.pullAt` without support for individual
  4818. * indexes or capturing the removed elements.
  4819. *
  4820. * @private
  4821. * @param {Array} array The array to modify.
  4822. * @param {number[]} indexes The indexes of elements to remove.
  4823. * @returns {Array} Returns `array`.
  4824. */
  4825. function basePullAt(array, indexes) {
  4826. var length = array ? indexes.length : 0,
  4827. lastIndex = length - 1;
  4828. while (length--) {
  4829. var index = indexes[length];
  4830. if (length == lastIndex || index !== previous) {
  4831. var previous = index;
  4832. if (isIndex(index)) {
  4833. splice.call(array, index, 1);
  4834. } else {
  4835. baseUnset(array, index);
  4836. }
  4837. }
  4838. }
  4839. return array;
  4840. }
  4841. /**
  4842. * The base implementation of `_.random` without support for returning
  4843. * floating-point numbers.
  4844. *
  4845. * @private
  4846. * @param {number} lower The lower bound.
  4847. * @param {number} upper The upper bound.
  4848. * @returns {number} Returns the random number.
  4849. */
  4850. function baseRandom(lower, upper) {
  4851. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4852. }
  4853. /**
  4854. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4855. * coerce arguments.
  4856. *
  4857. * @private
  4858. * @param {number} start The start of the range.
  4859. * @param {number} end The end of the range.
  4860. * @param {number} step The value to increment or decrement by.
  4861. * @param {boolean} [fromRight] Specify iterating from right to left.
  4862. * @returns {Array} Returns the range of numbers.
  4863. */
  4864. function baseRange(start, end, step, fromRight) {
  4865. var index = -1,
  4866. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4867. result = Array(length);
  4868. while (length--) {
  4869. result[fromRight ? length : ++index] = start;
  4870. start += step;
  4871. }
  4872. return result;
  4873. }
  4874. /**
  4875. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4876. *
  4877. * @private
  4878. * @param {string} string The string to repeat.
  4879. * @param {number} n The number of times to repeat the string.
  4880. * @returns {string} Returns the repeated string.
  4881. */
  4882. function baseRepeat(string, n) {
  4883. var result = '';
  4884. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4885. return result;
  4886. }
  4887. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4888. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4889. do {
  4890. if (n % 2) {
  4891. result += string;
  4892. }
  4893. n = nativeFloor(n / 2);
  4894. if (n) {
  4895. string += string;
  4896. }
  4897. } while (n);
  4898. return result;
  4899. }
  4900. /**
  4901. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4902. *
  4903. * @private
  4904. * @param {Function} func The function to apply a rest parameter to.
  4905. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4906. * @returns {Function} Returns the new function.
  4907. */
  4908. function baseRest(func, start) {
  4909. return setToString(overRest(func, start, identity), func + '');
  4910. }
  4911. /**
  4912. * The base implementation of `_.sample`.
  4913. *
  4914. * @private
  4915. * @param {Array|Object} collection The collection to sample.
  4916. * @returns {*} Returns the random element.
  4917. */
  4918. function baseSample(collection) {
  4919. return arraySample(values(collection));
  4920. }
  4921. /**
  4922. * The base implementation of `_.sampleSize` without param guards.
  4923. *
  4924. * @private
  4925. * @param {Array|Object} collection The collection to sample.
  4926. * @param {number} n The number of elements to sample.
  4927. * @returns {Array} Returns the random elements.
  4928. */
  4929. function baseSampleSize(collection, n) {
  4930. var array = values(collection);
  4931. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4932. }
  4933. /**
  4934. * The base implementation of `_.set`.
  4935. *
  4936. * @private
  4937. * @param {Object} object The object to modify.
  4938. * @param {Array|string} path The path of the property to set.
  4939. * @param {*} value The value to set.
  4940. * @param {Function} [customizer] The function to customize path creation.
  4941. * @returns {Object} Returns `object`.
  4942. */
  4943. function baseSet(object, path, value, customizer) {
  4944. if (!isObject(object)) {
  4945. return object;
  4946. }
  4947. path = castPath(path, object);
  4948. var index = -1,
  4949. length = path.length,
  4950. lastIndex = length - 1,
  4951. nested = object;
  4952. while (nested != null && ++index < length) {
  4953. var key = toKey(path[index]),
  4954. newValue = value;
  4955. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4956. return object;
  4957. }
  4958. if (index != lastIndex) {
  4959. var objValue = nested[key];
  4960. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4961. if (newValue === undefined) {
  4962. newValue = isObject(objValue)
  4963. ? objValue
  4964. : (isIndex(path[index + 1]) ? [] : {});
  4965. }
  4966. }
  4967. assignValue(nested, key, newValue);
  4968. nested = nested[key];
  4969. }
  4970. return object;
  4971. }
  4972. /**
  4973. * The base implementation of `setData` without support for hot loop shorting.
  4974. *
  4975. * @private
  4976. * @param {Function} func The function to associate metadata with.
  4977. * @param {*} data The metadata.
  4978. * @returns {Function} Returns `func`.
  4979. */
  4980. var baseSetData = !metaMap ? identity : function(func, data) {
  4981. metaMap.set(func, data);
  4982. return func;
  4983. };
  4984. /**
  4985. * The base implementation of `setToString` without support for hot loop shorting.
  4986. *
  4987. * @private
  4988. * @param {Function} func The function to modify.
  4989. * @param {Function} string The `toString` result.
  4990. * @returns {Function} Returns `func`.
  4991. */
  4992. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4993. return defineProperty(func, 'toString', {
  4994. 'configurable': true,
  4995. 'enumerable': false,
  4996. 'value': constant(string),
  4997. 'writable': true
  4998. });
  4999. };
  5000. /**
  5001. * The base implementation of `_.shuffle`.
  5002. *
  5003. * @private
  5004. * @param {Array|Object} collection The collection to shuffle.
  5005. * @returns {Array} Returns the new shuffled array.
  5006. */
  5007. function baseShuffle(collection) {
  5008. return shuffleSelf(values(collection));
  5009. }
  5010. /**
  5011. * The base implementation of `_.slice` without an iteratee call guard.
  5012. *
  5013. * @private
  5014. * @param {Array} array The array to slice.
  5015. * @param {number} [start=0] The start position.
  5016. * @param {number} [end=array.length] The end position.
  5017. * @returns {Array} Returns the slice of `array`.
  5018. */
  5019. function baseSlice(array, start, end) {
  5020. var index = -1,
  5021. length = array.length;
  5022. if (start < 0) {
  5023. start = -start > length ? 0 : (length + start);
  5024. }
  5025. end = end > length ? length : end;
  5026. if (end < 0) {
  5027. end += length;
  5028. }
  5029. length = start > end ? 0 : ((end - start) >>> 0);
  5030. start >>>= 0;
  5031. var result = Array(length);
  5032. while (++index < length) {
  5033. result[index] = array[index + start];
  5034. }
  5035. return result;
  5036. }
  5037. /**
  5038. * The base implementation of `_.some` without support for iteratee shorthands.
  5039. *
  5040. * @private
  5041. * @param {Array|Object} collection The collection to iterate over.
  5042. * @param {Function} predicate The function invoked per iteration.
  5043. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5044. * else `false`.
  5045. */
  5046. function baseSome(collection, predicate) {
  5047. var result;
  5048. baseEach(collection, function(value, index, collection) {
  5049. result = predicate(value, index, collection);
  5050. return !result;
  5051. });
  5052. return !!result;
  5053. }
  5054. /**
  5055. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5056. * performs a binary search of `array` to determine the index at which `value`
  5057. * should be inserted into `array` in order to maintain its sort order.
  5058. *
  5059. * @private
  5060. * @param {Array} array The sorted array to inspect.
  5061. * @param {*} value The value to evaluate.
  5062. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5063. * @returns {number} Returns the index at which `value` should be inserted
  5064. * into `array`.
  5065. */
  5066. function baseSortedIndex(array, value, retHighest) {
  5067. var low = 0,
  5068. high = array == null ? low : array.length;
  5069. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5070. while (low < high) {
  5071. var mid = (low + high) >>> 1,
  5072. computed = array[mid];
  5073. if (computed !== null && !isSymbol(computed) &&
  5074. (retHighest ? (computed <= value) : (computed < value))) {
  5075. low = mid + 1;
  5076. } else {
  5077. high = mid;
  5078. }
  5079. }
  5080. return high;
  5081. }
  5082. return baseSortedIndexBy(array, value, identity, retHighest);
  5083. }
  5084. /**
  5085. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5086. * which invokes `iteratee` for `value` and each element of `array` to compute
  5087. * their sort ranking. The iteratee is invoked with one argument; (value).
  5088. *
  5089. * @private
  5090. * @param {Array} array The sorted array to inspect.
  5091. * @param {*} value The value to evaluate.
  5092. * @param {Function} iteratee The iteratee invoked per element.
  5093. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5094. * @returns {number} Returns the index at which `value` should be inserted
  5095. * into `array`.
  5096. */
  5097. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5098. var low = 0,
  5099. high = array == null ? 0 : array.length;
  5100. if (high === 0) {
  5101. return 0;
  5102. }
  5103. value = iteratee(value);
  5104. var valIsNaN = value !== value,
  5105. valIsNull = value === null,
  5106. valIsSymbol = isSymbol(value),
  5107. valIsUndefined = value === undefined;
  5108. while (low < high) {
  5109. var mid = nativeFloor((low + high) / 2),
  5110. computed = iteratee(array[mid]),
  5111. othIsDefined = computed !== undefined,
  5112. othIsNull = computed === null,
  5113. othIsReflexive = computed === computed,
  5114. othIsSymbol = isSymbol(computed);
  5115. if (valIsNaN) {
  5116. var setLow = retHighest || othIsReflexive;
  5117. } else if (valIsUndefined) {
  5118. setLow = othIsReflexive && (retHighest || othIsDefined);
  5119. } else if (valIsNull) {
  5120. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5121. } else if (valIsSymbol) {
  5122. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5123. } else if (othIsNull || othIsSymbol) {
  5124. setLow = false;
  5125. } else {
  5126. setLow = retHighest ? (computed <= value) : (computed < value);
  5127. }
  5128. if (setLow) {
  5129. low = mid + 1;
  5130. } else {
  5131. high = mid;
  5132. }
  5133. }
  5134. return nativeMin(high, MAX_ARRAY_INDEX);
  5135. }
  5136. /**
  5137. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5138. * support for iteratee shorthands.
  5139. *
  5140. * @private
  5141. * @param {Array} array The array to inspect.
  5142. * @param {Function} [iteratee] The iteratee invoked per element.
  5143. * @returns {Array} Returns the new duplicate free array.
  5144. */
  5145. function baseSortedUniq(array, iteratee) {
  5146. var index = -1,
  5147. length = array.length,
  5148. resIndex = 0,
  5149. result = [];
  5150. while (++index < length) {
  5151. var value = array[index],
  5152. computed = iteratee ? iteratee(value) : value;
  5153. if (!index || !eq(computed, seen)) {
  5154. var seen = computed;
  5155. result[resIndex++] = value === 0 ? 0 : value;
  5156. }
  5157. }
  5158. return result;
  5159. }
  5160. /**
  5161. * The base implementation of `_.toNumber` which doesn't ensure correct
  5162. * conversions of binary, hexadecimal, or octal string values.
  5163. *
  5164. * @private
  5165. * @param {*} value The value to process.
  5166. * @returns {number} Returns the number.
  5167. */
  5168. function baseToNumber(value) {
  5169. if (typeof value == 'number') {
  5170. return value;
  5171. }
  5172. if (isSymbol(value)) {
  5173. return NAN;
  5174. }
  5175. return +value;
  5176. }
  5177. /**
  5178. * The base implementation of `_.toString` which doesn't convert nullish
  5179. * values to empty strings.
  5180. *
  5181. * @private
  5182. * @param {*} value The value to process.
  5183. * @returns {string} Returns the string.
  5184. */
  5185. function baseToString(value) {
  5186. // Exit early for strings to avoid a performance hit in some environments.
  5187. if (typeof value == 'string') {
  5188. return value;
  5189. }
  5190. if (isArray(value)) {
  5191. // Recursively convert values (susceptible to call stack limits).
  5192. return arrayMap(value, baseToString) + '';
  5193. }
  5194. if (isSymbol(value)) {
  5195. return symbolToString ? symbolToString.call(value) : '';
  5196. }
  5197. var result = (value + '');
  5198. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5199. }
  5200. /**
  5201. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5202. *
  5203. * @private
  5204. * @param {Array} array The array to inspect.
  5205. * @param {Function} [iteratee] The iteratee invoked per element.
  5206. * @param {Function} [comparator] The comparator invoked per element.
  5207. * @returns {Array} Returns the new duplicate free array.
  5208. */
  5209. function baseUniq(array, iteratee, comparator) {
  5210. var index = -1,
  5211. includes = arrayIncludes,
  5212. length = array.length,
  5213. isCommon = true,
  5214. result = [],
  5215. seen = result;
  5216. if (comparator) {
  5217. isCommon = false;
  5218. includes = arrayIncludesWith;
  5219. }
  5220. else if (length >= LARGE_ARRAY_SIZE) {
  5221. var set = iteratee ? null : createSet(array);
  5222. if (set) {
  5223. return setToArray(set);
  5224. }
  5225. isCommon = false;
  5226. includes = cacheHas;
  5227. seen = new SetCache;
  5228. }
  5229. else {
  5230. seen = iteratee ? [] : result;
  5231. }
  5232. outer:
  5233. while (++index < length) {
  5234. var value = array[index],
  5235. computed = iteratee ? iteratee(value) : value;
  5236. value = (comparator || value !== 0) ? value : 0;
  5237. if (isCommon && computed === computed) {
  5238. var seenIndex = seen.length;
  5239. while (seenIndex--) {
  5240. if (seen[seenIndex] === computed) {
  5241. continue outer;
  5242. }
  5243. }
  5244. if (iteratee) {
  5245. seen.push(computed);
  5246. }
  5247. result.push(value);
  5248. }
  5249. else if (!includes(seen, computed, comparator)) {
  5250. if (seen !== result) {
  5251. seen.push(computed);
  5252. }
  5253. result.push(value);
  5254. }
  5255. }
  5256. return result;
  5257. }
  5258. /**
  5259. * The base implementation of `_.unset`.
  5260. *
  5261. * @private
  5262. * @param {Object} object The object to modify.
  5263. * @param {Array|string} path The property path to unset.
  5264. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5265. */
  5266. function baseUnset(object, path) {
  5267. path = castPath(path, object);
  5268. object = parent(object, path);
  5269. return object == null || delete object[toKey(last(path))];
  5270. }
  5271. /**
  5272. * The base implementation of `_.update`.
  5273. *
  5274. * @private
  5275. * @param {Object} object The object to modify.
  5276. * @param {Array|string} path The path of the property to update.
  5277. * @param {Function} updater The function to produce the updated value.
  5278. * @param {Function} [customizer] The function to customize path creation.
  5279. * @returns {Object} Returns `object`.
  5280. */
  5281. function baseUpdate(object, path, updater, customizer) {
  5282. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5283. }
  5284. /**
  5285. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5286. * without support for iteratee shorthands.
  5287. *
  5288. * @private
  5289. * @param {Array} array The array to query.
  5290. * @param {Function} predicate The function invoked per iteration.
  5291. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5292. * @param {boolean} [fromRight] Specify iterating from right to left.
  5293. * @returns {Array} Returns the slice of `array`.
  5294. */
  5295. function baseWhile(array, predicate, isDrop, fromRight) {
  5296. var length = array.length,
  5297. index = fromRight ? length : -1;
  5298. while ((fromRight ? index-- : ++index < length) &&
  5299. predicate(array[index], index, array)) {}
  5300. return isDrop
  5301. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5302. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5303. }
  5304. /**
  5305. * The base implementation of `wrapperValue` which returns the result of
  5306. * performing a sequence of actions on the unwrapped `value`, where each
  5307. * successive action is supplied the return value of the previous.
  5308. *
  5309. * @private
  5310. * @param {*} value The unwrapped value.
  5311. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5312. * @returns {*} Returns the resolved value.
  5313. */
  5314. function baseWrapperValue(value, actions) {
  5315. var result = value;
  5316. if (result instanceof LazyWrapper) {
  5317. result = result.value();
  5318. }
  5319. return arrayReduce(actions, function(result, action) {
  5320. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5321. }, result);
  5322. }
  5323. /**
  5324. * The base implementation of methods like `_.xor`, without support for
  5325. * iteratee shorthands, that accepts an array of arrays to inspect.
  5326. *
  5327. * @private
  5328. * @param {Array} arrays The arrays to inspect.
  5329. * @param {Function} [iteratee] The iteratee invoked per element.
  5330. * @param {Function} [comparator] The comparator invoked per element.
  5331. * @returns {Array} Returns the new array of values.
  5332. */
  5333. function baseXor(arrays, iteratee, comparator) {
  5334. var length = arrays.length;
  5335. if (length < 2) {
  5336. return length ? baseUniq(arrays[0]) : [];
  5337. }
  5338. var index = -1,
  5339. result = Array(length);
  5340. while (++index < length) {
  5341. var array = arrays[index],
  5342. othIndex = -1;
  5343. while (++othIndex < length) {
  5344. if (othIndex != index) {
  5345. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5346. }
  5347. }
  5348. }
  5349. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5350. }
  5351. /**
  5352. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5353. *
  5354. * @private
  5355. * @param {Array} props The property identifiers.
  5356. * @param {Array} values The property values.
  5357. * @param {Function} assignFunc The function to assign values.
  5358. * @returns {Object} Returns the new object.
  5359. */
  5360. function baseZipObject(props, values, assignFunc) {
  5361. var index = -1,
  5362. length = props.length,
  5363. valsLength = values.length,
  5364. result = {};
  5365. while (++index < length) {
  5366. var value = index < valsLength ? values[index] : undefined;
  5367. assignFunc(result, props[index], value);
  5368. }
  5369. return result;
  5370. }
  5371. /**
  5372. * Casts `value` to an empty array if it's not an array like object.
  5373. *
  5374. * @private
  5375. * @param {*} value The value to inspect.
  5376. * @returns {Array|Object} Returns the cast array-like object.
  5377. */
  5378. function castArrayLikeObject(value) {
  5379. return isArrayLikeObject(value) ? value : [];
  5380. }
  5381. /**
  5382. * Casts `value` to `identity` if it's not a function.
  5383. *
  5384. * @private
  5385. * @param {*} value The value to inspect.
  5386. * @returns {Function} Returns cast function.
  5387. */
  5388. function castFunction(value) {
  5389. return typeof value == 'function' ? value : identity;
  5390. }
  5391. /**
  5392. * Casts `value` to a path array if it's not one.
  5393. *
  5394. * @private
  5395. * @param {*} value The value to inspect.
  5396. * @param {Object} [object] The object to query keys on.
  5397. * @returns {Array} Returns the cast property path array.
  5398. */
  5399. function castPath(value, object) {
  5400. if (isArray(value)) {
  5401. return value;
  5402. }
  5403. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5404. }
  5405. /**
  5406. * A `baseRest` alias which can be replaced with `identity` by module
  5407. * replacement plugins.
  5408. *
  5409. * @private
  5410. * @type {Function}
  5411. * @param {Function} func The function to apply a rest parameter to.
  5412. * @returns {Function} Returns the new function.
  5413. */
  5414. var castRest = baseRest;
  5415. /**
  5416. * Casts `array` to a slice if it's needed.
  5417. *
  5418. * @private
  5419. * @param {Array} array The array to inspect.
  5420. * @param {number} start The start position.
  5421. * @param {number} [end=array.length] The end position.
  5422. * @returns {Array} Returns the cast slice.
  5423. */
  5424. function castSlice(array, start, end) {
  5425. var length = array.length;
  5426. end = end === undefined ? length : end;
  5427. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5428. }
  5429. /**
  5430. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5431. *
  5432. * @private
  5433. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5434. */
  5435. var clearTimeout = ctxClearTimeout || function(id) {
  5436. return root.clearTimeout(id);
  5437. };
  5438. /**
  5439. * Creates a clone of `buffer`.
  5440. *
  5441. * @private
  5442. * @param {Buffer} buffer The buffer to clone.
  5443. * @param {boolean} [isDeep] Specify a deep clone.
  5444. * @returns {Buffer} Returns the cloned buffer.
  5445. */
  5446. function cloneBuffer(buffer, isDeep) {
  5447. if (isDeep) {
  5448. return buffer.slice();
  5449. }
  5450. var length = buffer.length,
  5451. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5452. buffer.copy(result);
  5453. return result;
  5454. }
  5455. /**
  5456. * Creates a clone of `arrayBuffer`.
  5457. *
  5458. * @private
  5459. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5460. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5461. */
  5462. function cloneArrayBuffer(arrayBuffer) {
  5463. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5464. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5465. return result;
  5466. }
  5467. /**
  5468. * Creates a clone of `dataView`.
  5469. *
  5470. * @private
  5471. * @param {Object} dataView The data view to clone.
  5472. * @param {boolean} [isDeep] Specify a deep clone.
  5473. * @returns {Object} Returns the cloned data view.
  5474. */
  5475. function cloneDataView(dataView, isDeep) {
  5476. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5477. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5478. }
  5479. /**
  5480. * Creates a clone of `regexp`.
  5481. *
  5482. * @private
  5483. * @param {Object} regexp The regexp to clone.
  5484. * @returns {Object} Returns the cloned regexp.
  5485. */
  5486. function cloneRegExp(regexp) {
  5487. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5488. result.lastIndex = regexp.lastIndex;
  5489. return result;
  5490. }
  5491. /**
  5492. * Creates a clone of the `symbol` object.
  5493. *
  5494. * @private
  5495. * @param {Object} symbol The symbol object to clone.
  5496. * @returns {Object} Returns the cloned symbol object.
  5497. */
  5498. function cloneSymbol(symbol) {
  5499. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5500. }
  5501. /**
  5502. * Creates a clone of `typedArray`.
  5503. *
  5504. * @private
  5505. * @param {Object} typedArray The typed array to clone.
  5506. * @param {boolean} [isDeep] Specify a deep clone.
  5507. * @returns {Object} Returns the cloned typed array.
  5508. */
  5509. function cloneTypedArray(typedArray, isDeep) {
  5510. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5511. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5512. }
  5513. /**
  5514. * Compares values to sort them in ascending order.
  5515. *
  5516. * @private
  5517. * @param {*} value The value to compare.
  5518. * @param {*} other The other value to compare.
  5519. * @returns {number} Returns the sort order indicator for `value`.
  5520. */
  5521. function compareAscending(value, other) {
  5522. if (value !== other) {
  5523. var valIsDefined = value !== undefined,
  5524. valIsNull = value === null,
  5525. valIsReflexive = value === value,
  5526. valIsSymbol = isSymbol(value);
  5527. var othIsDefined = other !== undefined,
  5528. othIsNull = other === null,
  5529. othIsReflexive = other === other,
  5530. othIsSymbol = isSymbol(other);
  5531. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5532. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5533. (valIsNull && othIsDefined && othIsReflexive) ||
  5534. (!valIsDefined && othIsReflexive) ||
  5535. !valIsReflexive) {
  5536. return 1;
  5537. }
  5538. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5539. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5540. (othIsNull && valIsDefined && valIsReflexive) ||
  5541. (!othIsDefined && valIsReflexive) ||
  5542. !othIsReflexive) {
  5543. return -1;
  5544. }
  5545. }
  5546. return 0;
  5547. }
  5548. /**
  5549. * Used by `_.orderBy` to compare multiple properties of a value to another
  5550. * and stable sort them.
  5551. *
  5552. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5553. * specify an order of "desc" for descending or "asc" for ascending sort order
  5554. * of corresponding values.
  5555. *
  5556. * @private
  5557. * @param {Object} object The object to compare.
  5558. * @param {Object} other The other object to compare.
  5559. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5560. * @returns {number} Returns the sort order indicator for `object`.
  5561. */
  5562. function compareMultiple(object, other, orders) {
  5563. var index = -1,
  5564. objCriteria = object.criteria,
  5565. othCriteria = other.criteria,
  5566. length = objCriteria.length,
  5567. ordersLength = orders.length;
  5568. while (++index < length) {
  5569. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5570. if (result) {
  5571. if (index >= ordersLength) {
  5572. return result;
  5573. }
  5574. var order = orders[index];
  5575. return result * (order == 'desc' ? -1 : 1);
  5576. }
  5577. }
  5578. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5579. // that causes it, under certain circumstances, to provide the same value for
  5580. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5581. // for more details.
  5582. //
  5583. // This also ensures a stable sort in V8 and other engines.
  5584. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5585. return object.index - other.index;
  5586. }
  5587. /**
  5588. * Creates an array that is the composition of partially applied arguments,
  5589. * placeholders, and provided arguments into a single array of arguments.
  5590. *
  5591. * @private
  5592. * @param {Array} args The provided arguments.
  5593. * @param {Array} partials The arguments to prepend to those provided.
  5594. * @param {Array} holders The `partials` placeholder indexes.
  5595. * @params {boolean} [isCurried] Specify composing for a curried function.
  5596. * @returns {Array} Returns the new array of composed arguments.
  5597. */
  5598. function composeArgs(args, partials, holders, isCurried) {
  5599. var argsIndex = -1,
  5600. argsLength = args.length,
  5601. holdersLength = holders.length,
  5602. leftIndex = -1,
  5603. leftLength = partials.length,
  5604. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5605. result = Array(leftLength + rangeLength),
  5606. isUncurried = !isCurried;
  5607. while (++leftIndex < leftLength) {
  5608. result[leftIndex] = partials[leftIndex];
  5609. }
  5610. while (++argsIndex < holdersLength) {
  5611. if (isUncurried || argsIndex < argsLength) {
  5612. result[holders[argsIndex]] = args[argsIndex];
  5613. }
  5614. }
  5615. while (rangeLength--) {
  5616. result[leftIndex++] = args[argsIndex++];
  5617. }
  5618. return result;
  5619. }
  5620. /**
  5621. * This function is like `composeArgs` except that the arguments composition
  5622. * is tailored for `_.partialRight`.
  5623. *
  5624. * @private
  5625. * @param {Array} args The provided arguments.
  5626. * @param {Array} partials The arguments to append to those provided.
  5627. * @param {Array} holders The `partials` placeholder indexes.
  5628. * @params {boolean} [isCurried] Specify composing for a curried function.
  5629. * @returns {Array} Returns the new array of composed arguments.
  5630. */
  5631. function composeArgsRight(args, partials, holders, isCurried) {
  5632. var argsIndex = -1,
  5633. argsLength = args.length,
  5634. holdersIndex = -1,
  5635. holdersLength = holders.length,
  5636. rightIndex = -1,
  5637. rightLength = partials.length,
  5638. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5639. result = Array(rangeLength + rightLength),
  5640. isUncurried = !isCurried;
  5641. while (++argsIndex < rangeLength) {
  5642. result[argsIndex] = args[argsIndex];
  5643. }
  5644. var offset = argsIndex;
  5645. while (++rightIndex < rightLength) {
  5646. result[offset + rightIndex] = partials[rightIndex];
  5647. }
  5648. while (++holdersIndex < holdersLength) {
  5649. if (isUncurried || argsIndex < argsLength) {
  5650. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5651. }
  5652. }
  5653. return result;
  5654. }
  5655. /**
  5656. * Copies the values of `source` to `array`.
  5657. *
  5658. * @private
  5659. * @param {Array} source The array to copy values from.
  5660. * @param {Array} [array=[]] The array to copy values to.
  5661. * @returns {Array} Returns `array`.
  5662. */
  5663. function copyArray(source, array) {
  5664. var index = -1,
  5665. length = source.length;
  5666. array || (array = Array(length));
  5667. while (++index < length) {
  5668. array[index] = source[index];
  5669. }
  5670. return array;
  5671. }
  5672. /**
  5673. * Copies properties of `source` to `object`.
  5674. *
  5675. * @private
  5676. * @param {Object} source The object to copy properties from.
  5677. * @param {Array} props The property identifiers to copy.
  5678. * @param {Object} [object={}] The object to copy properties to.
  5679. * @param {Function} [customizer] The function to customize copied values.
  5680. * @returns {Object} Returns `object`.
  5681. */
  5682. function copyObject(source, props, object, customizer) {
  5683. var isNew = !object;
  5684. object || (object = {});
  5685. var index = -1,
  5686. length = props.length;
  5687. while (++index < length) {
  5688. var key = props[index];
  5689. var newValue = customizer
  5690. ? customizer(object[key], source[key], key, object, source)
  5691. : undefined;
  5692. if (newValue === undefined) {
  5693. newValue = source[key];
  5694. }
  5695. if (isNew) {
  5696. baseAssignValue(object, key, newValue);
  5697. } else {
  5698. assignValue(object, key, newValue);
  5699. }
  5700. }
  5701. return object;
  5702. }
  5703. /**
  5704. * Copies own symbols of `source` to `object`.
  5705. *
  5706. * @private
  5707. * @param {Object} source The object to copy symbols from.
  5708. * @param {Object} [object={}] The object to copy symbols to.
  5709. * @returns {Object} Returns `object`.
  5710. */
  5711. function copySymbols(source, object) {
  5712. return copyObject(source, getSymbols(source), object);
  5713. }
  5714. /**
  5715. * Copies own and inherited symbols of `source` to `object`.
  5716. *
  5717. * @private
  5718. * @param {Object} source The object to copy symbols from.
  5719. * @param {Object} [object={}] The object to copy symbols to.
  5720. * @returns {Object} Returns `object`.
  5721. */
  5722. function copySymbolsIn(source, object) {
  5723. return copyObject(source, getSymbolsIn(source), object);
  5724. }
  5725. /**
  5726. * Creates a function like `_.groupBy`.
  5727. *
  5728. * @private
  5729. * @param {Function} setter The function to set accumulator values.
  5730. * @param {Function} [initializer] The accumulator object initializer.
  5731. * @returns {Function} Returns the new aggregator function.
  5732. */
  5733. function createAggregator(setter, initializer) {
  5734. return function(collection, iteratee) {
  5735. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5736. accumulator = initializer ? initializer() : {};
  5737. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5738. };
  5739. }
  5740. /**
  5741. * Creates a function like `_.assign`.
  5742. *
  5743. * @private
  5744. * @param {Function} assigner The function to assign values.
  5745. * @returns {Function} Returns the new assigner function.
  5746. */
  5747. function createAssigner(assigner) {
  5748. return baseRest(function(object, sources) {
  5749. var index = -1,
  5750. length = sources.length,
  5751. customizer = length > 1 ? sources[length - 1] : undefined,
  5752. guard = length > 2 ? sources[2] : undefined;
  5753. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5754. ? (length--, customizer)
  5755. : undefined;
  5756. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5757. customizer = length < 3 ? undefined : customizer;
  5758. length = 1;
  5759. }
  5760. object = Object(object);
  5761. while (++index < length) {
  5762. var source = sources[index];
  5763. if (source) {
  5764. assigner(object, source, index, customizer);
  5765. }
  5766. }
  5767. return object;
  5768. });
  5769. }
  5770. /**
  5771. * Creates a `baseEach` or `baseEachRight` function.
  5772. *
  5773. * @private
  5774. * @param {Function} eachFunc The function to iterate over a collection.
  5775. * @param {boolean} [fromRight] Specify iterating from right to left.
  5776. * @returns {Function} Returns the new base function.
  5777. */
  5778. function createBaseEach(eachFunc, fromRight) {
  5779. return function(collection, iteratee) {
  5780. if (collection == null) {
  5781. return collection;
  5782. }
  5783. if (!isArrayLike(collection)) {
  5784. return eachFunc(collection, iteratee);
  5785. }
  5786. var length = collection.length,
  5787. index = fromRight ? length : -1,
  5788. iterable = Object(collection);
  5789. while ((fromRight ? index-- : ++index < length)) {
  5790. if (iteratee(iterable[index], index, iterable) === false) {
  5791. break;
  5792. }
  5793. }
  5794. return collection;
  5795. };
  5796. }
  5797. /**
  5798. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5799. *
  5800. * @private
  5801. * @param {boolean} [fromRight] Specify iterating from right to left.
  5802. * @returns {Function} Returns the new base function.
  5803. */
  5804. function createBaseFor(fromRight) {
  5805. return function(object, iteratee, keysFunc) {
  5806. var index = -1,
  5807. iterable = Object(object),
  5808. props = keysFunc(object),
  5809. length = props.length;
  5810. while (length--) {
  5811. var key = props[fromRight ? length : ++index];
  5812. if (iteratee(iterable[key], key, iterable) === false) {
  5813. break;
  5814. }
  5815. }
  5816. return object;
  5817. };
  5818. }
  5819. /**
  5820. * Creates a function that wraps `func` to invoke it with the optional `this`
  5821. * binding of `thisArg`.
  5822. *
  5823. * @private
  5824. * @param {Function} func The function to wrap.
  5825. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5826. * @param {*} [thisArg] The `this` binding of `func`.
  5827. * @returns {Function} Returns the new wrapped function.
  5828. */
  5829. function createBind(func, bitmask, thisArg) {
  5830. var isBind = bitmask & WRAP_BIND_FLAG,
  5831. Ctor = createCtor(func);
  5832. function wrapper() {
  5833. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5834. return fn.apply(isBind ? thisArg : this, arguments);
  5835. }
  5836. return wrapper;
  5837. }
  5838. /**
  5839. * Creates a function like `_.lowerFirst`.
  5840. *
  5841. * @private
  5842. * @param {string} methodName The name of the `String` case method to use.
  5843. * @returns {Function} Returns the new case function.
  5844. */
  5845. function createCaseFirst(methodName) {
  5846. return function(string) {
  5847. string = toString(string);
  5848. var strSymbols = hasUnicode(string)
  5849. ? stringToArray(string)
  5850. : undefined;
  5851. var chr = strSymbols
  5852. ? strSymbols[0]
  5853. : string.charAt(0);
  5854. var trailing = strSymbols
  5855. ? castSlice(strSymbols, 1).join('')
  5856. : string.slice(1);
  5857. return chr[methodName]() + trailing;
  5858. };
  5859. }
  5860. /**
  5861. * Creates a function like `_.camelCase`.
  5862. *
  5863. * @private
  5864. * @param {Function} callback The function to combine each word.
  5865. * @returns {Function} Returns the new compounder function.
  5866. */
  5867. function createCompounder(callback) {
  5868. return function(string) {
  5869. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5870. };
  5871. }
  5872. /**
  5873. * Creates a function that produces an instance of `Ctor` regardless of
  5874. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5875. *
  5876. * @private
  5877. * @param {Function} Ctor The constructor to wrap.
  5878. * @returns {Function} Returns the new wrapped function.
  5879. */
  5880. function createCtor(Ctor) {
  5881. return function() {
  5882. // Use a `switch` statement to work with class constructors. See
  5883. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5884. // for more details.
  5885. var args = arguments;
  5886. switch (args.length) {
  5887. case 0: return new Ctor;
  5888. case 1: return new Ctor(args[0]);
  5889. case 2: return new Ctor(args[0], args[1]);
  5890. case 3: return new Ctor(args[0], args[1], args[2]);
  5891. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5892. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5893. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5894. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5895. }
  5896. var thisBinding = baseCreate(Ctor.prototype),
  5897. result = Ctor.apply(thisBinding, args);
  5898. // Mimic the constructor's `return` behavior.
  5899. // See https://es5.github.io/#x13.2.2 for more details.
  5900. return isObject(result) ? result : thisBinding;
  5901. };
  5902. }
  5903. /**
  5904. * Creates a function that wraps `func` to enable currying.
  5905. *
  5906. * @private
  5907. * @param {Function} func The function to wrap.
  5908. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5909. * @param {number} arity The arity of `func`.
  5910. * @returns {Function} Returns the new wrapped function.
  5911. */
  5912. function createCurry(func, bitmask, arity) {
  5913. var Ctor = createCtor(func);
  5914. function wrapper() {
  5915. var length = arguments.length,
  5916. args = Array(length),
  5917. index = length,
  5918. placeholder = getHolder(wrapper);
  5919. while (index--) {
  5920. args[index] = arguments[index];
  5921. }
  5922. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5923. ? []
  5924. : replaceHolders(args, placeholder);
  5925. length -= holders.length;
  5926. if (length < arity) {
  5927. return createRecurry(
  5928. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5929. args, holders, undefined, undefined, arity - length);
  5930. }
  5931. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5932. return apply(fn, this, args);
  5933. }
  5934. return wrapper;
  5935. }
  5936. /**
  5937. * Creates a `_.find` or `_.findLast` function.
  5938. *
  5939. * @private
  5940. * @param {Function} findIndexFunc The function to find the collection index.
  5941. * @returns {Function} Returns the new find function.
  5942. */
  5943. function createFind(findIndexFunc) {
  5944. return function(collection, predicate, fromIndex) {
  5945. var iterable = Object(collection);
  5946. if (!isArrayLike(collection)) {
  5947. var iteratee = getIteratee(predicate, 3);
  5948. collection = keys(collection);
  5949. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5950. }
  5951. var index = findIndexFunc(collection, predicate, fromIndex);
  5952. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5953. };
  5954. }
  5955. /**
  5956. * Creates a `_.flow` or `_.flowRight` function.
  5957. *
  5958. * @private
  5959. * @param {boolean} [fromRight] Specify iterating from right to left.
  5960. * @returns {Function} Returns the new flow function.
  5961. */
  5962. function createFlow(fromRight) {
  5963. return flatRest(function(funcs) {
  5964. var length = funcs.length,
  5965. index = length,
  5966. prereq = LodashWrapper.prototype.thru;
  5967. if (fromRight) {
  5968. funcs.reverse();
  5969. }
  5970. while (index--) {
  5971. var func = funcs[index];
  5972. if (typeof func != 'function') {
  5973. throw new TypeError(FUNC_ERROR_TEXT);
  5974. }
  5975. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5976. var wrapper = new LodashWrapper([], true);
  5977. }
  5978. }
  5979. index = wrapper ? index : length;
  5980. while (++index < length) {
  5981. func = funcs[index];
  5982. var funcName = getFuncName(func),
  5983. data = funcName == 'wrapper' ? getData(func) : undefined;
  5984. if (data && isLaziable(data[0]) &&
  5985. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5986. !data[4].length && data[9] == 1
  5987. ) {
  5988. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5989. } else {
  5990. wrapper = (func.length == 1 && isLaziable(func))
  5991. ? wrapper[funcName]()
  5992. : wrapper.thru(func);
  5993. }
  5994. }
  5995. return function() {
  5996. var args = arguments,
  5997. value = args[0];
  5998. if (wrapper && args.length == 1 && isArray(value)) {
  5999. return wrapper.plant(value).value();
  6000. }
  6001. var index = 0,
  6002. result = length ? funcs[index].apply(this, args) : value;
  6003. while (++index < length) {
  6004. result = funcs[index].call(this, result);
  6005. }
  6006. return result;
  6007. };
  6008. });
  6009. }
  6010. /**
  6011. * Creates a function that wraps `func` to invoke it with optional `this`
  6012. * binding of `thisArg`, partial application, and currying.
  6013. *
  6014. * @private
  6015. * @param {Function|string} func The function or method name to wrap.
  6016. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6017. * @param {*} [thisArg] The `this` binding of `func`.
  6018. * @param {Array} [partials] The arguments to prepend to those provided to
  6019. * the new function.
  6020. * @param {Array} [holders] The `partials` placeholder indexes.
  6021. * @param {Array} [partialsRight] The arguments to append to those provided
  6022. * to the new function.
  6023. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6024. * @param {Array} [argPos] The argument positions of the new function.
  6025. * @param {number} [ary] The arity cap of `func`.
  6026. * @param {number} [arity] The arity of `func`.
  6027. * @returns {Function} Returns the new wrapped function.
  6028. */
  6029. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6030. var isAry = bitmask & WRAP_ARY_FLAG,
  6031. isBind = bitmask & WRAP_BIND_FLAG,
  6032. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6033. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6034. isFlip = bitmask & WRAP_FLIP_FLAG,
  6035. Ctor = isBindKey ? undefined : createCtor(func);
  6036. function wrapper() {
  6037. var length = arguments.length,
  6038. args = Array(length),
  6039. index = length;
  6040. while (index--) {
  6041. args[index] = arguments[index];
  6042. }
  6043. if (isCurried) {
  6044. var placeholder = getHolder(wrapper),
  6045. holdersCount = countHolders(args, placeholder);
  6046. }
  6047. if (partials) {
  6048. args = composeArgs(args, partials, holders, isCurried);
  6049. }
  6050. if (partialsRight) {
  6051. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6052. }
  6053. length -= holdersCount;
  6054. if (isCurried && length < arity) {
  6055. var newHolders = replaceHolders(args, placeholder);
  6056. return createRecurry(
  6057. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6058. args, newHolders, argPos, ary, arity - length
  6059. );
  6060. }
  6061. var thisBinding = isBind ? thisArg : this,
  6062. fn = isBindKey ? thisBinding[func] : func;
  6063. length = args.length;
  6064. if (argPos) {
  6065. args = reorder(args, argPos);
  6066. } else if (isFlip && length > 1) {
  6067. args.reverse();
  6068. }
  6069. if (isAry && ary < length) {
  6070. args.length = ary;
  6071. }
  6072. if (this && this !== root && this instanceof wrapper) {
  6073. fn = Ctor || createCtor(fn);
  6074. }
  6075. return fn.apply(thisBinding, args);
  6076. }
  6077. return wrapper;
  6078. }
  6079. /**
  6080. * Creates a function like `_.invertBy`.
  6081. *
  6082. * @private
  6083. * @param {Function} setter The function to set accumulator values.
  6084. * @param {Function} toIteratee The function to resolve iteratees.
  6085. * @returns {Function} Returns the new inverter function.
  6086. */
  6087. function createInverter(setter, toIteratee) {
  6088. return function(object, iteratee) {
  6089. return baseInverter(object, setter, toIteratee(iteratee), {});
  6090. };
  6091. }
  6092. /**
  6093. * Creates a function that performs a mathematical operation on two values.
  6094. *
  6095. * @private
  6096. * @param {Function} operator The function to perform the operation.
  6097. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6098. * @returns {Function} Returns the new mathematical operation function.
  6099. */
  6100. function createMathOperation(operator, defaultValue) {
  6101. return function(value, other) {
  6102. var result;
  6103. if (value === undefined && other === undefined) {
  6104. return defaultValue;
  6105. }
  6106. if (value !== undefined) {
  6107. result = value;
  6108. }
  6109. if (other !== undefined) {
  6110. if (result === undefined) {
  6111. return other;
  6112. }
  6113. if (typeof value == 'string' || typeof other == 'string') {
  6114. value = baseToString(value);
  6115. other = baseToString(other);
  6116. } else {
  6117. value = baseToNumber(value);
  6118. other = baseToNumber(other);
  6119. }
  6120. result = operator(value, other);
  6121. }
  6122. return result;
  6123. };
  6124. }
  6125. /**
  6126. * Creates a function like `_.over`.
  6127. *
  6128. * @private
  6129. * @param {Function} arrayFunc The function to iterate over iteratees.
  6130. * @returns {Function} Returns the new over function.
  6131. */
  6132. function createOver(arrayFunc) {
  6133. return flatRest(function(iteratees) {
  6134. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6135. return baseRest(function(args) {
  6136. var thisArg = this;
  6137. return arrayFunc(iteratees, function(iteratee) {
  6138. return apply(iteratee, thisArg, args);
  6139. });
  6140. });
  6141. });
  6142. }
  6143. /**
  6144. * Creates the padding for `string` based on `length`. The `chars` string
  6145. * is truncated if the number of characters exceeds `length`.
  6146. *
  6147. * @private
  6148. * @param {number} length The padding length.
  6149. * @param {string} [chars=' '] The string used as padding.
  6150. * @returns {string} Returns the padding for `string`.
  6151. */
  6152. function createPadding(length, chars) {
  6153. chars = chars === undefined ? ' ' : baseToString(chars);
  6154. var charsLength = chars.length;
  6155. if (charsLength < 2) {
  6156. return charsLength ? baseRepeat(chars, length) : chars;
  6157. }
  6158. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6159. return hasUnicode(chars)
  6160. ? castSlice(stringToArray(result), 0, length).join('')
  6161. : result.slice(0, length);
  6162. }
  6163. /**
  6164. * Creates a function that wraps `func` to invoke it with the `this` binding
  6165. * of `thisArg` and `partials` prepended to the arguments it receives.
  6166. *
  6167. * @private
  6168. * @param {Function} func The function to wrap.
  6169. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6170. * @param {*} thisArg The `this` binding of `func`.
  6171. * @param {Array} partials The arguments to prepend to those provided to
  6172. * the new function.
  6173. * @returns {Function} Returns the new wrapped function.
  6174. */
  6175. function createPartial(func, bitmask, thisArg, partials) {
  6176. var isBind = bitmask & WRAP_BIND_FLAG,
  6177. Ctor = createCtor(func);
  6178. function wrapper() {
  6179. var argsIndex = -1,
  6180. argsLength = arguments.length,
  6181. leftIndex = -1,
  6182. leftLength = partials.length,
  6183. args = Array(leftLength + argsLength),
  6184. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6185. while (++leftIndex < leftLength) {
  6186. args[leftIndex] = partials[leftIndex];
  6187. }
  6188. while (argsLength--) {
  6189. args[leftIndex++] = arguments[++argsIndex];
  6190. }
  6191. return apply(fn, isBind ? thisArg : this, args);
  6192. }
  6193. return wrapper;
  6194. }
  6195. /**
  6196. * Creates a `_.range` or `_.rangeRight` function.
  6197. *
  6198. * @private
  6199. * @param {boolean} [fromRight] Specify iterating from right to left.
  6200. * @returns {Function} Returns the new range function.
  6201. */
  6202. function createRange(fromRight) {
  6203. return function(start, end, step) {
  6204. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6205. end = step = undefined;
  6206. }
  6207. // Ensure the sign of `-0` is preserved.
  6208. start = toFinite(start);
  6209. if (end === undefined) {
  6210. end = start;
  6211. start = 0;
  6212. } else {
  6213. end = toFinite(end);
  6214. }
  6215. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6216. return baseRange(start, end, step, fromRight);
  6217. };
  6218. }
  6219. /**
  6220. * Creates a function that performs a relational operation on two values.
  6221. *
  6222. * @private
  6223. * @param {Function} operator The function to perform the operation.
  6224. * @returns {Function} Returns the new relational operation function.
  6225. */
  6226. function createRelationalOperation(operator) {
  6227. return function(value, other) {
  6228. if (!(typeof value == 'string' && typeof other == 'string')) {
  6229. value = toNumber(value);
  6230. other = toNumber(other);
  6231. }
  6232. return operator(value, other);
  6233. };
  6234. }
  6235. /**
  6236. * Creates a function that wraps `func` to continue currying.
  6237. *
  6238. * @private
  6239. * @param {Function} func The function to wrap.
  6240. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6241. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6242. * @param {*} placeholder The placeholder value.
  6243. * @param {*} [thisArg] The `this` binding of `func`.
  6244. * @param {Array} [partials] The arguments to prepend to those provided to
  6245. * the new function.
  6246. * @param {Array} [holders] The `partials` placeholder indexes.
  6247. * @param {Array} [argPos] The argument positions of the new function.
  6248. * @param {number} [ary] The arity cap of `func`.
  6249. * @param {number} [arity] The arity of `func`.
  6250. * @returns {Function} Returns the new wrapped function.
  6251. */
  6252. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6253. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6254. newHolders = isCurry ? holders : undefined,
  6255. newHoldersRight = isCurry ? undefined : holders,
  6256. newPartials = isCurry ? partials : undefined,
  6257. newPartialsRight = isCurry ? undefined : partials;
  6258. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6259. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6260. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6261. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6262. }
  6263. var newData = [
  6264. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6265. newHoldersRight, argPos, ary, arity
  6266. ];
  6267. var result = wrapFunc.apply(undefined, newData);
  6268. if (isLaziable(func)) {
  6269. setData(result, newData);
  6270. }
  6271. result.placeholder = placeholder;
  6272. return setWrapToString(result, func, bitmask);
  6273. }
  6274. /**
  6275. * Creates a function like `_.round`.
  6276. *
  6277. * @private
  6278. * @param {string} methodName The name of the `Math` method to use when rounding.
  6279. * @returns {Function} Returns the new round function.
  6280. */
  6281. function createRound(methodName) {
  6282. var func = Math[methodName];
  6283. return function(number, precision) {
  6284. number = toNumber(number);
  6285. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6286. if (precision && nativeIsFinite(number)) {
  6287. // Shift with exponential notation to avoid floating-point issues.
  6288. // See [MDN](https://mdn.io/round#Examples) for more details.
  6289. var pair = (toString(number) + 'e').split('e'),
  6290. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6291. pair = (toString(value) + 'e').split('e');
  6292. return +(pair[0] + 'e' + (+pair[1] - precision));
  6293. }
  6294. return func(number);
  6295. };
  6296. }
  6297. /**
  6298. * Creates a set object of `values`.
  6299. *
  6300. * @private
  6301. * @param {Array} values The values to add to the set.
  6302. * @returns {Object} Returns the new set.
  6303. */
  6304. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6305. return new Set(values);
  6306. };
  6307. /**
  6308. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6309. *
  6310. * @private
  6311. * @param {Function} keysFunc The function to get the keys of a given object.
  6312. * @returns {Function} Returns the new pairs function.
  6313. */
  6314. function createToPairs(keysFunc) {
  6315. return function(object) {
  6316. var tag = getTag(object);
  6317. if (tag == mapTag) {
  6318. return mapToArray(object);
  6319. }
  6320. if (tag == setTag) {
  6321. return setToPairs(object);
  6322. }
  6323. return baseToPairs(object, keysFunc(object));
  6324. };
  6325. }
  6326. /**
  6327. * Creates a function that either curries or invokes `func` with optional
  6328. * `this` binding and partially applied arguments.
  6329. *
  6330. * @private
  6331. * @param {Function|string} func The function or method name to wrap.
  6332. * @param {number} bitmask The bitmask flags.
  6333. * 1 - `_.bind`
  6334. * 2 - `_.bindKey`
  6335. * 4 - `_.curry` or `_.curryRight` of a bound function
  6336. * 8 - `_.curry`
  6337. * 16 - `_.curryRight`
  6338. * 32 - `_.partial`
  6339. * 64 - `_.partialRight`
  6340. * 128 - `_.rearg`
  6341. * 256 - `_.ary`
  6342. * 512 - `_.flip`
  6343. * @param {*} [thisArg] The `this` binding of `func`.
  6344. * @param {Array} [partials] The arguments to be partially applied.
  6345. * @param {Array} [holders] The `partials` placeholder indexes.
  6346. * @param {Array} [argPos] The argument positions of the new function.
  6347. * @param {number} [ary] The arity cap of `func`.
  6348. * @param {number} [arity] The arity of `func`.
  6349. * @returns {Function} Returns the new wrapped function.
  6350. */
  6351. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6352. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6353. if (!isBindKey && typeof func != 'function') {
  6354. throw new TypeError(FUNC_ERROR_TEXT);
  6355. }
  6356. var length = partials ? partials.length : 0;
  6357. if (!length) {
  6358. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6359. partials = holders = undefined;
  6360. }
  6361. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6362. arity = arity === undefined ? arity : toInteger(arity);
  6363. length -= holders ? holders.length : 0;
  6364. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6365. var partialsRight = partials,
  6366. holdersRight = holders;
  6367. partials = holders = undefined;
  6368. }
  6369. var data = isBindKey ? undefined : getData(func);
  6370. var newData = [
  6371. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6372. argPos, ary, arity
  6373. ];
  6374. if (data) {
  6375. mergeData(newData, data);
  6376. }
  6377. func = newData[0];
  6378. bitmask = newData[1];
  6379. thisArg = newData[2];
  6380. partials = newData[3];
  6381. holders = newData[4];
  6382. arity = newData[9] = newData[9] === undefined
  6383. ? (isBindKey ? 0 : func.length)
  6384. : nativeMax(newData[9] - length, 0);
  6385. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6386. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6387. }
  6388. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6389. var result = createBind(func, bitmask, thisArg);
  6390. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6391. result = createCurry(func, bitmask, arity);
  6392. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6393. result = createPartial(func, bitmask, thisArg, partials);
  6394. } else {
  6395. result = createHybrid.apply(undefined, newData);
  6396. }
  6397. var setter = data ? baseSetData : setData;
  6398. return setWrapToString(setter(result, newData), func, bitmask);
  6399. }
  6400. /**
  6401. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6402. * of source objects to the destination object for all destination properties
  6403. * that resolve to `undefined`.
  6404. *
  6405. * @private
  6406. * @param {*} objValue The destination value.
  6407. * @param {*} srcValue The source value.
  6408. * @param {string} key The key of the property to assign.
  6409. * @param {Object} object The parent object of `objValue`.
  6410. * @returns {*} Returns the value to assign.
  6411. */
  6412. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6413. if (objValue === undefined ||
  6414. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6415. return srcValue;
  6416. }
  6417. return objValue;
  6418. }
  6419. /**
  6420. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6421. * objects into destination objects that are passed thru.
  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 merge.
  6427. * @param {Object} object The parent object of `objValue`.
  6428. * @param {Object} source The parent object of `srcValue`.
  6429. * @param {Object} [stack] Tracks traversed source values and their merged
  6430. * counterparts.
  6431. * @returns {*} Returns the value to assign.
  6432. */
  6433. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6434. if (isObject(objValue) && isObject(srcValue)) {
  6435. // Recursively merge objects and arrays (susceptible to call stack limits).
  6436. stack.set(srcValue, objValue);
  6437. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6438. stack['delete'](srcValue);
  6439. }
  6440. return objValue;
  6441. }
  6442. /**
  6443. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6444. * objects.
  6445. *
  6446. * @private
  6447. * @param {*} value The value to inspect.
  6448. * @param {string} key The key of the property to inspect.
  6449. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6450. */
  6451. function customOmitClone(value) {
  6452. return isPlainObject(value) ? undefined : value;
  6453. }
  6454. /**
  6455. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6456. * partial deep comparisons.
  6457. *
  6458. * @private
  6459. * @param {Array} array The array to compare.
  6460. * @param {Array} other The other array to compare.
  6461. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6462. * @param {Function} customizer The function to customize comparisons.
  6463. * @param {Function} equalFunc The function to determine equivalents of values.
  6464. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6465. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6466. */
  6467. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6468. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6469. arrLength = array.length,
  6470. othLength = other.length;
  6471. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6472. return false;
  6473. }
  6474. // Check that cyclic values are equal.
  6475. var arrStacked = stack.get(array);
  6476. var othStacked = stack.get(other);
  6477. if (arrStacked && othStacked) {
  6478. return arrStacked == other && othStacked == array;
  6479. }
  6480. var index = -1,
  6481. result = true,
  6482. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6483. stack.set(array, other);
  6484. stack.set(other, array);
  6485. // Ignore non-index properties.
  6486. while (++index < arrLength) {
  6487. var arrValue = array[index],
  6488. othValue = other[index];
  6489. if (customizer) {
  6490. var compared = isPartial
  6491. ? customizer(othValue, arrValue, index, other, array, stack)
  6492. : customizer(arrValue, othValue, index, array, other, stack);
  6493. }
  6494. if (compared !== undefined) {
  6495. if (compared) {
  6496. continue;
  6497. }
  6498. result = false;
  6499. break;
  6500. }
  6501. // Recursively compare arrays (susceptible to call stack limits).
  6502. if (seen) {
  6503. if (!arraySome(other, function(othValue, othIndex) {
  6504. if (!cacheHas(seen, othIndex) &&
  6505. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6506. return seen.push(othIndex);
  6507. }
  6508. })) {
  6509. result = false;
  6510. break;
  6511. }
  6512. } else if (!(
  6513. arrValue === othValue ||
  6514. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6515. )) {
  6516. result = false;
  6517. break;
  6518. }
  6519. }
  6520. stack['delete'](array);
  6521. stack['delete'](other);
  6522. return result;
  6523. }
  6524. /**
  6525. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6526. * the same `toStringTag`.
  6527. *
  6528. * **Note:** This function only supports comparing values with tags of
  6529. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6530. *
  6531. * @private
  6532. * @param {Object} object The object to compare.
  6533. * @param {Object} other The other object to compare.
  6534. * @param {string} tag The `toStringTag` of the objects to compare.
  6535. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6536. * @param {Function} customizer The function to customize comparisons.
  6537. * @param {Function} equalFunc The function to determine equivalents of values.
  6538. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6539. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6540. */
  6541. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6542. switch (tag) {
  6543. case dataViewTag:
  6544. if ((object.byteLength != other.byteLength) ||
  6545. (object.byteOffset != other.byteOffset)) {
  6546. return false;
  6547. }
  6548. object = object.buffer;
  6549. other = other.buffer;
  6550. case arrayBufferTag:
  6551. if ((object.byteLength != other.byteLength) ||
  6552. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6553. return false;
  6554. }
  6555. return true;
  6556. case boolTag:
  6557. case dateTag:
  6558. case numberTag:
  6559. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6560. // Invalid dates are coerced to `NaN`.
  6561. return eq(+object, +other);
  6562. case errorTag:
  6563. return object.name == other.name && object.message == other.message;
  6564. case regexpTag:
  6565. case stringTag:
  6566. // Coerce regexes to strings and treat strings, primitives and objects,
  6567. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6568. // for more details.
  6569. return object == (other + '');
  6570. case mapTag:
  6571. var convert = mapToArray;
  6572. case setTag:
  6573. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6574. convert || (convert = setToArray);
  6575. if (object.size != other.size && !isPartial) {
  6576. return false;
  6577. }
  6578. // Assume cyclic values are equal.
  6579. var stacked = stack.get(object);
  6580. if (stacked) {
  6581. return stacked == other;
  6582. }
  6583. bitmask |= COMPARE_UNORDERED_FLAG;
  6584. // Recursively compare objects (susceptible to call stack limits).
  6585. stack.set(object, other);
  6586. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6587. stack['delete'](object);
  6588. return result;
  6589. case symbolTag:
  6590. if (symbolValueOf) {
  6591. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6592. }
  6593. }
  6594. return false;
  6595. }
  6596. /**
  6597. * A specialized version of `baseIsEqualDeep` for objects with support for
  6598. * partial deep comparisons.
  6599. *
  6600. * @private
  6601. * @param {Object} object The object to compare.
  6602. * @param {Object} other The other object to compare.
  6603. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6604. * @param {Function} customizer The function to customize comparisons.
  6605. * @param {Function} equalFunc The function to determine equivalents of values.
  6606. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6607. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6608. */
  6609. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6610. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6611. objProps = getAllKeys(object),
  6612. objLength = objProps.length,
  6613. othProps = getAllKeys(other),
  6614. othLength = othProps.length;
  6615. if (objLength != othLength && !isPartial) {
  6616. return false;
  6617. }
  6618. var index = objLength;
  6619. while (index--) {
  6620. var key = objProps[index];
  6621. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6622. return false;
  6623. }
  6624. }
  6625. // Check that cyclic values are equal.
  6626. var objStacked = stack.get(object);
  6627. var othStacked = stack.get(other);
  6628. if (objStacked && othStacked) {
  6629. return objStacked == other && othStacked == object;
  6630. }
  6631. var result = true;
  6632. stack.set(object, other);
  6633. stack.set(other, object);
  6634. var skipCtor = isPartial;
  6635. while (++index < objLength) {
  6636. key = objProps[index];
  6637. var objValue = object[key],
  6638. othValue = other[key];
  6639. if (customizer) {
  6640. var compared = isPartial
  6641. ? customizer(othValue, objValue, key, other, object, stack)
  6642. : customizer(objValue, othValue, key, object, other, stack);
  6643. }
  6644. // Recursively compare objects (susceptible to call stack limits).
  6645. if (!(compared === undefined
  6646. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6647. : compared
  6648. )) {
  6649. result = false;
  6650. break;
  6651. }
  6652. skipCtor || (skipCtor = key == 'constructor');
  6653. }
  6654. if (result && !skipCtor) {
  6655. var objCtor = object.constructor,
  6656. othCtor = other.constructor;
  6657. // Non `Object` object instances with different constructors are not equal.
  6658. if (objCtor != othCtor &&
  6659. ('constructor' in object && 'constructor' in other) &&
  6660. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6661. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6662. result = false;
  6663. }
  6664. }
  6665. stack['delete'](object);
  6666. stack['delete'](other);
  6667. return result;
  6668. }
  6669. /**
  6670. * A specialized version of `baseRest` which flattens the rest array.
  6671. *
  6672. * @private
  6673. * @param {Function} func The function to apply a rest parameter to.
  6674. * @returns {Function} Returns the new function.
  6675. */
  6676. function flatRest(func) {
  6677. return setToString(overRest(func, undefined, flatten), func + '');
  6678. }
  6679. /**
  6680. * Creates an array of own enumerable property names and symbols of `object`.
  6681. *
  6682. * @private
  6683. * @param {Object} object The object to query.
  6684. * @returns {Array} Returns the array of property names and symbols.
  6685. */
  6686. function getAllKeys(object) {
  6687. return baseGetAllKeys(object, keys, getSymbols);
  6688. }
  6689. /**
  6690. * Creates an array of own and inherited enumerable property names and
  6691. * symbols of `object`.
  6692. *
  6693. * @private
  6694. * @param {Object} object The object to query.
  6695. * @returns {Array} Returns the array of property names and symbols.
  6696. */
  6697. function getAllKeysIn(object) {
  6698. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6699. }
  6700. /**
  6701. * Gets metadata for `func`.
  6702. *
  6703. * @private
  6704. * @param {Function} func The function to query.
  6705. * @returns {*} Returns the metadata for `func`.
  6706. */
  6707. var getData = !metaMap ? noop : function(func) {
  6708. return metaMap.get(func);
  6709. };
  6710. /**
  6711. * Gets the name of `func`.
  6712. *
  6713. * @private
  6714. * @param {Function} func The function to query.
  6715. * @returns {string} Returns the function name.
  6716. */
  6717. function getFuncName(func) {
  6718. var result = (func.name + ''),
  6719. array = realNames[result],
  6720. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6721. while (length--) {
  6722. var data = array[length],
  6723. otherFunc = data.func;
  6724. if (otherFunc == null || otherFunc == func) {
  6725. return data.name;
  6726. }
  6727. }
  6728. return result;
  6729. }
  6730. /**
  6731. * Gets the argument placeholder value for `func`.
  6732. *
  6733. * @private
  6734. * @param {Function} func The function to inspect.
  6735. * @returns {*} Returns the placeholder value.
  6736. */
  6737. function getHolder(func) {
  6738. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6739. return object.placeholder;
  6740. }
  6741. /**
  6742. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6743. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6744. * If arguments are provided, the chosen function is invoked with them and
  6745. * its result is returned.
  6746. *
  6747. * @private
  6748. * @param {*} [value] The value to convert to an iteratee.
  6749. * @param {number} [arity] The arity of the created iteratee.
  6750. * @returns {Function} Returns the chosen function or its result.
  6751. */
  6752. function getIteratee() {
  6753. var result = lodash.iteratee || iteratee;
  6754. result = result === iteratee ? baseIteratee : result;
  6755. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6756. }
  6757. /**
  6758. * Gets the data for `map`.
  6759. *
  6760. * @private
  6761. * @param {Object} map The map to query.
  6762. * @param {string} key The reference key.
  6763. * @returns {*} Returns the map data.
  6764. */
  6765. function getMapData(map, key) {
  6766. var data = map.__data__;
  6767. return isKeyable(key)
  6768. ? data[typeof key == 'string' ? 'string' : 'hash']
  6769. : data.map;
  6770. }
  6771. /**
  6772. * Gets the property names, values, and compare flags of `object`.
  6773. *
  6774. * @private
  6775. * @param {Object} object The object to query.
  6776. * @returns {Array} Returns the match data of `object`.
  6777. */
  6778. function getMatchData(object) {
  6779. var result = keys(object),
  6780. length = result.length;
  6781. while (length--) {
  6782. var key = result[length],
  6783. value = object[key];
  6784. result[length] = [key, value, isStrictComparable(value)];
  6785. }
  6786. return result;
  6787. }
  6788. /**
  6789. * Gets the native function at `key` of `object`.
  6790. *
  6791. * @private
  6792. * @param {Object} object The object to query.
  6793. * @param {string} key The key of the method to get.
  6794. * @returns {*} Returns the function if it's native, else `undefined`.
  6795. */
  6796. function getNative(object, key) {
  6797. var value = getValue(object, key);
  6798. return baseIsNative(value) ? value : undefined;
  6799. }
  6800. /**
  6801. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6802. *
  6803. * @private
  6804. * @param {*} value The value to query.
  6805. * @returns {string} Returns the raw `toStringTag`.
  6806. */
  6807. function getRawTag(value) {
  6808. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6809. tag = value[symToStringTag];
  6810. try {
  6811. value[symToStringTag] = undefined;
  6812. var unmasked = true;
  6813. } catch (e) {}
  6814. var result = nativeObjectToString.call(value);
  6815. if (unmasked) {
  6816. if (isOwn) {
  6817. value[symToStringTag] = tag;
  6818. } else {
  6819. delete value[symToStringTag];
  6820. }
  6821. }
  6822. return result;
  6823. }
  6824. /**
  6825. * Creates an array of the own enumerable symbols of `object`.
  6826. *
  6827. * @private
  6828. * @param {Object} object The object to query.
  6829. * @returns {Array} Returns the array of symbols.
  6830. */
  6831. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6832. if (object == null) {
  6833. return [];
  6834. }
  6835. object = Object(object);
  6836. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6837. return propertyIsEnumerable.call(object, symbol);
  6838. });
  6839. };
  6840. /**
  6841. * Creates an array of the own and inherited enumerable symbols of `object`.
  6842. *
  6843. * @private
  6844. * @param {Object} object The object to query.
  6845. * @returns {Array} Returns the array of symbols.
  6846. */
  6847. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6848. var result = [];
  6849. while (object) {
  6850. arrayPush(result, getSymbols(object));
  6851. object = getPrototype(object);
  6852. }
  6853. return result;
  6854. };
  6855. /**
  6856. * Gets the `toStringTag` of `value`.
  6857. *
  6858. * @private
  6859. * @param {*} value The value to query.
  6860. * @returns {string} Returns the `toStringTag`.
  6861. */
  6862. var getTag = baseGetTag;
  6863. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6864. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6865. (Map && getTag(new Map) != mapTag) ||
  6866. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6867. (Set && getTag(new Set) != setTag) ||
  6868. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6869. getTag = function(value) {
  6870. var result = baseGetTag(value),
  6871. Ctor = result == objectTag ? value.constructor : undefined,
  6872. ctorString = Ctor ? toSource(Ctor) : '';
  6873. if (ctorString) {
  6874. switch (ctorString) {
  6875. case dataViewCtorString: return dataViewTag;
  6876. case mapCtorString: return mapTag;
  6877. case promiseCtorString: return promiseTag;
  6878. case setCtorString: return setTag;
  6879. case weakMapCtorString: return weakMapTag;
  6880. }
  6881. }
  6882. return result;
  6883. };
  6884. }
  6885. /**
  6886. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6887. *
  6888. * @private
  6889. * @param {number} start The start of the view.
  6890. * @param {number} end The end of the view.
  6891. * @param {Array} transforms The transformations to apply to the view.
  6892. * @returns {Object} Returns an object containing the `start` and `end`
  6893. * positions of the view.
  6894. */
  6895. function getView(start, end, transforms) {
  6896. var index = -1,
  6897. length = transforms.length;
  6898. while (++index < length) {
  6899. var data = transforms[index],
  6900. size = data.size;
  6901. switch (data.type) {
  6902. case 'drop': start += size; break;
  6903. case 'dropRight': end -= size; break;
  6904. case 'take': end = nativeMin(end, start + size); break;
  6905. case 'takeRight': start = nativeMax(start, end - size); break;
  6906. }
  6907. }
  6908. return { 'start': start, 'end': end };
  6909. }
  6910. /**
  6911. * Extracts wrapper details from the `source` body comment.
  6912. *
  6913. * @private
  6914. * @param {string} source The source to inspect.
  6915. * @returns {Array} Returns the wrapper details.
  6916. */
  6917. function getWrapDetails(source) {
  6918. var match = source.match(reWrapDetails);
  6919. return match ? match[1].split(reSplitDetails) : [];
  6920. }
  6921. /**
  6922. * Checks if `path` exists on `object`.
  6923. *
  6924. * @private
  6925. * @param {Object} object The object to query.
  6926. * @param {Array|string} path The path to check.
  6927. * @param {Function} hasFunc The function to check properties.
  6928. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6929. */
  6930. function hasPath(object, path, hasFunc) {
  6931. path = castPath(path, object);
  6932. var index = -1,
  6933. length = path.length,
  6934. result = false;
  6935. while (++index < length) {
  6936. var key = toKey(path[index]);
  6937. if (!(result = object != null && hasFunc(object, key))) {
  6938. break;
  6939. }
  6940. object = object[key];
  6941. }
  6942. if (result || ++index != length) {
  6943. return result;
  6944. }
  6945. length = object == null ? 0 : object.length;
  6946. return !!length && isLength(length) && isIndex(key, length) &&
  6947. (isArray(object) || isArguments(object));
  6948. }
  6949. /**
  6950. * Initializes an array clone.
  6951. *
  6952. * @private
  6953. * @param {Array} array The array to clone.
  6954. * @returns {Array} Returns the initialized clone.
  6955. */
  6956. function initCloneArray(array) {
  6957. var length = array.length,
  6958. result = new array.constructor(length);
  6959. // Add properties assigned by `RegExp#exec`.
  6960. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6961. result.index = array.index;
  6962. result.input = array.input;
  6963. }
  6964. return result;
  6965. }
  6966. /**
  6967. * Initializes an object clone.
  6968. *
  6969. * @private
  6970. * @param {Object} object The object to clone.
  6971. * @returns {Object} Returns the initialized clone.
  6972. */
  6973. function initCloneObject(object) {
  6974. return (typeof object.constructor == 'function' && !isPrototype(object))
  6975. ? baseCreate(getPrototype(object))
  6976. : {};
  6977. }
  6978. /**
  6979. * Initializes an object clone based on its `toStringTag`.
  6980. *
  6981. * **Note:** This function only supports cloning values with tags of
  6982. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6983. *
  6984. * @private
  6985. * @param {Object} object The object to clone.
  6986. * @param {string} tag The `toStringTag` of the object to clone.
  6987. * @param {boolean} [isDeep] Specify a deep clone.
  6988. * @returns {Object} Returns the initialized clone.
  6989. */
  6990. function initCloneByTag(object, tag, isDeep) {
  6991. var Ctor = object.constructor;
  6992. switch (tag) {
  6993. case arrayBufferTag:
  6994. return cloneArrayBuffer(object);
  6995. case boolTag:
  6996. case dateTag:
  6997. return new Ctor(+object);
  6998. case dataViewTag:
  6999. return cloneDataView(object, isDeep);
  7000. case float32Tag: case float64Tag:
  7001. case int8Tag: case int16Tag: case int32Tag:
  7002. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7003. return cloneTypedArray(object, isDeep);
  7004. case mapTag:
  7005. return new Ctor;
  7006. case numberTag:
  7007. case stringTag:
  7008. return new Ctor(object);
  7009. case regexpTag:
  7010. return cloneRegExp(object);
  7011. case setTag:
  7012. return new Ctor;
  7013. case symbolTag:
  7014. return cloneSymbol(object);
  7015. }
  7016. }
  7017. /**
  7018. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7019. *
  7020. * @private
  7021. * @param {string} source The source to modify.
  7022. * @returns {Array} details The details to insert.
  7023. * @returns {string} Returns the modified source.
  7024. */
  7025. function insertWrapDetails(source, details) {
  7026. var length = details.length;
  7027. if (!length) {
  7028. return source;
  7029. }
  7030. var lastIndex = length - 1;
  7031. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7032. details = details.join(length > 2 ? ', ' : ' ');
  7033. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7034. }
  7035. /**
  7036. * Checks if `value` is a flattenable `arguments` object or array.
  7037. *
  7038. * @private
  7039. * @param {*} value The value to check.
  7040. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7041. */
  7042. function isFlattenable(value) {
  7043. return isArray(value) || isArguments(value) ||
  7044. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7045. }
  7046. /**
  7047. * Checks if `value` is a valid array-like index.
  7048. *
  7049. * @private
  7050. * @param {*} value The value to check.
  7051. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7052. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7053. */
  7054. function isIndex(value, length) {
  7055. var type = typeof value;
  7056. length = length == null ? MAX_SAFE_INTEGER : length;
  7057. return !!length &&
  7058. (type == 'number' ||
  7059. (type != 'symbol' && reIsUint.test(value))) &&
  7060. (value > -1 && value % 1 == 0 && value < length);
  7061. }
  7062. /**
  7063. * Checks if the given arguments are from an iteratee call.
  7064. *
  7065. * @private
  7066. * @param {*} value The potential iteratee value argument.
  7067. * @param {*} index The potential iteratee index or key argument.
  7068. * @param {*} object The potential iteratee object argument.
  7069. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7070. * else `false`.
  7071. */
  7072. function isIterateeCall(value, index, object) {
  7073. if (!isObject(object)) {
  7074. return false;
  7075. }
  7076. var type = typeof index;
  7077. if (type == 'number'
  7078. ? (isArrayLike(object) && isIndex(index, object.length))
  7079. : (type == 'string' && index in object)
  7080. ) {
  7081. return eq(object[index], value);
  7082. }
  7083. return false;
  7084. }
  7085. /**
  7086. * Checks if `value` is a property name and not a property path.
  7087. *
  7088. * @private
  7089. * @param {*} value The value to check.
  7090. * @param {Object} [object] The object to query keys on.
  7091. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7092. */
  7093. function isKey(value, object) {
  7094. if (isArray(value)) {
  7095. return false;
  7096. }
  7097. var type = typeof value;
  7098. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7099. value == null || isSymbol(value)) {
  7100. return true;
  7101. }
  7102. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7103. (object != null && value in Object(object));
  7104. }
  7105. /**
  7106. * Checks if `value` is suitable for use as unique object key.
  7107. *
  7108. * @private
  7109. * @param {*} value The value to check.
  7110. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7111. */
  7112. function isKeyable(value) {
  7113. var type = typeof value;
  7114. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7115. ? (value !== '__proto__')
  7116. : (value === null);
  7117. }
  7118. /**
  7119. * Checks if `func` has a lazy counterpart.
  7120. *
  7121. * @private
  7122. * @param {Function} func The function to check.
  7123. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7124. * else `false`.
  7125. */
  7126. function isLaziable(func) {
  7127. var funcName = getFuncName(func),
  7128. other = lodash[funcName];
  7129. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7130. return false;
  7131. }
  7132. if (func === other) {
  7133. return true;
  7134. }
  7135. var data = getData(other);
  7136. return !!data && func === data[0];
  7137. }
  7138. /**
  7139. * Checks if `func` has its source masked.
  7140. *
  7141. * @private
  7142. * @param {Function} func The function to check.
  7143. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7144. */
  7145. function isMasked(func) {
  7146. return !!maskSrcKey && (maskSrcKey in func);
  7147. }
  7148. /**
  7149. * Checks if `func` is capable of being masked.
  7150. *
  7151. * @private
  7152. * @param {*} value The value to check.
  7153. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7154. */
  7155. var isMaskable = coreJsData ? isFunction : stubFalse;
  7156. /**
  7157. * Checks if `value` is likely a prototype object.
  7158. *
  7159. * @private
  7160. * @param {*} value The value to check.
  7161. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7162. */
  7163. function isPrototype(value) {
  7164. var Ctor = value && value.constructor,
  7165. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7166. return value === proto;
  7167. }
  7168. /**
  7169. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7170. *
  7171. * @private
  7172. * @param {*} value The value to check.
  7173. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7174. * equality comparisons, else `false`.
  7175. */
  7176. function isStrictComparable(value) {
  7177. return value === value && !isObject(value);
  7178. }
  7179. /**
  7180. * A specialized version of `matchesProperty` for source values suitable
  7181. * for strict equality comparisons, i.e. `===`.
  7182. *
  7183. * @private
  7184. * @param {string} key The key of the property to get.
  7185. * @param {*} srcValue The value to match.
  7186. * @returns {Function} Returns the new spec function.
  7187. */
  7188. function matchesStrictComparable(key, srcValue) {
  7189. return function(object) {
  7190. if (object == null) {
  7191. return false;
  7192. }
  7193. return object[key] === srcValue &&
  7194. (srcValue !== undefined || (key in Object(object)));
  7195. };
  7196. }
  7197. /**
  7198. * A specialized version of `_.memoize` which clears the memoized function's
  7199. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7200. *
  7201. * @private
  7202. * @param {Function} func The function to have its output memoized.
  7203. * @returns {Function} Returns the new memoized function.
  7204. */
  7205. function memoizeCapped(func) {
  7206. var result = memoize(func, function(key) {
  7207. if (cache.size === MAX_MEMOIZE_SIZE) {
  7208. cache.clear();
  7209. }
  7210. return key;
  7211. });
  7212. var cache = result.cache;
  7213. return result;
  7214. }
  7215. /**
  7216. * Merges the function metadata of `source` into `data`.
  7217. *
  7218. * Merging metadata reduces the number of wrappers used to invoke a function.
  7219. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7220. * may be applied regardless of execution order. Methods like `_.ary` and
  7221. * `_.rearg` modify function arguments, making the order in which they are
  7222. * executed important, preventing the merging of metadata. However, we make
  7223. * an exception for a safe combined case where curried functions have `_.ary`
  7224. * and or `_.rearg` applied.
  7225. *
  7226. * @private
  7227. * @param {Array} data The destination metadata.
  7228. * @param {Array} source The source metadata.
  7229. * @returns {Array} Returns `data`.
  7230. */
  7231. function mergeData(data, source) {
  7232. var bitmask = data[1],
  7233. srcBitmask = source[1],
  7234. newBitmask = bitmask | srcBitmask,
  7235. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7236. var isCombo =
  7237. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7238. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7239. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7240. // Exit early if metadata can't be merged.
  7241. if (!(isCommon || isCombo)) {
  7242. return data;
  7243. }
  7244. // Use source `thisArg` if available.
  7245. if (srcBitmask & WRAP_BIND_FLAG) {
  7246. data[2] = source[2];
  7247. // Set when currying a bound function.
  7248. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7249. }
  7250. // Compose partial arguments.
  7251. var value = source[3];
  7252. if (value) {
  7253. var partials = data[3];
  7254. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7255. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7256. }
  7257. // Compose partial right arguments.
  7258. value = source[5];
  7259. if (value) {
  7260. partials = data[5];
  7261. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7262. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7263. }
  7264. // Use source `argPos` if available.
  7265. value = source[7];
  7266. if (value) {
  7267. data[7] = value;
  7268. }
  7269. // Use source `ary` if it's smaller.
  7270. if (srcBitmask & WRAP_ARY_FLAG) {
  7271. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7272. }
  7273. // Use source `arity` if one is not provided.
  7274. if (data[9] == null) {
  7275. data[9] = source[9];
  7276. }
  7277. // Use source `func` and merge bitmasks.
  7278. data[0] = source[0];
  7279. data[1] = newBitmask;
  7280. return data;
  7281. }
  7282. /**
  7283. * This function is like
  7284. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7285. * except that it includes inherited enumerable properties.
  7286. *
  7287. * @private
  7288. * @param {Object} object The object to query.
  7289. * @returns {Array} Returns the array of property names.
  7290. */
  7291. function nativeKeysIn(object) {
  7292. var result = [];
  7293. if (object != null) {
  7294. for (var key in Object(object)) {
  7295. result.push(key);
  7296. }
  7297. }
  7298. return result;
  7299. }
  7300. /**
  7301. * Converts `value` to a string using `Object.prototype.toString`.
  7302. *
  7303. * @private
  7304. * @param {*} value The value to convert.
  7305. * @returns {string} Returns the converted string.
  7306. */
  7307. function objectToString(value) {
  7308. return nativeObjectToString.call(value);
  7309. }
  7310. /**
  7311. * A specialized version of `baseRest` which transforms the rest array.
  7312. *
  7313. * @private
  7314. * @param {Function} func The function to apply a rest parameter to.
  7315. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7316. * @param {Function} transform The rest array transform.
  7317. * @returns {Function} Returns the new function.
  7318. */
  7319. function overRest(func, start, transform) {
  7320. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7321. return function() {
  7322. var args = arguments,
  7323. index = -1,
  7324. length = nativeMax(args.length - start, 0),
  7325. array = Array(length);
  7326. while (++index < length) {
  7327. array[index] = args[start + index];
  7328. }
  7329. index = -1;
  7330. var otherArgs = Array(start + 1);
  7331. while (++index < start) {
  7332. otherArgs[index] = args[index];
  7333. }
  7334. otherArgs[start] = transform(array);
  7335. return apply(func, this, otherArgs);
  7336. };
  7337. }
  7338. /**
  7339. * Gets the parent value at `path` of `object`.
  7340. *
  7341. * @private
  7342. * @param {Object} object The object to query.
  7343. * @param {Array} path The path to get the parent value of.
  7344. * @returns {*} Returns the parent value.
  7345. */
  7346. function parent(object, path) {
  7347. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7348. }
  7349. /**
  7350. * Reorder `array` according to the specified indexes where the element at
  7351. * the first index is assigned as the first element, the element at
  7352. * the second index is assigned as the second element, and so on.
  7353. *
  7354. * @private
  7355. * @param {Array} array The array to reorder.
  7356. * @param {Array} indexes The arranged array indexes.
  7357. * @returns {Array} Returns `array`.
  7358. */
  7359. function reorder(array, indexes) {
  7360. var arrLength = array.length,
  7361. length = nativeMin(indexes.length, arrLength),
  7362. oldArray = copyArray(array);
  7363. while (length--) {
  7364. var index = indexes[length];
  7365. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7366. }
  7367. return array;
  7368. }
  7369. /**
  7370. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7371. *
  7372. * @private
  7373. * @param {Object} object The object to query.
  7374. * @param {string} key The key of the property to get.
  7375. * @returns {*} Returns the property value.
  7376. */
  7377. function safeGet(object, key) {
  7378. if (key === 'constructor' && typeof object[key] === 'function') {
  7379. return;
  7380. }
  7381. if (key == '__proto__') {
  7382. return;
  7383. }
  7384. return object[key];
  7385. }
  7386. /**
  7387. * Sets metadata for `func`.
  7388. *
  7389. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7390. * period of time, it will trip its breaker and transition to an identity
  7391. * function to avoid garbage collection pauses in V8. See
  7392. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7393. * for more details.
  7394. *
  7395. * @private
  7396. * @param {Function} func The function to associate metadata with.
  7397. * @param {*} data The metadata.
  7398. * @returns {Function} Returns `func`.
  7399. */
  7400. var setData = shortOut(baseSetData);
  7401. /**
  7402. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7403. *
  7404. * @private
  7405. * @param {Function} func The function to delay.
  7406. * @param {number} wait The number of milliseconds to delay invocation.
  7407. * @returns {number|Object} Returns the timer id or timeout object.
  7408. */
  7409. var setTimeout = ctxSetTimeout || function(func, wait) {
  7410. return root.setTimeout(func, wait);
  7411. };
  7412. /**
  7413. * Sets the `toString` method of `func` to return `string`.
  7414. *
  7415. * @private
  7416. * @param {Function} func The function to modify.
  7417. * @param {Function} string The `toString` result.
  7418. * @returns {Function} Returns `func`.
  7419. */
  7420. var setToString = shortOut(baseSetToString);
  7421. /**
  7422. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7423. * with wrapper details in a comment at the top of the source body.
  7424. *
  7425. * @private
  7426. * @param {Function} wrapper The function to modify.
  7427. * @param {Function} reference The reference function.
  7428. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7429. * @returns {Function} Returns `wrapper`.
  7430. */
  7431. function setWrapToString(wrapper, reference, bitmask) {
  7432. var source = (reference + '');
  7433. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7434. }
  7435. /**
  7436. * Creates a function that'll short out and invoke `identity` instead
  7437. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7438. * milliseconds.
  7439. *
  7440. * @private
  7441. * @param {Function} func The function to restrict.
  7442. * @returns {Function} Returns the new shortable function.
  7443. */
  7444. function shortOut(func) {
  7445. var count = 0,
  7446. lastCalled = 0;
  7447. return function() {
  7448. var stamp = nativeNow(),
  7449. remaining = HOT_SPAN - (stamp - lastCalled);
  7450. lastCalled = stamp;
  7451. if (remaining > 0) {
  7452. if (++count >= HOT_COUNT) {
  7453. return arguments[0];
  7454. }
  7455. } else {
  7456. count = 0;
  7457. }
  7458. return func.apply(undefined, arguments);
  7459. };
  7460. }
  7461. /**
  7462. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7463. *
  7464. * @private
  7465. * @param {Array} array The array to shuffle.
  7466. * @param {number} [size=array.length] The size of `array`.
  7467. * @returns {Array} Returns `array`.
  7468. */
  7469. function shuffleSelf(array, size) {
  7470. var index = -1,
  7471. length = array.length,
  7472. lastIndex = length - 1;
  7473. size = size === undefined ? length : size;
  7474. while (++index < size) {
  7475. var rand = baseRandom(index, lastIndex),
  7476. value = array[rand];
  7477. array[rand] = array[index];
  7478. array[index] = value;
  7479. }
  7480. array.length = size;
  7481. return array;
  7482. }
  7483. /**
  7484. * Converts `string` to a property path array.
  7485. *
  7486. * @private
  7487. * @param {string} string The string to convert.
  7488. * @returns {Array} Returns the property path array.
  7489. */
  7490. var stringToPath = memoizeCapped(function(string) {
  7491. var result = [];
  7492. if (string.charCodeAt(0) === 46 /* . */) {
  7493. result.push('');
  7494. }
  7495. string.replace(rePropName, function(match, number, quote, subString) {
  7496. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7497. });
  7498. return result;
  7499. });
  7500. /**
  7501. * Converts `value` to a string key if it's not a string or symbol.
  7502. *
  7503. * @private
  7504. * @param {*} value The value to inspect.
  7505. * @returns {string|symbol} Returns the key.
  7506. */
  7507. function toKey(value) {
  7508. if (typeof value == 'string' || isSymbol(value)) {
  7509. return value;
  7510. }
  7511. var result = (value + '');
  7512. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7513. }
  7514. /**
  7515. * Converts `func` to its source code.
  7516. *
  7517. * @private
  7518. * @param {Function} func The function to convert.
  7519. * @returns {string} Returns the source code.
  7520. */
  7521. function toSource(func) {
  7522. if (func != null) {
  7523. try {
  7524. return funcToString.call(func);
  7525. } catch (e) {}
  7526. try {
  7527. return (func + '');
  7528. } catch (e) {}
  7529. }
  7530. return '';
  7531. }
  7532. /**
  7533. * Updates wrapper `details` based on `bitmask` flags.
  7534. *
  7535. * @private
  7536. * @returns {Array} details The details to modify.
  7537. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7538. * @returns {Array} Returns `details`.
  7539. */
  7540. function updateWrapDetails(details, bitmask) {
  7541. arrayEach(wrapFlags, function(pair) {
  7542. var value = '_.' + pair[0];
  7543. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7544. details.push(value);
  7545. }
  7546. });
  7547. return details.sort();
  7548. }
  7549. /**
  7550. * Creates a clone of `wrapper`.
  7551. *
  7552. * @private
  7553. * @param {Object} wrapper The wrapper to clone.
  7554. * @returns {Object} Returns the cloned wrapper.
  7555. */
  7556. function wrapperClone(wrapper) {
  7557. if (wrapper instanceof LazyWrapper) {
  7558. return wrapper.clone();
  7559. }
  7560. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7561. result.__actions__ = copyArray(wrapper.__actions__);
  7562. result.__index__ = wrapper.__index__;
  7563. result.__values__ = wrapper.__values__;
  7564. return result;
  7565. }
  7566. /*------------------------------------------------------------------------*/
  7567. /**
  7568. * Creates an array of elements split into groups the length of `size`.
  7569. * If `array` can't be split evenly, the final chunk will be the remaining
  7570. * elements.
  7571. *
  7572. * @static
  7573. * @memberOf _
  7574. * @since 3.0.0
  7575. * @category Array
  7576. * @param {Array} array The array to process.
  7577. * @param {number} [size=1] The length of each chunk
  7578. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7579. * @returns {Array} Returns the new array of chunks.
  7580. * @example
  7581. *
  7582. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7583. * // => [['a', 'b'], ['c', 'd']]
  7584. *
  7585. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7586. * // => [['a', 'b', 'c'], ['d']]
  7587. */
  7588. function chunk(array, size, guard) {
  7589. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7590. size = 1;
  7591. } else {
  7592. size = nativeMax(toInteger(size), 0);
  7593. }
  7594. var length = array == null ? 0 : array.length;
  7595. if (!length || size < 1) {
  7596. return [];
  7597. }
  7598. var index = 0,
  7599. resIndex = 0,
  7600. result = Array(nativeCeil(length / size));
  7601. while (index < length) {
  7602. result[resIndex++] = baseSlice(array, index, (index += size));
  7603. }
  7604. return result;
  7605. }
  7606. /**
  7607. * Creates an array with all falsey values removed. The values `false`, `null`,
  7608. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7609. *
  7610. * @static
  7611. * @memberOf _
  7612. * @since 0.1.0
  7613. * @category Array
  7614. * @param {Array} array The array to compact.
  7615. * @returns {Array} Returns the new array of filtered values.
  7616. * @example
  7617. *
  7618. * _.compact([0, 1, false, 2, '', 3]);
  7619. * // => [1, 2, 3]
  7620. */
  7621. function compact(array) {
  7622. var index = -1,
  7623. length = array == null ? 0 : array.length,
  7624. resIndex = 0,
  7625. result = [];
  7626. while (++index < length) {
  7627. var value = array[index];
  7628. if (value) {
  7629. result[resIndex++] = value;
  7630. }
  7631. }
  7632. return result;
  7633. }
  7634. /**
  7635. * Creates a new array concatenating `array` with any additional arrays
  7636. * and/or values.
  7637. *
  7638. * @static
  7639. * @memberOf _
  7640. * @since 4.0.0
  7641. * @category Array
  7642. * @param {Array} array The array to concatenate.
  7643. * @param {...*} [values] The values to concatenate.
  7644. * @returns {Array} Returns the new concatenated array.
  7645. * @example
  7646. *
  7647. * var array = [1];
  7648. * var other = _.concat(array, 2, [3], [[4]]);
  7649. *
  7650. * console.log(other);
  7651. * // => [1, 2, 3, [4]]
  7652. *
  7653. * console.log(array);
  7654. * // => [1]
  7655. */
  7656. function concat() {
  7657. var length = arguments.length;
  7658. if (!length) {
  7659. return [];
  7660. }
  7661. var args = Array(length - 1),
  7662. array = arguments[0],
  7663. index = length;
  7664. while (index--) {
  7665. args[index - 1] = arguments[index];
  7666. }
  7667. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7668. }
  7669. /**
  7670. * Creates an array of `array` values not included in the other given arrays
  7671. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7672. * for equality comparisons. The order and references of result values are
  7673. * determined by the first array.
  7674. *
  7675. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7676. *
  7677. * @static
  7678. * @memberOf _
  7679. * @since 0.1.0
  7680. * @category Array
  7681. * @param {Array} array The array to inspect.
  7682. * @param {...Array} [values] The values to exclude.
  7683. * @returns {Array} Returns the new array of filtered values.
  7684. * @see _.without, _.xor
  7685. * @example
  7686. *
  7687. * _.difference([2, 1], [2, 3]);
  7688. * // => [1]
  7689. */
  7690. var difference = baseRest(function(array, values) {
  7691. return isArrayLikeObject(array)
  7692. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7693. : [];
  7694. });
  7695. /**
  7696. * This method is like `_.difference` except that it accepts `iteratee` which
  7697. * is invoked for each element of `array` and `values` to generate the criterion
  7698. * by which they're compared. The order and references of result values are
  7699. * determined by the first array. The iteratee is invoked with one argument:
  7700. * (value).
  7701. *
  7702. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7703. *
  7704. * @static
  7705. * @memberOf _
  7706. * @since 4.0.0
  7707. * @category Array
  7708. * @param {Array} array The array to inspect.
  7709. * @param {...Array} [values] The values to exclude.
  7710. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7711. * @returns {Array} Returns the new array of filtered values.
  7712. * @example
  7713. *
  7714. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7715. * // => [1.2]
  7716. *
  7717. * // The `_.property` iteratee shorthand.
  7718. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7719. * // => [{ 'x': 2 }]
  7720. */
  7721. var differenceBy = baseRest(function(array, values) {
  7722. var iteratee = last(values);
  7723. if (isArrayLikeObject(iteratee)) {
  7724. iteratee = undefined;
  7725. }
  7726. return isArrayLikeObject(array)
  7727. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7728. : [];
  7729. });
  7730. /**
  7731. * This method is like `_.difference` except that it accepts `comparator`
  7732. * which is invoked to compare elements of `array` to `values`. The order and
  7733. * references of result values are determined by the first array. The comparator
  7734. * is invoked with two arguments: (arrVal, othVal).
  7735. *
  7736. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7737. *
  7738. * @static
  7739. * @memberOf _
  7740. * @since 4.0.0
  7741. * @category Array
  7742. * @param {Array} array The array to inspect.
  7743. * @param {...Array} [values] The values to exclude.
  7744. * @param {Function} [comparator] The comparator invoked per element.
  7745. * @returns {Array} Returns the new array of filtered values.
  7746. * @example
  7747. *
  7748. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7749. *
  7750. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7751. * // => [{ 'x': 2, 'y': 1 }]
  7752. */
  7753. var differenceWith = baseRest(function(array, values) {
  7754. var comparator = last(values);
  7755. if (isArrayLikeObject(comparator)) {
  7756. comparator = undefined;
  7757. }
  7758. return isArrayLikeObject(array)
  7759. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7760. : [];
  7761. });
  7762. /**
  7763. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7764. *
  7765. * @static
  7766. * @memberOf _
  7767. * @since 0.5.0
  7768. * @category Array
  7769. * @param {Array} array The array to query.
  7770. * @param {number} [n=1] The number of elements to drop.
  7771. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7772. * @returns {Array} Returns the slice of `array`.
  7773. * @example
  7774. *
  7775. * _.drop([1, 2, 3]);
  7776. * // => [2, 3]
  7777. *
  7778. * _.drop([1, 2, 3], 2);
  7779. * // => [3]
  7780. *
  7781. * _.drop([1, 2, 3], 5);
  7782. * // => []
  7783. *
  7784. * _.drop([1, 2, 3], 0);
  7785. * // => [1, 2, 3]
  7786. */
  7787. function drop(array, n, guard) {
  7788. var length = array == null ? 0 : array.length;
  7789. if (!length) {
  7790. return [];
  7791. }
  7792. n = (guard || n === undefined) ? 1 : toInteger(n);
  7793. return baseSlice(array, n < 0 ? 0 : n, length);
  7794. }
  7795. /**
  7796. * Creates a slice of `array` with `n` elements dropped from the end.
  7797. *
  7798. * @static
  7799. * @memberOf _
  7800. * @since 3.0.0
  7801. * @category Array
  7802. * @param {Array} array The array to query.
  7803. * @param {number} [n=1] The number of elements to drop.
  7804. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7805. * @returns {Array} Returns the slice of `array`.
  7806. * @example
  7807. *
  7808. * _.dropRight([1, 2, 3]);
  7809. * // => [1, 2]
  7810. *
  7811. * _.dropRight([1, 2, 3], 2);
  7812. * // => [1]
  7813. *
  7814. * _.dropRight([1, 2, 3], 5);
  7815. * // => []
  7816. *
  7817. * _.dropRight([1, 2, 3], 0);
  7818. * // => [1, 2, 3]
  7819. */
  7820. function dropRight(array, n, guard) {
  7821. var length = array == null ? 0 : array.length;
  7822. if (!length) {
  7823. return [];
  7824. }
  7825. n = (guard || n === undefined) ? 1 : toInteger(n);
  7826. n = length - n;
  7827. return baseSlice(array, 0, n < 0 ? 0 : n);
  7828. }
  7829. /**
  7830. * Creates a slice of `array` excluding elements dropped from the end.
  7831. * Elements are dropped until `predicate` returns falsey. The predicate is
  7832. * invoked with three arguments: (value, index, array).
  7833. *
  7834. * @static
  7835. * @memberOf _
  7836. * @since 3.0.0
  7837. * @category Array
  7838. * @param {Array} array The array to query.
  7839. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7840. * @returns {Array} Returns the slice of `array`.
  7841. * @example
  7842. *
  7843. * var users = [
  7844. * { 'user': 'barney', 'active': true },
  7845. * { 'user': 'fred', 'active': false },
  7846. * { 'user': 'pebbles', 'active': false }
  7847. * ];
  7848. *
  7849. * _.dropRightWhile(users, function(o) { return !o.active; });
  7850. * // => objects for ['barney']
  7851. *
  7852. * // The `_.matches` iteratee shorthand.
  7853. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7854. * // => objects for ['barney', 'fred']
  7855. *
  7856. * // The `_.matchesProperty` iteratee shorthand.
  7857. * _.dropRightWhile(users, ['active', false]);
  7858. * // => objects for ['barney']
  7859. *
  7860. * // The `_.property` iteratee shorthand.
  7861. * _.dropRightWhile(users, 'active');
  7862. * // => objects for ['barney', 'fred', 'pebbles']
  7863. */
  7864. function dropRightWhile(array, predicate) {
  7865. return (array && array.length)
  7866. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7867. : [];
  7868. }
  7869. /**
  7870. * Creates a slice of `array` excluding elements dropped from the beginning.
  7871. * Elements are dropped until `predicate` returns falsey. The predicate is
  7872. * invoked with three arguments: (value, index, array).
  7873. *
  7874. * @static
  7875. * @memberOf _
  7876. * @since 3.0.0
  7877. * @category Array
  7878. * @param {Array} array The array to query.
  7879. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7880. * @returns {Array} Returns the slice of `array`.
  7881. * @example
  7882. *
  7883. * var users = [
  7884. * { 'user': 'barney', 'active': false },
  7885. * { 'user': 'fred', 'active': false },
  7886. * { 'user': 'pebbles', 'active': true }
  7887. * ];
  7888. *
  7889. * _.dropWhile(users, function(o) { return !o.active; });
  7890. * // => objects for ['pebbles']
  7891. *
  7892. * // The `_.matches` iteratee shorthand.
  7893. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7894. * // => objects for ['fred', 'pebbles']
  7895. *
  7896. * // The `_.matchesProperty` iteratee shorthand.
  7897. * _.dropWhile(users, ['active', false]);
  7898. * // => objects for ['pebbles']
  7899. *
  7900. * // The `_.property` iteratee shorthand.
  7901. * _.dropWhile(users, 'active');
  7902. * // => objects for ['barney', 'fred', 'pebbles']
  7903. */
  7904. function dropWhile(array, predicate) {
  7905. return (array && array.length)
  7906. ? baseWhile(array, getIteratee(predicate, 3), true)
  7907. : [];
  7908. }
  7909. /**
  7910. * Fills elements of `array` with `value` from `start` up to, but not
  7911. * including, `end`.
  7912. *
  7913. * **Note:** This method mutates `array`.
  7914. *
  7915. * @static
  7916. * @memberOf _
  7917. * @since 3.2.0
  7918. * @category Array
  7919. * @param {Array} array The array to fill.
  7920. * @param {*} value The value to fill `array` with.
  7921. * @param {number} [start=0] The start position.
  7922. * @param {number} [end=array.length] The end position.
  7923. * @returns {Array} Returns `array`.
  7924. * @example
  7925. *
  7926. * var array = [1, 2, 3];
  7927. *
  7928. * _.fill(array, 'a');
  7929. * console.log(array);
  7930. * // => ['a', 'a', 'a']
  7931. *
  7932. * _.fill(Array(3), 2);
  7933. * // => [2, 2, 2]
  7934. *
  7935. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7936. * // => [4, '*', '*', 10]
  7937. */
  7938. function fill(array, value, start, end) {
  7939. var length = array == null ? 0 : array.length;
  7940. if (!length) {
  7941. return [];
  7942. }
  7943. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7944. start = 0;
  7945. end = length;
  7946. }
  7947. return baseFill(array, value, start, end);
  7948. }
  7949. /**
  7950. * This method is like `_.find` except that it returns the index of the first
  7951. * element `predicate` returns truthy for instead of the element itself.
  7952. *
  7953. * @static
  7954. * @memberOf _
  7955. * @since 1.1.0
  7956. * @category Array
  7957. * @param {Array} array The array to inspect.
  7958. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7959. * @param {number} [fromIndex=0] The index to search from.
  7960. * @returns {number} Returns the index of the found element, else `-1`.
  7961. * @example
  7962. *
  7963. * var users = [
  7964. * { 'user': 'barney', 'active': false },
  7965. * { 'user': 'fred', 'active': false },
  7966. * { 'user': 'pebbles', 'active': true }
  7967. * ];
  7968. *
  7969. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7970. * // => 0
  7971. *
  7972. * // The `_.matches` iteratee shorthand.
  7973. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7974. * // => 1
  7975. *
  7976. * // The `_.matchesProperty` iteratee shorthand.
  7977. * _.findIndex(users, ['active', false]);
  7978. * // => 0
  7979. *
  7980. * // The `_.property` iteratee shorthand.
  7981. * _.findIndex(users, 'active');
  7982. * // => 2
  7983. */
  7984. function findIndex(array, predicate, fromIndex) {
  7985. var length = array == null ? 0 : array.length;
  7986. if (!length) {
  7987. return -1;
  7988. }
  7989. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7990. if (index < 0) {
  7991. index = nativeMax(length + index, 0);
  7992. }
  7993. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7994. }
  7995. /**
  7996. * This method is like `_.findIndex` except that it iterates over elements
  7997. * of `collection` from right to left.
  7998. *
  7999. * @static
  8000. * @memberOf _
  8001. * @since 2.0.0
  8002. * @category Array
  8003. * @param {Array} array The array to inspect.
  8004. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8005. * @param {number} [fromIndex=array.length-1] The index to search from.
  8006. * @returns {number} Returns the index of the found element, else `-1`.
  8007. * @example
  8008. *
  8009. * var users = [
  8010. * { 'user': 'barney', 'active': true },
  8011. * { 'user': 'fred', 'active': false },
  8012. * { 'user': 'pebbles', 'active': false }
  8013. * ];
  8014. *
  8015. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8016. * // => 2
  8017. *
  8018. * // The `_.matches` iteratee shorthand.
  8019. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8020. * // => 0
  8021. *
  8022. * // The `_.matchesProperty` iteratee shorthand.
  8023. * _.findLastIndex(users, ['active', false]);
  8024. * // => 2
  8025. *
  8026. * // The `_.property` iteratee shorthand.
  8027. * _.findLastIndex(users, 'active');
  8028. * // => 0
  8029. */
  8030. function findLastIndex(array, predicate, fromIndex) {
  8031. var length = array == null ? 0 : array.length;
  8032. if (!length) {
  8033. return -1;
  8034. }
  8035. var index = length - 1;
  8036. if (fromIndex !== undefined) {
  8037. index = toInteger(fromIndex);
  8038. index = fromIndex < 0
  8039. ? nativeMax(length + index, 0)
  8040. : nativeMin(index, length - 1);
  8041. }
  8042. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8043. }
  8044. /**
  8045. * Flattens `array` a single level deep.
  8046. *
  8047. * @static
  8048. * @memberOf _
  8049. * @since 0.1.0
  8050. * @category Array
  8051. * @param {Array} array The array to flatten.
  8052. * @returns {Array} Returns the new flattened array.
  8053. * @example
  8054. *
  8055. * _.flatten([1, [2, [3, [4]], 5]]);
  8056. * // => [1, 2, [3, [4]], 5]
  8057. */
  8058. function flatten(array) {
  8059. var length = array == null ? 0 : array.length;
  8060. return length ? baseFlatten(array, 1) : [];
  8061. }
  8062. /**
  8063. * Recursively flattens `array`.
  8064. *
  8065. * @static
  8066. * @memberOf _
  8067. * @since 3.0.0
  8068. * @category Array
  8069. * @param {Array} array The array to flatten.
  8070. * @returns {Array} Returns the new flattened array.
  8071. * @example
  8072. *
  8073. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8074. * // => [1, 2, 3, 4, 5]
  8075. */
  8076. function flattenDeep(array) {
  8077. var length = array == null ? 0 : array.length;
  8078. return length ? baseFlatten(array, INFINITY) : [];
  8079. }
  8080. /**
  8081. * Recursively flatten `array` up to `depth` times.
  8082. *
  8083. * @static
  8084. * @memberOf _
  8085. * @since 4.4.0
  8086. * @category Array
  8087. * @param {Array} array The array to flatten.
  8088. * @param {number} [depth=1] The maximum recursion depth.
  8089. * @returns {Array} Returns the new flattened array.
  8090. * @example
  8091. *
  8092. * var array = [1, [2, [3, [4]], 5]];
  8093. *
  8094. * _.flattenDepth(array, 1);
  8095. * // => [1, 2, [3, [4]], 5]
  8096. *
  8097. * _.flattenDepth(array, 2);
  8098. * // => [1, 2, 3, [4], 5]
  8099. */
  8100. function flattenDepth(array, depth) {
  8101. var length = array == null ? 0 : array.length;
  8102. if (!length) {
  8103. return [];
  8104. }
  8105. depth = depth === undefined ? 1 : toInteger(depth);
  8106. return baseFlatten(array, depth);
  8107. }
  8108. /**
  8109. * The inverse of `_.toPairs`; this method returns an object composed
  8110. * from key-value `pairs`.
  8111. *
  8112. * @static
  8113. * @memberOf _
  8114. * @since 4.0.0
  8115. * @category Array
  8116. * @param {Array} pairs The key-value pairs.
  8117. * @returns {Object} Returns the new object.
  8118. * @example
  8119. *
  8120. * _.fromPairs([['a', 1], ['b', 2]]);
  8121. * // => { 'a': 1, 'b': 2 }
  8122. */
  8123. function fromPairs(pairs) {
  8124. var index = -1,
  8125. length = pairs == null ? 0 : pairs.length,
  8126. result = {};
  8127. while (++index < length) {
  8128. var pair = pairs[index];
  8129. result[pair[0]] = pair[1];
  8130. }
  8131. return result;
  8132. }
  8133. /**
  8134. * Gets the first element of `array`.
  8135. *
  8136. * @static
  8137. * @memberOf _
  8138. * @since 0.1.0
  8139. * @alias first
  8140. * @category Array
  8141. * @param {Array} array The array to query.
  8142. * @returns {*} Returns the first element of `array`.
  8143. * @example
  8144. *
  8145. * _.head([1, 2, 3]);
  8146. * // => 1
  8147. *
  8148. * _.head([]);
  8149. * // => undefined
  8150. */
  8151. function head(array) {
  8152. return (array && array.length) ? array[0] : undefined;
  8153. }
  8154. /**
  8155. * Gets the index at which the first occurrence of `value` is found in `array`
  8156. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8157. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8158. * offset from the end of `array`.
  8159. *
  8160. * @static
  8161. * @memberOf _
  8162. * @since 0.1.0
  8163. * @category Array
  8164. * @param {Array} array The array to inspect.
  8165. * @param {*} value The value to search for.
  8166. * @param {number} [fromIndex=0] The index to search from.
  8167. * @returns {number} Returns the index of the matched value, else `-1`.
  8168. * @example
  8169. *
  8170. * _.indexOf([1, 2, 1, 2], 2);
  8171. * // => 1
  8172. *
  8173. * // Search from the `fromIndex`.
  8174. * _.indexOf([1, 2, 1, 2], 2, 2);
  8175. * // => 3
  8176. */
  8177. function indexOf(array, value, fromIndex) {
  8178. var length = array == null ? 0 : array.length;
  8179. if (!length) {
  8180. return -1;
  8181. }
  8182. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8183. if (index < 0) {
  8184. index = nativeMax(length + index, 0);
  8185. }
  8186. return baseIndexOf(array, value, index);
  8187. }
  8188. /**
  8189. * Gets all but the last element of `array`.
  8190. *
  8191. * @static
  8192. * @memberOf _
  8193. * @since 0.1.0
  8194. * @category Array
  8195. * @param {Array} array The array to query.
  8196. * @returns {Array} Returns the slice of `array`.
  8197. * @example
  8198. *
  8199. * _.initial([1, 2, 3]);
  8200. * // => [1, 2]
  8201. */
  8202. function initial(array) {
  8203. var length = array == null ? 0 : array.length;
  8204. return length ? baseSlice(array, 0, -1) : [];
  8205. }
  8206. /**
  8207. * Creates an array of unique values that are included in all given arrays
  8208. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8209. * for equality comparisons. The order and references of result values are
  8210. * determined by the first array.
  8211. *
  8212. * @static
  8213. * @memberOf _
  8214. * @since 0.1.0
  8215. * @category Array
  8216. * @param {...Array} [arrays] The arrays to inspect.
  8217. * @returns {Array} Returns the new array of intersecting values.
  8218. * @example
  8219. *
  8220. * _.intersection([2, 1], [2, 3]);
  8221. * // => [2]
  8222. */
  8223. var intersection = baseRest(function(arrays) {
  8224. var mapped = arrayMap(arrays, castArrayLikeObject);
  8225. return (mapped.length && mapped[0] === arrays[0])
  8226. ? baseIntersection(mapped)
  8227. : [];
  8228. });
  8229. /**
  8230. * This method is like `_.intersection` except that it accepts `iteratee`
  8231. * which is invoked for each element of each `arrays` to generate the criterion
  8232. * by which they're compared. The order and references of result values are
  8233. * determined by the first array. The iteratee is invoked with one argument:
  8234. * (value).
  8235. *
  8236. * @static
  8237. * @memberOf _
  8238. * @since 4.0.0
  8239. * @category Array
  8240. * @param {...Array} [arrays] The arrays to inspect.
  8241. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8242. * @returns {Array} Returns the new array of intersecting values.
  8243. * @example
  8244. *
  8245. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8246. * // => [2.1]
  8247. *
  8248. * // The `_.property` iteratee shorthand.
  8249. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8250. * // => [{ 'x': 1 }]
  8251. */
  8252. var intersectionBy = baseRest(function(arrays) {
  8253. var iteratee = last(arrays),
  8254. mapped = arrayMap(arrays, castArrayLikeObject);
  8255. if (iteratee === last(mapped)) {
  8256. iteratee = undefined;
  8257. } else {
  8258. mapped.pop();
  8259. }
  8260. return (mapped.length && mapped[0] === arrays[0])
  8261. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8262. : [];
  8263. });
  8264. /**
  8265. * This method is like `_.intersection` except that it accepts `comparator`
  8266. * which is invoked to compare elements of `arrays`. The order and references
  8267. * of result values are determined by the first array. The comparator is
  8268. * invoked with two arguments: (arrVal, othVal).
  8269. *
  8270. * @static
  8271. * @memberOf _
  8272. * @since 4.0.0
  8273. * @category Array
  8274. * @param {...Array} [arrays] The arrays to inspect.
  8275. * @param {Function} [comparator] The comparator invoked per element.
  8276. * @returns {Array} Returns the new array of intersecting values.
  8277. * @example
  8278. *
  8279. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8280. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8281. *
  8282. * _.intersectionWith(objects, others, _.isEqual);
  8283. * // => [{ 'x': 1, 'y': 2 }]
  8284. */
  8285. var intersectionWith = baseRest(function(arrays) {
  8286. var comparator = last(arrays),
  8287. mapped = arrayMap(arrays, castArrayLikeObject);
  8288. comparator = typeof comparator == 'function' ? comparator : undefined;
  8289. if (comparator) {
  8290. mapped.pop();
  8291. }
  8292. return (mapped.length && mapped[0] === arrays[0])
  8293. ? baseIntersection(mapped, undefined, comparator)
  8294. : [];
  8295. });
  8296. /**
  8297. * Converts all elements in `array` into a string separated by `separator`.
  8298. *
  8299. * @static
  8300. * @memberOf _
  8301. * @since 4.0.0
  8302. * @category Array
  8303. * @param {Array} array The array to convert.
  8304. * @param {string} [separator=','] The element separator.
  8305. * @returns {string} Returns the joined string.
  8306. * @example
  8307. *
  8308. * _.join(['a', 'b', 'c'], '~');
  8309. * // => 'a~b~c'
  8310. */
  8311. function join(array, separator) {
  8312. return array == null ? '' : nativeJoin.call(array, separator);
  8313. }
  8314. /**
  8315. * Gets the last element of `array`.
  8316. *
  8317. * @static
  8318. * @memberOf _
  8319. * @since 0.1.0
  8320. * @category Array
  8321. * @param {Array} array The array to query.
  8322. * @returns {*} Returns the last element of `array`.
  8323. * @example
  8324. *
  8325. * _.last([1, 2, 3]);
  8326. * // => 3
  8327. */
  8328. function last(array) {
  8329. var length = array == null ? 0 : array.length;
  8330. return length ? array[length - 1] : undefined;
  8331. }
  8332. /**
  8333. * This method is like `_.indexOf` except that it iterates over elements of
  8334. * `array` from right to left.
  8335. *
  8336. * @static
  8337. * @memberOf _
  8338. * @since 0.1.0
  8339. * @category Array
  8340. * @param {Array} array The array to inspect.
  8341. * @param {*} value The value to search for.
  8342. * @param {number} [fromIndex=array.length-1] The index to search from.
  8343. * @returns {number} Returns the index of the matched value, else `-1`.
  8344. * @example
  8345. *
  8346. * _.lastIndexOf([1, 2, 1, 2], 2);
  8347. * // => 3
  8348. *
  8349. * // Search from the `fromIndex`.
  8350. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8351. * // => 1
  8352. */
  8353. function lastIndexOf(array, value, fromIndex) {
  8354. var length = array == null ? 0 : array.length;
  8355. if (!length) {
  8356. return -1;
  8357. }
  8358. var index = length;
  8359. if (fromIndex !== undefined) {
  8360. index = toInteger(fromIndex);
  8361. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8362. }
  8363. return value === value
  8364. ? strictLastIndexOf(array, value, index)
  8365. : baseFindIndex(array, baseIsNaN, index, true);
  8366. }
  8367. /**
  8368. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8369. * element from the end is returned.
  8370. *
  8371. * @static
  8372. * @memberOf _
  8373. * @since 4.11.0
  8374. * @category Array
  8375. * @param {Array} array The array to query.
  8376. * @param {number} [n=0] The index of the element to return.
  8377. * @returns {*} Returns the nth element of `array`.
  8378. * @example
  8379. *
  8380. * var array = ['a', 'b', 'c', 'd'];
  8381. *
  8382. * _.nth(array, 1);
  8383. * // => 'b'
  8384. *
  8385. * _.nth(array, -2);
  8386. * // => 'c';
  8387. */
  8388. function nth(array, n) {
  8389. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8390. }
  8391. /**
  8392. * Removes all given values from `array` using
  8393. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8394. * for equality comparisons.
  8395. *
  8396. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8397. * to remove elements from an array by predicate.
  8398. *
  8399. * @static
  8400. * @memberOf _
  8401. * @since 2.0.0
  8402. * @category Array
  8403. * @param {Array} array The array to modify.
  8404. * @param {...*} [values] The values to remove.
  8405. * @returns {Array} Returns `array`.
  8406. * @example
  8407. *
  8408. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8409. *
  8410. * _.pull(array, 'a', 'c');
  8411. * console.log(array);
  8412. * // => ['b', 'b']
  8413. */
  8414. var pull = baseRest(pullAll);
  8415. /**
  8416. * This method is like `_.pull` except that it accepts an array of values to remove.
  8417. *
  8418. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8419. *
  8420. * @static
  8421. * @memberOf _
  8422. * @since 4.0.0
  8423. * @category Array
  8424. * @param {Array} array The array to modify.
  8425. * @param {Array} values The values to remove.
  8426. * @returns {Array} Returns `array`.
  8427. * @example
  8428. *
  8429. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8430. *
  8431. * _.pullAll(array, ['a', 'c']);
  8432. * console.log(array);
  8433. * // => ['b', 'b']
  8434. */
  8435. function pullAll(array, values) {
  8436. return (array && array.length && values && values.length)
  8437. ? basePullAll(array, values)
  8438. : array;
  8439. }
  8440. /**
  8441. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8442. * invoked for each element of `array` and `values` to generate the criterion
  8443. * by which they're compared. The iteratee is invoked with one argument: (value).
  8444. *
  8445. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8446. *
  8447. * @static
  8448. * @memberOf _
  8449. * @since 4.0.0
  8450. * @category Array
  8451. * @param {Array} array The array to modify.
  8452. * @param {Array} values The values to remove.
  8453. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8454. * @returns {Array} Returns `array`.
  8455. * @example
  8456. *
  8457. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8458. *
  8459. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8460. * console.log(array);
  8461. * // => [{ 'x': 2 }]
  8462. */
  8463. function pullAllBy(array, values, iteratee) {
  8464. return (array && array.length && values && values.length)
  8465. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8466. : array;
  8467. }
  8468. /**
  8469. * This method is like `_.pullAll` except that it accepts `comparator` which
  8470. * is invoked to compare elements of `array` to `values`. The comparator is
  8471. * invoked with two arguments: (arrVal, othVal).
  8472. *
  8473. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8474. *
  8475. * @static
  8476. * @memberOf _
  8477. * @since 4.6.0
  8478. * @category Array
  8479. * @param {Array} array The array to modify.
  8480. * @param {Array} values The values to remove.
  8481. * @param {Function} [comparator] The comparator invoked per element.
  8482. * @returns {Array} Returns `array`.
  8483. * @example
  8484. *
  8485. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8486. *
  8487. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8488. * console.log(array);
  8489. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8490. */
  8491. function pullAllWith(array, values, comparator) {
  8492. return (array && array.length && values && values.length)
  8493. ? basePullAll(array, values, undefined, comparator)
  8494. : array;
  8495. }
  8496. /**
  8497. * Removes elements from `array` corresponding to `indexes` and returns an
  8498. * array of removed elements.
  8499. *
  8500. * **Note:** Unlike `_.at`, this method mutates `array`.
  8501. *
  8502. * @static
  8503. * @memberOf _
  8504. * @since 3.0.0
  8505. * @category Array
  8506. * @param {Array} array The array to modify.
  8507. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8508. * @returns {Array} Returns the new array of removed elements.
  8509. * @example
  8510. *
  8511. * var array = ['a', 'b', 'c', 'd'];
  8512. * var pulled = _.pullAt(array, [1, 3]);
  8513. *
  8514. * console.log(array);
  8515. * // => ['a', 'c']
  8516. *
  8517. * console.log(pulled);
  8518. * // => ['b', 'd']
  8519. */
  8520. var pullAt = flatRest(function(array, indexes) {
  8521. var length = array == null ? 0 : array.length,
  8522. result = baseAt(array, indexes);
  8523. basePullAt(array, arrayMap(indexes, function(index) {
  8524. return isIndex(index, length) ? +index : index;
  8525. }).sort(compareAscending));
  8526. return result;
  8527. });
  8528. /**
  8529. * Removes all elements from `array` that `predicate` returns truthy for
  8530. * and returns an array of the removed elements. The predicate is invoked
  8531. * with three arguments: (value, index, array).
  8532. *
  8533. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8534. * to pull elements from an array by value.
  8535. *
  8536. * @static
  8537. * @memberOf _
  8538. * @since 2.0.0
  8539. * @category Array
  8540. * @param {Array} array The array to modify.
  8541. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8542. * @returns {Array} Returns the new array of removed elements.
  8543. * @example
  8544. *
  8545. * var array = [1, 2, 3, 4];
  8546. * var evens = _.remove(array, function(n) {
  8547. * return n % 2 == 0;
  8548. * });
  8549. *
  8550. * console.log(array);
  8551. * // => [1, 3]
  8552. *
  8553. * console.log(evens);
  8554. * // => [2, 4]
  8555. */
  8556. function remove(array, predicate) {
  8557. var result = [];
  8558. if (!(array && array.length)) {
  8559. return result;
  8560. }
  8561. var index = -1,
  8562. indexes = [],
  8563. length = array.length;
  8564. predicate = getIteratee(predicate, 3);
  8565. while (++index < length) {
  8566. var value = array[index];
  8567. if (predicate(value, index, array)) {
  8568. result.push(value);
  8569. indexes.push(index);
  8570. }
  8571. }
  8572. basePullAt(array, indexes);
  8573. return result;
  8574. }
  8575. /**
  8576. * Reverses `array` so that the first element becomes the last, the second
  8577. * element becomes the second to last, and so on.
  8578. *
  8579. * **Note:** This method mutates `array` and is based on
  8580. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8581. *
  8582. * @static
  8583. * @memberOf _
  8584. * @since 4.0.0
  8585. * @category Array
  8586. * @param {Array} array The array to modify.
  8587. * @returns {Array} Returns `array`.
  8588. * @example
  8589. *
  8590. * var array = [1, 2, 3];
  8591. *
  8592. * _.reverse(array);
  8593. * // => [3, 2, 1]
  8594. *
  8595. * console.log(array);
  8596. * // => [3, 2, 1]
  8597. */
  8598. function reverse(array) {
  8599. return array == null ? array : nativeReverse.call(array);
  8600. }
  8601. /**
  8602. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8603. *
  8604. * **Note:** This method is used instead of
  8605. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8606. * returned.
  8607. *
  8608. * @static
  8609. * @memberOf _
  8610. * @since 3.0.0
  8611. * @category Array
  8612. * @param {Array} array The array to slice.
  8613. * @param {number} [start=0] The start position.
  8614. * @param {number} [end=array.length] The end position.
  8615. * @returns {Array} Returns the slice of `array`.
  8616. */
  8617. function slice(array, start, end) {
  8618. var length = array == null ? 0 : array.length;
  8619. if (!length) {
  8620. return [];
  8621. }
  8622. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8623. start = 0;
  8624. end = length;
  8625. }
  8626. else {
  8627. start = start == null ? 0 : toInteger(start);
  8628. end = end === undefined ? length : toInteger(end);
  8629. }
  8630. return baseSlice(array, start, end);
  8631. }
  8632. /**
  8633. * Uses a binary search to determine the lowest index at which `value`
  8634. * should be inserted into `array` in order to maintain its sort order.
  8635. *
  8636. * @static
  8637. * @memberOf _
  8638. * @since 0.1.0
  8639. * @category Array
  8640. * @param {Array} array The sorted array to inspect.
  8641. * @param {*} value The value to evaluate.
  8642. * @returns {number} Returns the index at which `value` should be inserted
  8643. * into `array`.
  8644. * @example
  8645. *
  8646. * _.sortedIndex([30, 50], 40);
  8647. * // => 1
  8648. */
  8649. function sortedIndex(array, value) {
  8650. return baseSortedIndex(array, value);
  8651. }
  8652. /**
  8653. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8654. * which is invoked for `value` and each element of `array` to compute their
  8655. * sort ranking. The iteratee is invoked with one argument: (value).
  8656. *
  8657. * @static
  8658. * @memberOf _
  8659. * @since 4.0.0
  8660. * @category Array
  8661. * @param {Array} array The sorted array to inspect.
  8662. * @param {*} value The value to evaluate.
  8663. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8664. * @returns {number} Returns the index at which `value` should be inserted
  8665. * into `array`.
  8666. * @example
  8667. *
  8668. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8669. *
  8670. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8671. * // => 0
  8672. *
  8673. * // The `_.property` iteratee shorthand.
  8674. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8675. * // => 0
  8676. */
  8677. function sortedIndexBy(array, value, iteratee) {
  8678. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8679. }
  8680. /**
  8681. * This method is like `_.indexOf` except that it performs a binary
  8682. * search on a sorted `array`.
  8683. *
  8684. * @static
  8685. * @memberOf _
  8686. * @since 4.0.0
  8687. * @category Array
  8688. * @param {Array} array The array to inspect.
  8689. * @param {*} value The value to search for.
  8690. * @returns {number} Returns the index of the matched value, else `-1`.
  8691. * @example
  8692. *
  8693. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8694. * // => 1
  8695. */
  8696. function sortedIndexOf(array, value) {
  8697. var length = array == null ? 0 : array.length;
  8698. if (length) {
  8699. var index = baseSortedIndex(array, value);
  8700. if (index < length && eq(array[index], value)) {
  8701. return index;
  8702. }
  8703. }
  8704. return -1;
  8705. }
  8706. /**
  8707. * This method is like `_.sortedIndex` except that it returns the highest
  8708. * index at which `value` should be inserted into `array` in order to
  8709. * maintain its sort order.
  8710. *
  8711. * @static
  8712. * @memberOf _
  8713. * @since 3.0.0
  8714. * @category Array
  8715. * @param {Array} array The sorted array to inspect.
  8716. * @param {*} value The value to evaluate.
  8717. * @returns {number} Returns the index at which `value` should be inserted
  8718. * into `array`.
  8719. * @example
  8720. *
  8721. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8722. * // => 4
  8723. */
  8724. function sortedLastIndex(array, value) {
  8725. return baseSortedIndex(array, value, true);
  8726. }
  8727. /**
  8728. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8729. * which is invoked for `value` and each element of `array` to compute their
  8730. * sort ranking. The iteratee is invoked with one argument: (value).
  8731. *
  8732. * @static
  8733. * @memberOf _
  8734. * @since 4.0.0
  8735. * @category Array
  8736. * @param {Array} array The sorted array to inspect.
  8737. * @param {*} value The value to evaluate.
  8738. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8739. * @returns {number} Returns the index at which `value` should be inserted
  8740. * into `array`.
  8741. * @example
  8742. *
  8743. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8744. *
  8745. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8746. * // => 1
  8747. *
  8748. * // The `_.property` iteratee shorthand.
  8749. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8750. * // => 1
  8751. */
  8752. function sortedLastIndexBy(array, value, iteratee) {
  8753. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8754. }
  8755. /**
  8756. * This method is like `_.lastIndexOf` except that it performs a binary
  8757. * search on a sorted `array`.
  8758. *
  8759. * @static
  8760. * @memberOf _
  8761. * @since 4.0.0
  8762. * @category Array
  8763. * @param {Array} array The array to inspect.
  8764. * @param {*} value The value to search for.
  8765. * @returns {number} Returns the index of the matched value, else `-1`.
  8766. * @example
  8767. *
  8768. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8769. * // => 3
  8770. */
  8771. function sortedLastIndexOf(array, value) {
  8772. var length = array == null ? 0 : array.length;
  8773. if (length) {
  8774. var index = baseSortedIndex(array, value, true) - 1;
  8775. if (eq(array[index], value)) {
  8776. return index;
  8777. }
  8778. }
  8779. return -1;
  8780. }
  8781. /**
  8782. * This method is like `_.uniq` except that it's designed and optimized
  8783. * for sorted arrays.
  8784. *
  8785. * @static
  8786. * @memberOf _
  8787. * @since 4.0.0
  8788. * @category Array
  8789. * @param {Array} array The array to inspect.
  8790. * @returns {Array} Returns the new duplicate free array.
  8791. * @example
  8792. *
  8793. * _.sortedUniq([1, 1, 2]);
  8794. * // => [1, 2]
  8795. */
  8796. function sortedUniq(array) {
  8797. return (array && array.length)
  8798. ? baseSortedUniq(array)
  8799. : [];
  8800. }
  8801. /**
  8802. * This method is like `_.uniqBy` except that it's designed and optimized
  8803. * for sorted arrays.
  8804. *
  8805. * @static
  8806. * @memberOf _
  8807. * @since 4.0.0
  8808. * @category Array
  8809. * @param {Array} array The array to inspect.
  8810. * @param {Function} [iteratee] The iteratee invoked per element.
  8811. * @returns {Array} Returns the new duplicate free array.
  8812. * @example
  8813. *
  8814. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8815. * // => [1.1, 2.3]
  8816. */
  8817. function sortedUniqBy(array, iteratee) {
  8818. return (array && array.length)
  8819. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8820. : [];
  8821. }
  8822. /**
  8823. * Gets all but the first element of `array`.
  8824. *
  8825. * @static
  8826. * @memberOf _
  8827. * @since 4.0.0
  8828. * @category Array
  8829. * @param {Array} array The array to query.
  8830. * @returns {Array} Returns the slice of `array`.
  8831. * @example
  8832. *
  8833. * _.tail([1, 2, 3]);
  8834. * // => [2, 3]
  8835. */
  8836. function tail(array) {
  8837. var length = array == null ? 0 : array.length;
  8838. return length ? baseSlice(array, 1, length) : [];
  8839. }
  8840. /**
  8841. * Creates a slice of `array` with `n` elements taken from the beginning.
  8842. *
  8843. * @static
  8844. * @memberOf _
  8845. * @since 0.1.0
  8846. * @category Array
  8847. * @param {Array} array The array to query.
  8848. * @param {number} [n=1] The number of elements to take.
  8849. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8850. * @returns {Array} Returns the slice of `array`.
  8851. * @example
  8852. *
  8853. * _.take([1, 2, 3]);
  8854. * // => [1]
  8855. *
  8856. * _.take([1, 2, 3], 2);
  8857. * // => [1, 2]
  8858. *
  8859. * _.take([1, 2, 3], 5);
  8860. * // => [1, 2, 3]
  8861. *
  8862. * _.take([1, 2, 3], 0);
  8863. * // => []
  8864. */
  8865. function take(array, n, guard) {
  8866. if (!(array && array.length)) {
  8867. return [];
  8868. }
  8869. n = (guard || n === undefined) ? 1 : toInteger(n);
  8870. return baseSlice(array, 0, n < 0 ? 0 : n);
  8871. }
  8872. /**
  8873. * Creates a slice of `array` with `n` elements taken from the end.
  8874. *
  8875. * @static
  8876. * @memberOf _
  8877. * @since 3.0.0
  8878. * @category Array
  8879. * @param {Array} array The array to query.
  8880. * @param {number} [n=1] The number of elements to take.
  8881. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8882. * @returns {Array} Returns the slice of `array`.
  8883. * @example
  8884. *
  8885. * _.takeRight([1, 2, 3]);
  8886. * // => [3]
  8887. *
  8888. * _.takeRight([1, 2, 3], 2);
  8889. * // => [2, 3]
  8890. *
  8891. * _.takeRight([1, 2, 3], 5);
  8892. * // => [1, 2, 3]
  8893. *
  8894. * _.takeRight([1, 2, 3], 0);
  8895. * // => []
  8896. */
  8897. function takeRight(array, n, guard) {
  8898. var length = array == null ? 0 : array.length;
  8899. if (!length) {
  8900. return [];
  8901. }
  8902. n = (guard || n === undefined) ? 1 : toInteger(n);
  8903. n = length - n;
  8904. return baseSlice(array, n < 0 ? 0 : n, length);
  8905. }
  8906. /**
  8907. * Creates a slice of `array` with elements taken from the end. Elements are
  8908. * taken until `predicate` returns falsey. The predicate is invoked with
  8909. * three arguments: (value, index, array).
  8910. *
  8911. * @static
  8912. * @memberOf _
  8913. * @since 3.0.0
  8914. * @category Array
  8915. * @param {Array} array The array to query.
  8916. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8917. * @returns {Array} Returns the slice of `array`.
  8918. * @example
  8919. *
  8920. * var users = [
  8921. * { 'user': 'barney', 'active': true },
  8922. * { 'user': 'fred', 'active': false },
  8923. * { 'user': 'pebbles', 'active': false }
  8924. * ];
  8925. *
  8926. * _.takeRightWhile(users, function(o) { return !o.active; });
  8927. * // => objects for ['fred', 'pebbles']
  8928. *
  8929. * // The `_.matches` iteratee shorthand.
  8930. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8931. * // => objects for ['pebbles']
  8932. *
  8933. * // The `_.matchesProperty` iteratee shorthand.
  8934. * _.takeRightWhile(users, ['active', false]);
  8935. * // => objects for ['fred', 'pebbles']
  8936. *
  8937. * // The `_.property` iteratee shorthand.
  8938. * _.takeRightWhile(users, 'active');
  8939. * // => []
  8940. */
  8941. function takeRightWhile(array, predicate) {
  8942. return (array && array.length)
  8943. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8944. : [];
  8945. }
  8946. /**
  8947. * Creates a slice of `array` with elements taken from the beginning. Elements
  8948. * are taken until `predicate` returns falsey. The predicate is invoked with
  8949. * three arguments: (value, index, array).
  8950. *
  8951. * @static
  8952. * @memberOf _
  8953. * @since 3.0.0
  8954. * @category Array
  8955. * @param {Array} array The array to query.
  8956. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8957. * @returns {Array} Returns the slice of `array`.
  8958. * @example
  8959. *
  8960. * var users = [
  8961. * { 'user': 'barney', 'active': false },
  8962. * { 'user': 'fred', 'active': false },
  8963. * { 'user': 'pebbles', 'active': true }
  8964. * ];
  8965. *
  8966. * _.takeWhile(users, function(o) { return !o.active; });
  8967. * // => objects for ['barney', 'fred']
  8968. *
  8969. * // The `_.matches` iteratee shorthand.
  8970. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8971. * // => objects for ['barney']
  8972. *
  8973. * // The `_.matchesProperty` iteratee shorthand.
  8974. * _.takeWhile(users, ['active', false]);
  8975. * // => objects for ['barney', 'fred']
  8976. *
  8977. * // The `_.property` iteratee shorthand.
  8978. * _.takeWhile(users, 'active');
  8979. * // => []
  8980. */
  8981. function takeWhile(array, predicate) {
  8982. return (array && array.length)
  8983. ? baseWhile(array, getIteratee(predicate, 3))
  8984. : [];
  8985. }
  8986. /**
  8987. * Creates an array of unique values, in order, from all given arrays using
  8988. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8989. * for equality comparisons.
  8990. *
  8991. * @static
  8992. * @memberOf _
  8993. * @since 0.1.0
  8994. * @category Array
  8995. * @param {...Array} [arrays] The arrays to inspect.
  8996. * @returns {Array} Returns the new array of combined values.
  8997. * @example
  8998. *
  8999. * _.union([2], [1, 2]);
  9000. * // => [2, 1]
  9001. */
  9002. var union = baseRest(function(arrays) {
  9003. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9004. });
  9005. /**
  9006. * This method is like `_.union` except that it accepts `iteratee` which is
  9007. * invoked for each element of each `arrays` to generate the criterion by
  9008. * which uniqueness is computed. Result values are chosen from the first
  9009. * array in which the value occurs. The iteratee is invoked with one argument:
  9010. * (value).
  9011. *
  9012. * @static
  9013. * @memberOf _
  9014. * @since 4.0.0
  9015. * @category Array
  9016. * @param {...Array} [arrays] The arrays to inspect.
  9017. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9018. * @returns {Array} Returns the new array of combined values.
  9019. * @example
  9020. *
  9021. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9022. * // => [2.1, 1.2]
  9023. *
  9024. * // The `_.property` iteratee shorthand.
  9025. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9026. * // => [{ 'x': 1 }, { 'x': 2 }]
  9027. */
  9028. var unionBy = baseRest(function(arrays) {
  9029. var iteratee = last(arrays);
  9030. if (isArrayLikeObject(iteratee)) {
  9031. iteratee = undefined;
  9032. }
  9033. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9034. });
  9035. /**
  9036. * This method is like `_.union` except that it accepts `comparator` which
  9037. * is invoked to compare elements of `arrays`. Result values are chosen from
  9038. * the first array in which the value occurs. The comparator is invoked
  9039. * with two arguments: (arrVal, othVal).
  9040. *
  9041. * @static
  9042. * @memberOf _
  9043. * @since 4.0.0
  9044. * @category Array
  9045. * @param {...Array} [arrays] The arrays to inspect.
  9046. * @param {Function} [comparator] The comparator invoked per element.
  9047. * @returns {Array} Returns the new array of combined values.
  9048. * @example
  9049. *
  9050. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9051. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9052. *
  9053. * _.unionWith(objects, others, _.isEqual);
  9054. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9055. */
  9056. var unionWith = baseRest(function(arrays) {
  9057. var comparator = last(arrays);
  9058. comparator = typeof comparator == 'function' ? comparator : undefined;
  9059. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9060. });
  9061. /**
  9062. * Creates a duplicate-free version of an array, using
  9063. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9064. * for equality comparisons, in which only the first occurrence of each element
  9065. * is kept. The order of result values is determined by the order they occur
  9066. * in the array.
  9067. *
  9068. * @static
  9069. * @memberOf _
  9070. * @since 0.1.0
  9071. * @category Array
  9072. * @param {Array} array The array to inspect.
  9073. * @returns {Array} Returns the new duplicate free array.
  9074. * @example
  9075. *
  9076. * _.uniq([2, 1, 2]);
  9077. * // => [2, 1]
  9078. */
  9079. function uniq(array) {
  9080. return (array && array.length) ? baseUniq(array) : [];
  9081. }
  9082. /**
  9083. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9084. * invoked for each element in `array` to generate the criterion by which
  9085. * uniqueness is computed. The order of result values is determined by the
  9086. * order they occur in the array. The iteratee is invoked with one argument:
  9087. * (value).
  9088. *
  9089. * @static
  9090. * @memberOf _
  9091. * @since 4.0.0
  9092. * @category Array
  9093. * @param {Array} array The array to inspect.
  9094. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9095. * @returns {Array} Returns the new duplicate free array.
  9096. * @example
  9097. *
  9098. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9099. * // => [2.1, 1.2]
  9100. *
  9101. * // The `_.property` iteratee shorthand.
  9102. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9103. * // => [{ 'x': 1 }, { 'x': 2 }]
  9104. */
  9105. function uniqBy(array, iteratee) {
  9106. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9107. }
  9108. /**
  9109. * This method is like `_.uniq` except that it accepts `comparator` which
  9110. * is invoked to compare elements of `array`. The order of result values is
  9111. * determined by the order they occur in the array.The comparator is invoked
  9112. * with two arguments: (arrVal, othVal).
  9113. *
  9114. * @static
  9115. * @memberOf _
  9116. * @since 4.0.0
  9117. * @category Array
  9118. * @param {Array} array The array to inspect.
  9119. * @param {Function} [comparator] The comparator invoked per element.
  9120. * @returns {Array} Returns the new duplicate free array.
  9121. * @example
  9122. *
  9123. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9124. *
  9125. * _.uniqWith(objects, _.isEqual);
  9126. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9127. */
  9128. function uniqWith(array, comparator) {
  9129. comparator = typeof comparator == 'function' ? comparator : undefined;
  9130. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9131. }
  9132. /**
  9133. * This method is like `_.zip` except that it accepts an array of grouped
  9134. * elements and creates an array regrouping the elements to their pre-zip
  9135. * configuration.
  9136. *
  9137. * @static
  9138. * @memberOf _
  9139. * @since 1.2.0
  9140. * @category Array
  9141. * @param {Array} array The array of grouped elements to process.
  9142. * @returns {Array} Returns the new array of regrouped elements.
  9143. * @example
  9144. *
  9145. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9146. * // => [['a', 1, true], ['b', 2, false]]
  9147. *
  9148. * _.unzip(zipped);
  9149. * // => [['a', 'b'], [1, 2], [true, false]]
  9150. */
  9151. function unzip(array) {
  9152. if (!(array && array.length)) {
  9153. return [];
  9154. }
  9155. var length = 0;
  9156. array = arrayFilter(array, function(group) {
  9157. if (isArrayLikeObject(group)) {
  9158. length = nativeMax(group.length, length);
  9159. return true;
  9160. }
  9161. });
  9162. return baseTimes(length, function(index) {
  9163. return arrayMap(array, baseProperty(index));
  9164. });
  9165. }
  9166. /**
  9167. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9168. * how regrouped values should be combined. The iteratee is invoked with the
  9169. * elements of each group: (...group).
  9170. *
  9171. * @static
  9172. * @memberOf _
  9173. * @since 3.8.0
  9174. * @category Array
  9175. * @param {Array} array The array of grouped elements to process.
  9176. * @param {Function} [iteratee=_.identity] The function to combine
  9177. * regrouped values.
  9178. * @returns {Array} Returns the new array of regrouped elements.
  9179. * @example
  9180. *
  9181. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9182. * // => [[1, 10, 100], [2, 20, 200]]
  9183. *
  9184. * _.unzipWith(zipped, _.add);
  9185. * // => [3, 30, 300]
  9186. */
  9187. function unzipWith(array, iteratee) {
  9188. if (!(array && array.length)) {
  9189. return [];
  9190. }
  9191. var result = unzip(array);
  9192. if (iteratee == null) {
  9193. return result;
  9194. }
  9195. return arrayMap(result, function(group) {
  9196. return apply(iteratee, undefined, group);
  9197. });
  9198. }
  9199. /**
  9200. * Creates an array excluding all given values using
  9201. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9202. * for equality comparisons.
  9203. *
  9204. * **Note:** Unlike `_.pull`, this method returns a new array.
  9205. *
  9206. * @static
  9207. * @memberOf _
  9208. * @since 0.1.0
  9209. * @category Array
  9210. * @param {Array} array The array to inspect.
  9211. * @param {...*} [values] The values to exclude.
  9212. * @returns {Array} Returns the new array of filtered values.
  9213. * @see _.difference, _.xor
  9214. * @example
  9215. *
  9216. * _.without([2, 1, 2, 3], 1, 2);
  9217. * // => [3]
  9218. */
  9219. var without = baseRest(function(array, values) {
  9220. return isArrayLikeObject(array)
  9221. ? baseDifference(array, values)
  9222. : [];
  9223. });
  9224. /**
  9225. * Creates an array of unique values that is the
  9226. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9227. * of the given arrays. The order of result values is determined by the order
  9228. * they occur in the arrays.
  9229. *
  9230. * @static
  9231. * @memberOf _
  9232. * @since 2.4.0
  9233. * @category Array
  9234. * @param {...Array} [arrays] The arrays to inspect.
  9235. * @returns {Array} Returns the new array of filtered values.
  9236. * @see _.difference, _.without
  9237. * @example
  9238. *
  9239. * _.xor([2, 1], [2, 3]);
  9240. * // => [1, 3]
  9241. */
  9242. var xor = baseRest(function(arrays) {
  9243. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9244. });
  9245. /**
  9246. * This method is like `_.xor` except that it accepts `iteratee` which is
  9247. * invoked for each element of each `arrays` to generate the criterion by
  9248. * which by which they're compared. The order of result values is determined
  9249. * by the order they occur in the arrays. The iteratee is invoked with one
  9250. * argument: (value).
  9251. *
  9252. * @static
  9253. * @memberOf _
  9254. * @since 4.0.0
  9255. * @category Array
  9256. * @param {...Array} [arrays] The arrays to inspect.
  9257. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9258. * @returns {Array} Returns the new array of filtered values.
  9259. * @example
  9260. *
  9261. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9262. * // => [1.2, 3.4]
  9263. *
  9264. * // The `_.property` iteratee shorthand.
  9265. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9266. * // => [{ 'x': 2 }]
  9267. */
  9268. var xorBy = baseRest(function(arrays) {
  9269. var iteratee = last(arrays);
  9270. if (isArrayLikeObject(iteratee)) {
  9271. iteratee = undefined;
  9272. }
  9273. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9274. });
  9275. /**
  9276. * This method is like `_.xor` except that it accepts `comparator` which is
  9277. * invoked to compare elements of `arrays`. The order of result values is
  9278. * determined by the order they occur in the arrays. The comparator is invoked
  9279. * with two arguments: (arrVal, othVal).
  9280. *
  9281. * @static
  9282. * @memberOf _
  9283. * @since 4.0.0
  9284. * @category Array
  9285. * @param {...Array} [arrays] The arrays to inspect.
  9286. * @param {Function} [comparator] The comparator invoked per element.
  9287. * @returns {Array} Returns the new array of filtered values.
  9288. * @example
  9289. *
  9290. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9291. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9292. *
  9293. * _.xorWith(objects, others, _.isEqual);
  9294. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9295. */
  9296. var xorWith = baseRest(function(arrays) {
  9297. var comparator = last(arrays);
  9298. comparator = typeof comparator == 'function' ? comparator : undefined;
  9299. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9300. });
  9301. /**
  9302. * Creates an array of grouped elements, the first of which contains the
  9303. * first elements of the given arrays, the second of which contains the
  9304. * second elements of the given arrays, and so on.
  9305. *
  9306. * @static
  9307. * @memberOf _
  9308. * @since 0.1.0
  9309. * @category Array
  9310. * @param {...Array} [arrays] The arrays to process.
  9311. * @returns {Array} Returns the new array of grouped elements.
  9312. * @example
  9313. *
  9314. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9315. * // => [['a', 1, true], ['b', 2, false]]
  9316. */
  9317. var zip = baseRest(unzip);
  9318. /**
  9319. * This method is like `_.fromPairs` except that it accepts two arrays,
  9320. * one of property identifiers and one of corresponding values.
  9321. *
  9322. * @static
  9323. * @memberOf _
  9324. * @since 0.4.0
  9325. * @category Array
  9326. * @param {Array} [props=[]] The property identifiers.
  9327. * @param {Array} [values=[]] The property values.
  9328. * @returns {Object} Returns the new object.
  9329. * @example
  9330. *
  9331. * _.zipObject(['a', 'b'], [1, 2]);
  9332. * // => { 'a': 1, 'b': 2 }
  9333. */
  9334. function zipObject(props, values) {
  9335. return baseZipObject(props || [], values || [], assignValue);
  9336. }
  9337. /**
  9338. * This method is like `_.zipObject` except that it supports property paths.
  9339. *
  9340. * @static
  9341. * @memberOf _
  9342. * @since 4.1.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. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9350. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9351. */
  9352. function zipObjectDeep(props, values) {
  9353. return baseZipObject(props || [], values || [], baseSet);
  9354. }
  9355. /**
  9356. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9357. * how grouped values should be combined. The iteratee is invoked with the
  9358. * elements of each group: (...group).
  9359. *
  9360. * @static
  9361. * @memberOf _
  9362. * @since 3.8.0
  9363. * @category Array
  9364. * @param {...Array} [arrays] The arrays to process.
  9365. * @param {Function} [iteratee=_.identity] The function to combine
  9366. * grouped values.
  9367. * @returns {Array} Returns the new array of grouped elements.
  9368. * @example
  9369. *
  9370. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9371. * return a + b + c;
  9372. * });
  9373. * // => [111, 222]
  9374. */
  9375. var zipWith = baseRest(function(arrays) {
  9376. var length = arrays.length,
  9377. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9378. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9379. return unzipWith(arrays, iteratee);
  9380. });
  9381. /*------------------------------------------------------------------------*/
  9382. /**
  9383. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9384. * chain sequences enabled. The result of such sequences must be unwrapped
  9385. * with `_#value`.
  9386. *
  9387. * @static
  9388. * @memberOf _
  9389. * @since 1.3.0
  9390. * @category Seq
  9391. * @param {*} value The value to wrap.
  9392. * @returns {Object} Returns the new `lodash` wrapper instance.
  9393. * @example
  9394. *
  9395. * var users = [
  9396. * { 'user': 'barney', 'age': 36 },
  9397. * { 'user': 'fred', 'age': 40 },
  9398. * { 'user': 'pebbles', 'age': 1 }
  9399. * ];
  9400. *
  9401. * var youngest = _
  9402. * .chain(users)
  9403. * .sortBy('age')
  9404. * .map(function(o) {
  9405. * return o.user + ' is ' + o.age;
  9406. * })
  9407. * .head()
  9408. * .value();
  9409. * // => 'pebbles is 1'
  9410. */
  9411. function chain(value) {
  9412. var result = lodash(value);
  9413. result.__chain__ = true;
  9414. return result;
  9415. }
  9416. /**
  9417. * This method invokes `interceptor` and returns `value`. The interceptor
  9418. * is invoked with one argument; (value). The purpose of this method is to
  9419. * "tap into" a method chain sequence in order to modify intermediate results.
  9420. *
  9421. * @static
  9422. * @memberOf _
  9423. * @since 0.1.0
  9424. * @category Seq
  9425. * @param {*} value The value to provide to `interceptor`.
  9426. * @param {Function} interceptor The function to invoke.
  9427. * @returns {*} Returns `value`.
  9428. * @example
  9429. *
  9430. * _([1, 2, 3])
  9431. * .tap(function(array) {
  9432. * // Mutate input array.
  9433. * array.pop();
  9434. * })
  9435. * .reverse()
  9436. * .value();
  9437. * // => [2, 1]
  9438. */
  9439. function tap(value, interceptor) {
  9440. interceptor(value);
  9441. return value;
  9442. }
  9443. /**
  9444. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9445. * The purpose of this method is to "pass thru" values replacing intermediate
  9446. * results in a method chain sequence.
  9447. *
  9448. * @static
  9449. * @memberOf _
  9450. * @since 3.0.0
  9451. * @category Seq
  9452. * @param {*} value The value to provide to `interceptor`.
  9453. * @param {Function} interceptor The function to invoke.
  9454. * @returns {*} Returns the result of `interceptor`.
  9455. * @example
  9456. *
  9457. * _(' abc ')
  9458. * .chain()
  9459. * .trim()
  9460. * .thru(function(value) {
  9461. * return [value];
  9462. * })
  9463. * .value();
  9464. * // => ['abc']
  9465. */
  9466. function thru(value, interceptor) {
  9467. return interceptor(value);
  9468. }
  9469. /**
  9470. * This method is the wrapper version of `_.at`.
  9471. *
  9472. * @name at
  9473. * @memberOf _
  9474. * @since 1.0.0
  9475. * @category Seq
  9476. * @param {...(string|string[])} [paths] The property paths to pick.
  9477. * @returns {Object} Returns the new `lodash` wrapper instance.
  9478. * @example
  9479. *
  9480. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9481. *
  9482. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9483. * // => [3, 4]
  9484. */
  9485. var wrapperAt = flatRest(function(paths) {
  9486. var length = paths.length,
  9487. start = length ? paths[0] : 0,
  9488. value = this.__wrapped__,
  9489. interceptor = function(object) { return baseAt(object, paths); };
  9490. if (length > 1 || this.__actions__.length ||
  9491. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9492. return this.thru(interceptor);
  9493. }
  9494. value = value.slice(start, +start + (length ? 1 : 0));
  9495. value.__actions__.push({
  9496. 'func': thru,
  9497. 'args': [interceptor],
  9498. 'thisArg': undefined
  9499. });
  9500. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9501. if (length && !array.length) {
  9502. array.push(undefined);
  9503. }
  9504. return array;
  9505. });
  9506. });
  9507. /**
  9508. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9509. *
  9510. * @name chain
  9511. * @memberOf _
  9512. * @since 0.1.0
  9513. * @category Seq
  9514. * @returns {Object} Returns the new `lodash` wrapper instance.
  9515. * @example
  9516. *
  9517. * var users = [
  9518. * { 'user': 'barney', 'age': 36 },
  9519. * { 'user': 'fred', 'age': 40 }
  9520. * ];
  9521. *
  9522. * // A sequence without explicit chaining.
  9523. * _(users).head();
  9524. * // => { 'user': 'barney', 'age': 36 }
  9525. *
  9526. * // A sequence with explicit chaining.
  9527. * _(users)
  9528. * .chain()
  9529. * .head()
  9530. * .pick('user')
  9531. * .value();
  9532. * // => { 'user': 'barney' }
  9533. */
  9534. function wrapperChain() {
  9535. return chain(this);
  9536. }
  9537. /**
  9538. * Executes the chain sequence and returns the wrapped result.
  9539. *
  9540. * @name commit
  9541. * @memberOf _
  9542. * @since 3.2.0
  9543. * @category Seq
  9544. * @returns {Object} Returns the new `lodash` wrapper instance.
  9545. * @example
  9546. *
  9547. * var array = [1, 2];
  9548. * var wrapped = _(array).push(3);
  9549. *
  9550. * console.log(array);
  9551. * // => [1, 2]
  9552. *
  9553. * wrapped = wrapped.commit();
  9554. * console.log(array);
  9555. * // => [1, 2, 3]
  9556. *
  9557. * wrapped.last();
  9558. * // => 3
  9559. *
  9560. * console.log(array);
  9561. * // => [1, 2, 3]
  9562. */
  9563. function wrapperCommit() {
  9564. return new LodashWrapper(this.value(), this.__chain__);
  9565. }
  9566. /**
  9567. * Gets the next value on a wrapped object following the
  9568. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9569. *
  9570. * @name next
  9571. * @memberOf _
  9572. * @since 4.0.0
  9573. * @category Seq
  9574. * @returns {Object} Returns the next iterator value.
  9575. * @example
  9576. *
  9577. * var wrapped = _([1, 2]);
  9578. *
  9579. * wrapped.next();
  9580. * // => { 'done': false, 'value': 1 }
  9581. *
  9582. * wrapped.next();
  9583. * // => { 'done': false, 'value': 2 }
  9584. *
  9585. * wrapped.next();
  9586. * // => { 'done': true, 'value': undefined }
  9587. */
  9588. function wrapperNext() {
  9589. if (this.__values__ === undefined) {
  9590. this.__values__ = toArray(this.value());
  9591. }
  9592. var done = this.__index__ >= this.__values__.length,
  9593. value = done ? undefined : this.__values__[this.__index__++];
  9594. return { 'done': done, 'value': value };
  9595. }
  9596. /**
  9597. * Enables the wrapper to be iterable.
  9598. *
  9599. * @name Symbol.iterator
  9600. * @memberOf _
  9601. * @since 4.0.0
  9602. * @category Seq
  9603. * @returns {Object} Returns the wrapper object.
  9604. * @example
  9605. *
  9606. * var wrapped = _([1, 2]);
  9607. *
  9608. * wrapped[Symbol.iterator]() === wrapped;
  9609. * // => true
  9610. *
  9611. * Array.from(wrapped);
  9612. * // => [1, 2]
  9613. */
  9614. function wrapperToIterator() {
  9615. return this;
  9616. }
  9617. /**
  9618. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9619. *
  9620. * @name plant
  9621. * @memberOf _
  9622. * @since 3.2.0
  9623. * @category Seq
  9624. * @param {*} value The value to plant.
  9625. * @returns {Object} Returns the new `lodash` wrapper instance.
  9626. * @example
  9627. *
  9628. * function square(n) {
  9629. * return n * n;
  9630. * }
  9631. *
  9632. * var wrapped = _([1, 2]).map(square);
  9633. * var other = wrapped.plant([3, 4]);
  9634. *
  9635. * other.value();
  9636. * // => [9, 16]
  9637. *
  9638. * wrapped.value();
  9639. * // => [1, 4]
  9640. */
  9641. function wrapperPlant(value) {
  9642. var result,
  9643. parent = this;
  9644. while (parent instanceof baseLodash) {
  9645. var clone = wrapperClone(parent);
  9646. clone.__index__ = 0;
  9647. clone.__values__ = undefined;
  9648. if (result) {
  9649. previous.__wrapped__ = clone;
  9650. } else {
  9651. result = clone;
  9652. }
  9653. var previous = clone;
  9654. parent = parent.__wrapped__;
  9655. }
  9656. previous.__wrapped__ = value;
  9657. return result;
  9658. }
  9659. /**
  9660. * This method is the wrapper version of `_.reverse`.
  9661. *
  9662. * **Note:** This method mutates the wrapped array.
  9663. *
  9664. * @name reverse
  9665. * @memberOf _
  9666. * @since 0.1.0
  9667. * @category Seq
  9668. * @returns {Object} Returns the new `lodash` wrapper instance.
  9669. * @example
  9670. *
  9671. * var array = [1, 2, 3];
  9672. *
  9673. * _(array).reverse().value()
  9674. * // => [3, 2, 1]
  9675. *
  9676. * console.log(array);
  9677. * // => [3, 2, 1]
  9678. */
  9679. function wrapperReverse() {
  9680. var value = this.__wrapped__;
  9681. if (value instanceof LazyWrapper) {
  9682. var wrapped = value;
  9683. if (this.__actions__.length) {
  9684. wrapped = new LazyWrapper(this);
  9685. }
  9686. wrapped = wrapped.reverse();
  9687. wrapped.__actions__.push({
  9688. 'func': thru,
  9689. 'args': [reverse],
  9690. 'thisArg': undefined
  9691. });
  9692. return new LodashWrapper(wrapped, this.__chain__);
  9693. }
  9694. return this.thru(reverse);
  9695. }
  9696. /**
  9697. * Executes the chain sequence to resolve the unwrapped value.
  9698. *
  9699. * @name value
  9700. * @memberOf _
  9701. * @since 0.1.0
  9702. * @alias toJSON, valueOf
  9703. * @category Seq
  9704. * @returns {*} Returns the resolved unwrapped value.
  9705. * @example
  9706. *
  9707. * _([1, 2, 3]).value();
  9708. * // => [1, 2, 3]
  9709. */
  9710. function wrapperValue() {
  9711. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9712. }
  9713. /*------------------------------------------------------------------------*/
  9714. /**
  9715. * Creates an object composed of keys generated from the results of running
  9716. * each element of `collection` thru `iteratee`. The corresponding value of
  9717. * each key is the number of times the key was returned by `iteratee`. The
  9718. * iteratee is invoked with one argument: (value).
  9719. *
  9720. * @static
  9721. * @memberOf _
  9722. * @since 0.5.0
  9723. * @category Collection
  9724. * @param {Array|Object} collection The collection to iterate over.
  9725. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9726. * @returns {Object} Returns the composed aggregate object.
  9727. * @example
  9728. *
  9729. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9730. * // => { '4': 1, '6': 2 }
  9731. *
  9732. * // The `_.property` iteratee shorthand.
  9733. * _.countBy(['one', 'two', 'three'], 'length');
  9734. * // => { '3': 2, '5': 1 }
  9735. */
  9736. var countBy = createAggregator(function(result, value, key) {
  9737. if (hasOwnProperty.call(result, key)) {
  9738. ++result[key];
  9739. } else {
  9740. baseAssignValue(result, key, 1);
  9741. }
  9742. });
  9743. /**
  9744. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9745. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9746. * invoked with three arguments: (value, index|key, collection).
  9747. *
  9748. * **Note:** This method returns `true` for
  9749. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9750. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9751. * elements of empty collections.
  9752. *
  9753. * @static
  9754. * @memberOf _
  9755. * @since 0.1.0
  9756. * @category Collection
  9757. * @param {Array|Object} collection The collection to iterate over.
  9758. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9759. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9760. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9761. * else `false`.
  9762. * @example
  9763. *
  9764. * _.every([true, 1, null, 'yes'], Boolean);
  9765. * // => false
  9766. *
  9767. * var users = [
  9768. * { 'user': 'barney', 'age': 36, 'active': false },
  9769. * { 'user': 'fred', 'age': 40, 'active': false }
  9770. * ];
  9771. *
  9772. * // The `_.matches` iteratee shorthand.
  9773. * _.every(users, { 'user': 'barney', 'active': false });
  9774. * // => false
  9775. *
  9776. * // The `_.matchesProperty` iteratee shorthand.
  9777. * _.every(users, ['active', false]);
  9778. * // => true
  9779. *
  9780. * // The `_.property` iteratee shorthand.
  9781. * _.every(users, 'active');
  9782. * // => false
  9783. */
  9784. function every(collection, predicate, guard) {
  9785. var func = isArray(collection) ? arrayEvery : baseEvery;
  9786. if (guard && isIterateeCall(collection, predicate, guard)) {
  9787. predicate = undefined;
  9788. }
  9789. return func(collection, getIteratee(predicate, 3));
  9790. }
  9791. /**
  9792. * Iterates over elements of `collection`, returning an array of all elements
  9793. * `predicate` returns truthy for. The predicate is invoked with three
  9794. * arguments: (value, index|key, collection).
  9795. *
  9796. * **Note:** Unlike `_.remove`, this method returns a new array.
  9797. *
  9798. * @static
  9799. * @memberOf _
  9800. * @since 0.1.0
  9801. * @category Collection
  9802. * @param {Array|Object} collection The collection to iterate over.
  9803. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9804. * @returns {Array} Returns the new filtered array.
  9805. * @see _.reject
  9806. * @example
  9807. *
  9808. * var users = [
  9809. * { 'user': 'barney', 'age': 36, 'active': true },
  9810. * { 'user': 'fred', 'age': 40, 'active': false }
  9811. * ];
  9812. *
  9813. * _.filter(users, function(o) { return !o.active; });
  9814. * // => objects for ['fred']
  9815. *
  9816. * // The `_.matches` iteratee shorthand.
  9817. * _.filter(users, { 'age': 36, 'active': true });
  9818. * // => objects for ['barney']
  9819. *
  9820. * // The `_.matchesProperty` iteratee shorthand.
  9821. * _.filter(users, ['active', false]);
  9822. * // => objects for ['fred']
  9823. *
  9824. * // The `_.property` iteratee shorthand.
  9825. * _.filter(users, 'active');
  9826. * // => objects for ['barney']
  9827. *
  9828. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9829. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9830. * // => objects for ['fred', 'barney']
  9831. */
  9832. function filter(collection, predicate) {
  9833. var func = isArray(collection) ? arrayFilter : baseFilter;
  9834. return func(collection, getIteratee(predicate, 3));
  9835. }
  9836. /**
  9837. * Iterates over elements of `collection`, returning the first element
  9838. * `predicate` returns truthy for. The predicate is invoked with three
  9839. * arguments: (value, index|key, collection).
  9840. *
  9841. * @static
  9842. * @memberOf _
  9843. * @since 0.1.0
  9844. * @category Collection
  9845. * @param {Array|Object} collection The collection to inspect.
  9846. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9847. * @param {number} [fromIndex=0] The index to search from.
  9848. * @returns {*} Returns the matched element, else `undefined`.
  9849. * @example
  9850. *
  9851. * var users = [
  9852. * { 'user': 'barney', 'age': 36, 'active': true },
  9853. * { 'user': 'fred', 'age': 40, 'active': false },
  9854. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9855. * ];
  9856. *
  9857. * _.find(users, function(o) { return o.age < 40; });
  9858. * // => object for 'barney'
  9859. *
  9860. * // The `_.matches` iteratee shorthand.
  9861. * _.find(users, { 'age': 1, 'active': true });
  9862. * // => object for 'pebbles'
  9863. *
  9864. * // The `_.matchesProperty` iteratee shorthand.
  9865. * _.find(users, ['active', false]);
  9866. * // => object for 'fred'
  9867. *
  9868. * // The `_.property` iteratee shorthand.
  9869. * _.find(users, 'active');
  9870. * // => object for 'barney'
  9871. */
  9872. var find = createFind(findIndex);
  9873. /**
  9874. * This method is like `_.find` except that it iterates over elements of
  9875. * `collection` from right to left.
  9876. *
  9877. * @static
  9878. * @memberOf _
  9879. * @since 2.0.0
  9880. * @category Collection
  9881. * @param {Array|Object} collection The collection to inspect.
  9882. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9883. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9884. * @returns {*} Returns the matched element, else `undefined`.
  9885. * @example
  9886. *
  9887. * _.findLast([1, 2, 3, 4], function(n) {
  9888. * return n % 2 == 1;
  9889. * });
  9890. * // => 3
  9891. */
  9892. var findLast = createFind(findLastIndex);
  9893. /**
  9894. * Creates a flattened array of values by running each element in `collection`
  9895. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9896. * with three arguments: (value, index|key, collection).
  9897. *
  9898. * @static
  9899. * @memberOf _
  9900. * @since 4.0.0
  9901. * @category Collection
  9902. * @param {Array|Object} collection The collection to iterate over.
  9903. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9904. * @returns {Array} Returns the new flattened array.
  9905. * @example
  9906. *
  9907. * function duplicate(n) {
  9908. * return [n, n];
  9909. * }
  9910. *
  9911. * _.flatMap([1, 2], duplicate);
  9912. * // => [1, 1, 2, 2]
  9913. */
  9914. function flatMap(collection, iteratee) {
  9915. return baseFlatten(map(collection, iteratee), 1);
  9916. }
  9917. /**
  9918. * This method is like `_.flatMap` except that it recursively flattens the
  9919. * mapped results.
  9920. *
  9921. * @static
  9922. * @memberOf _
  9923. * @since 4.7.0
  9924. * @category Collection
  9925. * @param {Array|Object} collection The collection to iterate over.
  9926. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9927. * @returns {Array} Returns the new flattened array.
  9928. * @example
  9929. *
  9930. * function duplicate(n) {
  9931. * return [[[n, n]]];
  9932. * }
  9933. *
  9934. * _.flatMapDeep([1, 2], duplicate);
  9935. * // => [1, 1, 2, 2]
  9936. */
  9937. function flatMapDeep(collection, iteratee) {
  9938. return baseFlatten(map(collection, iteratee), INFINITY);
  9939. }
  9940. /**
  9941. * This method is like `_.flatMap` except that it recursively flattens the
  9942. * mapped results up to `depth` times.
  9943. *
  9944. * @static
  9945. * @memberOf _
  9946. * @since 4.7.0
  9947. * @category Collection
  9948. * @param {Array|Object} collection The collection to iterate over.
  9949. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9950. * @param {number} [depth=1] The maximum recursion depth.
  9951. * @returns {Array} Returns the new flattened array.
  9952. * @example
  9953. *
  9954. * function duplicate(n) {
  9955. * return [[[n, n]]];
  9956. * }
  9957. *
  9958. * _.flatMapDepth([1, 2], duplicate, 2);
  9959. * // => [[1, 1], [2, 2]]
  9960. */
  9961. function flatMapDepth(collection, iteratee, depth) {
  9962. depth = depth === undefined ? 1 : toInteger(depth);
  9963. return baseFlatten(map(collection, iteratee), depth);
  9964. }
  9965. /**
  9966. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9967. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9968. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9969. *
  9970. * **Note:** As with other "Collections" methods, objects with a "length"
  9971. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9972. * or `_.forOwn` for object iteration.
  9973. *
  9974. * @static
  9975. * @memberOf _
  9976. * @since 0.1.0
  9977. * @alias each
  9978. * @category Collection
  9979. * @param {Array|Object} collection The collection to iterate over.
  9980. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9981. * @returns {Array|Object} Returns `collection`.
  9982. * @see _.forEachRight
  9983. * @example
  9984. *
  9985. * _.forEach([1, 2], function(value) {
  9986. * console.log(value);
  9987. * });
  9988. * // => Logs `1` then `2`.
  9989. *
  9990. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9991. * console.log(key);
  9992. * });
  9993. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9994. */
  9995. function forEach(collection, iteratee) {
  9996. var func = isArray(collection) ? arrayEach : baseEach;
  9997. return func(collection, getIteratee(iteratee, 3));
  9998. }
  9999. /**
  10000. * This method is like `_.forEach` except that it iterates over elements of
  10001. * `collection` from right to left.
  10002. *
  10003. * @static
  10004. * @memberOf _
  10005. * @since 2.0.0
  10006. * @alias eachRight
  10007. * @category Collection
  10008. * @param {Array|Object} collection The collection to iterate over.
  10009. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10010. * @returns {Array|Object} Returns `collection`.
  10011. * @see _.forEach
  10012. * @example
  10013. *
  10014. * _.forEachRight([1, 2], function(value) {
  10015. * console.log(value);
  10016. * });
  10017. * // => Logs `2` then `1`.
  10018. */
  10019. function forEachRight(collection, iteratee) {
  10020. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10021. return func(collection, getIteratee(iteratee, 3));
  10022. }
  10023. /**
  10024. * Creates an object composed of keys generated from the results of running
  10025. * each element of `collection` thru `iteratee`. The order of grouped values
  10026. * is determined by the order they occur in `collection`. The corresponding
  10027. * value of each key is an array of elements responsible for generating the
  10028. * key. The iteratee is invoked with one argument: (value).
  10029. *
  10030. * @static
  10031. * @memberOf _
  10032. * @since 0.1.0
  10033. * @category Collection
  10034. * @param {Array|Object} collection The collection to iterate over.
  10035. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10036. * @returns {Object} Returns the composed aggregate object.
  10037. * @example
  10038. *
  10039. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10040. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10041. *
  10042. * // The `_.property` iteratee shorthand.
  10043. * _.groupBy(['one', 'two', 'three'], 'length');
  10044. * // => { '3': ['one', 'two'], '5': ['three'] }
  10045. */
  10046. var groupBy = createAggregator(function(result, value, key) {
  10047. if (hasOwnProperty.call(result, key)) {
  10048. result[key].push(value);
  10049. } else {
  10050. baseAssignValue(result, key, [value]);
  10051. }
  10052. });
  10053. /**
  10054. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10055. * checked for a substring of `value`, otherwise
  10056. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10057. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10058. * the offset from the end of `collection`.
  10059. *
  10060. * @static
  10061. * @memberOf _
  10062. * @since 0.1.0
  10063. * @category Collection
  10064. * @param {Array|Object|string} collection The collection to inspect.
  10065. * @param {*} value The value to search for.
  10066. * @param {number} [fromIndex=0] The index to search from.
  10067. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10068. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10069. * @example
  10070. *
  10071. * _.includes([1, 2, 3], 1);
  10072. * // => true
  10073. *
  10074. * _.includes([1, 2, 3], 1, 2);
  10075. * // => false
  10076. *
  10077. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10078. * // => true
  10079. *
  10080. * _.includes('abcd', 'bc');
  10081. * // => true
  10082. */
  10083. function includes(collection, value, fromIndex, guard) {
  10084. collection = isArrayLike(collection) ? collection : values(collection);
  10085. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10086. var length = collection.length;
  10087. if (fromIndex < 0) {
  10088. fromIndex = nativeMax(length + fromIndex, 0);
  10089. }
  10090. return isString(collection)
  10091. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10092. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10093. }
  10094. /**
  10095. * Invokes the method at `path` of each element in `collection`, returning
  10096. * an array of the results of each invoked method. Any additional arguments
  10097. * are provided to each invoked method. If `path` is a function, it's invoked
  10098. * for, and `this` bound to, each element in `collection`.
  10099. *
  10100. * @static
  10101. * @memberOf _
  10102. * @since 4.0.0
  10103. * @category Collection
  10104. * @param {Array|Object} collection The collection to iterate over.
  10105. * @param {Array|Function|string} path The path of the method to invoke or
  10106. * the function invoked per iteration.
  10107. * @param {...*} [args] The arguments to invoke each method with.
  10108. * @returns {Array} Returns the array of results.
  10109. * @example
  10110. *
  10111. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10112. * // => [[1, 5, 7], [1, 2, 3]]
  10113. *
  10114. * _.invokeMap([123, 456], String.prototype.split, '');
  10115. * // => [['1', '2', '3'], ['4', '5', '6']]
  10116. */
  10117. var invokeMap = baseRest(function(collection, path, args) {
  10118. var index = -1,
  10119. isFunc = typeof path == 'function',
  10120. result = isArrayLike(collection) ? Array(collection.length) : [];
  10121. baseEach(collection, function(value) {
  10122. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10123. });
  10124. return result;
  10125. });
  10126. /**
  10127. * Creates an object composed of keys generated from the results of running
  10128. * each element of `collection` thru `iteratee`. The corresponding value of
  10129. * each key is the last element responsible for generating the key. The
  10130. * iteratee is invoked with one argument: (value).
  10131. *
  10132. * @static
  10133. * @memberOf _
  10134. * @since 4.0.0
  10135. * @category Collection
  10136. * @param {Array|Object} collection The collection to iterate over.
  10137. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10138. * @returns {Object} Returns the composed aggregate object.
  10139. * @example
  10140. *
  10141. * var array = [
  10142. * { 'dir': 'left', 'code': 97 },
  10143. * { 'dir': 'right', 'code': 100 }
  10144. * ];
  10145. *
  10146. * _.keyBy(array, function(o) {
  10147. * return String.fromCharCode(o.code);
  10148. * });
  10149. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10150. *
  10151. * _.keyBy(array, 'dir');
  10152. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10153. */
  10154. var keyBy = createAggregator(function(result, value, key) {
  10155. baseAssignValue(result, key, value);
  10156. });
  10157. /**
  10158. * Creates an array of values by running each element in `collection` thru
  10159. * `iteratee`. The iteratee is invoked with three arguments:
  10160. * (value, index|key, collection).
  10161. *
  10162. * Many lodash methods are guarded to work as iteratees for methods like
  10163. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10164. *
  10165. * The guarded methods are:
  10166. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10167. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10168. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10169. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10170. *
  10171. * @static
  10172. * @memberOf _
  10173. * @since 0.1.0
  10174. * @category Collection
  10175. * @param {Array|Object} collection The collection to iterate over.
  10176. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10177. * @returns {Array} Returns the new mapped array.
  10178. * @example
  10179. *
  10180. * function square(n) {
  10181. * return n * n;
  10182. * }
  10183. *
  10184. * _.map([4, 8], square);
  10185. * // => [16, 64]
  10186. *
  10187. * _.map({ 'a': 4, 'b': 8 }, square);
  10188. * // => [16, 64] (iteration order is not guaranteed)
  10189. *
  10190. * var users = [
  10191. * { 'user': 'barney' },
  10192. * { 'user': 'fred' }
  10193. * ];
  10194. *
  10195. * // The `_.property` iteratee shorthand.
  10196. * _.map(users, 'user');
  10197. * // => ['barney', 'fred']
  10198. */
  10199. function map(collection, iteratee) {
  10200. var func = isArray(collection) ? arrayMap : baseMap;
  10201. return func(collection, getIteratee(iteratee, 3));
  10202. }
  10203. /**
  10204. * This method is like `_.sortBy` except that it allows specifying the sort
  10205. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10206. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10207. * descending or "asc" for ascending sort order of corresponding values.
  10208. *
  10209. * @static
  10210. * @memberOf _
  10211. * @since 4.0.0
  10212. * @category Collection
  10213. * @param {Array|Object} collection The collection to iterate over.
  10214. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10215. * The iteratees to sort by.
  10216. * @param {string[]} [orders] The sort orders of `iteratees`.
  10217. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10218. * @returns {Array} Returns the new sorted array.
  10219. * @example
  10220. *
  10221. * var users = [
  10222. * { 'user': 'fred', 'age': 48 },
  10223. * { 'user': 'barney', 'age': 34 },
  10224. * { 'user': 'fred', 'age': 40 },
  10225. * { 'user': 'barney', 'age': 36 }
  10226. * ];
  10227. *
  10228. * // Sort by `user` in ascending order and by `age` in descending order.
  10229. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10230. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10231. */
  10232. function orderBy(collection, iteratees, orders, guard) {
  10233. if (collection == null) {
  10234. return [];
  10235. }
  10236. if (!isArray(iteratees)) {
  10237. iteratees = iteratees == null ? [] : [iteratees];
  10238. }
  10239. orders = guard ? undefined : orders;
  10240. if (!isArray(orders)) {
  10241. orders = orders == null ? [] : [orders];
  10242. }
  10243. return baseOrderBy(collection, iteratees, orders);
  10244. }
  10245. /**
  10246. * Creates an array of elements split into two groups, the first of which
  10247. * contains elements `predicate` returns truthy for, the second of which
  10248. * contains elements `predicate` returns falsey for. The predicate is
  10249. * invoked with one argument: (value).
  10250. *
  10251. * @static
  10252. * @memberOf _
  10253. * @since 3.0.0
  10254. * @category Collection
  10255. * @param {Array|Object} collection The collection to iterate over.
  10256. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10257. * @returns {Array} Returns the array of grouped elements.
  10258. * @example
  10259. *
  10260. * var users = [
  10261. * { 'user': 'barney', 'age': 36, 'active': false },
  10262. * { 'user': 'fred', 'age': 40, 'active': true },
  10263. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10264. * ];
  10265. *
  10266. * _.partition(users, function(o) { return o.active; });
  10267. * // => objects for [['fred'], ['barney', 'pebbles']]
  10268. *
  10269. * // The `_.matches` iteratee shorthand.
  10270. * _.partition(users, { 'age': 1, 'active': false });
  10271. * // => objects for [['pebbles'], ['barney', 'fred']]
  10272. *
  10273. * // The `_.matchesProperty` iteratee shorthand.
  10274. * _.partition(users, ['active', false]);
  10275. * // => objects for [['barney', 'pebbles'], ['fred']]
  10276. *
  10277. * // The `_.property` iteratee shorthand.
  10278. * _.partition(users, 'active');
  10279. * // => objects for [['fred'], ['barney', 'pebbles']]
  10280. */
  10281. var partition = createAggregator(function(result, value, key) {
  10282. result[key ? 0 : 1].push(value);
  10283. }, function() { return [[], []]; });
  10284. /**
  10285. * Reduces `collection` to a value which is the accumulated result of running
  10286. * each element in `collection` thru `iteratee`, where each successive
  10287. * invocation is supplied the return value of the previous. If `accumulator`
  10288. * is not given, the first element of `collection` is used as the initial
  10289. * value. The iteratee is invoked with four arguments:
  10290. * (accumulator, value, index|key, collection).
  10291. *
  10292. * Many lodash methods are guarded to work as iteratees for methods like
  10293. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10294. *
  10295. * The guarded methods are:
  10296. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10297. * and `sortBy`
  10298. *
  10299. * @static
  10300. * @memberOf _
  10301. * @since 0.1.0
  10302. * @category Collection
  10303. * @param {Array|Object} collection The collection to iterate over.
  10304. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10305. * @param {*} [accumulator] The initial value.
  10306. * @returns {*} Returns the accumulated value.
  10307. * @see _.reduceRight
  10308. * @example
  10309. *
  10310. * _.reduce([1, 2], function(sum, n) {
  10311. * return sum + n;
  10312. * }, 0);
  10313. * // => 3
  10314. *
  10315. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10316. * (result[value] || (result[value] = [])).push(key);
  10317. * return result;
  10318. * }, {});
  10319. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10320. */
  10321. function reduce(collection, iteratee, accumulator) {
  10322. var func = isArray(collection) ? arrayReduce : baseReduce,
  10323. initAccum = arguments.length < 3;
  10324. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10325. }
  10326. /**
  10327. * This method is like `_.reduce` except that it iterates over elements of
  10328. * `collection` from right to left.
  10329. *
  10330. * @static
  10331. * @memberOf _
  10332. * @since 0.1.0
  10333. * @category Collection
  10334. * @param {Array|Object} collection The collection to iterate over.
  10335. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10336. * @param {*} [accumulator] The initial value.
  10337. * @returns {*} Returns the accumulated value.
  10338. * @see _.reduce
  10339. * @example
  10340. *
  10341. * var array = [[0, 1], [2, 3], [4, 5]];
  10342. *
  10343. * _.reduceRight(array, function(flattened, other) {
  10344. * return flattened.concat(other);
  10345. * }, []);
  10346. * // => [4, 5, 2, 3, 0, 1]
  10347. */
  10348. function reduceRight(collection, iteratee, accumulator) {
  10349. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10350. initAccum = arguments.length < 3;
  10351. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10352. }
  10353. /**
  10354. * The opposite of `_.filter`; this method returns the elements of `collection`
  10355. * that `predicate` does **not** return truthy for.
  10356. *
  10357. * @static
  10358. * @memberOf _
  10359. * @since 0.1.0
  10360. * @category Collection
  10361. * @param {Array|Object} collection The collection to iterate over.
  10362. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10363. * @returns {Array} Returns the new filtered array.
  10364. * @see _.filter
  10365. * @example
  10366. *
  10367. * var users = [
  10368. * { 'user': 'barney', 'age': 36, 'active': false },
  10369. * { 'user': 'fred', 'age': 40, 'active': true }
  10370. * ];
  10371. *
  10372. * _.reject(users, function(o) { return !o.active; });
  10373. * // => objects for ['fred']
  10374. *
  10375. * // The `_.matches` iteratee shorthand.
  10376. * _.reject(users, { 'age': 40, 'active': true });
  10377. * // => objects for ['barney']
  10378. *
  10379. * // The `_.matchesProperty` iteratee shorthand.
  10380. * _.reject(users, ['active', false]);
  10381. * // => objects for ['fred']
  10382. *
  10383. * // The `_.property` iteratee shorthand.
  10384. * _.reject(users, 'active');
  10385. * // => objects for ['barney']
  10386. */
  10387. function reject(collection, predicate) {
  10388. var func = isArray(collection) ? arrayFilter : baseFilter;
  10389. return func(collection, negate(getIteratee(predicate, 3)));
  10390. }
  10391. /**
  10392. * Gets a random element from `collection`.
  10393. *
  10394. * @static
  10395. * @memberOf _
  10396. * @since 2.0.0
  10397. * @category Collection
  10398. * @param {Array|Object} collection The collection to sample.
  10399. * @returns {*} Returns the random element.
  10400. * @example
  10401. *
  10402. * _.sample([1, 2, 3, 4]);
  10403. * // => 2
  10404. */
  10405. function sample(collection) {
  10406. var func = isArray(collection) ? arraySample : baseSample;
  10407. return func(collection);
  10408. }
  10409. /**
  10410. * Gets `n` random elements at unique keys from `collection` up to the
  10411. * size of `collection`.
  10412. *
  10413. * @static
  10414. * @memberOf _
  10415. * @since 4.0.0
  10416. * @category Collection
  10417. * @param {Array|Object} collection The collection to sample.
  10418. * @param {number} [n=1] The number of elements to sample.
  10419. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10420. * @returns {Array} Returns the random elements.
  10421. * @example
  10422. *
  10423. * _.sampleSize([1, 2, 3], 2);
  10424. * // => [3, 1]
  10425. *
  10426. * _.sampleSize([1, 2, 3], 4);
  10427. * // => [2, 3, 1]
  10428. */
  10429. function sampleSize(collection, n, guard) {
  10430. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10431. n = 1;
  10432. } else {
  10433. n = toInteger(n);
  10434. }
  10435. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10436. return func(collection, n);
  10437. }
  10438. /**
  10439. * Creates an array of shuffled values, using a version of the
  10440. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10441. *
  10442. * @static
  10443. * @memberOf _
  10444. * @since 0.1.0
  10445. * @category Collection
  10446. * @param {Array|Object} collection The collection to shuffle.
  10447. * @returns {Array} Returns the new shuffled array.
  10448. * @example
  10449. *
  10450. * _.shuffle([1, 2, 3, 4]);
  10451. * // => [4, 1, 3, 2]
  10452. */
  10453. function shuffle(collection) {
  10454. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10455. return func(collection);
  10456. }
  10457. /**
  10458. * Gets the size of `collection` by returning its length for array-like
  10459. * values or the number of own enumerable string keyed properties for objects.
  10460. *
  10461. * @static
  10462. * @memberOf _
  10463. * @since 0.1.0
  10464. * @category Collection
  10465. * @param {Array|Object|string} collection The collection to inspect.
  10466. * @returns {number} Returns the collection size.
  10467. * @example
  10468. *
  10469. * _.size([1, 2, 3]);
  10470. * // => 3
  10471. *
  10472. * _.size({ 'a': 1, 'b': 2 });
  10473. * // => 2
  10474. *
  10475. * _.size('pebbles');
  10476. * // => 7
  10477. */
  10478. function size(collection) {
  10479. if (collection == null) {
  10480. return 0;
  10481. }
  10482. if (isArrayLike(collection)) {
  10483. return isString(collection) ? stringSize(collection) : collection.length;
  10484. }
  10485. var tag = getTag(collection);
  10486. if (tag == mapTag || tag == setTag) {
  10487. return collection.size;
  10488. }
  10489. return baseKeys(collection).length;
  10490. }
  10491. /**
  10492. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10493. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10494. * invoked with three arguments: (value, index|key, collection).
  10495. *
  10496. * @static
  10497. * @memberOf _
  10498. * @since 0.1.0
  10499. * @category Collection
  10500. * @param {Array|Object} collection The collection to iterate over.
  10501. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10502. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10503. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10504. * else `false`.
  10505. * @example
  10506. *
  10507. * _.some([null, 0, 'yes', false], Boolean);
  10508. * // => true
  10509. *
  10510. * var users = [
  10511. * { 'user': 'barney', 'active': true },
  10512. * { 'user': 'fred', 'active': false }
  10513. * ];
  10514. *
  10515. * // The `_.matches` iteratee shorthand.
  10516. * _.some(users, { 'user': 'barney', 'active': false });
  10517. * // => false
  10518. *
  10519. * // The `_.matchesProperty` iteratee shorthand.
  10520. * _.some(users, ['active', false]);
  10521. * // => true
  10522. *
  10523. * // The `_.property` iteratee shorthand.
  10524. * _.some(users, 'active');
  10525. * // => true
  10526. */
  10527. function some(collection, predicate, guard) {
  10528. var func = isArray(collection) ? arraySome : baseSome;
  10529. if (guard && isIterateeCall(collection, predicate, guard)) {
  10530. predicate = undefined;
  10531. }
  10532. return func(collection, getIteratee(predicate, 3));
  10533. }
  10534. /**
  10535. * Creates an array of elements, sorted in ascending order by the results of
  10536. * running each element in a collection thru each iteratee. This method
  10537. * performs a stable sort, that is, it preserves the original sort order of
  10538. * equal elements. The iteratees are invoked with one argument: (value).
  10539. *
  10540. * @static
  10541. * @memberOf _
  10542. * @since 0.1.0
  10543. * @category Collection
  10544. * @param {Array|Object} collection The collection to iterate over.
  10545. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10546. * The iteratees to sort by.
  10547. * @returns {Array} Returns the new sorted array.
  10548. * @example
  10549. *
  10550. * var users = [
  10551. * { 'user': 'fred', 'age': 48 },
  10552. * { 'user': 'barney', 'age': 36 },
  10553. * { 'user': 'fred', 'age': 30 },
  10554. * { 'user': 'barney', 'age': 34 }
  10555. * ];
  10556. *
  10557. * _.sortBy(users, [function(o) { return o.user; }]);
  10558. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10559. *
  10560. * _.sortBy(users, ['user', 'age']);
  10561. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10562. */
  10563. var sortBy = baseRest(function(collection, iteratees) {
  10564. if (collection == null) {
  10565. return [];
  10566. }
  10567. var length = iteratees.length;
  10568. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10569. iteratees = [];
  10570. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10571. iteratees = [iteratees[0]];
  10572. }
  10573. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10574. });
  10575. /*------------------------------------------------------------------------*/
  10576. /**
  10577. * Gets the timestamp of the number of milliseconds that have elapsed since
  10578. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10579. *
  10580. * @static
  10581. * @memberOf _
  10582. * @since 2.4.0
  10583. * @category Date
  10584. * @returns {number} Returns the timestamp.
  10585. * @example
  10586. *
  10587. * _.defer(function(stamp) {
  10588. * console.log(_.now() - stamp);
  10589. * }, _.now());
  10590. * // => Logs the number of milliseconds it took for the deferred invocation.
  10591. */
  10592. var now = ctxNow || function() {
  10593. return root.Date.now();
  10594. };
  10595. /*------------------------------------------------------------------------*/
  10596. /**
  10597. * The opposite of `_.before`; this method creates a function that invokes
  10598. * `func` once it's called `n` or more times.
  10599. *
  10600. * @static
  10601. * @memberOf _
  10602. * @since 0.1.0
  10603. * @category Function
  10604. * @param {number} n The number of calls before `func` is invoked.
  10605. * @param {Function} func The function to restrict.
  10606. * @returns {Function} Returns the new restricted function.
  10607. * @example
  10608. *
  10609. * var saves = ['profile', 'settings'];
  10610. *
  10611. * var done = _.after(saves.length, function() {
  10612. * console.log('done saving!');
  10613. * });
  10614. *
  10615. * _.forEach(saves, function(type) {
  10616. * asyncSave({ 'type': type, 'complete': done });
  10617. * });
  10618. * // => Logs 'done saving!' after the two async saves have completed.
  10619. */
  10620. function after(n, func) {
  10621. if (typeof func != 'function') {
  10622. throw new TypeError(FUNC_ERROR_TEXT);
  10623. }
  10624. n = toInteger(n);
  10625. return function() {
  10626. if (--n < 1) {
  10627. return func.apply(this, arguments);
  10628. }
  10629. };
  10630. }
  10631. /**
  10632. * Creates a function that invokes `func`, with up to `n` arguments,
  10633. * ignoring any additional arguments.
  10634. *
  10635. * @static
  10636. * @memberOf _
  10637. * @since 3.0.0
  10638. * @category Function
  10639. * @param {Function} func The function to cap arguments for.
  10640. * @param {number} [n=func.length] The arity cap.
  10641. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10642. * @returns {Function} Returns the new capped function.
  10643. * @example
  10644. *
  10645. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10646. * // => [6, 8, 10]
  10647. */
  10648. function ary(func, n, guard) {
  10649. n = guard ? undefined : n;
  10650. n = (func && n == null) ? func.length : n;
  10651. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10652. }
  10653. /**
  10654. * Creates a function that invokes `func`, with the `this` binding and arguments
  10655. * of the created function, while it's called less than `n` times. Subsequent
  10656. * calls to the created function return the result of the last `func` invocation.
  10657. *
  10658. * @static
  10659. * @memberOf _
  10660. * @since 3.0.0
  10661. * @category Function
  10662. * @param {number} n The number of calls at which `func` is no longer invoked.
  10663. * @param {Function} func The function to restrict.
  10664. * @returns {Function} Returns the new restricted function.
  10665. * @example
  10666. *
  10667. * jQuery(element).on('click', _.before(5, addContactToList));
  10668. * // => Allows adding up to 4 contacts to the list.
  10669. */
  10670. function before(n, func) {
  10671. var result;
  10672. if (typeof func != 'function') {
  10673. throw new TypeError(FUNC_ERROR_TEXT);
  10674. }
  10675. n = toInteger(n);
  10676. return function() {
  10677. if (--n > 0) {
  10678. result = func.apply(this, arguments);
  10679. }
  10680. if (n <= 1) {
  10681. func = undefined;
  10682. }
  10683. return result;
  10684. };
  10685. }
  10686. /**
  10687. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10688. * and `partials` prepended to the arguments it receives.
  10689. *
  10690. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10691. * may be used as a placeholder for partially applied arguments.
  10692. *
  10693. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10694. * property of bound functions.
  10695. *
  10696. * @static
  10697. * @memberOf _
  10698. * @since 0.1.0
  10699. * @category Function
  10700. * @param {Function} func The function to bind.
  10701. * @param {*} thisArg The `this` binding of `func`.
  10702. * @param {...*} [partials] The arguments to be partially applied.
  10703. * @returns {Function} Returns the new bound function.
  10704. * @example
  10705. *
  10706. * function greet(greeting, punctuation) {
  10707. * return greeting + ' ' + this.user + punctuation;
  10708. * }
  10709. *
  10710. * var object = { 'user': 'fred' };
  10711. *
  10712. * var bound = _.bind(greet, object, 'hi');
  10713. * bound('!');
  10714. * // => 'hi fred!'
  10715. *
  10716. * // Bound with placeholders.
  10717. * var bound = _.bind(greet, object, _, '!');
  10718. * bound('hi');
  10719. * // => 'hi fred!'
  10720. */
  10721. var bind = baseRest(function(func, thisArg, partials) {
  10722. var bitmask = WRAP_BIND_FLAG;
  10723. if (partials.length) {
  10724. var holders = replaceHolders(partials, getHolder(bind));
  10725. bitmask |= WRAP_PARTIAL_FLAG;
  10726. }
  10727. return createWrap(func, bitmask, thisArg, partials, holders);
  10728. });
  10729. /**
  10730. * Creates a function that invokes the method at `object[key]` with `partials`
  10731. * prepended to the arguments it receives.
  10732. *
  10733. * This method differs from `_.bind` by allowing bound functions to reference
  10734. * methods that may be redefined or don't yet exist. See
  10735. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10736. * for more details.
  10737. *
  10738. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10739. * builds, may be used as a placeholder for partially applied arguments.
  10740. *
  10741. * @static
  10742. * @memberOf _
  10743. * @since 0.10.0
  10744. * @category Function
  10745. * @param {Object} object The object to invoke the method on.
  10746. * @param {string} key The key of the method.
  10747. * @param {...*} [partials] The arguments to be partially applied.
  10748. * @returns {Function} Returns the new bound function.
  10749. * @example
  10750. *
  10751. * var object = {
  10752. * 'user': 'fred',
  10753. * 'greet': function(greeting, punctuation) {
  10754. * return greeting + ' ' + this.user + punctuation;
  10755. * }
  10756. * };
  10757. *
  10758. * var bound = _.bindKey(object, 'greet', 'hi');
  10759. * bound('!');
  10760. * // => 'hi fred!'
  10761. *
  10762. * object.greet = function(greeting, punctuation) {
  10763. * return greeting + 'ya ' + this.user + punctuation;
  10764. * };
  10765. *
  10766. * bound('!');
  10767. * // => 'hiya fred!'
  10768. *
  10769. * // Bound with placeholders.
  10770. * var bound = _.bindKey(object, 'greet', _, '!');
  10771. * bound('hi');
  10772. * // => 'hiya fred!'
  10773. */
  10774. var bindKey = baseRest(function(object, key, partials) {
  10775. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10776. if (partials.length) {
  10777. var holders = replaceHolders(partials, getHolder(bindKey));
  10778. bitmask |= WRAP_PARTIAL_FLAG;
  10779. }
  10780. return createWrap(key, bitmask, object, partials, holders);
  10781. });
  10782. /**
  10783. * Creates a function that accepts arguments of `func` and either invokes
  10784. * `func` returning its result, if at least `arity` number of arguments have
  10785. * been provided, or returns a function that accepts the remaining `func`
  10786. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10787. * is not sufficient.
  10788. *
  10789. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10790. * may be used as a placeholder for provided arguments.
  10791. *
  10792. * **Note:** This method doesn't set the "length" property of curried functions.
  10793. *
  10794. * @static
  10795. * @memberOf _
  10796. * @since 2.0.0
  10797. * @category Function
  10798. * @param {Function} func The function to curry.
  10799. * @param {number} [arity=func.length] The arity of `func`.
  10800. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10801. * @returns {Function} Returns the new curried function.
  10802. * @example
  10803. *
  10804. * var abc = function(a, b, c) {
  10805. * return [a, b, c];
  10806. * };
  10807. *
  10808. * var curried = _.curry(abc);
  10809. *
  10810. * curried(1)(2)(3);
  10811. * // => [1, 2, 3]
  10812. *
  10813. * curried(1, 2)(3);
  10814. * // => [1, 2, 3]
  10815. *
  10816. * curried(1, 2, 3);
  10817. * // => [1, 2, 3]
  10818. *
  10819. * // Curried with placeholders.
  10820. * curried(1)(_, 3)(2);
  10821. * // => [1, 2, 3]
  10822. */
  10823. function curry(func, arity, guard) {
  10824. arity = guard ? undefined : arity;
  10825. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10826. result.placeholder = curry.placeholder;
  10827. return result;
  10828. }
  10829. /**
  10830. * This method is like `_.curry` except that arguments are applied to `func`
  10831. * in the manner of `_.partialRight` instead of `_.partial`.
  10832. *
  10833. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10834. * builds, may be used as a placeholder for provided arguments.
  10835. *
  10836. * **Note:** This method doesn't set the "length" property of curried functions.
  10837. *
  10838. * @static
  10839. * @memberOf _
  10840. * @since 3.0.0
  10841. * @category Function
  10842. * @param {Function} func The function to curry.
  10843. * @param {number} [arity=func.length] The arity of `func`.
  10844. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10845. * @returns {Function} Returns the new curried function.
  10846. * @example
  10847. *
  10848. * var abc = function(a, b, c) {
  10849. * return [a, b, c];
  10850. * };
  10851. *
  10852. * var curried = _.curryRight(abc);
  10853. *
  10854. * curried(3)(2)(1);
  10855. * // => [1, 2, 3]
  10856. *
  10857. * curried(2, 3)(1);
  10858. * // => [1, 2, 3]
  10859. *
  10860. * curried(1, 2, 3);
  10861. * // => [1, 2, 3]
  10862. *
  10863. * // Curried with placeholders.
  10864. * curried(3)(1, _)(2);
  10865. * // => [1, 2, 3]
  10866. */
  10867. function curryRight(func, arity, guard) {
  10868. arity = guard ? undefined : arity;
  10869. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10870. result.placeholder = curryRight.placeholder;
  10871. return result;
  10872. }
  10873. /**
  10874. * Creates a debounced function that delays invoking `func` until after `wait`
  10875. * milliseconds have elapsed since the last time the debounced function was
  10876. * invoked. The debounced function comes with a `cancel` method to cancel
  10877. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10878. * Provide `options` to indicate whether `func` should be invoked on the
  10879. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10880. * with the last arguments provided to the debounced function. Subsequent
  10881. * calls to the debounced function return the result of the last `func`
  10882. * invocation.
  10883. *
  10884. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10885. * invoked on the trailing edge of the timeout only if the debounced function
  10886. * is invoked more than once during the `wait` timeout.
  10887. *
  10888. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10889. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10890. *
  10891. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10892. * for details over the differences between `_.debounce` and `_.throttle`.
  10893. *
  10894. * @static
  10895. * @memberOf _
  10896. * @since 0.1.0
  10897. * @category Function
  10898. * @param {Function} func The function to debounce.
  10899. * @param {number} [wait=0] The number of milliseconds to delay.
  10900. * @param {Object} [options={}] The options object.
  10901. * @param {boolean} [options.leading=false]
  10902. * Specify invoking on the leading edge of the timeout.
  10903. * @param {number} [options.maxWait]
  10904. * The maximum time `func` is allowed to be delayed before it's invoked.
  10905. * @param {boolean} [options.trailing=true]
  10906. * Specify invoking on the trailing edge of the timeout.
  10907. * @returns {Function} Returns the new debounced function.
  10908. * @example
  10909. *
  10910. * // Avoid costly calculations while the window size is in flux.
  10911. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10912. *
  10913. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10914. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10915. * 'leading': true,
  10916. * 'trailing': false
  10917. * }));
  10918. *
  10919. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10920. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10921. * var source = new EventSource('/stream');
  10922. * jQuery(source).on('message', debounced);
  10923. *
  10924. * // Cancel the trailing debounced invocation.
  10925. * jQuery(window).on('popstate', debounced.cancel);
  10926. */
  10927. function debounce(func, wait, options) {
  10928. var lastArgs,
  10929. lastThis,
  10930. maxWait,
  10931. result,
  10932. timerId,
  10933. lastCallTime,
  10934. lastInvokeTime = 0,
  10935. leading = false,
  10936. maxing = false,
  10937. trailing = true;
  10938. if (typeof func != 'function') {
  10939. throw new TypeError(FUNC_ERROR_TEXT);
  10940. }
  10941. wait = toNumber(wait) || 0;
  10942. if (isObject(options)) {
  10943. leading = !!options.leading;
  10944. maxing = 'maxWait' in options;
  10945. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10946. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10947. }
  10948. function invokeFunc(time) {
  10949. var args = lastArgs,
  10950. thisArg = lastThis;
  10951. lastArgs = lastThis = undefined;
  10952. lastInvokeTime = time;
  10953. result = func.apply(thisArg, args);
  10954. return result;
  10955. }
  10956. function leadingEdge(time) {
  10957. // Reset any `maxWait` timer.
  10958. lastInvokeTime = time;
  10959. // Start the timer for the trailing edge.
  10960. timerId = setTimeout(timerExpired, wait);
  10961. // Invoke the leading edge.
  10962. return leading ? invokeFunc(time) : result;
  10963. }
  10964. function remainingWait(time) {
  10965. var timeSinceLastCall = time - lastCallTime,
  10966. timeSinceLastInvoke = time - lastInvokeTime,
  10967. timeWaiting = wait - timeSinceLastCall;
  10968. return maxing
  10969. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10970. : timeWaiting;
  10971. }
  10972. function shouldInvoke(time) {
  10973. var timeSinceLastCall = time - lastCallTime,
  10974. timeSinceLastInvoke = time - lastInvokeTime;
  10975. // Either this is the first call, activity has stopped and we're at the
  10976. // trailing edge, the system time has gone backwards and we're treating
  10977. // it as the trailing edge, or we've hit the `maxWait` limit.
  10978. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10979. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10980. }
  10981. function timerExpired() {
  10982. var time = now();
  10983. if (shouldInvoke(time)) {
  10984. return trailingEdge(time);
  10985. }
  10986. // Restart the timer.
  10987. timerId = setTimeout(timerExpired, remainingWait(time));
  10988. }
  10989. function trailingEdge(time) {
  10990. timerId = undefined;
  10991. // Only invoke if we have `lastArgs` which means `func` has been
  10992. // debounced at least once.
  10993. if (trailing && lastArgs) {
  10994. return invokeFunc(time);
  10995. }
  10996. lastArgs = lastThis = undefined;
  10997. return result;
  10998. }
  10999. function cancel() {
  11000. if (timerId !== undefined) {
  11001. clearTimeout(timerId);
  11002. }
  11003. lastInvokeTime = 0;
  11004. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11005. }
  11006. function flush() {
  11007. return timerId === undefined ? result : trailingEdge(now());
  11008. }
  11009. function debounced() {
  11010. var time = now(),
  11011. isInvoking = shouldInvoke(time);
  11012. lastArgs = arguments;
  11013. lastThis = this;
  11014. lastCallTime = time;
  11015. if (isInvoking) {
  11016. if (timerId === undefined) {
  11017. return leadingEdge(lastCallTime);
  11018. }
  11019. if (maxing) {
  11020. // Handle invocations in a tight loop.
  11021. clearTimeout(timerId);
  11022. timerId = setTimeout(timerExpired, wait);
  11023. return invokeFunc(lastCallTime);
  11024. }
  11025. }
  11026. if (timerId === undefined) {
  11027. timerId = setTimeout(timerExpired, wait);
  11028. }
  11029. return result;
  11030. }
  11031. debounced.cancel = cancel;
  11032. debounced.flush = flush;
  11033. return debounced;
  11034. }
  11035. /**
  11036. * Defers invoking the `func` until the current call stack has cleared. Any
  11037. * additional arguments are provided to `func` when it's invoked.
  11038. *
  11039. * @static
  11040. * @memberOf _
  11041. * @since 0.1.0
  11042. * @category Function
  11043. * @param {Function} func The function to defer.
  11044. * @param {...*} [args] The arguments to invoke `func` with.
  11045. * @returns {number} Returns the timer id.
  11046. * @example
  11047. *
  11048. * _.defer(function(text) {
  11049. * console.log(text);
  11050. * }, 'deferred');
  11051. * // => Logs 'deferred' after one millisecond.
  11052. */
  11053. var defer = baseRest(function(func, args) {
  11054. return baseDelay(func, 1, args);
  11055. });
  11056. /**
  11057. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11058. * provided to `func` when it's invoked.
  11059. *
  11060. * @static
  11061. * @memberOf _
  11062. * @since 0.1.0
  11063. * @category Function
  11064. * @param {Function} func The function to delay.
  11065. * @param {number} wait The number of milliseconds to delay invocation.
  11066. * @param {...*} [args] The arguments to invoke `func` with.
  11067. * @returns {number} Returns the timer id.
  11068. * @example
  11069. *
  11070. * _.delay(function(text) {
  11071. * console.log(text);
  11072. * }, 1000, 'later');
  11073. * // => Logs 'later' after one second.
  11074. */
  11075. var delay = baseRest(function(func, wait, args) {
  11076. return baseDelay(func, toNumber(wait) || 0, args);
  11077. });
  11078. /**
  11079. * Creates a function that invokes `func` with arguments reversed.
  11080. *
  11081. * @static
  11082. * @memberOf _
  11083. * @since 4.0.0
  11084. * @category Function
  11085. * @param {Function} func The function to flip arguments for.
  11086. * @returns {Function} Returns the new flipped function.
  11087. * @example
  11088. *
  11089. * var flipped = _.flip(function() {
  11090. * return _.toArray(arguments);
  11091. * });
  11092. *
  11093. * flipped('a', 'b', 'c', 'd');
  11094. * // => ['d', 'c', 'b', 'a']
  11095. */
  11096. function flip(func) {
  11097. return createWrap(func, WRAP_FLIP_FLAG);
  11098. }
  11099. /**
  11100. * Creates a function that memoizes the result of `func`. If `resolver` is
  11101. * provided, it determines the cache key for storing the result based on the
  11102. * arguments provided to the memoized function. By default, the first argument
  11103. * provided to the memoized function is used as the map cache key. The `func`
  11104. * is invoked with the `this` binding of the memoized function.
  11105. *
  11106. * **Note:** The cache is exposed as the `cache` property on the memoized
  11107. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11108. * constructor with one whose instances implement the
  11109. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11110. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11111. *
  11112. * @static
  11113. * @memberOf _
  11114. * @since 0.1.0
  11115. * @category Function
  11116. * @param {Function} func The function to have its output memoized.
  11117. * @param {Function} [resolver] The function to resolve the cache key.
  11118. * @returns {Function} Returns the new memoized function.
  11119. * @example
  11120. *
  11121. * var object = { 'a': 1, 'b': 2 };
  11122. * var other = { 'c': 3, 'd': 4 };
  11123. *
  11124. * var values = _.memoize(_.values);
  11125. * values(object);
  11126. * // => [1, 2]
  11127. *
  11128. * values(other);
  11129. * // => [3, 4]
  11130. *
  11131. * object.a = 2;
  11132. * values(object);
  11133. * // => [1, 2]
  11134. *
  11135. * // Modify the result cache.
  11136. * values.cache.set(object, ['a', 'b']);
  11137. * values(object);
  11138. * // => ['a', 'b']
  11139. *
  11140. * // Replace `_.memoize.Cache`.
  11141. * _.memoize.Cache = WeakMap;
  11142. */
  11143. function memoize(func, resolver) {
  11144. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11145. throw new TypeError(FUNC_ERROR_TEXT);
  11146. }
  11147. var memoized = function() {
  11148. var args = arguments,
  11149. key = resolver ? resolver.apply(this, args) : args[0],
  11150. cache = memoized.cache;
  11151. if (cache.has(key)) {
  11152. return cache.get(key);
  11153. }
  11154. var result = func.apply(this, args);
  11155. memoized.cache = cache.set(key, result) || cache;
  11156. return result;
  11157. };
  11158. memoized.cache = new (memoize.Cache || MapCache);
  11159. return memoized;
  11160. }
  11161. // Expose `MapCache`.
  11162. memoize.Cache = MapCache;
  11163. /**
  11164. * Creates a function that negates the result of the predicate `func`. The
  11165. * `func` predicate is invoked with the `this` binding and arguments of the
  11166. * created function.
  11167. *
  11168. * @static
  11169. * @memberOf _
  11170. * @since 3.0.0
  11171. * @category Function
  11172. * @param {Function} predicate The predicate to negate.
  11173. * @returns {Function} Returns the new negated function.
  11174. * @example
  11175. *
  11176. * function isEven(n) {
  11177. * return n % 2 == 0;
  11178. * }
  11179. *
  11180. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11181. * // => [1, 3, 5]
  11182. */
  11183. function negate(predicate) {
  11184. if (typeof predicate != 'function') {
  11185. throw new TypeError(FUNC_ERROR_TEXT);
  11186. }
  11187. return function() {
  11188. var args = arguments;
  11189. switch (args.length) {
  11190. case 0: return !predicate.call(this);
  11191. case 1: return !predicate.call(this, args[0]);
  11192. case 2: return !predicate.call(this, args[0], args[1]);
  11193. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11194. }
  11195. return !predicate.apply(this, args);
  11196. };
  11197. }
  11198. /**
  11199. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11200. * to the function return the value of the first invocation. The `func` is
  11201. * invoked with the `this` binding and arguments of the created function.
  11202. *
  11203. * @static
  11204. * @memberOf _
  11205. * @since 0.1.0
  11206. * @category Function
  11207. * @param {Function} func The function to restrict.
  11208. * @returns {Function} Returns the new restricted function.
  11209. * @example
  11210. *
  11211. * var initialize = _.once(createApplication);
  11212. * initialize();
  11213. * initialize();
  11214. * // => `createApplication` is invoked once
  11215. */
  11216. function once(func) {
  11217. return before(2, func);
  11218. }
  11219. /**
  11220. * Creates a function that invokes `func` with its arguments transformed.
  11221. *
  11222. * @static
  11223. * @since 4.0.0
  11224. * @memberOf _
  11225. * @category Function
  11226. * @param {Function} func The function to wrap.
  11227. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11228. * The argument transforms.
  11229. * @returns {Function} Returns the new function.
  11230. * @example
  11231. *
  11232. * function doubled(n) {
  11233. * return n * 2;
  11234. * }
  11235. *
  11236. * function square(n) {
  11237. * return n * n;
  11238. * }
  11239. *
  11240. * var func = _.overArgs(function(x, y) {
  11241. * return [x, y];
  11242. * }, [square, doubled]);
  11243. *
  11244. * func(9, 3);
  11245. * // => [81, 6]
  11246. *
  11247. * func(10, 5);
  11248. * // => [100, 10]
  11249. */
  11250. var overArgs = castRest(function(func, transforms) {
  11251. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11252. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11253. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11254. var funcsLength = transforms.length;
  11255. return baseRest(function(args) {
  11256. var index = -1,
  11257. length = nativeMin(args.length, funcsLength);
  11258. while (++index < length) {
  11259. args[index] = transforms[index].call(this, args[index]);
  11260. }
  11261. return apply(func, this, args);
  11262. });
  11263. });
  11264. /**
  11265. * Creates a function that invokes `func` with `partials` prepended to the
  11266. * arguments it receives. This method is like `_.bind` except it does **not**
  11267. * alter the `this` binding.
  11268. *
  11269. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11270. * builds, may be used as a placeholder for partially applied arguments.
  11271. *
  11272. * **Note:** This method doesn't set the "length" property of partially
  11273. * applied functions.
  11274. *
  11275. * @static
  11276. * @memberOf _
  11277. * @since 0.2.0
  11278. * @category Function
  11279. * @param {Function} func The function to partially apply arguments to.
  11280. * @param {...*} [partials] The arguments to be partially applied.
  11281. * @returns {Function} Returns the new partially applied function.
  11282. * @example
  11283. *
  11284. * function greet(greeting, name) {
  11285. * return greeting + ' ' + name;
  11286. * }
  11287. *
  11288. * var sayHelloTo = _.partial(greet, 'hello');
  11289. * sayHelloTo('fred');
  11290. * // => 'hello fred'
  11291. *
  11292. * // Partially applied with placeholders.
  11293. * var greetFred = _.partial(greet, _, 'fred');
  11294. * greetFred('hi');
  11295. * // => 'hi fred'
  11296. */
  11297. var partial = baseRest(function(func, partials) {
  11298. var holders = replaceHolders(partials, getHolder(partial));
  11299. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11300. });
  11301. /**
  11302. * This method is like `_.partial` except that partially applied arguments
  11303. * are appended to the arguments it receives.
  11304. *
  11305. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11306. * builds, may be used as a placeholder for partially applied arguments.
  11307. *
  11308. * **Note:** This method doesn't set the "length" property of partially
  11309. * applied functions.
  11310. *
  11311. * @static
  11312. * @memberOf _
  11313. * @since 1.0.0
  11314. * @category Function
  11315. * @param {Function} func The function to partially apply arguments to.
  11316. * @param {...*} [partials] The arguments to be partially applied.
  11317. * @returns {Function} Returns the new partially applied function.
  11318. * @example
  11319. *
  11320. * function greet(greeting, name) {
  11321. * return greeting + ' ' + name;
  11322. * }
  11323. *
  11324. * var greetFred = _.partialRight(greet, 'fred');
  11325. * greetFred('hi');
  11326. * // => 'hi fred'
  11327. *
  11328. * // Partially applied with placeholders.
  11329. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11330. * sayHelloTo('fred');
  11331. * // => 'hello fred'
  11332. */
  11333. var partialRight = baseRest(function(func, partials) {
  11334. var holders = replaceHolders(partials, getHolder(partialRight));
  11335. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11336. });
  11337. /**
  11338. * Creates a function that invokes `func` with arguments arranged according
  11339. * to the specified `indexes` where the argument value at the first index is
  11340. * provided as the first argument, the argument value at the second index is
  11341. * provided as the second argument, and so on.
  11342. *
  11343. * @static
  11344. * @memberOf _
  11345. * @since 3.0.0
  11346. * @category Function
  11347. * @param {Function} func The function to rearrange arguments for.
  11348. * @param {...(number|number[])} indexes The arranged argument indexes.
  11349. * @returns {Function} Returns the new function.
  11350. * @example
  11351. *
  11352. * var rearged = _.rearg(function(a, b, c) {
  11353. * return [a, b, c];
  11354. * }, [2, 0, 1]);
  11355. *
  11356. * rearged('b', 'c', 'a')
  11357. * // => ['a', 'b', 'c']
  11358. */
  11359. var rearg = flatRest(function(func, indexes) {
  11360. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11361. });
  11362. /**
  11363. * Creates a function that invokes `func` with the `this` binding of the
  11364. * created function and arguments from `start` and beyond provided as
  11365. * an array.
  11366. *
  11367. * **Note:** This method is based on the
  11368. * [rest parameter](https://mdn.io/rest_parameters).
  11369. *
  11370. * @static
  11371. * @memberOf _
  11372. * @since 4.0.0
  11373. * @category Function
  11374. * @param {Function} func The function to apply a rest parameter to.
  11375. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11376. * @returns {Function} Returns the new function.
  11377. * @example
  11378. *
  11379. * var say = _.rest(function(what, names) {
  11380. * return what + ' ' + _.initial(names).join(', ') +
  11381. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11382. * });
  11383. *
  11384. * say('hello', 'fred', 'barney', 'pebbles');
  11385. * // => 'hello fred, barney, & pebbles'
  11386. */
  11387. function rest(func, start) {
  11388. if (typeof func != 'function') {
  11389. throw new TypeError(FUNC_ERROR_TEXT);
  11390. }
  11391. start = start === undefined ? start : toInteger(start);
  11392. return baseRest(func, start);
  11393. }
  11394. /**
  11395. * Creates a function that invokes `func` with the `this` binding of the
  11396. * create function and an array of arguments much like
  11397. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11398. *
  11399. * **Note:** This method is based on the
  11400. * [spread operator](https://mdn.io/spread_operator).
  11401. *
  11402. * @static
  11403. * @memberOf _
  11404. * @since 3.2.0
  11405. * @category Function
  11406. * @param {Function} func The function to spread arguments over.
  11407. * @param {number} [start=0] The start position of the spread.
  11408. * @returns {Function} Returns the new function.
  11409. * @example
  11410. *
  11411. * var say = _.spread(function(who, what) {
  11412. * return who + ' says ' + what;
  11413. * });
  11414. *
  11415. * say(['fred', 'hello']);
  11416. * // => 'fred says hello'
  11417. *
  11418. * var numbers = Promise.all([
  11419. * Promise.resolve(40),
  11420. * Promise.resolve(36)
  11421. * ]);
  11422. *
  11423. * numbers.then(_.spread(function(x, y) {
  11424. * return x + y;
  11425. * }));
  11426. * // => a Promise of 76
  11427. */
  11428. function spread(func, start) {
  11429. if (typeof func != 'function') {
  11430. throw new TypeError(FUNC_ERROR_TEXT);
  11431. }
  11432. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11433. return baseRest(function(args) {
  11434. var array = args[start],
  11435. otherArgs = castSlice(args, 0, start);
  11436. if (array) {
  11437. arrayPush(otherArgs, array);
  11438. }
  11439. return apply(func, this, otherArgs);
  11440. });
  11441. }
  11442. /**
  11443. * Creates a throttled function that only invokes `func` at most once per
  11444. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11445. * method to cancel delayed `func` invocations and a `flush` method to
  11446. * immediately invoke them. Provide `options` to indicate whether `func`
  11447. * should be invoked on the leading and/or trailing edge of the `wait`
  11448. * timeout. The `func` is invoked with the last arguments provided to the
  11449. * throttled function. Subsequent calls to the throttled function return the
  11450. * result of the last `func` invocation.
  11451. *
  11452. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11453. * invoked on the trailing edge of the timeout only if the throttled function
  11454. * is invoked more than once during the `wait` timeout.
  11455. *
  11456. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11457. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11458. *
  11459. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11460. * for details over the differences between `_.throttle` and `_.debounce`.
  11461. *
  11462. * @static
  11463. * @memberOf _
  11464. * @since 0.1.0
  11465. * @category Function
  11466. * @param {Function} func The function to throttle.
  11467. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11468. * @param {Object} [options={}] The options object.
  11469. * @param {boolean} [options.leading=true]
  11470. * Specify invoking on the leading edge of the timeout.
  11471. * @param {boolean} [options.trailing=true]
  11472. * Specify invoking on the trailing edge of the timeout.
  11473. * @returns {Function} Returns the new throttled function.
  11474. * @example
  11475. *
  11476. * // Avoid excessively updating the position while scrolling.
  11477. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11478. *
  11479. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11480. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11481. * jQuery(element).on('click', throttled);
  11482. *
  11483. * // Cancel the trailing throttled invocation.
  11484. * jQuery(window).on('popstate', throttled.cancel);
  11485. */
  11486. function throttle(func, wait, options) {
  11487. var leading = true,
  11488. trailing = true;
  11489. if (typeof func != 'function') {
  11490. throw new TypeError(FUNC_ERROR_TEXT);
  11491. }
  11492. if (isObject(options)) {
  11493. leading = 'leading' in options ? !!options.leading : leading;
  11494. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11495. }
  11496. return debounce(func, wait, {
  11497. 'leading': leading,
  11498. 'maxWait': wait,
  11499. 'trailing': trailing
  11500. });
  11501. }
  11502. /**
  11503. * Creates a function that accepts up to one argument, ignoring any
  11504. * additional arguments.
  11505. *
  11506. * @static
  11507. * @memberOf _
  11508. * @since 4.0.0
  11509. * @category Function
  11510. * @param {Function} func The function to cap arguments for.
  11511. * @returns {Function} Returns the new capped function.
  11512. * @example
  11513. *
  11514. * _.map(['6', '8', '10'], _.unary(parseInt));
  11515. * // => [6, 8, 10]
  11516. */
  11517. function unary(func) {
  11518. return ary(func, 1);
  11519. }
  11520. /**
  11521. * Creates a function that provides `value` to `wrapper` as its first
  11522. * argument. Any additional arguments provided to the function are appended
  11523. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11524. * binding of the created function.
  11525. *
  11526. * @static
  11527. * @memberOf _
  11528. * @since 0.1.0
  11529. * @category Function
  11530. * @param {*} value The value to wrap.
  11531. * @param {Function} [wrapper=identity] The wrapper function.
  11532. * @returns {Function} Returns the new function.
  11533. * @example
  11534. *
  11535. * var p = _.wrap(_.escape, function(func, text) {
  11536. * return '<p>' + func(text) + '</p>';
  11537. * });
  11538. *
  11539. * p('fred, barney, & pebbles');
  11540. * // => '<p>fred, barney, &amp; pebbles</p>'
  11541. */
  11542. function wrap(value, wrapper) {
  11543. return partial(castFunction(wrapper), value);
  11544. }
  11545. /*------------------------------------------------------------------------*/
  11546. /**
  11547. * Casts `value` as an array if it's not one.
  11548. *
  11549. * @static
  11550. * @memberOf _
  11551. * @since 4.4.0
  11552. * @category Lang
  11553. * @param {*} value The value to inspect.
  11554. * @returns {Array} Returns the cast array.
  11555. * @example
  11556. *
  11557. * _.castArray(1);
  11558. * // => [1]
  11559. *
  11560. * _.castArray({ 'a': 1 });
  11561. * // => [{ 'a': 1 }]
  11562. *
  11563. * _.castArray('abc');
  11564. * // => ['abc']
  11565. *
  11566. * _.castArray(null);
  11567. * // => [null]
  11568. *
  11569. * _.castArray(undefined);
  11570. * // => [undefined]
  11571. *
  11572. * _.castArray();
  11573. * // => []
  11574. *
  11575. * var array = [1, 2, 3];
  11576. * console.log(_.castArray(array) === array);
  11577. * // => true
  11578. */
  11579. function castArray() {
  11580. if (!arguments.length) {
  11581. return [];
  11582. }
  11583. var value = arguments[0];
  11584. return isArray(value) ? value : [value];
  11585. }
  11586. /**
  11587. * Creates a shallow clone of `value`.
  11588. *
  11589. * **Note:** This method is loosely based on the
  11590. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11591. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11592. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11593. * arrays. The own enumerable properties of `arguments` objects are cloned
  11594. * as plain objects. An empty object is returned for uncloneable values such
  11595. * as error objects, functions, DOM nodes, and WeakMaps.
  11596. *
  11597. * @static
  11598. * @memberOf _
  11599. * @since 0.1.0
  11600. * @category Lang
  11601. * @param {*} value The value to clone.
  11602. * @returns {*} Returns the cloned value.
  11603. * @see _.cloneDeep
  11604. * @example
  11605. *
  11606. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11607. *
  11608. * var shallow = _.clone(objects);
  11609. * console.log(shallow[0] === objects[0]);
  11610. * // => true
  11611. */
  11612. function clone(value) {
  11613. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11614. }
  11615. /**
  11616. * This method is like `_.clone` except that it accepts `customizer` which
  11617. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11618. * cloning is handled by the method instead. The `customizer` is invoked with
  11619. * up to four arguments; (value [, index|key, object, stack]).
  11620. *
  11621. * @static
  11622. * @memberOf _
  11623. * @since 4.0.0
  11624. * @category Lang
  11625. * @param {*} value The value to clone.
  11626. * @param {Function} [customizer] The function to customize cloning.
  11627. * @returns {*} Returns the cloned value.
  11628. * @see _.cloneDeepWith
  11629. * @example
  11630. *
  11631. * function customizer(value) {
  11632. * if (_.isElement(value)) {
  11633. * return value.cloneNode(false);
  11634. * }
  11635. * }
  11636. *
  11637. * var el = _.cloneWith(document.body, customizer);
  11638. *
  11639. * console.log(el === document.body);
  11640. * // => false
  11641. * console.log(el.nodeName);
  11642. * // => 'BODY'
  11643. * console.log(el.childNodes.length);
  11644. * // => 0
  11645. */
  11646. function cloneWith(value, customizer) {
  11647. customizer = typeof customizer == 'function' ? customizer : undefined;
  11648. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11649. }
  11650. /**
  11651. * This method is like `_.clone` except that it recursively clones `value`.
  11652. *
  11653. * @static
  11654. * @memberOf _
  11655. * @since 1.0.0
  11656. * @category Lang
  11657. * @param {*} value The value to recursively clone.
  11658. * @returns {*} Returns the deep cloned value.
  11659. * @see _.clone
  11660. * @example
  11661. *
  11662. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11663. *
  11664. * var deep = _.cloneDeep(objects);
  11665. * console.log(deep[0] === objects[0]);
  11666. * // => false
  11667. */
  11668. function cloneDeep(value) {
  11669. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11670. }
  11671. /**
  11672. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11673. *
  11674. * @static
  11675. * @memberOf _
  11676. * @since 4.0.0
  11677. * @category Lang
  11678. * @param {*} value The value to recursively clone.
  11679. * @param {Function} [customizer] The function to customize cloning.
  11680. * @returns {*} Returns the deep cloned value.
  11681. * @see _.cloneWith
  11682. * @example
  11683. *
  11684. * function customizer(value) {
  11685. * if (_.isElement(value)) {
  11686. * return value.cloneNode(true);
  11687. * }
  11688. * }
  11689. *
  11690. * var el = _.cloneDeepWith(document.body, customizer);
  11691. *
  11692. * console.log(el === document.body);
  11693. * // => false
  11694. * console.log(el.nodeName);
  11695. * // => 'BODY'
  11696. * console.log(el.childNodes.length);
  11697. * // => 20
  11698. */
  11699. function cloneDeepWith(value, customizer) {
  11700. customizer = typeof customizer == 'function' ? customizer : undefined;
  11701. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11702. }
  11703. /**
  11704. * Checks if `object` conforms to `source` by invoking the predicate
  11705. * properties of `source` with the corresponding property values of `object`.
  11706. *
  11707. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11708. * partially applied.
  11709. *
  11710. * @static
  11711. * @memberOf _
  11712. * @since 4.14.0
  11713. * @category Lang
  11714. * @param {Object} object The object to inspect.
  11715. * @param {Object} source The object of property predicates to conform to.
  11716. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11717. * @example
  11718. *
  11719. * var object = { 'a': 1, 'b': 2 };
  11720. *
  11721. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11722. * // => true
  11723. *
  11724. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11725. * // => false
  11726. */
  11727. function conformsTo(object, source) {
  11728. return source == null || baseConformsTo(object, source, keys(source));
  11729. }
  11730. /**
  11731. * Performs a
  11732. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11733. * comparison between two values to determine if they are equivalent.
  11734. *
  11735. * @static
  11736. * @memberOf _
  11737. * @since 4.0.0
  11738. * @category Lang
  11739. * @param {*} value The value to compare.
  11740. * @param {*} other The other value to compare.
  11741. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11742. * @example
  11743. *
  11744. * var object = { 'a': 1 };
  11745. * var other = { 'a': 1 };
  11746. *
  11747. * _.eq(object, object);
  11748. * // => true
  11749. *
  11750. * _.eq(object, other);
  11751. * // => false
  11752. *
  11753. * _.eq('a', 'a');
  11754. * // => true
  11755. *
  11756. * _.eq('a', Object('a'));
  11757. * // => false
  11758. *
  11759. * _.eq(NaN, NaN);
  11760. * // => true
  11761. */
  11762. function eq(value, other) {
  11763. return value === other || (value !== value && other !== other);
  11764. }
  11765. /**
  11766. * Checks if `value` is greater than `other`.
  11767. *
  11768. * @static
  11769. * @memberOf _
  11770. * @since 3.9.0
  11771. * @category Lang
  11772. * @param {*} value The value to compare.
  11773. * @param {*} other The other value to compare.
  11774. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11775. * else `false`.
  11776. * @see _.lt
  11777. * @example
  11778. *
  11779. * _.gt(3, 1);
  11780. * // => true
  11781. *
  11782. * _.gt(3, 3);
  11783. * // => false
  11784. *
  11785. * _.gt(1, 3);
  11786. * // => false
  11787. */
  11788. var gt = createRelationalOperation(baseGt);
  11789. /**
  11790. * Checks if `value` is greater than or equal to `other`.
  11791. *
  11792. * @static
  11793. * @memberOf _
  11794. * @since 3.9.0
  11795. * @category Lang
  11796. * @param {*} value The value to compare.
  11797. * @param {*} other The other value to compare.
  11798. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11799. * `other`, else `false`.
  11800. * @see _.lte
  11801. * @example
  11802. *
  11803. * _.gte(3, 1);
  11804. * // => true
  11805. *
  11806. * _.gte(3, 3);
  11807. * // => true
  11808. *
  11809. * _.gte(1, 3);
  11810. * // => false
  11811. */
  11812. var gte = createRelationalOperation(function(value, other) {
  11813. return value >= other;
  11814. });
  11815. /**
  11816. * Checks if `value` is likely an `arguments` object.
  11817. *
  11818. * @static
  11819. * @memberOf _
  11820. * @since 0.1.0
  11821. * @category Lang
  11822. * @param {*} value The value to check.
  11823. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11824. * else `false`.
  11825. * @example
  11826. *
  11827. * _.isArguments(function() { return arguments; }());
  11828. * // => true
  11829. *
  11830. * _.isArguments([1, 2, 3]);
  11831. * // => false
  11832. */
  11833. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11834. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11835. !propertyIsEnumerable.call(value, 'callee');
  11836. };
  11837. /**
  11838. * Checks if `value` is classified as an `Array` object.
  11839. *
  11840. * @static
  11841. * @memberOf _
  11842. * @since 0.1.0
  11843. * @category Lang
  11844. * @param {*} value The value to check.
  11845. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11846. * @example
  11847. *
  11848. * _.isArray([1, 2, 3]);
  11849. * // => true
  11850. *
  11851. * _.isArray(document.body.children);
  11852. * // => false
  11853. *
  11854. * _.isArray('abc');
  11855. * // => false
  11856. *
  11857. * _.isArray(_.noop);
  11858. * // => false
  11859. */
  11860. var isArray = Array.isArray;
  11861. /**
  11862. * Checks if `value` is classified as an `ArrayBuffer` object.
  11863. *
  11864. * @static
  11865. * @memberOf _
  11866. * @since 4.3.0
  11867. * @category Lang
  11868. * @param {*} value The value to check.
  11869. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11870. * @example
  11871. *
  11872. * _.isArrayBuffer(new ArrayBuffer(2));
  11873. * // => true
  11874. *
  11875. * _.isArrayBuffer(new Array(2));
  11876. * // => false
  11877. */
  11878. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11879. /**
  11880. * Checks if `value` is array-like. A value is considered array-like if it's
  11881. * not a function and has a `value.length` that's an integer greater than or
  11882. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11883. *
  11884. * @static
  11885. * @memberOf _
  11886. * @since 4.0.0
  11887. * @category Lang
  11888. * @param {*} value The value to check.
  11889. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11890. * @example
  11891. *
  11892. * _.isArrayLike([1, 2, 3]);
  11893. * // => true
  11894. *
  11895. * _.isArrayLike(document.body.children);
  11896. * // => true
  11897. *
  11898. * _.isArrayLike('abc');
  11899. * // => true
  11900. *
  11901. * _.isArrayLike(_.noop);
  11902. * // => false
  11903. */
  11904. function isArrayLike(value) {
  11905. return value != null && isLength(value.length) && !isFunction(value);
  11906. }
  11907. /**
  11908. * This method is like `_.isArrayLike` except that it also checks if `value`
  11909. * is an object.
  11910. *
  11911. * @static
  11912. * @memberOf _
  11913. * @since 4.0.0
  11914. * @category Lang
  11915. * @param {*} value The value to check.
  11916. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11917. * else `false`.
  11918. * @example
  11919. *
  11920. * _.isArrayLikeObject([1, 2, 3]);
  11921. * // => true
  11922. *
  11923. * _.isArrayLikeObject(document.body.children);
  11924. * // => true
  11925. *
  11926. * _.isArrayLikeObject('abc');
  11927. * // => false
  11928. *
  11929. * _.isArrayLikeObject(_.noop);
  11930. * // => false
  11931. */
  11932. function isArrayLikeObject(value) {
  11933. return isObjectLike(value) && isArrayLike(value);
  11934. }
  11935. /**
  11936. * Checks if `value` is classified as a boolean primitive or object.
  11937. *
  11938. * @static
  11939. * @memberOf _
  11940. * @since 0.1.0
  11941. * @category Lang
  11942. * @param {*} value The value to check.
  11943. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11944. * @example
  11945. *
  11946. * _.isBoolean(false);
  11947. * // => true
  11948. *
  11949. * _.isBoolean(null);
  11950. * // => false
  11951. */
  11952. function isBoolean(value) {
  11953. return value === true || value === false ||
  11954. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11955. }
  11956. /**
  11957. * Checks if `value` is a buffer.
  11958. *
  11959. * @static
  11960. * @memberOf _
  11961. * @since 4.3.0
  11962. * @category Lang
  11963. * @param {*} value The value to check.
  11964. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11965. * @example
  11966. *
  11967. * _.isBuffer(new Buffer(2));
  11968. * // => true
  11969. *
  11970. * _.isBuffer(new Uint8Array(2));
  11971. * // => false
  11972. */
  11973. var isBuffer = nativeIsBuffer || stubFalse;
  11974. /**
  11975. * Checks if `value` is classified as a `Date` object.
  11976. *
  11977. * @static
  11978. * @memberOf _
  11979. * @since 0.1.0
  11980. * @category Lang
  11981. * @param {*} value The value to check.
  11982. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11983. * @example
  11984. *
  11985. * _.isDate(new Date);
  11986. * // => true
  11987. *
  11988. * _.isDate('Mon April 23 2012');
  11989. * // => false
  11990. */
  11991. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11992. /**
  11993. * Checks if `value` is likely a DOM element.
  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 DOM element, else `false`.
  12001. * @example
  12002. *
  12003. * _.isElement(document.body);
  12004. * // => true
  12005. *
  12006. * _.isElement('<body>');
  12007. * // => false
  12008. */
  12009. function isElement(value) {
  12010. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12011. }
  12012. /**
  12013. * Checks if `value` is an empty object, collection, map, or set.
  12014. *
  12015. * Objects are considered empty if they have no own enumerable string keyed
  12016. * properties.
  12017. *
  12018. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12019. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12020. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12021. *
  12022. * @static
  12023. * @memberOf _
  12024. * @since 0.1.0
  12025. * @category Lang
  12026. * @param {*} value The value to check.
  12027. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12028. * @example
  12029. *
  12030. * _.isEmpty(null);
  12031. * // => true
  12032. *
  12033. * _.isEmpty(true);
  12034. * // => true
  12035. *
  12036. * _.isEmpty(1);
  12037. * // => true
  12038. *
  12039. * _.isEmpty([1, 2, 3]);
  12040. * // => false
  12041. *
  12042. * _.isEmpty({ 'a': 1 });
  12043. * // => false
  12044. */
  12045. function isEmpty(value) {
  12046. if (value == null) {
  12047. return true;
  12048. }
  12049. if (isArrayLike(value) &&
  12050. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12051. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12052. return !value.length;
  12053. }
  12054. var tag = getTag(value);
  12055. if (tag == mapTag || tag == setTag) {
  12056. return !value.size;
  12057. }
  12058. if (isPrototype(value)) {
  12059. return !baseKeys(value).length;
  12060. }
  12061. for (var key in value) {
  12062. if (hasOwnProperty.call(value, key)) {
  12063. return false;
  12064. }
  12065. }
  12066. return true;
  12067. }
  12068. /**
  12069. * Performs a deep comparison between two values to determine if they are
  12070. * equivalent.
  12071. *
  12072. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12073. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12074. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12075. * by their own, not inherited, enumerable properties. Functions and DOM
  12076. * nodes are compared by strict equality, i.e. `===`.
  12077. *
  12078. * @static
  12079. * @memberOf _
  12080. * @since 0.1.0
  12081. * @category Lang
  12082. * @param {*} value The value to compare.
  12083. * @param {*} other The other value to compare.
  12084. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12085. * @example
  12086. *
  12087. * var object = { 'a': 1 };
  12088. * var other = { 'a': 1 };
  12089. *
  12090. * _.isEqual(object, other);
  12091. * // => true
  12092. *
  12093. * object === other;
  12094. * // => false
  12095. */
  12096. function isEqual(value, other) {
  12097. return baseIsEqual(value, other);
  12098. }
  12099. /**
  12100. * This method is like `_.isEqual` except that it accepts `customizer` which
  12101. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12102. * are handled by the method instead. The `customizer` is invoked with up to
  12103. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12104. *
  12105. * @static
  12106. * @memberOf _
  12107. * @since 4.0.0
  12108. * @category Lang
  12109. * @param {*} value The value to compare.
  12110. * @param {*} other The other value to compare.
  12111. * @param {Function} [customizer] The function to customize comparisons.
  12112. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12113. * @example
  12114. *
  12115. * function isGreeting(value) {
  12116. * return /^h(?:i|ello)$/.test(value);
  12117. * }
  12118. *
  12119. * function customizer(objValue, othValue) {
  12120. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12121. * return true;
  12122. * }
  12123. * }
  12124. *
  12125. * var array = ['hello', 'goodbye'];
  12126. * var other = ['hi', 'goodbye'];
  12127. *
  12128. * _.isEqualWith(array, other, customizer);
  12129. * // => true
  12130. */
  12131. function isEqualWith(value, other, customizer) {
  12132. customizer = typeof customizer == 'function' ? customizer : undefined;
  12133. var result = customizer ? customizer(value, other) : undefined;
  12134. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12135. }
  12136. /**
  12137. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12138. * `SyntaxError`, `TypeError`, or `URIError` object.
  12139. *
  12140. * @static
  12141. * @memberOf _
  12142. * @since 3.0.0
  12143. * @category Lang
  12144. * @param {*} value The value to check.
  12145. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12146. * @example
  12147. *
  12148. * _.isError(new Error);
  12149. * // => true
  12150. *
  12151. * _.isError(Error);
  12152. * // => false
  12153. */
  12154. function isError(value) {
  12155. if (!isObjectLike(value)) {
  12156. return false;
  12157. }
  12158. var tag = baseGetTag(value);
  12159. return tag == errorTag || tag == domExcTag ||
  12160. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12161. }
  12162. /**
  12163. * Checks if `value` is a finite primitive number.
  12164. *
  12165. * **Note:** This method is based on
  12166. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12167. *
  12168. * @static
  12169. * @memberOf _
  12170. * @since 0.1.0
  12171. * @category Lang
  12172. * @param {*} value The value to check.
  12173. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12174. * @example
  12175. *
  12176. * _.isFinite(3);
  12177. * // => true
  12178. *
  12179. * _.isFinite(Number.MIN_VALUE);
  12180. * // => true
  12181. *
  12182. * _.isFinite(Infinity);
  12183. * // => false
  12184. *
  12185. * _.isFinite('3');
  12186. * // => false
  12187. */
  12188. function isFinite(value) {
  12189. return typeof value == 'number' && nativeIsFinite(value);
  12190. }
  12191. /**
  12192. * Checks if `value` is classified as a `Function` object.
  12193. *
  12194. * @static
  12195. * @memberOf _
  12196. * @since 0.1.0
  12197. * @category Lang
  12198. * @param {*} value The value to check.
  12199. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12200. * @example
  12201. *
  12202. * _.isFunction(_);
  12203. * // => true
  12204. *
  12205. * _.isFunction(/abc/);
  12206. * // => false
  12207. */
  12208. function isFunction(value) {
  12209. if (!isObject(value)) {
  12210. return false;
  12211. }
  12212. // The use of `Object#toString` avoids issues with the `typeof` operator
  12213. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12214. var tag = baseGetTag(value);
  12215. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12216. }
  12217. /**
  12218. * Checks if `value` is an integer.
  12219. *
  12220. * **Note:** This method is based on
  12221. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12222. *
  12223. * @static
  12224. * @memberOf _
  12225. * @since 4.0.0
  12226. * @category Lang
  12227. * @param {*} value The value to check.
  12228. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12229. * @example
  12230. *
  12231. * _.isInteger(3);
  12232. * // => true
  12233. *
  12234. * _.isInteger(Number.MIN_VALUE);
  12235. * // => false
  12236. *
  12237. * _.isInteger(Infinity);
  12238. * // => false
  12239. *
  12240. * _.isInteger('3');
  12241. * // => false
  12242. */
  12243. function isInteger(value) {
  12244. return typeof value == 'number' && value == toInteger(value);
  12245. }
  12246. /**
  12247. * Checks if `value` is a valid array-like length.
  12248. *
  12249. * **Note:** This method is loosely based on
  12250. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12251. *
  12252. * @static
  12253. * @memberOf _
  12254. * @since 4.0.0
  12255. * @category Lang
  12256. * @param {*} value The value to check.
  12257. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12258. * @example
  12259. *
  12260. * _.isLength(3);
  12261. * // => true
  12262. *
  12263. * _.isLength(Number.MIN_VALUE);
  12264. * // => false
  12265. *
  12266. * _.isLength(Infinity);
  12267. * // => false
  12268. *
  12269. * _.isLength('3');
  12270. * // => false
  12271. */
  12272. function isLength(value) {
  12273. return typeof value == 'number' &&
  12274. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12275. }
  12276. /**
  12277. * Checks if `value` is the
  12278. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12279. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12280. *
  12281. * @static
  12282. * @memberOf _
  12283. * @since 0.1.0
  12284. * @category Lang
  12285. * @param {*} value The value to check.
  12286. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12287. * @example
  12288. *
  12289. * _.isObject({});
  12290. * // => true
  12291. *
  12292. * _.isObject([1, 2, 3]);
  12293. * // => true
  12294. *
  12295. * _.isObject(_.noop);
  12296. * // => true
  12297. *
  12298. * _.isObject(null);
  12299. * // => false
  12300. */
  12301. function isObject(value) {
  12302. var type = typeof value;
  12303. return value != null && (type == 'object' || type == 'function');
  12304. }
  12305. /**
  12306. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12307. * and has a `typeof` result of "object".
  12308. *
  12309. * @static
  12310. * @memberOf _
  12311. * @since 4.0.0
  12312. * @category Lang
  12313. * @param {*} value The value to check.
  12314. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12315. * @example
  12316. *
  12317. * _.isObjectLike({});
  12318. * // => true
  12319. *
  12320. * _.isObjectLike([1, 2, 3]);
  12321. * // => true
  12322. *
  12323. * _.isObjectLike(_.noop);
  12324. * // => false
  12325. *
  12326. * _.isObjectLike(null);
  12327. * // => false
  12328. */
  12329. function isObjectLike(value) {
  12330. return value != null && typeof value == 'object';
  12331. }
  12332. /**
  12333. * Checks if `value` is classified as a `Map` object.
  12334. *
  12335. * @static
  12336. * @memberOf _
  12337. * @since 4.3.0
  12338. * @category Lang
  12339. * @param {*} value The value to check.
  12340. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12341. * @example
  12342. *
  12343. * _.isMap(new Map);
  12344. * // => true
  12345. *
  12346. * _.isMap(new WeakMap);
  12347. * // => false
  12348. */
  12349. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12350. /**
  12351. * Performs a partial deep comparison between `object` and `source` to
  12352. * determine if `object` contains equivalent property values.
  12353. *
  12354. * **Note:** This method is equivalent to `_.matches` when `source` is
  12355. * partially applied.
  12356. *
  12357. * Partial comparisons will match empty array and empty object `source`
  12358. * values against any array or object value, respectively. See `_.isEqual`
  12359. * for a list of supported value comparisons.
  12360. *
  12361. * @static
  12362. * @memberOf _
  12363. * @since 3.0.0
  12364. * @category Lang
  12365. * @param {Object} object The object to inspect.
  12366. * @param {Object} source The object of property values to match.
  12367. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12368. * @example
  12369. *
  12370. * var object = { 'a': 1, 'b': 2 };
  12371. *
  12372. * _.isMatch(object, { 'b': 2 });
  12373. * // => true
  12374. *
  12375. * _.isMatch(object, { 'b': 1 });
  12376. * // => false
  12377. */
  12378. function isMatch(object, source) {
  12379. return object === source || baseIsMatch(object, source, getMatchData(source));
  12380. }
  12381. /**
  12382. * This method is like `_.isMatch` except that it accepts `customizer` which
  12383. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12384. * are handled by the method instead. The `customizer` is invoked with five
  12385. * arguments: (objValue, srcValue, index|key, object, source).
  12386. *
  12387. * @static
  12388. * @memberOf _
  12389. * @since 4.0.0
  12390. * @category Lang
  12391. * @param {Object} object The object to inspect.
  12392. * @param {Object} source The object of property values to match.
  12393. * @param {Function} [customizer] The function to customize comparisons.
  12394. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12395. * @example
  12396. *
  12397. * function isGreeting(value) {
  12398. * return /^h(?:i|ello)$/.test(value);
  12399. * }
  12400. *
  12401. * function customizer(objValue, srcValue) {
  12402. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12403. * return true;
  12404. * }
  12405. * }
  12406. *
  12407. * var object = { 'greeting': 'hello' };
  12408. * var source = { 'greeting': 'hi' };
  12409. *
  12410. * _.isMatchWith(object, source, customizer);
  12411. * // => true
  12412. */
  12413. function isMatchWith(object, source, customizer) {
  12414. customizer = typeof customizer == 'function' ? customizer : undefined;
  12415. return baseIsMatch(object, source, getMatchData(source), customizer);
  12416. }
  12417. /**
  12418. * Checks if `value` is `NaN`.
  12419. *
  12420. * **Note:** This method is based on
  12421. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12422. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12423. * `undefined` and other non-number values.
  12424. *
  12425. * @static
  12426. * @memberOf _
  12427. * @since 0.1.0
  12428. * @category Lang
  12429. * @param {*} value The value to check.
  12430. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12431. * @example
  12432. *
  12433. * _.isNaN(NaN);
  12434. * // => true
  12435. *
  12436. * _.isNaN(new Number(NaN));
  12437. * // => true
  12438. *
  12439. * isNaN(undefined);
  12440. * // => true
  12441. *
  12442. * _.isNaN(undefined);
  12443. * // => false
  12444. */
  12445. function isNaN(value) {
  12446. // An `NaN` primitive is the only value that is not equal to itself.
  12447. // Perform the `toStringTag` check first to avoid errors with some
  12448. // ActiveX objects in IE.
  12449. return isNumber(value) && value != +value;
  12450. }
  12451. /**
  12452. * Checks if `value` is a pristine native function.
  12453. *
  12454. * **Note:** This method can't reliably detect native functions in the presence
  12455. * of the core-js package because core-js circumvents this kind of detection.
  12456. * Despite multiple requests, the core-js maintainer has made it clear: any
  12457. * attempt to fix the detection will be obstructed. As a result, we're left
  12458. * with little choice but to throw an error. Unfortunately, this also affects
  12459. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12460. * which rely on core-js.
  12461. *
  12462. * @static
  12463. * @memberOf _
  12464. * @since 3.0.0
  12465. * @category Lang
  12466. * @param {*} value The value to check.
  12467. * @returns {boolean} Returns `true` if `value` is a native function,
  12468. * else `false`.
  12469. * @example
  12470. *
  12471. * _.isNative(Array.prototype.push);
  12472. * // => true
  12473. *
  12474. * _.isNative(_);
  12475. * // => false
  12476. */
  12477. function isNative(value) {
  12478. if (isMaskable(value)) {
  12479. throw new Error(CORE_ERROR_TEXT);
  12480. }
  12481. return baseIsNative(value);
  12482. }
  12483. /**
  12484. * Checks if `value` is `null`.
  12485. *
  12486. * @static
  12487. * @memberOf _
  12488. * @since 0.1.0
  12489. * @category Lang
  12490. * @param {*} value The value to check.
  12491. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12492. * @example
  12493. *
  12494. * _.isNull(null);
  12495. * // => true
  12496. *
  12497. * _.isNull(void 0);
  12498. * // => false
  12499. */
  12500. function isNull(value) {
  12501. return value === null;
  12502. }
  12503. /**
  12504. * Checks if `value` is `null` or `undefined`.
  12505. *
  12506. * @static
  12507. * @memberOf _
  12508. * @since 4.0.0
  12509. * @category Lang
  12510. * @param {*} value The value to check.
  12511. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12512. * @example
  12513. *
  12514. * _.isNil(null);
  12515. * // => true
  12516. *
  12517. * _.isNil(void 0);
  12518. * // => true
  12519. *
  12520. * _.isNil(NaN);
  12521. * // => false
  12522. */
  12523. function isNil(value) {
  12524. return value == null;
  12525. }
  12526. /**
  12527. * Checks if `value` is classified as a `Number` primitive or object.
  12528. *
  12529. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12530. * classified as numbers, use the `_.isFinite` method.
  12531. *
  12532. * @static
  12533. * @memberOf _
  12534. * @since 0.1.0
  12535. * @category Lang
  12536. * @param {*} value The value to check.
  12537. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12538. * @example
  12539. *
  12540. * _.isNumber(3);
  12541. * // => true
  12542. *
  12543. * _.isNumber(Number.MIN_VALUE);
  12544. * // => true
  12545. *
  12546. * _.isNumber(Infinity);
  12547. * // => true
  12548. *
  12549. * _.isNumber('3');
  12550. * // => false
  12551. */
  12552. function isNumber(value) {
  12553. return typeof value == 'number' ||
  12554. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12555. }
  12556. /**
  12557. * Checks if `value` is a plain object, that is, an object created by the
  12558. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12559. *
  12560. * @static
  12561. * @memberOf _
  12562. * @since 0.8.0
  12563. * @category Lang
  12564. * @param {*} value The value to check.
  12565. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12566. * @example
  12567. *
  12568. * function Foo() {
  12569. * this.a = 1;
  12570. * }
  12571. *
  12572. * _.isPlainObject(new Foo);
  12573. * // => false
  12574. *
  12575. * _.isPlainObject([1, 2, 3]);
  12576. * // => false
  12577. *
  12578. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12579. * // => true
  12580. *
  12581. * _.isPlainObject(Object.create(null));
  12582. * // => true
  12583. */
  12584. function isPlainObject(value) {
  12585. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12586. return false;
  12587. }
  12588. var proto = getPrototype(value);
  12589. if (proto === null) {
  12590. return true;
  12591. }
  12592. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12593. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12594. funcToString.call(Ctor) == objectCtorString;
  12595. }
  12596. /**
  12597. * Checks if `value` is classified as a `RegExp` object.
  12598. *
  12599. * @static
  12600. * @memberOf _
  12601. * @since 0.1.0
  12602. * @category Lang
  12603. * @param {*} value The value to check.
  12604. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12605. * @example
  12606. *
  12607. * _.isRegExp(/abc/);
  12608. * // => true
  12609. *
  12610. * _.isRegExp('/abc/');
  12611. * // => false
  12612. */
  12613. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12614. /**
  12615. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12616. * double precision number which isn't the result of a rounded unsafe integer.
  12617. *
  12618. * **Note:** This method is based on
  12619. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12620. *
  12621. * @static
  12622. * @memberOf _
  12623. * @since 4.0.0
  12624. * @category Lang
  12625. * @param {*} value The value to check.
  12626. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12627. * @example
  12628. *
  12629. * _.isSafeInteger(3);
  12630. * // => true
  12631. *
  12632. * _.isSafeInteger(Number.MIN_VALUE);
  12633. * // => false
  12634. *
  12635. * _.isSafeInteger(Infinity);
  12636. * // => false
  12637. *
  12638. * _.isSafeInteger('3');
  12639. * // => false
  12640. */
  12641. function isSafeInteger(value) {
  12642. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12643. }
  12644. /**
  12645. * Checks if `value` is classified as a `Set` object.
  12646. *
  12647. * @static
  12648. * @memberOf _
  12649. * @since 4.3.0
  12650. * @category Lang
  12651. * @param {*} value The value to check.
  12652. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12653. * @example
  12654. *
  12655. * _.isSet(new Set);
  12656. * // => true
  12657. *
  12658. * _.isSet(new WeakSet);
  12659. * // => false
  12660. */
  12661. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12662. /**
  12663. * Checks if `value` is classified as a `String` primitive or object.
  12664. *
  12665. * @static
  12666. * @since 0.1.0
  12667. * @memberOf _
  12668. * @category Lang
  12669. * @param {*} value The value to check.
  12670. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12671. * @example
  12672. *
  12673. * _.isString('abc');
  12674. * // => true
  12675. *
  12676. * _.isString(1);
  12677. * // => false
  12678. */
  12679. function isString(value) {
  12680. return typeof value == 'string' ||
  12681. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12682. }
  12683. /**
  12684. * Checks if `value` is classified as a `Symbol` primitive or object.
  12685. *
  12686. * @static
  12687. * @memberOf _
  12688. * @since 4.0.0
  12689. * @category Lang
  12690. * @param {*} value The value to check.
  12691. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12692. * @example
  12693. *
  12694. * _.isSymbol(Symbol.iterator);
  12695. * // => true
  12696. *
  12697. * _.isSymbol('abc');
  12698. * // => false
  12699. */
  12700. function isSymbol(value) {
  12701. return typeof value == 'symbol' ||
  12702. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12703. }
  12704. /**
  12705. * Checks if `value` is classified as a typed array.
  12706. *
  12707. * @static
  12708. * @memberOf _
  12709. * @since 3.0.0
  12710. * @category Lang
  12711. * @param {*} value The value to check.
  12712. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12713. * @example
  12714. *
  12715. * _.isTypedArray(new Uint8Array);
  12716. * // => true
  12717. *
  12718. * _.isTypedArray([]);
  12719. * // => false
  12720. */
  12721. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12722. /**
  12723. * Checks if `value` is `undefined`.
  12724. *
  12725. * @static
  12726. * @since 0.1.0
  12727. * @memberOf _
  12728. * @category Lang
  12729. * @param {*} value The value to check.
  12730. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12731. * @example
  12732. *
  12733. * _.isUndefined(void 0);
  12734. * // => true
  12735. *
  12736. * _.isUndefined(null);
  12737. * // => false
  12738. */
  12739. function isUndefined(value) {
  12740. return value === undefined;
  12741. }
  12742. /**
  12743. * Checks if `value` is classified as a `WeakMap` object.
  12744. *
  12745. * @static
  12746. * @memberOf _
  12747. * @since 4.3.0
  12748. * @category Lang
  12749. * @param {*} value The value to check.
  12750. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12751. * @example
  12752. *
  12753. * _.isWeakMap(new WeakMap);
  12754. * // => true
  12755. *
  12756. * _.isWeakMap(new Map);
  12757. * // => false
  12758. */
  12759. function isWeakMap(value) {
  12760. return isObjectLike(value) && getTag(value) == weakMapTag;
  12761. }
  12762. /**
  12763. * Checks if `value` is classified as a `WeakSet` object.
  12764. *
  12765. * @static
  12766. * @memberOf _
  12767. * @since 4.3.0
  12768. * @category Lang
  12769. * @param {*} value The value to check.
  12770. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12771. * @example
  12772. *
  12773. * _.isWeakSet(new WeakSet);
  12774. * // => true
  12775. *
  12776. * _.isWeakSet(new Set);
  12777. * // => false
  12778. */
  12779. function isWeakSet(value) {
  12780. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12781. }
  12782. /**
  12783. * Checks if `value` is less than `other`.
  12784. *
  12785. * @static
  12786. * @memberOf _
  12787. * @since 3.9.0
  12788. * @category Lang
  12789. * @param {*} value The value to compare.
  12790. * @param {*} other The other value to compare.
  12791. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12792. * else `false`.
  12793. * @see _.gt
  12794. * @example
  12795. *
  12796. * _.lt(1, 3);
  12797. * // => true
  12798. *
  12799. * _.lt(3, 3);
  12800. * // => false
  12801. *
  12802. * _.lt(3, 1);
  12803. * // => false
  12804. */
  12805. var lt = createRelationalOperation(baseLt);
  12806. /**
  12807. * Checks if `value` is less than or equal to `other`.
  12808. *
  12809. * @static
  12810. * @memberOf _
  12811. * @since 3.9.0
  12812. * @category Lang
  12813. * @param {*} value The value to compare.
  12814. * @param {*} other The other value to compare.
  12815. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12816. * `other`, else `false`.
  12817. * @see _.gte
  12818. * @example
  12819. *
  12820. * _.lte(1, 3);
  12821. * // => true
  12822. *
  12823. * _.lte(3, 3);
  12824. * // => true
  12825. *
  12826. * _.lte(3, 1);
  12827. * // => false
  12828. */
  12829. var lte = createRelationalOperation(function(value, other) {
  12830. return value <= other;
  12831. });
  12832. /**
  12833. * Converts `value` to an array.
  12834. *
  12835. * @static
  12836. * @since 0.1.0
  12837. * @memberOf _
  12838. * @category Lang
  12839. * @param {*} value The value to convert.
  12840. * @returns {Array} Returns the converted array.
  12841. * @example
  12842. *
  12843. * _.toArray({ 'a': 1, 'b': 2 });
  12844. * // => [1, 2]
  12845. *
  12846. * _.toArray('abc');
  12847. * // => ['a', 'b', 'c']
  12848. *
  12849. * _.toArray(1);
  12850. * // => []
  12851. *
  12852. * _.toArray(null);
  12853. * // => []
  12854. */
  12855. function toArray(value) {
  12856. if (!value) {
  12857. return [];
  12858. }
  12859. if (isArrayLike(value)) {
  12860. return isString(value) ? stringToArray(value) : copyArray(value);
  12861. }
  12862. if (symIterator && value[symIterator]) {
  12863. return iteratorToArray(value[symIterator]());
  12864. }
  12865. var tag = getTag(value),
  12866. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12867. return func(value);
  12868. }
  12869. /**
  12870. * Converts `value` to a finite number.
  12871. *
  12872. * @static
  12873. * @memberOf _
  12874. * @since 4.12.0
  12875. * @category Lang
  12876. * @param {*} value The value to convert.
  12877. * @returns {number} Returns the converted number.
  12878. * @example
  12879. *
  12880. * _.toFinite(3.2);
  12881. * // => 3.2
  12882. *
  12883. * _.toFinite(Number.MIN_VALUE);
  12884. * // => 5e-324
  12885. *
  12886. * _.toFinite(Infinity);
  12887. * // => 1.7976931348623157e+308
  12888. *
  12889. * _.toFinite('3.2');
  12890. * // => 3.2
  12891. */
  12892. function toFinite(value) {
  12893. if (!value) {
  12894. return value === 0 ? value : 0;
  12895. }
  12896. value = toNumber(value);
  12897. if (value === INFINITY || value === -INFINITY) {
  12898. var sign = (value < 0 ? -1 : 1);
  12899. return sign * MAX_INTEGER;
  12900. }
  12901. return value === value ? value : 0;
  12902. }
  12903. /**
  12904. * Converts `value` to an integer.
  12905. *
  12906. * **Note:** This method is loosely based on
  12907. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12908. *
  12909. * @static
  12910. * @memberOf _
  12911. * @since 4.0.0
  12912. * @category Lang
  12913. * @param {*} value The value to convert.
  12914. * @returns {number} Returns the converted integer.
  12915. * @example
  12916. *
  12917. * _.toInteger(3.2);
  12918. * // => 3
  12919. *
  12920. * _.toInteger(Number.MIN_VALUE);
  12921. * // => 0
  12922. *
  12923. * _.toInteger(Infinity);
  12924. * // => 1.7976931348623157e+308
  12925. *
  12926. * _.toInteger('3.2');
  12927. * // => 3
  12928. */
  12929. function toInteger(value) {
  12930. var result = toFinite(value),
  12931. remainder = result % 1;
  12932. return result === result ? (remainder ? result - remainder : result) : 0;
  12933. }
  12934. /**
  12935. * Converts `value` to an integer suitable for use as the length of an
  12936. * array-like object.
  12937. *
  12938. * **Note:** This method is based on
  12939. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12940. *
  12941. * @static
  12942. * @memberOf _
  12943. * @since 4.0.0
  12944. * @category Lang
  12945. * @param {*} value The value to convert.
  12946. * @returns {number} Returns the converted integer.
  12947. * @example
  12948. *
  12949. * _.toLength(3.2);
  12950. * // => 3
  12951. *
  12952. * _.toLength(Number.MIN_VALUE);
  12953. * // => 0
  12954. *
  12955. * _.toLength(Infinity);
  12956. * // => 4294967295
  12957. *
  12958. * _.toLength('3.2');
  12959. * // => 3
  12960. */
  12961. function toLength(value) {
  12962. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12963. }
  12964. /**
  12965. * Converts `value` to a number.
  12966. *
  12967. * @static
  12968. * @memberOf _
  12969. * @since 4.0.0
  12970. * @category Lang
  12971. * @param {*} value The value to process.
  12972. * @returns {number} Returns the number.
  12973. * @example
  12974. *
  12975. * _.toNumber(3.2);
  12976. * // => 3.2
  12977. *
  12978. * _.toNumber(Number.MIN_VALUE);
  12979. * // => 5e-324
  12980. *
  12981. * _.toNumber(Infinity);
  12982. * // => Infinity
  12983. *
  12984. * _.toNumber('3.2');
  12985. * // => 3.2
  12986. */
  12987. function toNumber(value) {
  12988. if (typeof value == 'number') {
  12989. return value;
  12990. }
  12991. if (isSymbol(value)) {
  12992. return NAN;
  12993. }
  12994. if (isObject(value)) {
  12995. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12996. value = isObject(other) ? (other + '') : other;
  12997. }
  12998. if (typeof value != 'string') {
  12999. return value === 0 ? value : +value;
  13000. }
  13001. value = baseTrim(value);
  13002. var isBinary = reIsBinary.test(value);
  13003. return (isBinary || reIsOctal.test(value))
  13004. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13005. : (reIsBadHex.test(value) ? NAN : +value);
  13006. }
  13007. /**
  13008. * Converts `value` to a plain object flattening inherited enumerable string
  13009. * keyed properties of `value` to own properties of the plain object.
  13010. *
  13011. * @static
  13012. * @memberOf _
  13013. * @since 3.0.0
  13014. * @category Lang
  13015. * @param {*} value The value to convert.
  13016. * @returns {Object} Returns the converted plain object.
  13017. * @example
  13018. *
  13019. * function Foo() {
  13020. * this.b = 2;
  13021. * }
  13022. *
  13023. * Foo.prototype.c = 3;
  13024. *
  13025. * _.assign({ 'a': 1 }, new Foo);
  13026. * // => { 'a': 1, 'b': 2 }
  13027. *
  13028. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13029. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13030. */
  13031. function toPlainObject(value) {
  13032. return copyObject(value, keysIn(value));
  13033. }
  13034. /**
  13035. * Converts `value` to a safe integer. A safe integer can be compared and
  13036. * represented correctly.
  13037. *
  13038. * @static
  13039. * @memberOf _
  13040. * @since 4.0.0
  13041. * @category Lang
  13042. * @param {*} value The value to convert.
  13043. * @returns {number} Returns the converted integer.
  13044. * @example
  13045. *
  13046. * _.toSafeInteger(3.2);
  13047. * // => 3
  13048. *
  13049. * _.toSafeInteger(Number.MIN_VALUE);
  13050. * // => 0
  13051. *
  13052. * _.toSafeInteger(Infinity);
  13053. * // => 9007199254740991
  13054. *
  13055. * _.toSafeInteger('3.2');
  13056. * // => 3
  13057. */
  13058. function toSafeInteger(value) {
  13059. return value
  13060. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13061. : (value === 0 ? value : 0);
  13062. }
  13063. /**
  13064. * Converts `value` to a string. An empty string is returned for `null`
  13065. * and `undefined` values. The sign of `-0` is preserved.
  13066. *
  13067. * @static
  13068. * @memberOf _
  13069. * @since 4.0.0
  13070. * @category Lang
  13071. * @param {*} value The value to convert.
  13072. * @returns {string} Returns the converted string.
  13073. * @example
  13074. *
  13075. * _.toString(null);
  13076. * // => ''
  13077. *
  13078. * _.toString(-0);
  13079. * // => '-0'
  13080. *
  13081. * _.toString([1, 2, 3]);
  13082. * // => '1,2,3'
  13083. */
  13084. function toString(value) {
  13085. return value == null ? '' : baseToString(value);
  13086. }
  13087. /*------------------------------------------------------------------------*/
  13088. /**
  13089. * Assigns own enumerable string keyed properties of source objects to the
  13090. * destination object. Source objects are applied from left to right.
  13091. * Subsequent sources overwrite property assignments of previous sources.
  13092. *
  13093. * **Note:** This method mutates `object` and is loosely based on
  13094. * [`Object.assign`](https://mdn.io/Object/assign).
  13095. *
  13096. * @static
  13097. * @memberOf _
  13098. * @since 0.10.0
  13099. * @category Object
  13100. * @param {Object} object The destination object.
  13101. * @param {...Object} [sources] The source objects.
  13102. * @returns {Object} Returns `object`.
  13103. * @see _.assignIn
  13104. * @example
  13105. *
  13106. * function Foo() {
  13107. * this.a = 1;
  13108. * }
  13109. *
  13110. * function Bar() {
  13111. * this.c = 3;
  13112. * }
  13113. *
  13114. * Foo.prototype.b = 2;
  13115. * Bar.prototype.d = 4;
  13116. *
  13117. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13118. * // => { 'a': 1, 'c': 3 }
  13119. */
  13120. var assign = createAssigner(function(object, source) {
  13121. if (isPrototype(source) || isArrayLike(source)) {
  13122. copyObject(source, keys(source), object);
  13123. return;
  13124. }
  13125. for (var key in source) {
  13126. if (hasOwnProperty.call(source, key)) {
  13127. assignValue(object, key, source[key]);
  13128. }
  13129. }
  13130. });
  13131. /**
  13132. * This method is like `_.assign` except that it iterates over own and
  13133. * inherited source properties.
  13134. *
  13135. * **Note:** This method mutates `object`.
  13136. *
  13137. * @static
  13138. * @memberOf _
  13139. * @since 4.0.0
  13140. * @alias extend
  13141. * @category Object
  13142. * @param {Object} object The destination object.
  13143. * @param {...Object} [sources] The source objects.
  13144. * @returns {Object} Returns `object`.
  13145. * @see _.assign
  13146. * @example
  13147. *
  13148. * function Foo() {
  13149. * this.a = 1;
  13150. * }
  13151. *
  13152. * function Bar() {
  13153. * this.c = 3;
  13154. * }
  13155. *
  13156. * Foo.prototype.b = 2;
  13157. * Bar.prototype.d = 4;
  13158. *
  13159. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13160. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13161. */
  13162. var assignIn = createAssigner(function(object, source) {
  13163. copyObject(source, keysIn(source), object);
  13164. });
  13165. /**
  13166. * This method is like `_.assignIn` except that it accepts `customizer`
  13167. * which is invoked to produce the assigned values. If `customizer` returns
  13168. * `undefined`, assignment is handled by the method instead. The `customizer`
  13169. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13170. *
  13171. * **Note:** This method mutates `object`.
  13172. *
  13173. * @static
  13174. * @memberOf _
  13175. * @since 4.0.0
  13176. * @alias extendWith
  13177. * @category Object
  13178. * @param {Object} object The destination object.
  13179. * @param {...Object} sources The source objects.
  13180. * @param {Function} [customizer] The function to customize assigned values.
  13181. * @returns {Object} Returns `object`.
  13182. * @see _.assignWith
  13183. * @example
  13184. *
  13185. * function customizer(objValue, srcValue) {
  13186. * return _.isUndefined(objValue) ? srcValue : objValue;
  13187. * }
  13188. *
  13189. * var defaults = _.partialRight(_.assignInWith, customizer);
  13190. *
  13191. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13192. * // => { 'a': 1, 'b': 2 }
  13193. */
  13194. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13195. copyObject(source, keysIn(source), object, customizer);
  13196. });
  13197. /**
  13198. * This method is like `_.assign` except that it accepts `customizer`
  13199. * which is invoked to produce the assigned values. If `customizer` returns
  13200. * `undefined`, assignment is handled by the method instead. The `customizer`
  13201. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13202. *
  13203. * **Note:** This method mutates `object`.
  13204. *
  13205. * @static
  13206. * @memberOf _
  13207. * @since 4.0.0
  13208. * @category Object
  13209. * @param {Object} object The destination object.
  13210. * @param {...Object} sources The source objects.
  13211. * @param {Function} [customizer] The function to customize assigned values.
  13212. * @returns {Object} Returns `object`.
  13213. * @see _.assignInWith
  13214. * @example
  13215. *
  13216. * function customizer(objValue, srcValue) {
  13217. * return _.isUndefined(objValue) ? srcValue : objValue;
  13218. * }
  13219. *
  13220. * var defaults = _.partialRight(_.assignWith, customizer);
  13221. *
  13222. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13223. * // => { 'a': 1, 'b': 2 }
  13224. */
  13225. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13226. copyObject(source, keys(source), object, customizer);
  13227. });
  13228. /**
  13229. * Creates an array of values corresponding to `paths` of `object`.
  13230. *
  13231. * @static
  13232. * @memberOf _
  13233. * @since 1.0.0
  13234. * @category Object
  13235. * @param {Object} object The object to iterate over.
  13236. * @param {...(string|string[])} [paths] The property paths to pick.
  13237. * @returns {Array} Returns the picked values.
  13238. * @example
  13239. *
  13240. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13241. *
  13242. * _.at(object, ['a[0].b.c', 'a[1]']);
  13243. * // => [3, 4]
  13244. */
  13245. var at = flatRest(baseAt);
  13246. /**
  13247. * Creates an object that inherits from the `prototype` object. If a
  13248. * `properties` object is given, its own enumerable string keyed properties
  13249. * are assigned to the created object.
  13250. *
  13251. * @static
  13252. * @memberOf _
  13253. * @since 2.3.0
  13254. * @category Object
  13255. * @param {Object} prototype The object to inherit from.
  13256. * @param {Object} [properties] The properties to assign to the object.
  13257. * @returns {Object} Returns the new object.
  13258. * @example
  13259. *
  13260. * function Shape() {
  13261. * this.x = 0;
  13262. * this.y = 0;
  13263. * }
  13264. *
  13265. * function Circle() {
  13266. * Shape.call(this);
  13267. * }
  13268. *
  13269. * Circle.prototype = _.create(Shape.prototype, {
  13270. * 'constructor': Circle
  13271. * });
  13272. *
  13273. * var circle = new Circle;
  13274. * circle instanceof Circle;
  13275. * // => true
  13276. *
  13277. * circle instanceof Shape;
  13278. * // => true
  13279. */
  13280. function create(prototype, properties) {
  13281. var result = baseCreate(prototype);
  13282. return properties == null ? result : baseAssign(result, properties);
  13283. }
  13284. /**
  13285. * Assigns own and inherited enumerable string keyed properties of source
  13286. * objects to the destination object for all destination properties that
  13287. * resolve to `undefined`. Source objects are applied from left to right.
  13288. * Once a property is set, additional values of the same property are ignored.
  13289. *
  13290. * **Note:** This method mutates `object`.
  13291. *
  13292. * @static
  13293. * @since 0.1.0
  13294. * @memberOf _
  13295. * @category Object
  13296. * @param {Object} object The destination object.
  13297. * @param {...Object} [sources] The source objects.
  13298. * @returns {Object} Returns `object`.
  13299. * @see _.defaultsDeep
  13300. * @example
  13301. *
  13302. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13303. * // => { 'a': 1, 'b': 2 }
  13304. */
  13305. var defaults = baseRest(function(object, sources) {
  13306. object = Object(object);
  13307. var index = -1;
  13308. var length = sources.length;
  13309. var guard = length > 2 ? sources[2] : undefined;
  13310. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13311. length = 1;
  13312. }
  13313. while (++index < length) {
  13314. var source = sources[index];
  13315. var props = keysIn(source);
  13316. var propsIndex = -1;
  13317. var propsLength = props.length;
  13318. while (++propsIndex < propsLength) {
  13319. var key = props[propsIndex];
  13320. var value = object[key];
  13321. if (value === undefined ||
  13322. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13323. object[key] = source[key];
  13324. }
  13325. }
  13326. }
  13327. return object;
  13328. });
  13329. /**
  13330. * This method is like `_.defaults` except that it recursively assigns
  13331. * default properties.
  13332. *
  13333. * **Note:** This method mutates `object`.
  13334. *
  13335. * @static
  13336. * @memberOf _
  13337. * @since 3.10.0
  13338. * @category Object
  13339. * @param {Object} object The destination object.
  13340. * @param {...Object} [sources] The source objects.
  13341. * @returns {Object} Returns `object`.
  13342. * @see _.defaults
  13343. * @example
  13344. *
  13345. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13346. * // => { 'a': { 'b': 2, 'c': 3 } }
  13347. */
  13348. var defaultsDeep = baseRest(function(args) {
  13349. args.push(undefined, customDefaultsMerge);
  13350. return apply(mergeWith, undefined, args);
  13351. });
  13352. /**
  13353. * This method is like `_.find` except that it returns the key of the first
  13354. * element `predicate` returns truthy for instead of the element itself.
  13355. *
  13356. * @static
  13357. * @memberOf _
  13358. * @since 1.1.0
  13359. * @category Object
  13360. * @param {Object} object The object to inspect.
  13361. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13362. * @returns {string|undefined} Returns the key of the matched element,
  13363. * else `undefined`.
  13364. * @example
  13365. *
  13366. * var users = {
  13367. * 'barney': { 'age': 36, 'active': true },
  13368. * 'fred': { 'age': 40, 'active': false },
  13369. * 'pebbles': { 'age': 1, 'active': true }
  13370. * };
  13371. *
  13372. * _.findKey(users, function(o) { return o.age < 40; });
  13373. * // => 'barney' (iteration order is not guaranteed)
  13374. *
  13375. * // The `_.matches` iteratee shorthand.
  13376. * _.findKey(users, { 'age': 1, 'active': true });
  13377. * // => 'pebbles'
  13378. *
  13379. * // The `_.matchesProperty` iteratee shorthand.
  13380. * _.findKey(users, ['active', false]);
  13381. * // => 'fred'
  13382. *
  13383. * // The `_.property` iteratee shorthand.
  13384. * _.findKey(users, 'active');
  13385. * // => 'barney'
  13386. */
  13387. function findKey(object, predicate) {
  13388. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13389. }
  13390. /**
  13391. * This method is like `_.findKey` except that it iterates over elements of
  13392. * a collection in the opposite order.
  13393. *
  13394. * @static
  13395. * @memberOf _
  13396. * @since 2.0.0
  13397. * @category Object
  13398. * @param {Object} object The object to inspect.
  13399. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13400. * @returns {string|undefined} Returns the key of the matched element,
  13401. * else `undefined`.
  13402. * @example
  13403. *
  13404. * var users = {
  13405. * 'barney': { 'age': 36, 'active': true },
  13406. * 'fred': { 'age': 40, 'active': false },
  13407. * 'pebbles': { 'age': 1, 'active': true }
  13408. * };
  13409. *
  13410. * _.findLastKey(users, function(o) { return o.age < 40; });
  13411. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13412. *
  13413. * // The `_.matches` iteratee shorthand.
  13414. * _.findLastKey(users, { 'age': 36, 'active': true });
  13415. * // => 'barney'
  13416. *
  13417. * // The `_.matchesProperty` iteratee shorthand.
  13418. * _.findLastKey(users, ['active', false]);
  13419. * // => 'fred'
  13420. *
  13421. * // The `_.property` iteratee shorthand.
  13422. * _.findLastKey(users, 'active');
  13423. * // => 'pebbles'
  13424. */
  13425. function findLastKey(object, predicate) {
  13426. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13427. }
  13428. /**
  13429. * Iterates over own and inherited enumerable string keyed properties of an
  13430. * object and invokes `iteratee` for each property. The iteratee is invoked
  13431. * with three arguments: (value, key, object). Iteratee functions may exit
  13432. * iteration early by explicitly returning `false`.
  13433. *
  13434. * @static
  13435. * @memberOf _
  13436. * @since 0.3.0
  13437. * @category Object
  13438. * @param {Object} object The object to iterate over.
  13439. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13440. * @returns {Object} Returns `object`.
  13441. * @see _.forInRight
  13442. * @example
  13443. *
  13444. * function Foo() {
  13445. * this.a = 1;
  13446. * this.b = 2;
  13447. * }
  13448. *
  13449. * Foo.prototype.c = 3;
  13450. *
  13451. * _.forIn(new Foo, function(value, key) {
  13452. * console.log(key);
  13453. * });
  13454. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13455. */
  13456. function forIn(object, iteratee) {
  13457. return object == null
  13458. ? object
  13459. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13460. }
  13461. /**
  13462. * This method is like `_.forIn` except that it iterates over properties of
  13463. * `object` in the opposite order.
  13464. *
  13465. * @static
  13466. * @memberOf _
  13467. * @since 2.0.0
  13468. * @category Object
  13469. * @param {Object} object The object to iterate over.
  13470. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13471. * @returns {Object} Returns `object`.
  13472. * @see _.forIn
  13473. * @example
  13474. *
  13475. * function Foo() {
  13476. * this.a = 1;
  13477. * this.b = 2;
  13478. * }
  13479. *
  13480. * Foo.prototype.c = 3;
  13481. *
  13482. * _.forInRight(new Foo, function(value, key) {
  13483. * console.log(key);
  13484. * });
  13485. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13486. */
  13487. function forInRight(object, iteratee) {
  13488. return object == null
  13489. ? object
  13490. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13491. }
  13492. /**
  13493. * Iterates over own enumerable string keyed properties of an object and
  13494. * invokes `iteratee` for each property. The iteratee is invoked with three
  13495. * arguments: (value, key, object). Iteratee functions may exit iteration
  13496. * early by explicitly returning `false`.
  13497. *
  13498. * @static
  13499. * @memberOf _
  13500. * @since 0.3.0
  13501. * @category Object
  13502. * @param {Object} object The object to iterate over.
  13503. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13504. * @returns {Object} Returns `object`.
  13505. * @see _.forOwnRight
  13506. * @example
  13507. *
  13508. * function Foo() {
  13509. * this.a = 1;
  13510. * this.b = 2;
  13511. * }
  13512. *
  13513. * Foo.prototype.c = 3;
  13514. *
  13515. * _.forOwn(new Foo, function(value, key) {
  13516. * console.log(key);
  13517. * });
  13518. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13519. */
  13520. function forOwn(object, iteratee) {
  13521. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13522. }
  13523. /**
  13524. * This method is like `_.forOwn` except that it iterates over properties of
  13525. * `object` in the opposite order.
  13526. *
  13527. * @static
  13528. * @memberOf _
  13529. * @since 2.0.0
  13530. * @category Object
  13531. * @param {Object} object The object to iterate over.
  13532. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13533. * @returns {Object} Returns `object`.
  13534. * @see _.forOwn
  13535. * @example
  13536. *
  13537. * function Foo() {
  13538. * this.a = 1;
  13539. * this.b = 2;
  13540. * }
  13541. *
  13542. * Foo.prototype.c = 3;
  13543. *
  13544. * _.forOwnRight(new Foo, function(value, key) {
  13545. * console.log(key);
  13546. * });
  13547. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13548. */
  13549. function forOwnRight(object, iteratee) {
  13550. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13551. }
  13552. /**
  13553. * Creates an array of function property names from own enumerable properties
  13554. * of `object`.
  13555. *
  13556. * @static
  13557. * @since 0.1.0
  13558. * @memberOf _
  13559. * @category Object
  13560. * @param {Object} object The object to inspect.
  13561. * @returns {Array} Returns the function names.
  13562. * @see _.functionsIn
  13563. * @example
  13564. *
  13565. * function Foo() {
  13566. * this.a = _.constant('a');
  13567. * this.b = _.constant('b');
  13568. * }
  13569. *
  13570. * Foo.prototype.c = _.constant('c');
  13571. *
  13572. * _.functions(new Foo);
  13573. * // => ['a', 'b']
  13574. */
  13575. function functions(object) {
  13576. return object == null ? [] : baseFunctions(object, keys(object));
  13577. }
  13578. /**
  13579. * Creates an array of function property names from own and inherited
  13580. * enumerable properties of `object`.
  13581. *
  13582. * @static
  13583. * @memberOf _
  13584. * @since 4.0.0
  13585. * @category Object
  13586. * @param {Object} object The object to inspect.
  13587. * @returns {Array} Returns the function names.
  13588. * @see _.functions
  13589. * @example
  13590. *
  13591. * function Foo() {
  13592. * this.a = _.constant('a');
  13593. * this.b = _.constant('b');
  13594. * }
  13595. *
  13596. * Foo.prototype.c = _.constant('c');
  13597. *
  13598. * _.functionsIn(new Foo);
  13599. * // => ['a', 'b', 'c']
  13600. */
  13601. function functionsIn(object) {
  13602. return object == null ? [] : baseFunctions(object, keysIn(object));
  13603. }
  13604. /**
  13605. * Gets the value at `path` of `object`. If the resolved value is
  13606. * `undefined`, the `defaultValue` is returned in its place.
  13607. *
  13608. * @static
  13609. * @memberOf _
  13610. * @since 3.7.0
  13611. * @category Object
  13612. * @param {Object} object The object to query.
  13613. * @param {Array|string} path The path of the property to get.
  13614. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13615. * @returns {*} Returns the resolved value.
  13616. * @example
  13617. *
  13618. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13619. *
  13620. * _.get(object, 'a[0].b.c');
  13621. * // => 3
  13622. *
  13623. * _.get(object, ['a', '0', 'b', 'c']);
  13624. * // => 3
  13625. *
  13626. * _.get(object, 'a.b.c', 'default');
  13627. * // => 'default'
  13628. */
  13629. function get(object, path, defaultValue) {
  13630. var result = object == null ? undefined : baseGet(object, path);
  13631. return result === undefined ? defaultValue : result;
  13632. }
  13633. /**
  13634. * Checks if `path` is a direct property of `object`.
  13635. *
  13636. * @static
  13637. * @since 0.1.0
  13638. * @memberOf _
  13639. * @category Object
  13640. * @param {Object} object The object to query.
  13641. * @param {Array|string} path The path to check.
  13642. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13643. * @example
  13644. *
  13645. * var object = { 'a': { 'b': 2 } };
  13646. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13647. *
  13648. * _.has(object, 'a');
  13649. * // => true
  13650. *
  13651. * _.has(object, 'a.b');
  13652. * // => true
  13653. *
  13654. * _.has(object, ['a', 'b']);
  13655. * // => true
  13656. *
  13657. * _.has(other, 'a');
  13658. * // => false
  13659. */
  13660. function has(object, path) {
  13661. return object != null && hasPath(object, path, baseHas);
  13662. }
  13663. /**
  13664. * Checks if `path` is a direct or inherited property of `object`.
  13665. *
  13666. * @static
  13667. * @memberOf _
  13668. * @since 4.0.0
  13669. * @category Object
  13670. * @param {Object} object The object to query.
  13671. * @param {Array|string} path The path to check.
  13672. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13673. * @example
  13674. *
  13675. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13676. *
  13677. * _.hasIn(object, 'a');
  13678. * // => true
  13679. *
  13680. * _.hasIn(object, 'a.b');
  13681. * // => true
  13682. *
  13683. * _.hasIn(object, ['a', 'b']);
  13684. * // => true
  13685. *
  13686. * _.hasIn(object, 'b');
  13687. * // => false
  13688. */
  13689. function hasIn(object, path) {
  13690. return object != null && hasPath(object, path, baseHasIn);
  13691. }
  13692. /**
  13693. * Creates an object composed of the inverted keys and values of `object`.
  13694. * If `object` contains duplicate values, subsequent values overwrite
  13695. * property assignments of previous values.
  13696. *
  13697. * @static
  13698. * @memberOf _
  13699. * @since 0.7.0
  13700. * @category Object
  13701. * @param {Object} object The object to invert.
  13702. * @returns {Object} Returns the new inverted object.
  13703. * @example
  13704. *
  13705. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13706. *
  13707. * _.invert(object);
  13708. * // => { '1': 'c', '2': 'b' }
  13709. */
  13710. var invert = createInverter(function(result, value, key) {
  13711. if (value != null &&
  13712. typeof value.toString != 'function') {
  13713. value = nativeObjectToString.call(value);
  13714. }
  13715. result[value] = key;
  13716. }, constant(identity));
  13717. /**
  13718. * This method is like `_.invert` except that the inverted object is generated
  13719. * from the results of running each element of `object` thru `iteratee`. The
  13720. * corresponding inverted value of each inverted key is an array of keys
  13721. * responsible for generating the inverted value. The iteratee is invoked
  13722. * with one argument: (value).
  13723. *
  13724. * @static
  13725. * @memberOf _
  13726. * @since 4.1.0
  13727. * @category Object
  13728. * @param {Object} object The object to invert.
  13729. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13730. * @returns {Object} Returns the new inverted object.
  13731. * @example
  13732. *
  13733. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13734. *
  13735. * _.invertBy(object);
  13736. * // => { '1': ['a', 'c'], '2': ['b'] }
  13737. *
  13738. * _.invertBy(object, function(value) {
  13739. * return 'group' + value;
  13740. * });
  13741. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13742. */
  13743. var invertBy = createInverter(function(result, value, key) {
  13744. if (value != null &&
  13745. typeof value.toString != 'function') {
  13746. value = nativeObjectToString.call(value);
  13747. }
  13748. if (hasOwnProperty.call(result, value)) {
  13749. result[value].push(key);
  13750. } else {
  13751. result[value] = [key];
  13752. }
  13753. }, getIteratee);
  13754. /**
  13755. * Invokes the method at `path` of `object`.
  13756. *
  13757. * @static
  13758. * @memberOf _
  13759. * @since 4.0.0
  13760. * @category Object
  13761. * @param {Object} object The object to query.
  13762. * @param {Array|string} path The path of the method to invoke.
  13763. * @param {...*} [args] The arguments to invoke the method with.
  13764. * @returns {*} Returns the result of the invoked method.
  13765. * @example
  13766. *
  13767. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13768. *
  13769. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13770. * // => [2, 3]
  13771. */
  13772. var invoke = baseRest(baseInvoke);
  13773. /**
  13774. * Creates an array of the own enumerable property names of `object`.
  13775. *
  13776. * **Note:** Non-object values are coerced to objects. See the
  13777. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13778. * for more details.
  13779. *
  13780. * @static
  13781. * @since 0.1.0
  13782. * @memberOf _
  13783. * @category Object
  13784. * @param {Object} object The object to query.
  13785. * @returns {Array} Returns the array of property names.
  13786. * @example
  13787. *
  13788. * function Foo() {
  13789. * this.a = 1;
  13790. * this.b = 2;
  13791. * }
  13792. *
  13793. * Foo.prototype.c = 3;
  13794. *
  13795. * _.keys(new Foo);
  13796. * // => ['a', 'b'] (iteration order is not guaranteed)
  13797. *
  13798. * _.keys('hi');
  13799. * // => ['0', '1']
  13800. */
  13801. function keys(object) {
  13802. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13803. }
  13804. /**
  13805. * Creates an array of the own and inherited enumerable property names of `object`.
  13806. *
  13807. * **Note:** Non-object values are coerced to objects.
  13808. *
  13809. * @static
  13810. * @memberOf _
  13811. * @since 3.0.0
  13812. * @category Object
  13813. * @param {Object} object The object to query.
  13814. * @returns {Array} Returns the array of property names.
  13815. * @example
  13816. *
  13817. * function Foo() {
  13818. * this.a = 1;
  13819. * this.b = 2;
  13820. * }
  13821. *
  13822. * Foo.prototype.c = 3;
  13823. *
  13824. * _.keysIn(new Foo);
  13825. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13826. */
  13827. function keysIn(object) {
  13828. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13829. }
  13830. /**
  13831. * The opposite of `_.mapValues`; this method creates an object with the
  13832. * same values as `object` and keys generated by running each own enumerable
  13833. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13834. * with three arguments: (value, key, object).
  13835. *
  13836. * @static
  13837. * @memberOf _
  13838. * @since 3.8.0
  13839. * @category Object
  13840. * @param {Object} object The object to iterate over.
  13841. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13842. * @returns {Object} Returns the new mapped object.
  13843. * @see _.mapValues
  13844. * @example
  13845. *
  13846. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13847. * return key + value;
  13848. * });
  13849. * // => { 'a1': 1, 'b2': 2 }
  13850. */
  13851. function mapKeys(object, iteratee) {
  13852. var result = {};
  13853. iteratee = getIteratee(iteratee, 3);
  13854. baseForOwn(object, function(value, key, object) {
  13855. baseAssignValue(result, iteratee(value, key, object), value);
  13856. });
  13857. return result;
  13858. }
  13859. /**
  13860. * Creates an object with the same keys as `object` and values generated
  13861. * by running each own enumerable string keyed property of `object` thru
  13862. * `iteratee`. The iteratee is invoked with three arguments:
  13863. * (value, key, object).
  13864. *
  13865. * @static
  13866. * @memberOf _
  13867. * @since 2.4.0
  13868. * @category Object
  13869. * @param {Object} object The object to iterate over.
  13870. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13871. * @returns {Object} Returns the new mapped object.
  13872. * @see _.mapKeys
  13873. * @example
  13874. *
  13875. * var users = {
  13876. * 'fred': { 'user': 'fred', 'age': 40 },
  13877. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13878. * };
  13879. *
  13880. * _.mapValues(users, function(o) { return o.age; });
  13881. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13882. *
  13883. * // The `_.property` iteratee shorthand.
  13884. * _.mapValues(users, 'age');
  13885. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13886. */
  13887. function mapValues(object, iteratee) {
  13888. var result = {};
  13889. iteratee = getIteratee(iteratee, 3);
  13890. baseForOwn(object, function(value, key, object) {
  13891. baseAssignValue(result, key, iteratee(value, key, object));
  13892. });
  13893. return result;
  13894. }
  13895. /**
  13896. * This method is like `_.assign` except that it recursively merges own and
  13897. * inherited enumerable string keyed properties of source objects into the
  13898. * destination object. Source properties that resolve to `undefined` are
  13899. * skipped if a destination value exists. Array and plain object properties
  13900. * are merged recursively. Other objects and value types are overridden by
  13901. * assignment. Source objects are applied from left to right. Subsequent
  13902. * sources overwrite property assignments of previous sources.
  13903. *
  13904. * **Note:** This method mutates `object`.
  13905. *
  13906. * @static
  13907. * @memberOf _
  13908. * @since 0.5.0
  13909. * @category Object
  13910. * @param {Object} object The destination object.
  13911. * @param {...Object} [sources] The source objects.
  13912. * @returns {Object} Returns `object`.
  13913. * @example
  13914. *
  13915. * var object = {
  13916. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13917. * };
  13918. *
  13919. * var other = {
  13920. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13921. * };
  13922. *
  13923. * _.merge(object, other);
  13924. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13925. */
  13926. var merge = createAssigner(function(object, source, srcIndex) {
  13927. baseMerge(object, source, srcIndex);
  13928. });
  13929. /**
  13930. * This method is like `_.merge` except that it accepts `customizer` which
  13931. * is invoked to produce the merged values of the destination and source
  13932. * properties. If `customizer` returns `undefined`, merging is handled by the
  13933. * method instead. The `customizer` is invoked with six arguments:
  13934. * (objValue, srcValue, key, object, source, stack).
  13935. *
  13936. * **Note:** This method mutates `object`.
  13937. *
  13938. * @static
  13939. * @memberOf _
  13940. * @since 4.0.0
  13941. * @category Object
  13942. * @param {Object} object The destination object.
  13943. * @param {...Object} sources The source objects.
  13944. * @param {Function} customizer The function to customize assigned values.
  13945. * @returns {Object} Returns `object`.
  13946. * @example
  13947. *
  13948. * function customizer(objValue, srcValue) {
  13949. * if (_.isArray(objValue)) {
  13950. * return objValue.concat(srcValue);
  13951. * }
  13952. * }
  13953. *
  13954. * var object = { 'a': [1], 'b': [2] };
  13955. * var other = { 'a': [3], 'b': [4] };
  13956. *
  13957. * _.mergeWith(object, other, customizer);
  13958. * // => { 'a': [1, 3], 'b': [2, 4] }
  13959. */
  13960. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13961. baseMerge(object, source, srcIndex, customizer);
  13962. });
  13963. /**
  13964. * The opposite of `_.pick`; this method creates an object composed of the
  13965. * own and inherited enumerable property paths of `object` that are not omitted.
  13966. *
  13967. * **Note:** This method is considerably slower than `_.pick`.
  13968. *
  13969. * @static
  13970. * @since 0.1.0
  13971. * @memberOf _
  13972. * @category Object
  13973. * @param {Object} object The source object.
  13974. * @param {...(string|string[])} [paths] The property paths to omit.
  13975. * @returns {Object} Returns the new object.
  13976. * @example
  13977. *
  13978. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13979. *
  13980. * _.omit(object, ['a', 'c']);
  13981. * // => { 'b': '2' }
  13982. */
  13983. var omit = flatRest(function(object, paths) {
  13984. var result = {};
  13985. if (object == null) {
  13986. return result;
  13987. }
  13988. var isDeep = false;
  13989. paths = arrayMap(paths, function(path) {
  13990. path = castPath(path, object);
  13991. isDeep || (isDeep = path.length > 1);
  13992. return path;
  13993. });
  13994. copyObject(object, getAllKeysIn(object), result);
  13995. if (isDeep) {
  13996. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13997. }
  13998. var length = paths.length;
  13999. while (length--) {
  14000. baseUnset(result, paths[length]);
  14001. }
  14002. return result;
  14003. });
  14004. /**
  14005. * The opposite of `_.pickBy`; this method creates an object composed of
  14006. * the own and inherited enumerable string keyed properties of `object` that
  14007. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14008. * arguments: (value, key).
  14009. *
  14010. * @static
  14011. * @memberOf _
  14012. * @since 4.0.0
  14013. * @category Object
  14014. * @param {Object} object The source object.
  14015. * @param {Function} [predicate=_.identity] The function invoked per property.
  14016. * @returns {Object} Returns the new object.
  14017. * @example
  14018. *
  14019. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14020. *
  14021. * _.omitBy(object, _.isNumber);
  14022. * // => { 'b': '2' }
  14023. */
  14024. function omitBy(object, predicate) {
  14025. return pickBy(object, negate(getIteratee(predicate)));
  14026. }
  14027. /**
  14028. * Creates an object composed of the picked `object` properties.
  14029. *
  14030. * @static
  14031. * @since 0.1.0
  14032. * @memberOf _
  14033. * @category Object
  14034. * @param {Object} object The source object.
  14035. * @param {...(string|string[])} [paths] The property paths to pick.
  14036. * @returns {Object} Returns the new object.
  14037. * @example
  14038. *
  14039. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14040. *
  14041. * _.pick(object, ['a', 'c']);
  14042. * // => { 'a': 1, 'c': 3 }
  14043. */
  14044. var pick = flatRest(function(object, paths) {
  14045. return object == null ? {} : basePick(object, paths);
  14046. });
  14047. /**
  14048. * Creates an object composed of the `object` properties `predicate` returns
  14049. * truthy for. The predicate is invoked with two arguments: (value, key).
  14050. *
  14051. * @static
  14052. * @memberOf _
  14053. * @since 4.0.0
  14054. * @category Object
  14055. * @param {Object} object The source object.
  14056. * @param {Function} [predicate=_.identity] The function invoked per property.
  14057. * @returns {Object} Returns the new object.
  14058. * @example
  14059. *
  14060. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14061. *
  14062. * _.pickBy(object, _.isNumber);
  14063. * // => { 'a': 1, 'c': 3 }
  14064. */
  14065. function pickBy(object, predicate) {
  14066. if (object == null) {
  14067. return {};
  14068. }
  14069. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14070. return [prop];
  14071. });
  14072. predicate = getIteratee(predicate);
  14073. return basePickBy(object, props, function(value, path) {
  14074. return predicate(value, path[0]);
  14075. });
  14076. }
  14077. /**
  14078. * This method is like `_.get` except that if the resolved value is a
  14079. * function it's invoked with the `this` binding of its parent object and
  14080. * its result is returned.
  14081. *
  14082. * @static
  14083. * @since 0.1.0
  14084. * @memberOf _
  14085. * @category Object
  14086. * @param {Object} object The object to query.
  14087. * @param {Array|string} path The path of the property to resolve.
  14088. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14089. * @returns {*} Returns the resolved value.
  14090. * @example
  14091. *
  14092. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14093. *
  14094. * _.result(object, 'a[0].b.c1');
  14095. * // => 3
  14096. *
  14097. * _.result(object, 'a[0].b.c2');
  14098. * // => 4
  14099. *
  14100. * _.result(object, 'a[0].b.c3', 'default');
  14101. * // => 'default'
  14102. *
  14103. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14104. * // => 'default'
  14105. */
  14106. function result(object, path, defaultValue) {
  14107. path = castPath(path, object);
  14108. var index = -1,
  14109. length = path.length;
  14110. // Ensure the loop is entered when path is empty.
  14111. if (!length) {
  14112. length = 1;
  14113. object = undefined;
  14114. }
  14115. while (++index < length) {
  14116. var value = object == null ? undefined : object[toKey(path[index])];
  14117. if (value === undefined) {
  14118. index = length;
  14119. value = defaultValue;
  14120. }
  14121. object = isFunction(value) ? value.call(object) : value;
  14122. }
  14123. return object;
  14124. }
  14125. /**
  14126. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14127. * it's created. Arrays are created for missing index properties while objects
  14128. * are created for all other missing properties. Use `_.setWith` to customize
  14129. * `path` creation.
  14130. *
  14131. * **Note:** This method mutates `object`.
  14132. *
  14133. * @static
  14134. * @memberOf _
  14135. * @since 3.7.0
  14136. * @category Object
  14137. * @param {Object} object The object to modify.
  14138. * @param {Array|string} path The path of the property to set.
  14139. * @param {*} value The value to set.
  14140. * @returns {Object} Returns `object`.
  14141. * @example
  14142. *
  14143. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14144. *
  14145. * _.set(object, 'a[0].b.c', 4);
  14146. * console.log(object.a[0].b.c);
  14147. * // => 4
  14148. *
  14149. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14150. * console.log(object.x[0].y.z);
  14151. * // => 5
  14152. */
  14153. function set(object, path, value) {
  14154. return object == null ? object : baseSet(object, path, value);
  14155. }
  14156. /**
  14157. * This method is like `_.set` except that it accepts `customizer` which is
  14158. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14159. * path creation is handled by the method instead. The `customizer` is invoked
  14160. * with three arguments: (nsValue, key, nsObject).
  14161. *
  14162. * **Note:** This method mutates `object`.
  14163. *
  14164. * @static
  14165. * @memberOf _
  14166. * @since 4.0.0
  14167. * @category Object
  14168. * @param {Object} object The object to modify.
  14169. * @param {Array|string} path The path of the property to set.
  14170. * @param {*} value The value to set.
  14171. * @param {Function} [customizer] The function to customize assigned values.
  14172. * @returns {Object} Returns `object`.
  14173. * @example
  14174. *
  14175. * var object = {};
  14176. *
  14177. * _.setWith(object, '[0][1]', 'a', Object);
  14178. * // => { '0': { '1': 'a' } }
  14179. */
  14180. function setWith(object, path, value, customizer) {
  14181. customizer = typeof customizer == 'function' ? customizer : undefined;
  14182. return object == null ? object : baseSet(object, path, value, customizer);
  14183. }
  14184. /**
  14185. * Creates an array of own enumerable string keyed-value pairs for `object`
  14186. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14187. * entries are returned.
  14188. *
  14189. * @static
  14190. * @memberOf _
  14191. * @since 4.0.0
  14192. * @alias entries
  14193. * @category Object
  14194. * @param {Object} object The object to query.
  14195. * @returns {Array} Returns the key-value pairs.
  14196. * @example
  14197. *
  14198. * function Foo() {
  14199. * this.a = 1;
  14200. * this.b = 2;
  14201. * }
  14202. *
  14203. * Foo.prototype.c = 3;
  14204. *
  14205. * _.toPairs(new Foo);
  14206. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14207. */
  14208. var toPairs = createToPairs(keys);
  14209. /**
  14210. * Creates an array of own and inherited enumerable string keyed-value pairs
  14211. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14212. * or set, its entries are returned.
  14213. *
  14214. * @static
  14215. * @memberOf _
  14216. * @since 4.0.0
  14217. * @alias entriesIn
  14218. * @category Object
  14219. * @param {Object} object The object to query.
  14220. * @returns {Array} Returns the key-value pairs.
  14221. * @example
  14222. *
  14223. * function Foo() {
  14224. * this.a = 1;
  14225. * this.b = 2;
  14226. * }
  14227. *
  14228. * Foo.prototype.c = 3;
  14229. *
  14230. * _.toPairsIn(new Foo);
  14231. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14232. */
  14233. var toPairsIn = createToPairs(keysIn);
  14234. /**
  14235. * An alternative to `_.reduce`; this method transforms `object` to a new
  14236. * `accumulator` object which is the result of running each of its own
  14237. * enumerable string keyed properties thru `iteratee`, with each invocation
  14238. * potentially mutating the `accumulator` object. If `accumulator` is not
  14239. * provided, a new object with the same `[[Prototype]]` will be used. The
  14240. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14241. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14242. *
  14243. * @static
  14244. * @memberOf _
  14245. * @since 1.3.0
  14246. * @category Object
  14247. * @param {Object} object The object to iterate over.
  14248. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14249. * @param {*} [accumulator] The custom accumulator value.
  14250. * @returns {*} Returns the accumulated value.
  14251. * @example
  14252. *
  14253. * _.transform([2, 3, 4], function(result, n) {
  14254. * result.push(n *= n);
  14255. * return n % 2 == 0;
  14256. * }, []);
  14257. * // => [4, 9]
  14258. *
  14259. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14260. * (result[value] || (result[value] = [])).push(key);
  14261. * }, {});
  14262. * // => { '1': ['a', 'c'], '2': ['b'] }
  14263. */
  14264. function transform(object, iteratee, accumulator) {
  14265. var isArr = isArray(object),
  14266. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14267. iteratee = getIteratee(iteratee, 4);
  14268. if (accumulator == null) {
  14269. var Ctor = object && object.constructor;
  14270. if (isArrLike) {
  14271. accumulator = isArr ? new Ctor : [];
  14272. }
  14273. else if (isObject(object)) {
  14274. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14275. }
  14276. else {
  14277. accumulator = {};
  14278. }
  14279. }
  14280. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14281. return iteratee(accumulator, value, index, object);
  14282. });
  14283. return accumulator;
  14284. }
  14285. /**
  14286. * Removes the property at `path` of `object`.
  14287. *
  14288. * **Note:** This method mutates `object`.
  14289. *
  14290. * @static
  14291. * @memberOf _
  14292. * @since 4.0.0
  14293. * @category Object
  14294. * @param {Object} object The object to modify.
  14295. * @param {Array|string} path The path of the property to unset.
  14296. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14297. * @example
  14298. *
  14299. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14300. * _.unset(object, 'a[0].b.c');
  14301. * // => true
  14302. *
  14303. * console.log(object);
  14304. * // => { 'a': [{ 'b': {} }] };
  14305. *
  14306. * _.unset(object, ['a', '0', 'b', 'c']);
  14307. * // => true
  14308. *
  14309. * console.log(object);
  14310. * // => { 'a': [{ 'b': {} }] };
  14311. */
  14312. function unset(object, path) {
  14313. return object == null ? true : baseUnset(object, path);
  14314. }
  14315. /**
  14316. * This method is like `_.set` except that accepts `updater` to produce the
  14317. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14318. * is invoked with one argument: (value).
  14319. *
  14320. * **Note:** This method mutates `object`.
  14321. *
  14322. * @static
  14323. * @memberOf _
  14324. * @since 4.6.0
  14325. * @category Object
  14326. * @param {Object} object The object to modify.
  14327. * @param {Array|string} path The path of the property to set.
  14328. * @param {Function} updater The function to produce the updated value.
  14329. * @returns {Object} Returns `object`.
  14330. * @example
  14331. *
  14332. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14333. *
  14334. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14335. * console.log(object.a[0].b.c);
  14336. * // => 9
  14337. *
  14338. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14339. * console.log(object.x[0].y.z);
  14340. * // => 0
  14341. */
  14342. function update(object, path, updater) {
  14343. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14344. }
  14345. /**
  14346. * This method is like `_.update` except that it accepts `customizer` which is
  14347. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14348. * path creation is handled by the method instead. The `customizer` is invoked
  14349. * with three arguments: (nsValue, key, nsObject).
  14350. *
  14351. * **Note:** This method mutates `object`.
  14352. *
  14353. * @static
  14354. * @memberOf _
  14355. * @since 4.6.0
  14356. * @category Object
  14357. * @param {Object} object The object to modify.
  14358. * @param {Array|string} path The path of the property to set.
  14359. * @param {Function} updater The function to produce the updated value.
  14360. * @param {Function} [customizer] The function to customize assigned values.
  14361. * @returns {Object} Returns `object`.
  14362. * @example
  14363. *
  14364. * var object = {};
  14365. *
  14366. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14367. * // => { '0': { '1': 'a' } }
  14368. */
  14369. function updateWith(object, path, updater, customizer) {
  14370. customizer = typeof customizer == 'function' ? customizer : undefined;
  14371. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14372. }
  14373. /**
  14374. * Creates an array of the own enumerable string keyed property values of `object`.
  14375. *
  14376. * **Note:** Non-object values are coerced to objects.
  14377. *
  14378. * @static
  14379. * @since 0.1.0
  14380. * @memberOf _
  14381. * @category Object
  14382. * @param {Object} object The object to query.
  14383. * @returns {Array} Returns the array of property values.
  14384. * @example
  14385. *
  14386. * function Foo() {
  14387. * this.a = 1;
  14388. * this.b = 2;
  14389. * }
  14390. *
  14391. * Foo.prototype.c = 3;
  14392. *
  14393. * _.values(new Foo);
  14394. * // => [1, 2] (iteration order is not guaranteed)
  14395. *
  14396. * _.values('hi');
  14397. * // => ['h', 'i']
  14398. */
  14399. function values(object) {
  14400. return object == null ? [] : baseValues(object, keys(object));
  14401. }
  14402. /**
  14403. * Creates an array of the own and inherited enumerable string keyed property
  14404. * values of `object`.
  14405. *
  14406. * **Note:** Non-object values are coerced to objects.
  14407. *
  14408. * @static
  14409. * @memberOf _
  14410. * @since 3.0.0
  14411. * @category Object
  14412. * @param {Object} object The object to query.
  14413. * @returns {Array} Returns the array of property values.
  14414. * @example
  14415. *
  14416. * function Foo() {
  14417. * this.a = 1;
  14418. * this.b = 2;
  14419. * }
  14420. *
  14421. * Foo.prototype.c = 3;
  14422. *
  14423. * _.valuesIn(new Foo);
  14424. * // => [1, 2, 3] (iteration order is not guaranteed)
  14425. */
  14426. function valuesIn(object) {
  14427. return object == null ? [] : baseValues(object, keysIn(object));
  14428. }
  14429. /*------------------------------------------------------------------------*/
  14430. /**
  14431. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14432. *
  14433. * @static
  14434. * @memberOf _
  14435. * @since 4.0.0
  14436. * @category Number
  14437. * @param {number} number The number to clamp.
  14438. * @param {number} [lower] The lower bound.
  14439. * @param {number} upper The upper bound.
  14440. * @returns {number} Returns the clamped number.
  14441. * @example
  14442. *
  14443. * _.clamp(-10, -5, 5);
  14444. * // => -5
  14445. *
  14446. * _.clamp(10, -5, 5);
  14447. * // => 5
  14448. */
  14449. function clamp(number, lower, upper) {
  14450. if (upper === undefined) {
  14451. upper = lower;
  14452. lower = undefined;
  14453. }
  14454. if (upper !== undefined) {
  14455. upper = toNumber(upper);
  14456. upper = upper === upper ? upper : 0;
  14457. }
  14458. if (lower !== undefined) {
  14459. lower = toNumber(lower);
  14460. lower = lower === lower ? lower : 0;
  14461. }
  14462. return baseClamp(toNumber(number), lower, upper);
  14463. }
  14464. /**
  14465. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14466. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14467. * If `start` is greater than `end` the params are swapped to support
  14468. * negative ranges.
  14469. *
  14470. * @static
  14471. * @memberOf _
  14472. * @since 3.3.0
  14473. * @category Number
  14474. * @param {number} number The number to check.
  14475. * @param {number} [start=0] The start of the range.
  14476. * @param {number} end The end of the range.
  14477. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14478. * @see _.range, _.rangeRight
  14479. * @example
  14480. *
  14481. * _.inRange(3, 2, 4);
  14482. * // => true
  14483. *
  14484. * _.inRange(4, 8);
  14485. * // => true
  14486. *
  14487. * _.inRange(4, 2);
  14488. * // => false
  14489. *
  14490. * _.inRange(2, 2);
  14491. * // => false
  14492. *
  14493. * _.inRange(1.2, 2);
  14494. * // => true
  14495. *
  14496. * _.inRange(5.2, 4);
  14497. * // => false
  14498. *
  14499. * _.inRange(-3, -2, -6);
  14500. * // => true
  14501. */
  14502. function inRange(number, start, end) {
  14503. start = toFinite(start);
  14504. if (end === undefined) {
  14505. end = start;
  14506. start = 0;
  14507. } else {
  14508. end = toFinite(end);
  14509. }
  14510. number = toNumber(number);
  14511. return baseInRange(number, start, end);
  14512. }
  14513. /**
  14514. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14515. * If only one argument is provided a number between `0` and the given number
  14516. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14517. * floats, a floating-point number is returned instead of an integer.
  14518. *
  14519. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14520. * floating-point values which can produce unexpected results.
  14521. *
  14522. * @static
  14523. * @memberOf _
  14524. * @since 0.7.0
  14525. * @category Number
  14526. * @param {number} [lower=0] The lower bound.
  14527. * @param {number} [upper=1] The upper bound.
  14528. * @param {boolean} [floating] Specify returning a floating-point number.
  14529. * @returns {number} Returns the random number.
  14530. * @example
  14531. *
  14532. * _.random(0, 5);
  14533. * // => an integer between 0 and 5
  14534. *
  14535. * _.random(5);
  14536. * // => also an integer between 0 and 5
  14537. *
  14538. * _.random(5, true);
  14539. * // => a floating-point number between 0 and 5
  14540. *
  14541. * _.random(1.2, 5.2);
  14542. * // => a floating-point number between 1.2 and 5.2
  14543. */
  14544. function random(lower, upper, floating) {
  14545. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14546. upper = floating = undefined;
  14547. }
  14548. if (floating === undefined) {
  14549. if (typeof upper == 'boolean') {
  14550. floating = upper;
  14551. upper = undefined;
  14552. }
  14553. else if (typeof lower == 'boolean') {
  14554. floating = lower;
  14555. lower = undefined;
  14556. }
  14557. }
  14558. if (lower === undefined && upper === undefined) {
  14559. lower = 0;
  14560. upper = 1;
  14561. }
  14562. else {
  14563. lower = toFinite(lower);
  14564. if (upper === undefined) {
  14565. upper = lower;
  14566. lower = 0;
  14567. } else {
  14568. upper = toFinite(upper);
  14569. }
  14570. }
  14571. if (lower > upper) {
  14572. var temp = lower;
  14573. lower = upper;
  14574. upper = temp;
  14575. }
  14576. if (floating || lower % 1 || upper % 1) {
  14577. var rand = nativeRandom();
  14578. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14579. }
  14580. return baseRandom(lower, upper);
  14581. }
  14582. /*------------------------------------------------------------------------*/
  14583. /**
  14584. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14585. *
  14586. * @static
  14587. * @memberOf _
  14588. * @since 3.0.0
  14589. * @category String
  14590. * @param {string} [string=''] The string to convert.
  14591. * @returns {string} Returns the camel cased string.
  14592. * @example
  14593. *
  14594. * _.camelCase('Foo Bar');
  14595. * // => 'fooBar'
  14596. *
  14597. * _.camelCase('--foo-bar--');
  14598. * // => 'fooBar'
  14599. *
  14600. * _.camelCase('__FOO_BAR__');
  14601. * // => 'fooBar'
  14602. */
  14603. var camelCase = createCompounder(function(result, word, index) {
  14604. word = word.toLowerCase();
  14605. return result + (index ? capitalize(word) : word);
  14606. });
  14607. /**
  14608. * Converts the first character of `string` to upper case and the remaining
  14609. * to lower case.
  14610. *
  14611. * @static
  14612. * @memberOf _
  14613. * @since 3.0.0
  14614. * @category String
  14615. * @param {string} [string=''] The string to capitalize.
  14616. * @returns {string} Returns the capitalized string.
  14617. * @example
  14618. *
  14619. * _.capitalize('FRED');
  14620. * // => 'Fred'
  14621. */
  14622. function capitalize(string) {
  14623. return upperFirst(toString(string).toLowerCase());
  14624. }
  14625. /**
  14626. * Deburrs `string` by converting
  14627. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14628. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14629. * letters to basic Latin letters and removing
  14630. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14631. *
  14632. * @static
  14633. * @memberOf _
  14634. * @since 3.0.0
  14635. * @category String
  14636. * @param {string} [string=''] The string to deburr.
  14637. * @returns {string} Returns the deburred string.
  14638. * @example
  14639. *
  14640. * _.deburr('déjà vu');
  14641. * // => 'deja vu'
  14642. */
  14643. function deburr(string) {
  14644. string = toString(string);
  14645. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14646. }
  14647. /**
  14648. * Checks if `string` ends with the given target string.
  14649. *
  14650. * @static
  14651. * @memberOf _
  14652. * @since 3.0.0
  14653. * @category String
  14654. * @param {string} [string=''] The string to inspect.
  14655. * @param {string} [target] The string to search for.
  14656. * @param {number} [position=string.length] The position to search up to.
  14657. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14658. * else `false`.
  14659. * @example
  14660. *
  14661. * _.endsWith('abc', 'c');
  14662. * // => true
  14663. *
  14664. * _.endsWith('abc', 'b');
  14665. * // => false
  14666. *
  14667. * _.endsWith('abc', 'b', 2);
  14668. * // => true
  14669. */
  14670. function endsWith(string, target, position) {
  14671. string = toString(string);
  14672. target = baseToString(target);
  14673. var length = string.length;
  14674. position = position === undefined
  14675. ? length
  14676. : baseClamp(toInteger(position), 0, length);
  14677. var end = position;
  14678. position -= target.length;
  14679. return position >= 0 && string.slice(position, end) == target;
  14680. }
  14681. /**
  14682. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14683. * corresponding HTML entities.
  14684. *
  14685. * **Note:** No other characters are escaped. To escape additional
  14686. * characters use a third-party library like [_he_](https://mths.be/he).
  14687. *
  14688. * Though the ">" character is escaped for symmetry, characters like
  14689. * ">" and "/" don't need escaping in HTML and have no special meaning
  14690. * unless they're part of a tag or unquoted attribute value. See
  14691. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14692. * (under "semi-related fun fact") for more details.
  14693. *
  14694. * When working with HTML you should always
  14695. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14696. * XSS vectors.
  14697. *
  14698. * @static
  14699. * @since 0.1.0
  14700. * @memberOf _
  14701. * @category String
  14702. * @param {string} [string=''] The string to escape.
  14703. * @returns {string} Returns the escaped string.
  14704. * @example
  14705. *
  14706. * _.escape('fred, barney, & pebbles');
  14707. * // => 'fred, barney, &amp; pebbles'
  14708. */
  14709. function escape(string) {
  14710. string = toString(string);
  14711. return (string && reHasUnescapedHtml.test(string))
  14712. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14713. : string;
  14714. }
  14715. /**
  14716. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14717. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14718. *
  14719. * @static
  14720. * @memberOf _
  14721. * @since 3.0.0
  14722. * @category String
  14723. * @param {string} [string=''] The string to escape.
  14724. * @returns {string} Returns the escaped string.
  14725. * @example
  14726. *
  14727. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14728. * // => '\[lodash\]\(https://lodash\.com/\)'
  14729. */
  14730. function escapeRegExp(string) {
  14731. string = toString(string);
  14732. return (string && reHasRegExpChar.test(string))
  14733. ? string.replace(reRegExpChar, '\\$&')
  14734. : string;
  14735. }
  14736. /**
  14737. * Converts `string` to
  14738. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14739. *
  14740. * @static
  14741. * @memberOf _
  14742. * @since 3.0.0
  14743. * @category String
  14744. * @param {string} [string=''] The string to convert.
  14745. * @returns {string} Returns the kebab cased string.
  14746. * @example
  14747. *
  14748. * _.kebabCase('Foo Bar');
  14749. * // => 'foo-bar'
  14750. *
  14751. * _.kebabCase('fooBar');
  14752. * // => 'foo-bar'
  14753. *
  14754. * _.kebabCase('__FOO_BAR__');
  14755. * // => 'foo-bar'
  14756. */
  14757. var kebabCase = createCompounder(function(result, word, index) {
  14758. return result + (index ? '-' : '') + word.toLowerCase();
  14759. });
  14760. /**
  14761. * Converts `string`, as space separated words, to lower case.
  14762. *
  14763. * @static
  14764. * @memberOf _
  14765. * @since 4.0.0
  14766. * @category String
  14767. * @param {string} [string=''] The string to convert.
  14768. * @returns {string} Returns the lower cased string.
  14769. * @example
  14770. *
  14771. * _.lowerCase('--Foo-Bar--');
  14772. * // => 'foo bar'
  14773. *
  14774. * _.lowerCase('fooBar');
  14775. * // => 'foo bar'
  14776. *
  14777. * _.lowerCase('__FOO_BAR__');
  14778. * // => 'foo bar'
  14779. */
  14780. var lowerCase = createCompounder(function(result, word, index) {
  14781. return result + (index ? ' ' : '') + word.toLowerCase();
  14782. });
  14783. /**
  14784. * Converts the first character of `string` to lower case.
  14785. *
  14786. * @static
  14787. * @memberOf _
  14788. * @since 4.0.0
  14789. * @category String
  14790. * @param {string} [string=''] The string to convert.
  14791. * @returns {string} Returns the converted string.
  14792. * @example
  14793. *
  14794. * _.lowerFirst('Fred');
  14795. * // => 'fred'
  14796. *
  14797. * _.lowerFirst('FRED');
  14798. * // => 'fRED'
  14799. */
  14800. var lowerFirst = createCaseFirst('toLowerCase');
  14801. /**
  14802. * Pads `string` on the left and right sides if it's shorter than `length`.
  14803. * Padding characters are truncated if they can't be evenly divided by `length`.
  14804. *
  14805. * @static
  14806. * @memberOf _
  14807. * @since 3.0.0
  14808. * @category String
  14809. * @param {string} [string=''] The string to pad.
  14810. * @param {number} [length=0] The padding length.
  14811. * @param {string} [chars=' '] The string used as padding.
  14812. * @returns {string} Returns the padded string.
  14813. * @example
  14814. *
  14815. * _.pad('abc', 8);
  14816. * // => ' abc '
  14817. *
  14818. * _.pad('abc', 8, '_-');
  14819. * // => '_-abc_-_'
  14820. *
  14821. * _.pad('abc', 3);
  14822. * // => 'abc'
  14823. */
  14824. function pad(string, length, chars) {
  14825. string = toString(string);
  14826. length = toInteger(length);
  14827. var strLength = length ? stringSize(string) : 0;
  14828. if (!length || strLength >= length) {
  14829. return string;
  14830. }
  14831. var mid = (length - strLength) / 2;
  14832. return (
  14833. createPadding(nativeFloor(mid), chars) +
  14834. string +
  14835. createPadding(nativeCeil(mid), chars)
  14836. );
  14837. }
  14838. /**
  14839. * Pads `string` on the right side if it's shorter than `length`. Padding
  14840. * characters are truncated if they exceed `length`.
  14841. *
  14842. * @static
  14843. * @memberOf _
  14844. * @since 4.0.0
  14845. * @category String
  14846. * @param {string} [string=''] The string to pad.
  14847. * @param {number} [length=0] The padding length.
  14848. * @param {string} [chars=' '] The string used as padding.
  14849. * @returns {string} Returns the padded string.
  14850. * @example
  14851. *
  14852. * _.padEnd('abc', 6);
  14853. * // => 'abc '
  14854. *
  14855. * _.padEnd('abc', 6, '_-');
  14856. * // => 'abc_-_'
  14857. *
  14858. * _.padEnd('abc', 3);
  14859. * // => 'abc'
  14860. */
  14861. function padEnd(string, length, chars) {
  14862. string = toString(string);
  14863. length = toInteger(length);
  14864. var strLength = length ? stringSize(string) : 0;
  14865. return (length && strLength < length)
  14866. ? (string + createPadding(length - strLength, chars))
  14867. : string;
  14868. }
  14869. /**
  14870. * Pads `string` on the left side if it's shorter than `length`. Padding
  14871. * characters are truncated if they exceed `length`.
  14872. *
  14873. * @static
  14874. * @memberOf _
  14875. * @since 4.0.0
  14876. * @category String
  14877. * @param {string} [string=''] The string to pad.
  14878. * @param {number} [length=0] The padding length.
  14879. * @param {string} [chars=' '] The string used as padding.
  14880. * @returns {string} Returns the padded string.
  14881. * @example
  14882. *
  14883. * _.padStart('abc', 6);
  14884. * // => ' abc'
  14885. *
  14886. * _.padStart('abc', 6, '_-');
  14887. * // => '_-_abc'
  14888. *
  14889. * _.padStart('abc', 3);
  14890. * // => 'abc'
  14891. */
  14892. function padStart(string, length, chars) {
  14893. string = toString(string);
  14894. length = toInteger(length);
  14895. var strLength = length ? stringSize(string) : 0;
  14896. return (length && strLength < length)
  14897. ? (createPadding(length - strLength, chars) + string)
  14898. : string;
  14899. }
  14900. /**
  14901. * Converts `string` to an integer of the specified radix. If `radix` is
  14902. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14903. * hexadecimal, in which case a `radix` of `16` is used.
  14904. *
  14905. * **Note:** This method aligns with the
  14906. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14907. *
  14908. * @static
  14909. * @memberOf _
  14910. * @since 1.1.0
  14911. * @category String
  14912. * @param {string} string The string to convert.
  14913. * @param {number} [radix=10] The radix to interpret `value` by.
  14914. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14915. * @returns {number} Returns the converted integer.
  14916. * @example
  14917. *
  14918. * _.parseInt('08');
  14919. * // => 8
  14920. *
  14921. * _.map(['6', '08', '10'], _.parseInt);
  14922. * // => [6, 8, 10]
  14923. */
  14924. function parseInt(string, radix, guard) {
  14925. if (guard || radix == null) {
  14926. radix = 0;
  14927. } else if (radix) {
  14928. radix = +radix;
  14929. }
  14930. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14931. }
  14932. /**
  14933. * Repeats the given string `n` times.
  14934. *
  14935. * @static
  14936. * @memberOf _
  14937. * @since 3.0.0
  14938. * @category String
  14939. * @param {string} [string=''] The string to repeat.
  14940. * @param {number} [n=1] The number of times to repeat the string.
  14941. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14942. * @returns {string} Returns the repeated string.
  14943. * @example
  14944. *
  14945. * _.repeat('*', 3);
  14946. * // => '***'
  14947. *
  14948. * _.repeat('abc', 2);
  14949. * // => 'abcabc'
  14950. *
  14951. * _.repeat('abc', 0);
  14952. * // => ''
  14953. */
  14954. function repeat(string, n, guard) {
  14955. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14956. n = 1;
  14957. } else {
  14958. n = toInteger(n);
  14959. }
  14960. return baseRepeat(toString(string), n);
  14961. }
  14962. /**
  14963. * Replaces matches for `pattern` in `string` with `replacement`.
  14964. *
  14965. * **Note:** This method is based on
  14966. * [`String#replace`](https://mdn.io/String/replace).
  14967. *
  14968. * @static
  14969. * @memberOf _
  14970. * @since 4.0.0
  14971. * @category String
  14972. * @param {string} [string=''] The string to modify.
  14973. * @param {RegExp|string} pattern The pattern to replace.
  14974. * @param {Function|string} replacement The match replacement.
  14975. * @returns {string} Returns the modified string.
  14976. * @example
  14977. *
  14978. * _.replace('Hi Fred', 'Fred', 'Barney');
  14979. * // => 'Hi Barney'
  14980. */
  14981. function replace() {
  14982. var args = arguments,
  14983. string = toString(args[0]);
  14984. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14985. }
  14986. /**
  14987. * Converts `string` to
  14988. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14989. *
  14990. * @static
  14991. * @memberOf _
  14992. * @since 3.0.0
  14993. * @category String
  14994. * @param {string} [string=''] The string to convert.
  14995. * @returns {string} Returns the snake cased string.
  14996. * @example
  14997. *
  14998. * _.snakeCase('Foo Bar');
  14999. * // => 'foo_bar'
  15000. *
  15001. * _.snakeCase('fooBar');
  15002. * // => 'foo_bar'
  15003. *
  15004. * _.snakeCase('--FOO-BAR--');
  15005. * // => 'foo_bar'
  15006. */
  15007. var snakeCase = createCompounder(function(result, word, index) {
  15008. return result + (index ? '_' : '') + word.toLowerCase();
  15009. });
  15010. /**
  15011. * Splits `string` by `separator`.
  15012. *
  15013. * **Note:** This method is based on
  15014. * [`String#split`](https://mdn.io/String/split).
  15015. *
  15016. * @static
  15017. * @memberOf _
  15018. * @since 4.0.0
  15019. * @category String
  15020. * @param {string} [string=''] The string to split.
  15021. * @param {RegExp|string} separator The separator pattern to split by.
  15022. * @param {number} [limit] The length to truncate results to.
  15023. * @returns {Array} Returns the string segments.
  15024. * @example
  15025. *
  15026. * _.split('a-b-c', '-', 2);
  15027. * // => ['a', 'b']
  15028. */
  15029. function split(string, separator, limit) {
  15030. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15031. separator = limit = undefined;
  15032. }
  15033. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15034. if (!limit) {
  15035. return [];
  15036. }
  15037. string = toString(string);
  15038. if (string && (
  15039. typeof separator == 'string' ||
  15040. (separator != null && !isRegExp(separator))
  15041. )) {
  15042. separator = baseToString(separator);
  15043. if (!separator && hasUnicode(string)) {
  15044. return castSlice(stringToArray(string), 0, limit);
  15045. }
  15046. }
  15047. return string.split(separator, limit);
  15048. }
  15049. /**
  15050. * Converts `string` to
  15051. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15052. *
  15053. * @static
  15054. * @memberOf _
  15055. * @since 3.1.0
  15056. * @category String
  15057. * @param {string} [string=''] The string to convert.
  15058. * @returns {string} Returns the start cased string.
  15059. * @example
  15060. *
  15061. * _.startCase('--foo-bar--');
  15062. * // => 'Foo Bar'
  15063. *
  15064. * _.startCase('fooBar');
  15065. * // => 'Foo Bar'
  15066. *
  15067. * _.startCase('__FOO_BAR__');
  15068. * // => 'FOO BAR'
  15069. */
  15070. var startCase = createCompounder(function(result, word, index) {
  15071. return result + (index ? ' ' : '') + upperFirst(word);
  15072. });
  15073. /**
  15074. * Checks if `string` starts with the given target string.
  15075. *
  15076. * @static
  15077. * @memberOf _
  15078. * @since 3.0.0
  15079. * @category String
  15080. * @param {string} [string=''] The string to inspect.
  15081. * @param {string} [target] The string to search for.
  15082. * @param {number} [position=0] The position to search from.
  15083. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15084. * else `false`.
  15085. * @example
  15086. *
  15087. * _.startsWith('abc', 'a');
  15088. * // => true
  15089. *
  15090. * _.startsWith('abc', 'b');
  15091. * // => false
  15092. *
  15093. * _.startsWith('abc', 'b', 1);
  15094. * // => true
  15095. */
  15096. function startsWith(string, target, position) {
  15097. string = toString(string);
  15098. position = position == null
  15099. ? 0
  15100. : baseClamp(toInteger(position), 0, string.length);
  15101. target = baseToString(target);
  15102. return string.slice(position, position + target.length) == target;
  15103. }
  15104. /**
  15105. * Creates a compiled template function that can interpolate data properties
  15106. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15107. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15108. * properties may be accessed as free variables in the template. If a setting
  15109. * object is given, it takes precedence over `_.templateSettings` values.
  15110. *
  15111. * **Note:** In the development build `_.template` utilizes
  15112. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15113. * for easier debugging.
  15114. *
  15115. * For more information on precompiling templates see
  15116. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15117. *
  15118. * For more information on Chrome extension sandboxes see
  15119. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15120. *
  15121. * @static
  15122. * @since 0.1.0
  15123. * @memberOf _
  15124. * @category String
  15125. * @param {string} [string=''] The template string.
  15126. * @param {Object} [options={}] The options object.
  15127. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15128. * The HTML "escape" delimiter.
  15129. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15130. * The "evaluate" delimiter.
  15131. * @param {Object} [options.imports=_.templateSettings.imports]
  15132. * An object to import into the template as free variables.
  15133. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15134. * The "interpolate" delimiter.
  15135. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15136. * The sourceURL of the compiled template.
  15137. * @param {string} [options.variable='obj']
  15138. * The data object variable name.
  15139. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15140. * @returns {Function} Returns the compiled template function.
  15141. * @example
  15142. *
  15143. * // Use the "interpolate" delimiter to create a compiled template.
  15144. * var compiled = _.template('hello <%= user %>!');
  15145. * compiled({ 'user': 'fred' });
  15146. * // => 'hello fred!'
  15147. *
  15148. * // Use the HTML "escape" delimiter to escape data property values.
  15149. * var compiled = _.template('<b><%- value %></b>');
  15150. * compiled({ 'value': '<script>' });
  15151. * // => '<b>&lt;script&gt;</b>'
  15152. *
  15153. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15154. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15155. * compiled({ 'users': ['fred', 'barney'] });
  15156. * // => '<li>fred</li><li>barney</li>'
  15157. *
  15158. * // Use the internal `print` function in "evaluate" delimiters.
  15159. * var compiled = _.template('<% print("hello " + user); %>!');
  15160. * compiled({ 'user': 'barney' });
  15161. * // => 'hello barney!'
  15162. *
  15163. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15164. * // Disable support by replacing the "interpolate" delimiter.
  15165. * var compiled = _.template('hello ${ user }!');
  15166. * compiled({ 'user': 'pebbles' });
  15167. * // => 'hello pebbles!'
  15168. *
  15169. * // Use backslashes to treat delimiters as plain text.
  15170. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15171. * compiled({ 'value': 'ignored' });
  15172. * // => '<%- value %>'
  15173. *
  15174. * // Use the `imports` option to import `jQuery` as `jq`.
  15175. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15176. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15177. * compiled({ 'users': ['fred', 'barney'] });
  15178. * // => '<li>fred</li><li>barney</li>'
  15179. *
  15180. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15181. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15182. * compiled(data);
  15183. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15184. *
  15185. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15186. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15187. * compiled.source;
  15188. * // => function(data) {
  15189. * // var __t, __p = '';
  15190. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15191. * // return __p;
  15192. * // }
  15193. *
  15194. * // Use custom template delimiters.
  15195. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15196. * var compiled = _.template('hello {{ user }}!');
  15197. * compiled({ 'user': 'mustache' });
  15198. * // => 'hello mustache!'
  15199. *
  15200. * // Use the `source` property to inline compiled templates for meaningful
  15201. * // line numbers in error messages and stack traces.
  15202. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15203. * var JST = {\
  15204. * "main": ' + _.template(mainText).source + '\
  15205. * };\
  15206. * ');
  15207. */
  15208. function template(string, options, guard) {
  15209. // Based on John Resig's `tmpl` implementation
  15210. // (http://ejohn.org/blog/javascript-micro-templating/)
  15211. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15212. var settings = lodash.templateSettings;
  15213. if (guard && isIterateeCall(string, options, guard)) {
  15214. options = undefined;
  15215. }
  15216. string = toString(string);
  15217. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15218. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15219. importsKeys = keys(imports),
  15220. importsValues = baseValues(imports, importsKeys);
  15221. var isEscaping,
  15222. isEvaluating,
  15223. index = 0,
  15224. interpolate = options.interpolate || reNoMatch,
  15225. source = "__p += '";
  15226. // Compile the regexp to match each delimiter.
  15227. var reDelimiters = RegExp(
  15228. (options.escape || reNoMatch).source + '|' +
  15229. interpolate.source + '|' +
  15230. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15231. (options.evaluate || reNoMatch).source + '|$'
  15232. , 'g');
  15233. // Use a sourceURL for easier debugging.
  15234. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15235. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15236. // and escape the comment, thus injecting code that gets evaled.
  15237. var sourceURL = '//# sourceURL=' +
  15238. (hasOwnProperty.call(options, 'sourceURL')
  15239. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15240. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15241. ) + '\n';
  15242. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15243. interpolateValue || (interpolateValue = esTemplateValue);
  15244. // Escape characters that can't be included in string literals.
  15245. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15246. // Replace delimiters with snippets.
  15247. if (escapeValue) {
  15248. isEscaping = true;
  15249. source += "' +\n__e(" + escapeValue + ") +\n'";
  15250. }
  15251. if (evaluateValue) {
  15252. isEvaluating = true;
  15253. source += "';\n" + evaluateValue + ";\n__p += '";
  15254. }
  15255. if (interpolateValue) {
  15256. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15257. }
  15258. index = offset + match.length;
  15259. // The JS engine embedded in Adobe products needs `match` returned in
  15260. // order to produce the correct `offset` value.
  15261. return match;
  15262. });
  15263. source += "';\n";
  15264. // If `variable` is not specified wrap a with-statement around the generated
  15265. // code to add the data object to the top of the scope chain.
  15266. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15267. if (!variable) {
  15268. source = 'with (obj) {\n' + source + '\n}\n';
  15269. }
  15270. // Throw an error if a forbidden character was found in `variable`, to prevent
  15271. // potential command injection attacks.
  15272. else if (reForbiddenIdentifierChars.test(variable)) {
  15273. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15274. }
  15275. // Cleanup code by stripping empty strings.
  15276. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15277. .replace(reEmptyStringMiddle, '$1')
  15278. .replace(reEmptyStringTrailing, '$1;');
  15279. // Frame code as the function body.
  15280. source = 'function(' + (variable || 'obj') + ') {\n' +
  15281. (variable
  15282. ? ''
  15283. : 'obj || (obj = {});\n'
  15284. ) +
  15285. "var __t, __p = ''" +
  15286. (isEscaping
  15287. ? ', __e = _.escape'
  15288. : ''
  15289. ) +
  15290. (isEvaluating
  15291. ? ', __j = Array.prototype.join;\n' +
  15292. "function print() { __p += __j.call(arguments, '') }\n"
  15293. : ';\n'
  15294. ) +
  15295. source +
  15296. 'return __p\n}';
  15297. var result = attempt(function() {
  15298. return Function(importsKeys, sourceURL + 'return ' + source)
  15299. .apply(undefined, importsValues);
  15300. });
  15301. // Provide the compiled function's source by its `toString` method or
  15302. // the `source` property as a convenience for inlining compiled templates.
  15303. result.source = source;
  15304. if (isError(result)) {
  15305. throw result;
  15306. }
  15307. return result;
  15308. }
  15309. /**
  15310. * Converts `string`, as a whole, to lower case just like
  15311. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15312. *
  15313. * @static
  15314. * @memberOf _
  15315. * @since 4.0.0
  15316. * @category String
  15317. * @param {string} [string=''] The string to convert.
  15318. * @returns {string} Returns the lower cased string.
  15319. * @example
  15320. *
  15321. * _.toLower('--Foo-Bar--');
  15322. * // => '--foo-bar--'
  15323. *
  15324. * _.toLower('fooBar');
  15325. * // => 'foobar'
  15326. *
  15327. * _.toLower('__FOO_BAR__');
  15328. * // => '__foo_bar__'
  15329. */
  15330. function toLower(value) {
  15331. return toString(value).toLowerCase();
  15332. }
  15333. /**
  15334. * Converts `string`, as a whole, to upper case just like
  15335. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15336. *
  15337. * @static
  15338. * @memberOf _
  15339. * @since 4.0.0
  15340. * @category String
  15341. * @param {string} [string=''] The string to convert.
  15342. * @returns {string} Returns the upper cased string.
  15343. * @example
  15344. *
  15345. * _.toUpper('--foo-bar--');
  15346. * // => '--FOO-BAR--'
  15347. *
  15348. * _.toUpper('fooBar');
  15349. * // => 'FOOBAR'
  15350. *
  15351. * _.toUpper('__foo_bar__');
  15352. * // => '__FOO_BAR__'
  15353. */
  15354. function toUpper(value) {
  15355. return toString(value).toUpperCase();
  15356. }
  15357. /**
  15358. * Removes leading and trailing whitespace or specified characters from `string`.
  15359. *
  15360. * @static
  15361. * @memberOf _
  15362. * @since 3.0.0
  15363. * @category String
  15364. * @param {string} [string=''] The string to trim.
  15365. * @param {string} [chars=whitespace] The characters to trim.
  15366. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15367. * @returns {string} Returns the trimmed string.
  15368. * @example
  15369. *
  15370. * _.trim(' abc ');
  15371. * // => 'abc'
  15372. *
  15373. * _.trim('-_-abc-_-', '_-');
  15374. * // => 'abc'
  15375. *
  15376. * _.map([' foo ', ' bar '], _.trim);
  15377. * // => ['foo', 'bar']
  15378. */
  15379. function trim(string, chars, guard) {
  15380. string = toString(string);
  15381. if (string && (guard || chars === undefined)) {
  15382. return baseTrim(string);
  15383. }
  15384. if (!string || !(chars = baseToString(chars))) {
  15385. return string;
  15386. }
  15387. var strSymbols = stringToArray(string),
  15388. chrSymbols = stringToArray(chars),
  15389. start = charsStartIndex(strSymbols, chrSymbols),
  15390. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15391. return castSlice(strSymbols, start, end).join('');
  15392. }
  15393. /**
  15394. * Removes trailing whitespace or specified characters from `string`.
  15395. *
  15396. * @static
  15397. * @memberOf _
  15398. * @since 4.0.0
  15399. * @category String
  15400. * @param {string} [string=''] The string to trim.
  15401. * @param {string} [chars=whitespace] The characters to trim.
  15402. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15403. * @returns {string} Returns the trimmed string.
  15404. * @example
  15405. *
  15406. * _.trimEnd(' abc ');
  15407. * // => ' abc'
  15408. *
  15409. * _.trimEnd('-_-abc-_-', '_-');
  15410. * // => '-_-abc'
  15411. */
  15412. function trimEnd(string, chars, guard) {
  15413. string = toString(string);
  15414. if (string && (guard || chars === undefined)) {
  15415. return string.slice(0, trimmedEndIndex(string) + 1);
  15416. }
  15417. if (!string || !(chars = baseToString(chars))) {
  15418. return string;
  15419. }
  15420. var strSymbols = stringToArray(string),
  15421. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15422. return castSlice(strSymbols, 0, end).join('');
  15423. }
  15424. /**
  15425. * Removes leading whitespace or specified characters from `string`.
  15426. *
  15427. * @static
  15428. * @memberOf _
  15429. * @since 4.0.0
  15430. * @category String
  15431. * @param {string} [string=''] The string to trim.
  15432. * @param {string} [chars=whitespace] The characters to trim.
  15433. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15434. * @returns {string} Returns the trimmed string.
  15435. * @example
  15436. *
  15437. * _.trimStart(' abc ');
  15438. * // => 'abc '
  15439. *
  15440. * _.trimStart('-_-abc-_-', '_-');
  15441. * // => 'abc-_-'
  15442. */
  15443. function trimStart(string, chars, guard) {
  15444. string = toString(string);
  15445. if (string && (guard || chars === undefined)) {
  15446. return string.replace(reTrimStart, '');
  15447. }
  15448. if (!string || !(chars = baseToString(chars))) {
  15449. return string;
  15450. }
  15451. var strSymbols = stringToArray(string),
  15452. start = charsStartIndex(strSymbols, stringToArray(chars));
  15453. return castSlice(strSymbols, start).join('');
  15454. }
  15455. /**
  15456. * Truncates `string` if it's longer than the given maximum string length.
  15457. * The last characters of the truncated string are replaced with the omission
  15458. * string which defaults to "...".
  15459. *
  15460. * @static
  15461. * @memberOf _
  15462. * @since 4.0.0
  15463. * @category String
  15464. * @param {string} [string=''] The string to truncate.
  15465. * @param {Object} [options={}] The options object.
  15466. * @param {number} [options.length=30] The maximum string length.
  15467. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15468. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15469. * @returns {string} Returns the truncated string.
  15470. * @example
  15471. *
  15472. * _.truncate('hi-diddly-ho there, neighborino');
  15473. * // => 'hi-diddly-ho there, neighbo...'
  15474. *
  15475. * _.truncate('hi-diddly-ho there, neighborino', {
  15476. * 'length': 24,
  15477. * 'separator': ' '
  15478. * });
  15479. * // => 'hi-diddly-ho there,...'
  15480. *
  15481. * _.truncate('hi-diddly-ho there, neighborino', {
  15482. * 'length': 24,
  15483. * 'separator': /,? +/
  15484. * });
  15485. * // => 'hi-diddly-ho there...'
  15486. *
  15487. * _.truncate('hi-diddly-ho there, neighborino', {
  15488. * 'omission': ' [...]'
  15489. * });
  15490. * // => 'hi-diddly-ho there, neig [...]'
  15491. */
  15492. function truncate(string, options) {
  15493. var length = DEFAULT_TRUNC_LENGTH,
  15494. omission = DEFAULT_TRUNC_OMISSION;
  15495. if (isObject(options)) {
  15496. var separator = 'separator' in options ? options.separator : separator;
  15497. length = 'length' in options ? toInteger(options.length) : length;
  15498. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15499. }
  15500. string = toString(string);
  15501. var strLength = string.length;
  15502. if (hasUnicode(string)) {
  15503. var strSymbols = stringToArray(string);
  15504. strLength = strSymbols.length;
  15505. }
  15506. if (length >= strLength) {
  15507. return string;
  15508. }
  15509. var end = length - stringSize(omission);
  15510. if (end < 1) {
  15511. return omission;
  15512. }
  15513. var result = strSymbols
  15514. ? castSlice(strSymbols, 0, end).join('')
  15515. : string.slice(0, end);
  15516. if (separator === undefined) {
  15517. return result + omission;
  15518. }
  15519. if (strSymbols) {
  15520. end += (result.length - end);
  15521. }
  15522. if (isRegExp(separator)) {
  15523. if (string.slice(end).search(separator)) {
  15524. var match,
  15525. substring = result;
  15526. if (!separator.global) {
  15527. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15528. }
  15529. separator.lastIndex = 0;
  15530. while ((match = separator.exec(substring))) {
  15531. var newEnd = match.index;
  15532. }
  15533. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15534. }
  15535. } else if (string.indexOf(baseToString(separator), end) != end) {
  15536. var index = result.lastIndexOf(separator);
  15537. if (index > -1) {
  15538. result = result.slice(0, index);
  15539. }
  15540. }
  15541. return result + omission;
  15542. }
  15543. /**
  15544. * The inverse of `_.escape`; this method converts the HTML entities
  15545. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15546. * their corresponding characters.
  15547. *
  15548. * **Note:** No other HTML entities are unescaped. To unescape additional
  15549. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15550. *
  15551. * @static
  15552. * @memberOf _
  15553. * @since 0.6.0
  15554. * @category String
  15555. * @param {string} [string=''] The string to unescape.
  15556. * @returns {string} Returns the unescaped string.
  15557. * @example
  15558. *
  15559. * _.unescape('fred, barney, &amp; pebbles');
  15560. * // => 'fred, barney, & pebbles'
  15561. */
  15562. function unescape(string) {
  15563. string = toString(string);
  15564. return (string && reHasEscapedHtml.test(string))
  15565. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15566. : string;
  15567. }
  15568. /**
  15569. * Converts `string`, as space separated words, to upper case.
  15570. *
  15571. * @static
  15572. * @memberOf _
  15573. * @since 4.0.0
  15574. * @category String
  15575. * @param {string} [string=''] The string to convert.
  15576. * @returns {string} Returns the upper cased string.
  15577. * @example
  15578. *
  15579. * _.upperCase('--foo-bar');
  15580. * // => 'FOO BAR'
  15581. *
  15582. * _.upperCase('fooBar');
  15583. * // => 'FOO BAR'
  15584. *
  15585. * _.upperCase('__foo_bar__');
  15586. * // => 'FOO BAR'
  15587. */
  15588. var upperCase = createCompounder(function(result, word, index) {
  15589. return result + (index ? ' ' : '') + word.toUpperCase();
  15590. });
  15591. /**
  15592. * Converts the first character of `string` to upper case.
  15593. *
  15594. * @static
  15595. * @memberOf _
  15596. * @since 4.0.0
  15597. * @category String
  15598. * @param {string} [string=''] The string to convert.
  15599. * @returns {string} Returns the converted string.
  15600. * @example
  15601. *
  15602. * _.upperFirst('fred');
  15603. * // => 'Fred'
  15604. *
  15605. * _.upperFirst('FRED');
  15606. * // => 'FRED'
  15607. */
  15608. var upperFirst = createCaseFirst('toUpperCase');
  15609. /**
  15610. * Splits `string` into an array of its words.
  15611. *
  15612. * @static
  15613. * @memberOf _
  15614. * @since 3.0.0
  15615. * @category String
  15616. * @param {string} [string=''] The string to inspect.
  15617. * @param {RegExp|string} [pattern] The pattern to match words.
  15618. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15619. * @returns {Array} Returns the words of `string`.
  15620. * @example
  15621. *
  15622. * _.words('fred, barney, & pebbles');
  15623. * // => ['fred', 'barney', 'pebbles']
  15624. *
  15625. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15626. * // => ['fred', 'barney', '&', 'pebbles']
  15627. */
  15628. function words(string, pattern, guard) {
  15629. string = toString(string);
  15630. pattern = guard ? undefined : pattern;
  15631. if (pattern === undefined) {
  15632. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15633. }
  15634. return string.match(pattern) || [];
  15635. }
  15636. /*------------------------------------------------------------------------*/
  15637. /**
  15638. * Attempts to invoke `func`, returning either the result or the caught error
  15639. * object. Any additional arguments are provided to `func` when it's invoked.
  15640. *
  15641. * @static
  15642. * @memberOf _
  15643. * @since 3.0.0
  15644. * @category Util
  15645. * @param {Function} func The function to attempt.
  15646. * @param {...*} [args] The arguments to invoke `func` with.
  15647. * @returns {*} Returns the `func` result or error object.
  15648. * @example
  15649. *
  15650. * // Avoid throwing errors for invalid selectors.
  15651. * var elements = _.attempt(function(selector) {
  15652. * return document.querySelectorAll(selector);
  15653. * }, '>_>');
  15654. *
  15655. * if (_.isError(elements)) {
  15656. * elements = [];
  15657. * }
  15658. */
  15659. var attempt = baseRest(function(func, args) {
  15660. try {
  15661. return apply(func, undefined, args);
  15662. } catch (e) {
  15663. return isError(e) ? e : new Error(e);
  15664. }
  15665. });
  15666. /**
  15667. * Binds methods of an object to the object itself, overwriting the existing
  15668. * method.
  15669. *
  15670. * **Note:** This method doesn't set the "length" property of bound functions.
  15671. *
  15672. * @static
  15673. * @since 0.1.0
  15674. * @memberOf _
  15675. * @category Util
  15676. * @param {Object} object The object to bind and assign the bound methods to.
  15677. * @param {...(string|string[])} methodNames The object method names to bind.
  15678. * @returns {Object} Returns `object`.
  15679. * @example
  15680. *
  15681. * var view = {
  15682. * 'label': 'docs',
  15683. * 'click': function() {
  15684. * console.log('clicked ' + this.label);
  15685. * }
  15686. * };
  15687. *
  15688. * _.bindAll(view, ['click']);
  15689. * jQuery(element).on('click', view.click);
  15690. * // => Logs 'clicked docs' when clicked.
  15691. */
  15692. var bindAll = flatRest(function(object, methodNames) {
  15693. arrayEach(methodNames, function(key) {
  15694. key = toKey(key);
  15695. baseAssignValue(object, key, bind(object[key], object));
  15696. });
  15697. return object;
  15698. });
  15699. /**
  15700. * Creates a function that iterates over `pairs` and invokes the corresponding
  15701. * function of the first predicate to return truthy. The predicate-function
  15702. * pairs are invoked with the `this` binding and arguments of the created
  15703. * function.
  15704. *
  15705. * @static
  15706. * @memberOf _
  15707. * @since 4.0.0
  15708. * @category Util
  15709. * @param {Array} pairs The predicate-function pairs.
  15710. * @returns {Function} Returns the new composite function.
  15711. * @example
  15712. *
  15713. * var func = _.cond([
  15714. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15715. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15716. * [_.stubTrue, _.constant('no match')]
  15717. * ]);
  15718. *
  15719. * func({ 'a': 1, 'b': 2 });
  15720. * // => 'matches A'
  15721. *
  15722. * func({ 'a': 0, 'b': 1 });
  15723. * // => 'matches B'
  15724. *
  15725. * func({ 'a': '1', 'b': '2' });
  15726. * // => 'no match'
  15727. */
  15728. function cond(pairs) {
  15729. var length = pairs == null ? 0 : pairs.length,
  15730. toIteratee = getIteratee();
  15731. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15732. if (typeof pair[1] != 'function') {
  15733. throw new TypeError(FUNC_ERROR_TEXT);
  15734. }
  15735. return [toIteratee(pair[0]), pair[1]];
  15736. });
  15737. return baseRest(function(args) {
  15738. var index = -1;
  15739. while (++index < length) {
  15740. var pair = pairs[index];
  15741. if (apply(pair[0], this, args)) {
  15742. return apply(pair[1], this, args);
  15743. }
  15744. }
  15745. });
  15746. }
  15747. /**
  15748. * Creates a function that invokes the predicate properties of `source` with
  15749. * the corresponding property values of a given object, returning `true` if
  15750. * all predicates return truthy, else `false`.
  15751. *
  15752. * **Note:** The created function is equivalent to `_.conformsTo` with
  15753. * `source` partially applied.
  15754. *
  15755. * @static
  15756. * @memberOf _
  15757. * @since 4.0.0
  15758. * @category Util
  15759. * @param {Object} source The object of property predicates to conform to.
  15760. * @returns {Function} Returns the new spec function.
  15761. * @example
  15762. *
  15763. * var objects = [
  15764. * { 'a': 2, 'b': 1 },
  15765. * { 'a': 1, 'b': 2 }
  15766. * ];
  15767. *
  15768. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15769. * // => [{ 'a': 1, 'b': 2 }]
  15770. */
  15771. function conforms(source) {
  15772. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15773. }
  15774. /**
  15775. * Creates a function that returns `value`.
  15776. *
  15777. * @static
  15778. * @memberOf _
  15779. * @since 2.4.0
  15780. * @category Util
  15781. * @param {*} value The value to return from the new function.
  15782. * @returns {Function} Returns the new constant function.
  15783. * @example
  15784. *
  15785. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15786. *
  15787. * console.log(objects);
  15788. * // => [{ 'a': 1 }, { 'a': 1 }]
  15789. *
  15790. * console.log(objects[0] === objects[1]);
  15791. * // => true
  15792. */
  15793. function constant(value) {
  15794. return function() {
  15795. return value;
  15796. };
  15797. }
  15798. /**
  15799. * Checks `value` to determine whether a default value should be returned in
  15800. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15801. * or `undefined`.
  15802. *
  15803. * @static
  15804. * @memberOf _
  15805. * @since 4.14.0
  15806. * @category Util
  15807. * @param {*} value The value to check.
  15808. * @param {*} defaultValue The default value.
  15809. * @returns {*} Returns the resolved value.
  15810. * @example
  15811. *
  15812. * _.defaultTo(1, 10);
  15813. * // => 1
  15814. *
  15815. * _.defaultTo(undefined, 10);
  15816. * // => 10
  15817. */
  15818. function defaultTo(value, defaultValue) {
  15819. return (value == null || value !== value) ? defaultValue : value;
  15820. }
  15821. /**
  15822. * Creates a function that returns the result of invoking the given functions
  15823. * with the `this` binding of the created function, where each successive
  15824. * invocation is supplied the return value of the previous.
  15825. *
  15826. * @static
  15827. * @memberOf _
  15828. * @since 3.0.0
  15829. * @category Util
  15830. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15831. * @returns {Function} Returns the new composite function.
  15832. * @see _.flowRight
  15833. * @example
  15834. *
  15835. * function square(n) {
  15836. * return n * n;
  15837. * }
  15838. *
  15839. * var addSquare = _.flow([_.add, square]);
  15840. * addSquare(1, 2);
  15841. * // => 9
  15842. */
  15843. var flow = createFlow();
  15844. /**
  15845. * This method is like `_.flow` except that it creates a function that
  15846. * invokes the given functions from right to left.
  15847. *
  15848. * @static
  15849. * @since 3.0.0
  15850. * @memberOf _
  15851. * @category Util
  15852. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15853. * @returns {Function} Returns the new composite function.
  15854. * @see _.flow
  15855. * @example
  15856. *
  15857. * function square(n) {
  15858. * return n * n;
  15859. * }
  15860. *
  15861. * var addSquare = _.flowRight([square, _.add]);
  15862. * addSquare(1, 2);
  15863. * // => 9
  15864. */
  15865. var flowRight = createFlow(true);
  15866. /**
  15867. * This method returns the first argument it receives.
  15868. *
  15869. * @static
  15870. * @since 0.1.0
  15871. * @memberOf _
  15872. * @category Util
  15873. * @param {*} value Any value.
  15874. * @returns {*} Returns `value`.
  15875. * @example
  15876. *
  15877. * var object = { 'a': 1 };
  15878. *
  15879. * console.log(_.identity(object) === object);
  15880. * // => true
  15881. */
  15882. function identity(value) {
  15883. return value;
  15884. }
  15885. /**
  15886. * Creates a function that invokes `func` with the arguments of the created
  15887. * function. If `func` is a property name, the created function returns the
  15888. * property value for a given element. If `func` is an array or object, the
  15889. * created function returns `true` for elements that contain the equivalent
  15890. * source properties, otherwise it returns `false`.
  15891. *
  15892. * @static
  15893. * @since 4.0.0
  15894. * @memberOf _
  15895. * @category Util
  15896. * @param {*} [func=_.identity] The value to convert to a callback.
  15897. * @returns {Function} Returns the callback.
  15898. * @example
  15899. *
  15900. * var users = [
  15901. * { 'user': 'barney', 'age': 36, 'active': true },
  15902. * { 'user': 'fred', 'age': 40, 'active': false }
  15903. * ];
  15904. *
  15905. * // The `_.matches` iteratee shorthand.
  15906. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15907. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15908. *
  15909. * // The `_.matchesProperty` iteratee shorthand.
  15910. * _.filter(users, _.iteratee(['user', 'fred']));
  15911. * // => [{ 'user': 'fred', 'age': 40 }]
  15912. *
  15913. * // The `_.property` iteratee shorthand.
  15914. * _.map(users, _.iteratee('user'));
  15915. * // => ['barney', 'fred']
  15916. *
  15917. * // Create custom iteratee shorthands.
  15918. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15919. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15920. * return func.test(string);
  15921. * };
  15922. * });
  15923. *
  15924. * _.filter(['abc', 'def'], /ef/);
  15925. * // => ['def']
  15926. */
  15927. function iteratee(func) {
  15928. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15929. }
  15930. /**
  15931. * Creates a function that performs a partial deep comparison between a given
  15932. * object and `source`, returning `true` if the given object has equivalent
  15933. * property values, else `false`.
  15934. *
  15935. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15936. * partially applied.
  15937. *
  15938. * Partial comparisons will match empty array and empty object `source`
  15939. * values against any array or object value, respectively. See `_.isEqual`
  15940. * for a list of supported value comparisons.
  15941. *
  15942. * **Note:** Multiple values can be checked by combining several matchers
  15943. * using `_.overSome`
  15944. *
  15945. * @static
  15946. * @memberOf _
  15947. * @since 3.0.0
  15948. * @category Util
  15949. * @param {Object} source The object of property values to match.
  15950. * @returns {Function} Returns the new spec function.
  15951. * @example
  15952. *
  15953. * var objects = [
  15954. * { 'a': 1, 'b': 2, 'c': 3 },
  15955. * { 'a': 4, 'b': 5, 'c': 6 }
  15956. * ];
  15957. *
  15958. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15959. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15960. *
  15961. * // Checking for several possible values
  15962. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15963. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15964. */
  15965. function matches(source) {
  15966. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15967. }
  15968. /**
  15969. * Creates a function that performs a partial deep comparison between the
  15970. * value at `path` of a given object to `srcValue`, returning `true` if the
  15971. * object value is equivalent, else `false`.
  15972. *
  15973. * **Note:** Partial comparisons will match empty array and empty object
  15974. * `srcValue` values against any array or object value, respectively. See
  15975. * `_.isEqual` for a list of supported value comparisons.
  15976. *
  15977. * **Note:** Multiple values can be checked by combining several matchers
  15978. * using `_.overSome`
  15979. *
  15980. * @static
  15981. * @memberOf _
  15982. * @since 3.2.0
  15983. * @category Util
  15984. * @param {Array|string} path The path of the property to get.
  15985. * @param {*} srcValue The value to match.
  15986. * @returns {Function} Returns the new spec function.
  15987. * @example
  15988. *
  15989. * var objects = [
  15990. * { 'a': 1, 'b': 2, 'c': 3 },
  15991. * { 'a': 4, 'b': 5, 'c': 6 }
  15992. * ];
  15993. *
  15994. * _.find(objects, _.matchesProperty('a', 4));
  15995. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15996. *
  15997. * // Checking for several possible values
  15998. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15999. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16000. */
  16001. function matchesProperty(path, srcValue) {
  16002. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16003. }
  16004. /**
  16005. * Creates a function that invokes the method at `path` of a given object.
  16006. * Any additional arguments are provided to the invoked method.
  16007. *
  16008. * @static
  16009. * @memberOf _
  16010. * @since 3.7.0
  16011. * @category Util
  16012. * @param {Array|string} path The path of the method to invoke.
  16013. * @param {...*} [args] The arguments to invoke the method with.
  16014. * @returns {Function} Returns the new invoker function.
  16015. * @example
  16016. *
  16017. * var objects = [
  16018. * { 'a': { 'b': _.constant(2) } },
  16019. * { 'a': { 'b': _.constant(1) } }
  16020. * ];
  16021. *
  16022. * _.map(objects, _.method('a.b'));
  16023. * // => [2, 1]
  16024. *
  16025. * _.map(objects, _.method(['a', 'b']));
  16026. * // => [2, 1]
  16027. */
  16028. var method = baseRest(function(path, args) {
  16029. return function(object) {
  16030. return baseInvoke(object, path, args);
  16031. };
  16032. });
  16033. /**
  16034. * The opposite of `_.method`; this method creates a function that invokes
  16035. * the method at a given path of `object`. Any additional arguments are
  16036. * provided to the invoked method.
  16037. *
  16038. * @static
  16039. * @memberOf _
  16040. * @since 3.7.0
  16041. * @category Util
  16042. * @param {Object} object The object to query.
  16043. * @param {...*} [args] The arguments to invoke the method with.
  16044. * @returns {Function} Returns the new invoker function.
  16045. * @example
  16046. *
  16047. * var array = _.times(3, _.constant),
  16048. * object = { 'a': array, 'b': array, 'c': array };
  16049. *
  16050. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16051. * // => [2, 0]
  16052. *
  16053. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16054. * // => [2, 0]
  16055. */
  16056. var methodOf = baseRest(function(object, args) {
  16057. return function(path) {
  16058. return baseInvoke(object, path, args);
  16059. };
  16060. });
  16061. /**
  16062. * Adds all own enumerable string keyed function properties of a source
  16063. * object to the destination object. If `object` is a function, then methods
  16064. * are added to its prototype as well.
  16065. *
  16066. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16067. * avoid conflicts caused by modifying the original.
  16068. *
  16069. * @static
  16070. * @since 0.1.0
  16071. * @memberOf _
  16072. * @category Util
  16073. * @param {Function|Object} [object=lodash] The destination object.
  16074. * @param {Object} source The object of functions to add.
  16075. * @param {Object} [options={}] The options object.
  16076. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16077. * @returns {Function|Object} Returns `object`.
  16078. * @example
  16079. *
  16080. * function vowels(string) {
  16081. * return _.filter(string, function(v) {
  16082. * return /[aeiou]/i.test(v);
  16083. * });
  16084. * }
  16085. *
  16086. * _.mixin({ 'vowels': vowels });
  16087. * _.vowels('fred');
  16088. * // => ['e']
  16089. *
  16090. * _('fred').vowels().value();
  16091. * // => ['e']
  16092. *
  16093. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16094. * _('fred').vowels();
  16095. * // => ['e']
  16096. */
  16097. function mixin(object, source, options) {
  16098. var props = keys(source),
  16099. methodNames = baseFunctions(source, props);
  16100. if (options == null &&
  16101. !(isObject(source) && (methodNames.length || !props.length))) {
  16102. options = source;
  16103. source = object;
  16104. object = this;
  16105. methodNames = baseFunctions(source, keys(source));
  16106. }
  16107. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16108. isFunc = isFunction(object);
  16109. arrayEach(methodNames, function(methodName) {
  16110. var func = source[methodName];
  16111. object[methodName] = func;
  16112. if (isFunc) {
  16113. object.prototype[methodName] = function() {
  16114. var chainAll = this.__chain__;
  16115. if (chain || chainAll) {
  16116. var result = object(this.__wrapped__),
  16117. actions = result.__actions__ = copyArray(this.__actions__);
  16118. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16119. result.__chain__ = chainAll;
  16120. return result;
  16121. }
  16122. return func.apply(object, arrayPush([this.value()], arguments));
  16123. };
  16124. }
  16125. });
  16126. return object;
  16127. }
  16128. /**
  16129. * Reverts the `_` variable to its previous value and returns a reference to
  16130. * the `lodash` function.
  16131. *
  16132. * @static
  16133. * @since 0.1.0
  16134. * @memberOf _
  16135. * @category Util
  16136. * @returns {Function} Returns the `lodash` function.
  16137. * @example
  16138. *
  16139. * var lodash = _.noConflict();
  16140. */
  16141. function noConflict() {
  16142. if (root._ === this) {
  16143. root._ = oldDash;
  16144. }
  16145. return this;
  16146. }
  16147. /**
  16148. * This method returns `undefined`.
  16149. *
  16150. * @static
  16151. * @memberOf _
  16152. * @since 2.3.0
  16153. * @category Util
  16154. * @example
  16155. *
  16156. * _.times(2, _.noop);
  16157. * // => [undefined, undefined]
  16158. */
  16159. function noop() {
  16160. // No operation performed.
  16161. }
  16162. /**
  16163. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16164. * the nth argument from the end is returned.
  16165. *
  16166. * @static
  16167. * @memberOf _
  16168. * @since 4.0.0
  16169. * @category Util
  16170. * @param {number} [n=0] The index of the argument to return.
  16171. * @returns {Function} Returns the new pass-thru function.
  16172. * @example
  16173. *
  16174. * var func = _.nthArg(1);
  16175. * func('a', 'b', 'c', 'd');
  16176. * // => 'b'
  16177. *
  16178. * var func = _.nthArg(-2);
  16179. * func('a', 'b', 'c', 'd');
  16180. * // => 'c'
  16181. */
  16182. function nthArg(n) {
  16183. n = toInteger(n);
  16184. return baseRest(function(args) {
  16185. return baseNth(args, n);
  16186. });
  16187. }
  16188. /**
  16189. * Creates a function that invokes `iteratees` with the arguments it receives
  16190. * and returns their results.
  16191. *
  16192. * @static
  16193. * @memberOf _
  16194. * @since 4.0.0
  16195. * @category Util
  16196. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16197. * The iteratees to invoke.
  16198. * @returns {Function} Returns the new function.
  16199. * @example
  16200. *
  16201. * var func = _.over([Math.max, Math.min]);
  16202. *
  16203. * func(1, 2, 3, 4);
  16204. * // => [4, 1]
  16205. */
  16206. var over = createOver(arrayMap);
  16207. /**
  16208. * Creates a function that checks if **all** of the `predicates` return
  16209. * truthy when invoked with the arguments it receives.
  16210. *
  16211. * Following shorthands are possible for providing predicates.
  16212. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16213. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16214. *
  16215. * @static
  16216. * @memberOf _
  16217. * @since 4.0.0
  16218. * @category Util
  16219. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16220. * The predicates to check.
  16221. * @returns {Function} Returns the new function.
  16222. * @example
  16223. *
  16224. * var func = _.overEvery([Boolean, isFinite]);
  16225. *
  16226. * func('1');
  16227. * // => true
  16228. *
  16229. * func(null);
  16230. * // => false
  16231. *
  16232. * func(NaN);
  16233. * // => false
  16234. */
  16235. var overEvery = createOver(arrayEvery);
  16236. /**
  16237. * Creates a function that checks if **any** of the `predicates` return
  16238. * truthy when invoked with the arguments it receives.
  16239. *
  16240. * Following shorthands are possible for providing predicates.
  16241. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16242. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16243. *
  16244. * @static
  16245. * @memberOf _
  16246. * @since 4.0.0
  16247. * @category Util
  16248. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16249. * The predicates to check.
  16250. * @returns {Function} Returns the new function.
  16251. * @example
  16252. *
  16253. * var func = _.overSome([Boolean, isFinite]);
  16254. *
  16255. * func('1');
  16256. * // => true
  16257. *
  16258. * func(null);
  16259. * // => true
  16260. *
  16261. * func(NaN);
  16262. * // => false
  16263. *
  16264. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16265. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16266. */
  16267. var overSome = createOver(arraySome);
  16268. /**
  16269. * Creates a function that returns the value at `path` of a given object.
  16270. *
  16271. * @static
  16272. * @memberOf _
  16273. * @since 2.4.0
  16274. * @category Util
  16275. * @param {Array|string} path The path of the property to get.
  16276. * @returns {Function} Returns the new accessor function.
  16277. * @example
  16278. *
  16279. * var objects = [
  16280. * { 'a': { 'b': 2 } },
  16281. * { 'a': { 'b': 1 } }
  16282. * ];
  16283. *
  16284. * _.map(objects, _.property('a.b'));
  16285. * // => [2, 1]
  16286. *
  16287. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16288. * // => [1, 2]
  16289. */
  16290. function property(path) {
  16291. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16292. }
  16293. /**
  16294. * The opposite of `_.property`; this method creates a function that returns
  16295. * the value at a given path of `object`.
  16296. *
  16297. * @static
  16298. * @memberOf _
  16299. * @since 3.0.0
  16300. * @category Util
  16301. * @param {Object} object The object to query.
  16302. * @returns {Function} Returns the new accessor function.
  16303. * @example
  16304. *
  16305. * var array = [0, 1, 2],
  16306. * object = { 'a': array, 'b': array, 'c': array };
  16307. *
  16308. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16309. * // => [2, 0]
  16310. *
  16311. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16312. * // => [2, 0]
  16313. */
  16314. function propertyOf(object) {
  16315. return function(path) {
  16316. return object == null ? undefined : baseGet(object, path);
  16317. };
  16318. }
  16319. /**
  16320. * Creates an array of numbers (positive and/or negative) progressing from
  16321. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16322. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16323. * it's set to `start` with `start` then set to `0`.
  16324. *
  16325. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16326. * floating-point values which can produce unexpected results.
  16327. *
  16328. * @static
  16329. * @since 0.1.0
  16330. * @memberOf _
  16331. * @category Util
  16332. * @param {number} [start=0] The start of the range.
  16333. * @param {number} end The end of the range.
  16334. * @param {number} [step=1] The value to increment or decrement by.
  16335. * @returns {Array} Returns the range of numbers.
  16336. * @see _.inRange, _.rangeRight
  16337. * @example
  16338. *
  16339. * _.range(4);
  16340. * // => [0, 1, 2, 3]
  16341. *
  16342. * _.range(-4);
  16343. * // => [0, -1, -2, -3]
  16344. *
  16345. * _.range(1, 5);
  16346. * // => [1, 2, 3, 4]
  16347. *
  16348. * _.range(0, 20, 5);
  16349. * // => [0, 5, 10, 15]
  16350. *
  16351. * _.range(0, -4, -1);
  16352. * // => [0, -1, -2, -3]
  16353. *
  16354. * _.range(1, 4, 0);
  16355. * // => [1, 1, 1]
  16356. *
  16357. * _.range(0);
  16358. * // => []
  16359. */
  16360. var range = createRange();
  16361. /**
  16362. * This method is like `_.range` except that it populates values in
  16363. * descending order.
  16364. *
  16365. * @static
  16366. * @memberOf _
  16367. * @since 4.0.0
  16368. * @category Util
  16369. * @param {number} [start=0] The start of the range.
  16370. * @param {number} end The end of the range.
  16371. * @param {number} [step=1] The value to increment or decrement by.
  16372. * @returns {Array} Returns the range of numbers.
  16373. * @see _.inRange, _.range
  16374. * @example
  16375. *
  16376. * _.rangeRight(4);
  16377. * // => [3, 2, 1, 0]
  16378. *
  16379. * _.rangeRight(-4);
  16380. * // => [-3, -2, -1, 0]
  16381. *
  16382. * _.rangeRight(1, 5);
  16383. * // => [4, 3, 2, 1]
  16384. *
  16385. * _.rangeRight(0, 20, 5);
  16386. * // => [15, 10, 5, 0]
  16387. *
  16388. * _.rangeRight(0, -4, -1);
  16389. * // => [-3, -2, -1, 0]
  16390. *
  16391. * _.rangeRight(1, 4, 0);
  16392. * // => [1, 1, 1]
  16393. *
  16394. * _.rangeRight(0);
  16395. * // => []
  16396. */
  16397. var rangeRight = createRange(true);
  16398. /**
  16399. * This method returns a new empty array.
  16400. *
  16401. * @static
  16402. * @memberOf _
  16403. * @since 4.13.0
  16404. * @category Util
  16405. * @returns {Array} Returns the new empty array.
  16406. * @example
  16407. *
  16408. * var arrays = _.times(2, _.stubArray);
  16409. *
  16410. * console.log(arrays);
  16411. * // => [[], []]
  16412. *
  16413. * console.log(arrays[0] === arrays[1]);
  16414. * // => false
  16415. */
  16416. function stubArray() {
  16417. return [];
  16418. }
  16419. /**
  16420. * This method returns `false`.
  16421. *
  16422. * @static
  16423. * @memberOf _
  16424. * @since 4.13.0
  16425. * @category Util
  16426. * @returns {boolean} Returns `false`.
  16427. * @example
  16428. *
  16429. * _.times(2, _.stubFalse);
  16430. * // => [false, false]
  16431. */
  16432. function stubFalse() {
  16433. return false;
  16434. }
  16435. /**
  16436. * This method returns a new empty object.
  16437. *
  16438. * @static
  16439. * @memberOf _
  16440. * @since 4.13.0
  16441. * @category Util
  16442. * @returns {Object} Returns the new empty object.
  16443. * @example
  16444. *
  16445. * var objects = _.times(2, _.stubObject);
  16446. *
  16447. * console.log(objects);
  16448. * // => [{}, {}]
  16449. *
  16450. * console.log(objects[0] === objects[1]);
  16451. * // => false
  16452. */
  16453. function stubObject() {
  16454. return {};
  16455. }
  16456. /**
  16457. * This method returns an empty string.
  16458. *
  16459. * @static
  16460. * @memberOf _
  16461. * @since 4.13.0
  16462. * @category Util
  16463. * @returns {string} Returns the empty string.
  16464. * @example
  16465. *
  16466. * _.times(2, _.stubString);
  16467. * // => ['', '']
  16468. */
  16469. function stubString() {
  16470. return '';
  16471. }
  16472. /**
  16473. * This method returns `true`.
  16474. *
  16475. * @static
  16476. * @memberOf _
  16477. * @since 4.13.0
  16478. * @category Util
  16479. * @returns {boolean} Returns `true`.
  16480. * @example
  16481. *
  16482. * _.times(2, _.stubTrue);
  16483. * // => [true, true]
  16484. */
  16485. function stubTrue() {
  16486. return true;
  16487. }
  16488. /**
  16489. * Invokes the iteratee `n` times, returning an array of the results of
  16490. * each invocation. The iteratee is invoked with one argument; (index).
  16491. *
  16492. * @static
  16493. * @since 0.1.0
  16494. * @memberOf _
  16495. * @category Util
  16496. * @param {number} n The number of times to invoke `iteratee`.
  16497. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16498. * @returns {Array} Returns the array of results.
  16499. * @example
  16500. *
  16501. * _.times(3, String);
  16502. * // => ['0', '1', '2']
  16503. *
  16504. * _.times(4, _.constant(0));
  16505. * // => [0, 0, 0, 0]
  16506. */
  16507. function times(n, iteratee) {
  16508. n = toInteger(n);
  16509. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16510. return [];
  16511. }
  16512. var index = MAX_ARRAY_LENGTH,
  16513. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16514. iteratee = getIteratee(iteratee);
  16515. n -= MAX_ARRAY_LENGTH;
  16516. var result = baseTimes(length, iteratee);
  16517. while (++index < n) {
  16518. iteratee(index);
  16519. }
  16520. return result;
  16521. }
  16522. /**
  16523. * Converts `value` to a property path array.
  16524. *
  16525. * @static
  16526. * @memberOf _
  16527. * @since 4.0.0
  16528. * @category Util
  16529. * @param {*} value The value to convert.
  16530. * @returns {Array} Returns the new property path array.
  16531. * @example
  16532. *
  16533. * _.toPath('a.b.c');
  16534. * // => ['a', 'b', 'c']
  16535. *
  16536. * _.toPath('a[0].b.c');
  16537. * // => ['a', '0', 'b', 'c']
  16538. */
  16539. function toPath(value) {
  16540. if (isArray(value)) {
  16541. return arrayMap(value, toKey);
  16542. }
  16543. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16544. }
  16545. /**
  16546. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16547. *
  16548. * @static
  16549. * @since 0.1.0
  16550. * @memberOf _
  16551. * @category Util
  16552. * @param {string} [prefix=''] The value to prefix the ID with.
  16553. * @returns {string} Returns the unique ID.
  16554. * @example
  16555. *
  16556. * _.uniqueId('contact_');
  16557. * // => 'contact_104'
  16558. *
  16559. * _.uniqueId();
  16560. * // => '105'
  16561. */
  16562. function uniqueId(prefix) {
  16563. var id = ++idCounter;
  16564. return toString(prefix) + id;
  16565. }
  16566. /*------------------------------------------------------------------------*/
  16567. /**
  16568. * Adds two numbers.
  16569. *
  16570. * @static
  16571. * @memberOf _
  16572. * @since 3.4.0
  16573. * @category Math
  16574. * @param {number} augend The first number in an addition.
  16575. * @param {number} addend The second number in an addition.
  16576. * @returns {number} Returns the total.
  16577. * @example
  16578. *
  16579. * _.add(6, 4);
  16580. * // => 10
  16581. */
  16582. var add = createMathOperation(function(augend, addend) {
  16583. return augend + addend;
  16584. }, 0);
  16585. /**
  16586. * Computes `number` rounded up to `precision`.
  16587. *
  16588. * @static
  16589. * @memberOf _
  16590. * @since 3.10.0
  16591. * @category Math
  16592. * @param {number} number The number to round up.
  16593. * @param {number} [precision=0] The precision to round up to.
  16594. * @returns {number} Returns the rounded up number.
  16595. * @example
  16596. *
  16597. * _.ceil(4.006);
  16598. * // => 5
  16599. *
  16600. * _.ceil(6.004, 2);
  16601. * // => 6.01
  16602. *
  16603. * _.ceil(6040, -2);
  16604. * // => 6100
  16605. */
  16606. var ceil = createRound('ceil');
  16607. /**
  16608. * Divide two numbers.
  16609. *
  16610. * @static
  16611. * @memberOf _
  16612. * @since 4.7.0
  16613. * @category Math
  16614. * @param {number} dividend The first number in a division.
  16615. * @param {number} divisor The second number in a division.
  16616. * @returns {number} Returns the quotient.
  16617. * @example
  16618. *
  16619. * _.divide(6, 4);
  16620. * // => 1.5
  16621. */
  16622. var divide = createMathOperation(function(dividend, divisor) {
  16623. return dividend / divisor;
  16624. }, 1);
  16625. /**
  16626. * Computes `number` rounded down to `precision`.
  16627. *
  16628. * @static
  16629. * @memberOf _
  16630. * @since 3.10.0
  16631. * @category Math
  16632. * @param {number} number The number to round down.
  16633. * @param {number} [precision=0] The precision to round down to.
  16634. * @returns {number} Returns the rounded down number.
  16635. * @example
  16636. *
  16637. * _.floor(4.006);
  16638. * // => 4
  16639. *
  16640. * _.floor(0.046, 2);
  16641. * // => 0.04
  16642. *
  16643. * _.floor(4060, -2);
  16644. * // => 4000
  16645. */
  16646. var floor = createRound('floor');
  16647. /**
  16648. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16649. * `undefined` is returned.
  16650. *
  16651. * @static
  16652. * @since 0.1.0
  16653. * @memberOf _
  16654. * @category Math
  16655. * @param {Array} array The array to iterate over.
  16656. * @returns {*} Returns the maximum value.
  16657. * @example
  16658. *
  16659. * _.max([4, 2, 8, 6]);
  16660. * // => 8
  16661. *
  16662. * _.max([]);
  16663. * // => undefined
  16664. */
  16665. function max(array) {
  16666. return (array && array.length)
  16667. ? baseExtremum(array, identity, baseGt)
  16668. : undefined;
  16669. }
  16670. /**
  16671. * This method is like `_.max` except that it accepts `iteratee` which is
  16672. * invoked for each element in `array` to generate the criterion by which
  16673. * the value is ranked. The iteratee is invoked with one argument: (value).
  16674. *
  16675. * @static
  16676. * @memberOf _
  16677. * @since 4.0.0
  16678. * @category Math
  16679. * @param {Array} array The array to iterate over.
  16680. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16681. * @returns {*} Returns the maximum value.
  16682. * @example
  16683. *
  16684. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16685. *
  16686. * _.maxBy(objects, function(o) { return o.n; });
  16687. * // => { 'n': 2 }
  16688. *
  16689. * // The `_.property` iteratee shorthand.
  16690. * _.maxBy(objects, 'n');
  16691. * // => { 'n': 2 }
  16692. */
  16693. function maxBy(array, iteratee) {
  16694. return (array && array.length)
  16695. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16696. : undefined;
  16697. }
  16698. /**
  16699. * Computes the mean of the values in `array`.
  16700. *
  16701. * @static
  16702. * @memberOf _
  16703. * @since 4.0.0
  16704. * @category Math
  16705. * @param {Array} array The array to iterate over.
  16706. * @returns {number} Returns the mean.
  16707. * @example
  16708. *
  16709. * _.mean([4, 2, 8, 6]);
  16710. * // => 5
  16711. */
  16712. function mean(array) {
  16713. return baseMean(array, identity);
  16714. }
  16715. /**
  16716. * This method is like `_.mean` except that it accepts `iteratee` which is
  16717. * invoked for each element in `array` to generate the value to be averaged.
  16718. * The iteratee is invoked with one argument: (value).
  16719. *
  16720. * @static
  16721. * @memberOf _
  16722. * @since 4.7.0
  16723. * @category Math
  16724. * @param {Array} array The array to iterate over.
  16725. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16726. * @returns {number} Returns the mean.
  16727. * @example
  16728. *
  16729. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16730. *
  16731. * _.meanBy(objects, function(o) { return o.n; });
  16732. * // => 5
  16733. *
  16734. * // The `_.property` iteratee shorthand.
  16735. * _.meanBy(objects, 'n');
  16736. * // => 5
  16737. */
  16738. function meanBy(array, iteratee) {
  16739. return baseMean(array, getIteratee(iteratee, 2));
  16740. }
  16741. /**
  16742. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16743. * `undefined` is returned.
  16744. *
  16745. * @static
  16746. * @since 0.1.0
  16747. * @memberOf _
  16748. * @category Math
  16749. * @param {Array} array The array to iterate over.
  16750. * @returns {*} Returns the minimum value.
  16751. * @example
  16752. *
  16753. * _.min([4, 2, 8, 6]);
  16754. * // => 2
  16755. *
  16756. * _.min([]);
  16757. * // => undefined
  16758. */
  16759. function min(array) {
  16760. return (array && array.length)
  16761. ? baseExtremum(array, identity, baseLt)
  16762. : undefined;
  16763. }
  16764. /**
  16765. * This method is like `_.min` except that it accepts `iteratee` which is
  16766. * invoked for each element in `array` to generate the criterion by which
  16767. * the value is ranked. The iteratee is invoked with one argument: (value).
  16768. *
  16769. * @static
  16770. * @memberOf _
  16771. * @since 4.0.0
  16772. * @category Math
  16773. * @param {Array} array The array to iterate over.
  16774. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16775. * @returns {*} Returns the minimum value.
  16776. * @example
  16777. *
  16778. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16779. *
  16780. * _.minBy(objects, function(o) { return o.n; });
  16781. * // => { 'n': 1 }
  16782. *
  16783. * // The `_.property` iteratee shorthand.
  16784. * _.minBy(objects, 'n');
  16785. * // => { 'n': 1 }
  16786. */
  16787. function minBy(array, iteratee) {
  16788. return (array && array.length)
  16789. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16790. : undefined;
  16791. }
  16792. /**
  16793. * Multiply two numbers.
  16794. *
  16795. * @static
  16796. * @memberOf _
  16797. * @since 4.7.0
  16798. * @category Math
  16799. * @param {number} multiplier The first number in a multiplication.
  16800. * @param {number} multiplicand The second number in a multiplication.
  16801. * @returns {number} Returns the product.
  16802. * @example
  16803. *
  16804. * _.multiply(6, 4);
  16805. * // => 24
  16806. */
  16807. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16808. return multiplier * multiplicand;
  16809. }, 1);
  16810. /**
  16811. * Computes `number` rounded to `precision`.
  16812. *
  16813. * @static
  16814. * @memberOf _
  16815. * @since 3.10.0
  16816. * @category Math
  16817. * @param {number} number The number to round.
  16818. * @param {number} [precision=0] The precision to round to.
  16819. * @returns {number} Returns the rounded number.
  16820. * @example
  16821. *
  16822. * _.round(4.006);
  16823. * // => 4
  16824. *
  16825. * _.round(4.006, 2);
  16826. * // => 4.01
  16827. *
  16828. * _.round(4060, -2);
  16829. * // => 4100
  16830. */
  16831. var round = createRound('round');
  16832. /**
  16833. * Subtract two numbers.
  16834. *
  16835. * @static
  16836. * @memberOf _
  16837. * @since 4.0.0
  16838. * @category Math
  16839. * @param {number} minuend The first number in a subtraction.
  16840. * @param {number} subtrahend The second number in a subtraction.
  16841. * @returns {number} Returns the difference.
  16842. * @example
  16843. *
  16844. * _.subtract(6, 4);
  16845. * // => 2
  16846. */
  16847. var subtract = createMathOperation(function(minuend, subtrahend) {
  16848. return minuend - subtrahend;
  16849. }, 0);
  16850. /**
  16851. * Computes the sum of the values in `array`.
  16852. *
  16853. * @static
  16854. * @memberOf _
  16855. * @since 3.4.0
  16856. * @category Math
  16857. * @param {Array} array The array to iterate over.
  16858. * @returns {number} Returns the sum.
  16859. * @example
  16860. *
  16861. * _.sum([4, 2, 8, 6]);
  16862. * // => 20
  16863. */
  16864. function sum(array) {
  16865. return (array && array.length)
  16866. ? baseSum(array, identity)
  16867. : 0;
  16868. }
  16869. /**
  16870. * This method is like `_.sum` except that it accepts `iteratee` which is
  16871. * invoked for each element in `array` to generate the value to be summed.
  16872. * The iteratee is invoked with one argument: (value).
  16873. *
  16874. * @static
  16875. * @memberOf _
  16876. * @since 4.0.0
  16877. * @category Math
  16878. * @param {Array} array The array to iterate over.
  16879. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16880. * @returns {number} Returns the sum.
  16881. * @example
  16882. *
  16883. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16884. *
  16885. * _.sumBy(objects, function(o) { return o.n; });
  16886. * // => 20
  16887. *
  16888. * // The `_.property` iteratee shorthand.
  16889. * _.sumBy(objects, 'n');
  16890. * // => 20
  16891. */
  16892. function sumBy(array, iteratee) {
  16893. return (array && array.length)
  16894. ? baseSum(array, getIteratee(iteratee, 2))
  16895. : 0;
  16896. }
  16897. /*------------------------------------------------------------------------*/
  16898. // Add methods that return wrapped values in chain sequences.
  16899. lodash.after = after;
  16900. lodash.ary = ary;
  16901. lodash.assign = assign;
  16902. lodash.assignIn = assignIn;
  16903. lodash.assignInWith = assignInWith;
  16904. lodash.assignWith = assignWith;
  16905. lodash.at = at;
  16906. lodash.before = before;
  16907. lodash.bind = bind;
  16908. lodash.bindAll = bindAll;
  16909. lodash.bindKey = bindKey;
  16910. lodash.castArray = castArray;
  16911. lodash.chain = chain;
  16912. lodash.chunk = chunk;
  16913. lodash.compact = compact;
  16914. lodash.concat = concat;
  16915. lodash.cond = cond;
  16916. lodash.conforms = conforms;
  16917. lodash.constant = constant;
  16918. lodash.countBy = countBy;
  16919. lodash.create = create;
  16920. lodash.curry = curry;
  16921. lodash.curryRight = curryRight;
  16922. lodash.debounce = debounce;
  16923. lodash.defaults = defaults;
  16924. lodash.defaultsDeep = defaultsDeep;
  16925. lodash.defer = defer;
  16926. lodash.delay = delay;
  16927. lodash.difference = difference;
  16928. lodash.differenceBy = differenceBy;
  16929. lodash.differenceWith = differenceWith;
  16930. lodash.drop = drop;
  16931. lodash.dropRight = dropRight;
  16932. lodash.dropRightWhile = dropRightWhile;
  16933. lodash.dropWhile = dropWhile;
  16934. lodash.fill = fill;
  16935. lodash.filter = filter;
  16936. lodash.flatMap = flatMap;
  16937. lodash.flatMapDeep = flatMapDeep;
  16938. lodash.flatMapDepth = flatMapDepth;
  16939. lodash.flatten = flatten;
  16940. lodash.flattenDeep = flattenDeep;
  16941. lodash.flattenDepth = flattenDepth;
  16942. lodash.flip = flip;
  16943. lodash.flow = flow;
  16944. lodash.flowRight = flowRight;
  16945. lodash.fromPairs = fromPairs;
  16946. lodash.functions = functions;
  16947. lodash.functionsIn = functionsIn;
  16948. lodash.groupBy = groupBy;
  16949. lodash.initial = initial;
  16950. lodash.intersection = intersection;
  16951. lodash.intersectionBy = intersectionBy;
  16952. lodash.intersectionWith = intersectionWith;
  16953. lodash.invert = invert;
  16954. lodash.invertBy = invertBy;
  16955. lodash.invokeMap = invokeMap;
  16956. lodash.iteratee = iteratee;
  16957. lodash.keyBy = keyBy;
  16958. lodash.keys = keys;
  16959. lodash.keysIn = keysIn;
  16960. lodash.map = map;
  16961. lodash.mapKeys = mapKeys;
  16962. lodash.mapValues = mapValues;
  16963. lodash.matches = matches;
  16964. lodash.matchesProperty = matchesProperty;
  16965. lodash.memoize = memoize;
  16966. lodash.merge = merge;
  16967. lodash.mergeWith = mergeWith;
  16968. lodash.method = method;
  16969. lodash.methodOf = methodOf;
  16970. lodash.mixin = mixin;
  16971. lodash.negate = negate;
  16972. lodash.nthArg = nthArg;
  16973. lodash.omit = omit;
  16974. lodash.omitBy = omitBy;
  16975. lodash.once = once;
  16976. lodash.orderBy = orderBy;
  16977. lodash.over = over;
  16978. lodash.overArgs = overArgs;
  16979. lodash.overEvery = overEvery;
  16980. lodash.overSome = overSome;
  16981. lodash.partial = partial;
  16982. lodash.partialRight = partialRight;
  16983. lodash.partition = partition;
  16984. lodash.pick = pick;
  16985. lodash.pickBy = pickBy;
  16986. lodash.property = property;
  16987. lodash.propertyOf = propertyOf;
  16988. lodash.pull = pull;
  16989. lodash.pullAll = pullAll;
  16990. lodash.pullAllBy = pullAllBy;
  16991. lodash.pullAllWith = pullAllWith;
  16992. lodash.pullAt = pullAt;
  16993. lodash.range = range;
  16994. lodash.rangeRight = rangeRight;
  16995. lodash.rearg = rearg;
  16996. lodash.reject = reject;
  16997. lodash.remove = remove;
  16998. lodash.rest = rest;
  16999. lodash.reverse = reverse;
  17000. lodash.sampleSize = sampleSize;
  17001. lodash.set = set;
  17002. lodash.setWith = setWith;
  17003. lodash.shuffle = shuffle;
  17004. lodash.slice = slice;
  17005. lodash.sortBy = sortBy;
  17006. lodash.sortedUniq = sortedUniq;
  17007. lodash.sortedUniqBy = sortedUniqBy;
  17008. lodash.split = split;
  17009. lodash.spread = spread;
  17010. lodash.tail = tail;
  17011. lodash.take = take;
  17012. lodash.takeRight = takeRight;
  17013. lodash.takeRightWhile = takeRightWhile;
  17014. lodash.takeWhile = takeWhile;
  17015. lodash.tap = tap;
  17016. lodash.throttle = throttle;
  17017. lodash.thru = thru;
  17018. lodash.toArray = toArray;
  17019. lodash.toPairs = toPairs;
  17020. lodash.toPairsIn = toPairsIn;
  17021. lodash.toPath = toPath;
  17022. lodash.toPlainObject = toPlainObject;
  17023. lodash.transform = transform;
  17024. lodash.unary = unary;
  17025. lodash.union = union;
  17026. lodash.unionBy = unionBy;
  17027. lodash.unionWith = unionWith;
  17028. lodash.uniq = uniq;
  17029. lodash.uniqBy = uniqBy;
  17030. lodash.uniqWith = uniqWith;
  17031. lodash.unset = unset;
  17032. lodash.unzip = unzip;
  17033. lodash.unzipWith = unzipWith;
  17034. lodash.update = update;
  17035. lodash.updateWith = updateWith;
  17036. lodash.values = values;
  17037. lodash.valuesIn = valuesIn;
  17038. lodash.without = without;
  17039. lodash.words = words;
  17040. lodash.wrap = wrap;
  17041. lodash.xor = xor;
  17042. lodash.xorBy = xorBy;
  17043. lodash.xorWith = xorWith;
  17044. lodash.zip = zip;
  17045. lodash.zipObject = zipObject;
  17046. lodash.zipObjectDeep = zipObjectDeep;
  17047. lodash.zipWith = zipWith;
  17048. // Add aliases.
  17049. lodash.entries = toPairs;
  17050. lodash.entriesIn = toPairsIn;
  17051. lodash.extend = assignIn;
  17052. lodash.extendWith = assignInWith;
  17053. // Add methods to `lodash.prototype`.
  17054. mixin(lodash, lodash);
  17055. /*------------------------------------------------------------------------*/
  17056. // Add methods that return unwrapped values in chain sequences.
  17057. lodash.add = add;
  17058. lodash.attempt = attempt;
  17059. lodash.camelCase = camelCase;
  17060. lodash.capitalize = capitalize;
  17061. lodash.ceil = ceil;
  17062. lodash.clamp = clamp;
  17063. lodash.clone = clone;
  17064. lodash.cloneDeep = cloneDeep;
  17065. lodash.cloneDeepWith = cloneDeepWith;
  17066. lodash.cloneWith = cloneWith;
  17067. lodash.conformsTo = conformsTo;
  17068. lodash.deburr = deburr;
  17069. lodash.defaultTo = defaultTo;
  17070. lodash.divide = divide;
  17071. lodash.endsWith = endsWith;
  17072. lodash.eq = eq;
  17073. lodash.escape = escape;
  17074. lodash.escapeRegExp = escapeRegExp;
  17075. lodash.every = every;
  17076. lodash.find = find;
  17077. lodash.findIndex = findIndex;
  17078. lodash.findKey = findKey;
  17079. lodash.findLast = findLast;
  17080. lodash.findLastIndex = findLastIndex;
  17081. lodash.findLastKey = findLastKey;
  17082. lodash.floor = floor;
  17083. lodash.forEach = forEach;
  17084. lodash.forEachRight = forEachRight;
  17085. lodash.forIn = forIn;
  17086. lodash.forInRight = forInRight;
  17087. lodash.forOwn = forOwn;
  17088. lodash.forOwnRight = forOwnRight;
  17089. lodash.get = get;
  17090. lodash.gt = gt;
  17091. lodash.gte = gte;
  17092. lodash.has = has;
  17093. lodash.hasIn = hasIn;
  17094. lodash.head = head;
  17095. lodash.identity = identity;
  17096. lodash.includes = includes;
  17097. lodash.indexOf = indexOf;
  17098. lodash.inRange = inRange;
  17099. lodash.invoke = invoke;
  17100. lodash.isArguments = isArguments;
  17101. lodash.isArray = isArray;
  17102. lodash.isArrayBuffer = isArrayBuffer;
  17103. lodash.isArrayLike = isArrayLike;
  17104. lodash.isArrayLikeObject = isArrayLikeObject;
  17105. lodash.isBoolean = isBoolean;
  17106. lodash.isBuffer = isBuffer;
  17107. lodash.isDate = isDate;
  17108. lodash.isElement = isElement;
  17109. lodash.isEmpty = isEmpty;
  17110. lodash.isEqual = isEqual;
  17111. lodash.isEqualWith = isEqualWith;
  17112. lodash.isError = isError;
  17113. lodash.isFinite = isFinite;
  17114. lodash.isFunction = isFunction;
  17115. lodash.isInteger = isInteger;
  17116. lodash.isLength = isLength;
  17117. lodash.isMap = isMap;
  17118. lodash.isMatch = isMatch;
  17119. lodash.isMatchWith = isMatchWith;
  17120. lodash.isNaN = isNaN;
  17121. lodash.isNative = isNative;
  17122. lodash.isNil = isNil;
  17123. lodash.isNull = isNull;
  17124. lodash.isNumber = isNumber;
  17125. lodash.isObject = isObject;
  17126. lodash.isObjectLike = isObjectLike;
  17127. lodash.isPlainObject = isPlainObject;
  17128. lodash.isRegExp = isRegExp;
  17129. lodash.isSafeInteger = isSafeInteger;
  17130. lodash.isSet = isSet;
  17131. lodash.isString = isString;
  17132. lodash.isSymbol = isSymbol;
  17133. lodash.isTypedArray = isTypedArray;
  17134. lodash.isUndefined = isUndefined;
  17135. lodash.isWeakMap = isWeakMap;
  17136. lodash.isWeakSet = isWeakSet;
  17137. lodash.join = join;
  17138. lodash.kebabCase = kebabCase;
  17139. lodash.last = last;
  17140. lodash.lastIndexOf = lastIndexOf;
  17141. lodash.lowerCase = lowerCase;
  17142. lodash.lowerFirst = lowerFirst;
  17143. lodash.lt = lt;
  17144. lodash.lte = lte;
  17145. lodash.max = max;
  17146. lodash.maxBy = maxBy;
  17147. lodash.mean = mean;
  17148. lodash.meanBy = meanBy;
  17149. lodash.min = min;
  17150. lodash.minBy = minBy;
  17151. lodash.stubArray = stubArray;
  17152. lodash.stubFalse = stubFalse;
  17153. lodash.stubObject = stubObject;
  17154. lodash.stubString = stubString;
  17155. lodash.stubTrue = stubTrue;
  17156. lodash.multiply = multiply;
  17157. lodash.nth = nth;
  17158. lodash.noConflict = noConflict;
  17159. lodash.noop = noop;
  17160. lodash.now = now;
  17161. lodash.pad = pad;
  17162. lodash.padEnd = padEnd;
  17163. lodash.padStart = padStart;
  17164. lodash.parseInt = parseInt;
  17165. lodash.random = random;
  17166. lodash.reduce = reduce;
  17167. lodash.reduceRight = reduceRight;
  17168. lodash.repeat = repeat;
  17169. lodash.replace = replace;
  17170. lodash.result = result;
  17171. lodash.round = round;
  17172. lodash.runInContext = runInContext;
  17173. lodash.sample = sample;
  17174. lodash.size = size;
  17175. lodash.snakeCase = snakeCase;
  17176. lodash.some = some;
  17177. lodash.sortedIndex = sortedIndex;
  17178. lodash.sortedIndexBy = sortedIndexBy;
  17179. lodash.sortedIndexOf = sortedIndexOf;
  17180. lodash.sortedLastIndex = sortedLastIndex;
  17181. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17182. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17183. lodash.startCase = startCase;
  17184. lodash.startsWith = startsWith;
  17185. lodash.subtract = subtract;
  17186. lodash.sum = sum;
  17187. lodash.sumBy = sumBy;
  17188. lodash.template = template;
  17189. lodash.times = times;
  17190. lodash.toFinite = toFinite;
  17191. lodash.toInteger = toInteger;
  17192. lodash.toLength = toLength;
  17193. lodash.toLower = toLower;
  17194. lodash.toNumber = toNumber;
  17195. lodash.toSafeInteger = toSafeInteger;
  17196. lodash.toString = toString;
  17197. lodash.toUpper = toUpper;
  17198. lodash.trim = trim;
  17199. lodash.trimEnd = trimEnd;
  17200. lodash.trimStart = trimStart;
  17201. lodash.truncate = truncate;
  17202. lodash.unescape = unescape;
  17203. lodash.uniqueId = uniqueId;
  17204. lodash.upperCase = upperCase;
  17205. lodash.upperFirst = upperFirst;
  17206. // Add aliases.
  17207. lodash.each = forEach;
  17208. lodash.eachRight = forEachRight;
  17209. lodash.first = head;
  17210. mixin(lodash, (function() {
  17211. var source = {};
  17212. baseForOwn(lodash, function(func, methodName) {
  17213. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17214. source[methodName] = func;
  17215. }
  17216. });
  17217. return source;
  17218. }()), { 'chain': false });
  17219. /*------------------------------------------------------------------------*/
  17220. /**
  17221. * The semantic version number.
  17222. *
  17223. * @static
  17224. * @memberOf _
  17225. * @type {string}
  17226. */
  17227. lodash.VERSION = VERSION;
  17228. // Assign default placeholders.
  17229. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17230. lodash[methodName].placeholder = lodash;
  17231. });
  17232. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17233. arrayEach(['drop', 'take'], function(methodName, index) {
  17234. LazyWrapper.prototype[methodName] = function(n) {
  17235. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17236. var result = (this.__filtered__ && !index)
  17237. ? new LazyWrapper(this)
  17238. : this.clone();
  17239. if (result.__filtered__) {
  17240. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17241. } else {
  17242. result.__views__.push({
  17243. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17244. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17245. });
  17246. }
  17247. return result;
  17248. };
  17249. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17250. return this.reverse()[methodName](n).reverse();
  17251. };
  17252. });
  17253. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17254. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17255. var type = index + 1,
  17256. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17257. LazyWrapper.prototype[methodName] = function(iteratee) {
  17258. var result = this.clone();
  17259. result.__iteratees__.push({
  17260. 'iteratee': getIteratee(iteratee, 3),
  17261. 'type': type
  17262. });
  17263. result.__filtered__ = result.__filtered__ || isFilter;
  17264. return result;
  17265. };
  17266. });
  17267. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17268. arrayEach(['head', 'last'], function(methodName, index) {
  17269. var takeName = 'take' + (index ? 'Right' : '');
  17270. LazyWrapper.prototype[methodName] = function() {
  17271. return this[takeName](1).value()[0];
  17272. };
  17273. });
  17274. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17275. arrayEach(['initial', 'tail'], function(methodName, index) {
  17276. var dropName = 'drop' + (index ? '' : 'Right');
  17277. LazyWrapper.prototype[methodName] = function() {
  17278. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17279. };
  17280. });
  17281. LazyWrapper.prototype.compact = function() {
  17282. return this.filter(identity);
  17283. };
  17284. LazyWrapper.prototype.find = function(predicate) {
  17285. return this.filter(predicate).head();
  17286. };
  17287. LazyWrapper.prototype.findLast = function(predicate) {
  17288. return this.reverse().find(predicate);
  17289. };
  17290. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17291. if (typeof path == 'function') {
  17292. return new LazyWrapper(this);
  17293. }
  17294. return this.map(function(value) {
  17295. return baseInvoke(value, path, args);
  17296. });
  17297. });
  17298. LazyWrapper.prototype.reject = function(predicate) {
  17299. return this.filter(negate(getIteratee(predicate)));
  17300. };
  17301. LazyWrapper.prototype.slice = function(start, end) {
  17302. start = toInteger(start);
  17303. var result = this;
  17304. if (result.__filtered__ && (start > 0 || end < 0)) {
  17305. return new LazyWrapper(result);
  17306. }
  17307. if (start < 0) {
  17308. result = result.takeRight(-start);
  17309. } else if (start) {
  17310. result = result.drop(start);
  17311. }
  17312. if (end !== undefined) {
  17313. end = toInteger(end);
  17314. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17315. }
  17316. return result;
  17317. };
  17318. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17319. return this.reverse().takeWhile(predicate).reverse();
  17320. };
  17321. LazyWrapper.prototype.toArray = function() {
  17322. return this.take(MAX_ARRAY_LENGTH);
  17323. };
  17324. // Add `LazyWrapper` methods to `lodash.prototype`.
  17325. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17326. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17327. isTaker = /^(?:head|last)$/.test(methodName),
  17328. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17329. retUnwrapped = isTaker || /^find/.test(methodName);
  17330. if (!lodashFunc) {
  17331. return;
  17332. }
  17333. lodash.prototype[methodName] = function() {
  17334. var value = this.__wrapped__,
  17335. args = isTaker ? [1] : arguments,
  17336. isLazy = value instanceof LazyWrapper,
  17337. iteratee = args[0],
  17338. useLazy = isLazy || isArray(value);
  17339. var interceptor = function(value) {
  17340. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17341. return (isTaker && chainAll) ? result[0] : result;
  17342. };
  17343. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17344. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17345. isLazy = useLazy = false;
  17346. }
  17347. var chainAll = this.__chain__,
  17348. isHybrid = !!this.__actions__.length,
  17349. isUnwrapped = retUnwrapped && !chainAll,
  17350. onlyLazy = isLazy && !isHybrid;
  17351. if (!retUnwrapped && useLazy) {
  17352. value = onlyLazy ? value : new LazyWrapper(this);
  17353. var result = func.apply(value, args);
  17354. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17355. return new LodashWrapper(result, chainAll);
  17356. }
  17357. if (isUnwrapped && onlyLazy) {
  17358. return func.apply(this, args);
  17359. }
  17360. result = this.thru(interceptor);
  17361. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17362. };
  17363. });
  17364. // Add `Array` methods to `lodash.prototype`.
  17365. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17366. var func = arrayProto[methodName],
  17367. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17368. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17369. lodash.prototype[methodName] = function() {
  17370. var args = arguments;
  17371. if (retUnwrapped && !this.__chain__) {
  17372. var value = this.value();
  17373. return func.apply(isArray(value) ? value : [], args);
  17374. }
  17375. return this[chainName](function(value) {
  17376. return func.apply(isArray(value) ? value : [], args);
  17377. });
  17378. };
  17379. });
  17380. // Map minified method names to their real names.
  17381. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17382. var lodashFunc = lodash[methodName];
  17383. if (lodashFunc) {
  17384. var key = lodashFunc.name + '';
  17385. if (!hasOwnProperty.call(realNames, key)) {
  17386. realNames[key] = [];
  17387. }
  17388. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17389. }
  17390. });
  17391. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17392. 'name': 'wrapper',
  17393. 'func': undefined
  17394. }];
  17395. // Add methods to `LazyWrapper`.
  17396. LazyWrapper.prototype.clone = lazyClone;
  17397. LazyWrapper.prototype.reverse = lazyReverse;
  17398. LazyWrapper.prototype.value = lazyValue;
  17399. // Add chain sequence methods to the `lodash` wrapper.
  17400. lodash.prototype.at = wrapperAt;
  17401. lodash.prototype.chain = wrapperChain;
  17402. lodash.prototype.commit = wrapperCommit;
  17403. lodash.prototype.next = wrapperNext;
  17404. lodash.prototype.plant = wrapperPlant;
  17405. lodash.prototype.reverse = wrapperReverse;
  17406. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17407. // Add lazy aliases.
  17408. lodash.prototype.first = lodash.prototype.head;
  17409. if (symIterator) {
  17410. lodash.prototype[symIterator] = wrapperToIterator;
  17411. }
  17412. return lodash;
  17413. });
  17414. /*--------------------------------------------------------------------------*/
  17415. // Export lodash.
  17416. var _ = runInContext();
  17417. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17418. if (true) {
  17419. // Expose Lodash on the global object to prevent errors when Lodash is
  17420. // loaded by a script tag in the presence of an AMD loader.
  17421. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17422. // Use `_.noConflict` to remove Lodash from the global object.
  17423. root._ = _;
  17424. // Define as an anonymous module so, through path mapping, it can be
  17425. // referenced as the "underscore" module.
  17426. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17427. return _;
  17428. }).call(exports, __webpack_require__, exports, module),
  17429. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17430. }
  17431. // Check for `exports` after `define` in case a build optimizer adds it.
  17432. else {}
  17433. }.call(this));
  17434. /***/ }),
  17435. /***/ "./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":
  17436. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17437. !*** ./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 ***!
  17438. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17439. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17440. "use strict";
  17441. __webpack_require__.r(__webpack_exports__);
  17442. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17443. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17444. /* harmony export */ });
  17445. /* 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");
  17446. /* 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__);
  17447. /* 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");
  17448. var options = {};
  17449. options.insert = "head";
  17450. options.singleton = false;
  17451. 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);
  17452. /* 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 || {});
  17453. /***/ }),
  17454. /***/ "./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":
  17455. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17456. !*** ./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 ***!
  17457. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17458. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17459. "use strict";
  17460. __webpack_require__.r(__webpack_exports__);
  17461. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17462. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17463. /* harmony export */ });
  17464. /* 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");
  17465. /* 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__);
  17466. /* 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");
  17467. var options = {};
  17468. options.insert = "head";
  17469. options.singleton = false;
  17470. 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);
  17471. /* 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 || {});
  17472. /***/ }),
  17473. /***/ "./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":
  17474. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17475. !*** ./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 ***!
  17476. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17477. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17478. "use strict";
  17479. __webpack_require__.r(__webpack_exports__);
  17480. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17481. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17482. /* harmony export */ });
  17483. /* 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");
  17484. /* 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__);
  17485. /* 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");
  17486. var options = {};
  17487. options.insert = "head";
  17488. options.singleton = false;
  17489. 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);
  17490. /* 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 || {});
  17491. /***/ }),
  17492. /***/ "./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":
  17493. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17494. !*** ./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 ***!
  17495. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17496. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17497. "use strict";
  17498. __webpack_require__.r(__webpack_exports__);
  17499. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17500. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17501. /* harmony export */ });
  17502. /* 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");
  17503. /* 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__);
  17504. /* 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");
  17505. var options = {};
  17506. options.insert = "head";
  17507. options.singleton = false;
  17508. 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);
  17509. /* 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 || {});
  17510. /***/ }),
  17511. /***/ "./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":
  17512. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17513. !*** ./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 ***!
  17514. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17515. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17516. "use strict";
  17517. __webpack_require__.r(__webpack_exports__);
  17518. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17519. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17520. /* harmony export */ });
  17521. /* 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");
  17522. /* 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__);
  17523. /* 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");
  17524. var options = {};
  17525. options.insert = "head";
  17526. options.singleton = false;
  17527. 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);
  17528. /* 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 || {});
  17529. /***/ }),
  17530. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17531. /*!******************************************************!*\
  17532. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17533. \******************************************************/
  17534. /***/ ((__unused_webpack_module, exports) => {
  17535. "use strict";
  17536. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17537. // runtime helper for setting properties on components
  17538. // in a tree-shakable way
  17539. exports["default"] = (sfc, props) => {
  17540. const target = sfc.__vccOpts || sfc;
  17541. for (const [key, val] of props) {
  17542. target[key] = val;
  17543. }
  17544. return target;
  17545. };
  17546. /***/ }),
  17547. /***/ "./resources/js/components/AppButtonLink.vue":
  17548. /*!***************************************************!*\
  17549. !*** ./resources/js/components/AppButtonLink.vue ***!
  17550. \***************************************************/
  17551. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17552. "use strict";
  17553. __webpack_require__.r(__webpack_exports__);
  17554. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17555. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17556. /* harmony export */ });
  17557. /* 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");
  17558. /* 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");
  17559. /* 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");
  17560. ;
  17561. 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"]])
  17562. /* hot reload */
  17563. if (false) {}
  17564. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17565. /***/ }),
  17566. /***/ "./resources/js/components/AppFooter.vue":
  17567. /*!***********************************************!*\
  17568. !*** ./resources/js/components/AppFooter.vue ***!
  17569. \***********************************************/
  17570. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17571. "use strict";
  17572. __webpack_require__.r(__webpack_exports__);
  17573. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17574. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17575. /* harmony export */ });
  17576. /* harmony import */ var _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");
  17577. /* 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");
  17578. /* 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");
  17579. const script = {}
  17580. ;
  17581. 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"]])
  17582. /* hot reload */
  17583. if (false) {}
  17584. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17585. /***/ }),
  17586. /***/ "./resources/js/components/AppMessage.vue":
  17587. /*!************************************************!*\
  17588. !*** ./resources/js/components/AppMessage.vue ***!
  17589. \************************************************/
  17590. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17591. "use strict";
  17592. __webpack_require__.r(__webpack_exports__);
  17593. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17594. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17595. /* harmony export */ });
  17596. /* harmony import */ var _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");
  17597. /* 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");
  17598. /* 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");
  17599. ;
  17600. 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"]])
  17601. /* hot reload */
  17602. if (false) {}
  17603. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17604. /***/ }),
  17605. /***/ "./resources/js/components/AppPagination.vue":
  17606. /*!***************************************************!*\
  17607. !*** ./resources/js/components/AppPagination.vue ***!
  17608. \***************************************************/
  17609. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17610. "use strict";
  17611. __webpack_require__.r(__webpack_exports__);
  17612. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17613. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17614. /* harmony export */ });
  17615. /* 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");
  17616. /* 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");
  17617. /* 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");
  17618. ;
  17619. 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"]])
  17620. /* hot reload */
  17621. if (false) {}
  17622. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17623. /***/ }),
  17624. /***/ "./resources/js/components/AppSidebar.vue":
  17625. /*!************************************************!*\
  17626. !*** ./resources/js/components/AppSidebar.vue ***!
  17627. \************************************************/
  17628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17629. "use strict";
  17630. __webpack_require__.r(__webpack_exports__);
  17631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17632. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17633. /* harmony export */ });
  17634. /* 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");
  17635. /* 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");
  17636. /* 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");
  17637. /* 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");
  17638. ;
  17639. 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"]])
  17640. /* hot reload */
  17641. if (false) {}
  17642. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17643. /***/ }),
  17644. /***/ "./resources/js/components/AppSubSidebar.vue":
  17645. /*!***************************************************!*\
  17646. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17647. \***************************************************/
  17648. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17649. "use strict";
  17650. __webpack_require__.r(__webpack_exports__);
  17651. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17652. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17653. /* harmony export */ });
  17654. /* 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");
  17655. /* 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");
  17656. /* 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");
  17657. /* 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");
  17658. ;
  17659. 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"]])
  17660. /* hot reload */
  17661. if (false) {}
  17662. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17663. /***/ }),
  17664. /***/ "./resources/js/components/AppTopBar.vue":
  17665. /*!***********************************************!*\
  17666. !*** ./resources/js/components/AppTopBar.vue ***!
  17667. \***********************************************/
  17668. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17669. "use strict";
  17670. __webpack_require__.r(__webpack_exports__);
  17671. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17672. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17673. /* harmony export */ });
  17674. /* 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");
  17675. /* 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");
  17676. /* 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");
  17677. /* 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");
  17678. ;
  17679. 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"]])
  17680. /* hot reload */
  17681. if (false) {}
  17682. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17683. /***/ }),
  17684. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17685. /*!**************************************************!*\
  17686. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17687. \**************************************************/
  17688. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17689. "use strict";
  17690. __webpack_require__.r(__webpack_exports__);
  17691. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17692. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17693. /* harmony export */ });
  17694. /* 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");
  17695. /* 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");
  17696. /* 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");
  17697. /* 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");
  17698. ;
  17699. 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"]])
  17700. /* hot reload */
  17701. if (false) {}
  17702. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17703. /***/ }),
  17704. /***/ "./resources/js/pages/topup/Index.vue":
  17705. /*!********************************************!*\
  17706. !*** ./resources/js/pages/topup/Index.vue ***!
  17707. \********************************************/
  17708. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17709. "use strict";
  17710. __webpack_require__.r(__webpack_exports__);
  17711. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17712. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17713. /* harmony export */ });
  17714. /* 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");
  17715. /* 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");
  17716. /* 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");
  17717. ;
  17718. 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"]])
  17719. /* hot reload */
  17720. if (false) {}
  17721. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17722. /***/ }),
  17723. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17724. /*!**************************************************************************************!*\
  17725. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17726. \**************************************************************************************/
  17727. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17728. "use strict";
  17729. __webpack_require__.r(__webpack_exports__);
  17730. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17731. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17732. /* harmony export */ });
  17733. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17734. /***/ }),
  17735. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17736. /*!***********************************************************************************!*\
  17737. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17738. \***********************************************************************************/
  17739. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17740. "use strict";
  17741. __webpack_require__.r(__webpack_exports__);
  17742. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17743. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17744. /* harmony export */ });
  17745. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17746. /***/ }),
  17747. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17748. /*!**************************************************************************************!*\
  17749. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17750. \**************************************************************************************/
  17751. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17752. "use strict";
  17753. __webpack_require__.r(__webpack_exports__);
  17754. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17755. /* harmony export */ "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"])
  17756. /* harmony export */ });
  17757. /* 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");
  17758. /***/ }),
  17759. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17760. /*!***********************************************************************************!*\
  17761. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17762. \***********************************************************************************/
  17763. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17764. "use strict";
  17765. __webpack_require__.r(__webpack_exports__);
  17766. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17767. /* harmony export */ "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"])
  17768. /* harmony export */ });
  17769. /* 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");
  17770. /***/ }),
  17771. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17772. /*!**************************************************************************************!*\
  17773. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17774. \**************************************************************************************/
  17775. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17776. "use strict";
  17777. __webpack_require__.r(__webpack_exports__);
  17778. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17779. /* harmony export */ "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"])
  17780. /* harmony export */ });
  17781. /* 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");
  17782. /***/ }),
  17783. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17784. /*!**********************************************************************************!*\
  17785. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17786. \**********************************************************************************/
  17787. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17788. "use strict";
  17789. __webpack_require__.r(__webpack_exports__);
  17790. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17791. /* harmony export */ "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"])
  17792. /* harmony export */ });
  17793. /* 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");
  17794. /***/ }),
  17795. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17796. /*!*************************************************************************************!*\
  17797. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17798. \*************************************************************************************/
  17799. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17800. "use strict";
  17801. __webpack_require__.r(__webpack_exports__);
  17802. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17803. /* harmony export */ "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"])
  17804. /* harmony export */ });
  17805. /* 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");
  17806. /***/ }),
  17807. /***/ "./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  17808. /*!*******************************************************************************!*\
  17809. !*** ./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  17810. \*******************************************************************************/
  17811. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17812. "use strict";
  17813. __webpack_require__.r(__webpack_exports__);
  17814. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17815. /* harmony export */ "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"])
  17816. /* harmony export */ });
  17817. /* 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");
  17818. /***/ }),
  17819. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17820. /*!*********************************************************************************!*\
  17821. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17822. \*********************************************************************************/
  17823. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17824. "use strict";
  17825. __webpack_require__.r(__webpack_exports__);
  17826. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17827. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17828. /* harmony export */ });
  17829. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17830. /***/ }),
  17831. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17832. /*!*****************************************************************************************!*\
  17833. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17834. \*****************************************************************************************/
  17835. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17836. "use strict";
  17837. __webpack_require__.r(__webpack_exports__);
  17838. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17839. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17840. /* harmony export */ });
  17841. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17842. /***/ }),
  17843. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17844. /*!******************************************************************************!*\
  17845. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17846. \******************************************************************************/
  17847. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17848. "use strict";
  17849. __webpack_require__.r(__webpack_exports__);
  17850. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17851. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17852. /* harmony export */ });
  17853. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17854. /***/ }),
  17855. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17856. /*!*********************************************************************************!*\
  17857. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17858. \*********************************************************************************/
  17859. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17860. "use strict";
  17861. __webpack_require__.r(__webpack_exports__);
  17862. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17863. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17864. /* harmony export */ });
  17865. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17866. /***/ }),
  17867. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17868. /*!******************************************************************************************!*\
  17869. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17870. \******************************************************************************************/
  17871. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17872. "use strict";
  17873. __webpack_require__.r(__webpack_exports__);
  17874. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17875. /* 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)
  17876. /* harmony export */ });
  17877. /* 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");
  17878. /***/ }),
  17879. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17880. /*!*********************************************************************************************!*\
  17881. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17882. \*********************************************************************************************/
  17883. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17884. "use strict";
  17885. __webpack_require__.r(__webpack_exports__);
  17886. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17887. /* 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)
  17888. /* harmony export */ });
  17889. /* 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");
  17890. /***/ }),
  17891. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17892. /*!*****************************************************************************************!*\
  17893. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17894. \*****************************************************************************************/
  17895. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17896. "use strict";
  17897. __webpack_require__.r(__webpack_exports__);
  17898. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17899. /* 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)
  17900. /* harmony export */ });
  17901. /* 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");
  17902. /***/ }),
  17903. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17904. /*!********************************************************************************************!*\
  17905. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17906. \********************************************************************************************/
  17907. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17908. "use strict";
  17909. __webpack_require__.r(__webpack_exports__);
  17910. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17911. /* 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)
  17912. /* harmony export */ });
  17913. /* 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");
  17914. /***/ }),
  17915. /***/ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c":
  17916. /*!**************************************************************************!*\
  17917. !*** ./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  17918. \**************************************************************************/
  17919. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17920. "use strict";
  17921. __webpack_require__.r(__webpack_exports__);
  17922. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17923. /* 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)
  17924. /* harmony export */ });
  17925. /* 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");
  17926. /***/ }),
  17927. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17928. /*!********************************************************************************************************!*\
  17929. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17930. \********************************************************************************************************/
  17931. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17932. "use strict";
  17933. __webpack_require__.r(__webpack_exports__);
  17934. /* 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");
  17935. /***/ }),
  17936. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17937. /*!*********************************************************************************************************!*\
  17938. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17939. \*********************************************************************************************************/
  17940. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17941. "use strict";
  17942. __webpack_require__.r(__webpack_exports__);
  17943. /* 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");
  17944. /***/ }),
  17945. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17946. /*!************************************************************************************************************!*\
  17947. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&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_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");
  17953. /***/ }),
  17954. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17955. /*!********************************************************************************************************!*\
  17956. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&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_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");
  17962. /***/ }),
  17963. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17964. /*!***********************************************************************************************************!*\
  17965. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&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_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");
  17971. /***/ })
  17972. }]);