resources_js_pages_topup_Index_vue.js 704KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_topup_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!***********************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \***********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  269. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/topup/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  276. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  279. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  280. props: {
  281. topUp: Object,
  282. initialSearch: String,
  283. initialDateRange: Array
  284. },
  285. setup: function setup(__props, _ref) {
  286. var expose = _ref.expose;
  287. expose();
  288. var props = __props;
  289. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  290. search = _useSearchText.search;
  291. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter)(props),
  292. dates = _useDateRangeFilter.dates,
  293. startDate = _useDateRangeFilter.startDate,
  294. endDate = _useDateRangeFilter.endDate;
  295. (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)([dates, search], function () {
  296. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  297. startDate: startDate.value,
  298. endDate: endDate.value,
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var filterReset = function filterReset() {
  305. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups');
  306. };
  307. var __returned__ = {
  308. props: props,
  309. search: search,
  310. dates: dates,
  311. startDate: startDate,
  312. endDate: endDate,
  313. filterReset: filterReset,
  314. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  315. watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
  316. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  317. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  318. indexTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.indexTable,
  319. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  320. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter,
  321. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  322. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  323. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__["default"]
  324. };
  325. Object.defineProperty(__returned__, '__isScriptSetup', {
  326. enumerable: false,
  327. value: true
  328. });
  329. return __returned__;
  330. }
  331. });
  332. /***/ }),
  333. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  334. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  335. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  336. \***********************************************************************************************************************************************************************************************************************************************************************************/
  337. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  338. "use strict";
  339. __webpack_require__.r(__webpack_exports__);
  340. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  341. /* harmony export */ "render": () => (/* binding */ render)
  342. /* harmony export */ });
  343. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  344. var _hoisted_1 = {
  345. key: 1,
  346. "class": "p-button-label"
  347. };
  348. var _hoisted_2 = {
  349. key: 1,
  350. "class": "p-button-label"
  351. };
  352. function render(_ctx, _cache, $props, $setup, $data, $options) {
  353. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  354. key: 0,
  355. "class": "p-button p-component",
  356. as: "button",
  357. type: "button"
  358. }, {
  359. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  360. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  361. key: 0,
  362. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  363. }, null, 2
  364. /* CLASS */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  366. /* TEXT */
  367. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  368. }),
  369. _: 1
  370. /* STABLE */
  371. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  372. key: 1,
  373. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  374. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  375. key: 0,
  376. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  377. }, null, 2
  378. /* CLASS */
  379. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  380. /* TEXT */
  381. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  382. /* CLASS */
  383. ));
  384. }
  385. /***/ }),
  386. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  387. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  388. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  389. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  390. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  391. "use strict";
  392. __webpack_require__.r(__webpack_exports__);
  393. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  394. /* harmony export */ "render": () => (/* binding */ render)
  395. /* harmony export */ });
  396. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  397. var _withScopeId = function _withScopeId(n) {
  398. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  399. };
  400. var _hoisted_1 = {
  401. "class": "layout-footer"
  402. };
  403. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  404. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  405. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  406. href: "https://dijitalcode.com",
  407. target: "_blank",
  408. "class": "font-medium ml-2"
  409. }, "DijitalCODE", -1
  410. /* HOISTED */
  411. );
  412. });
  413. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  414. function render(_ctx, _cache) {
  415. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  416. }
  417. /***/ }),
  418. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  419. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  420. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  421. \********************************************************************************************************************************************************************************************************************************************************************************/
  422. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  423. "use strict";
  424. __webpack_require__.r(__webpack_exports__);
  425. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  426. /* harmony export */ "render": () => (/* binding */ render)
  427. /* harmony export */ });
  428. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  429. var _hoisted_1 = {
  430. key: 0
  431. };
  432. var _hoisted_2 = {
  433. key: 1
  434. };
  435. function render(_ctx, _cache, $props, $setup, $data, $options) {
  436. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  437. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  438. key: 0,
  439. severity: "success",
  440. onClose: $setup.onClose
  441. }, {
  442. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  443. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  444. /* TEXT */
  445. )];
  446. }),
  447. _: 1
  448. /* STABLE */
  449. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  450. key: 1,
  451. severity: "error",
  452. onClose: $setup.onClose
  453. }, {
  454. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  455. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  456. /* TEXT */
  457. )];
  458. }),
  459. _: 1
  460. /* STABLE */
  461. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  462. key: 2,
  463. severity: "error",
  464. onClose: $setup.onClose
  465. }, {
  466. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  467. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  468. /* TEXT */
  469. ))];
  470. }),
  471. _: 1
  472. /* STABLE */
  473. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  474. /* STABLE_FRAGMENT */
  475. );
  476. }
  477. /***/ }),
  478. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  479. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  480. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  481. \***********************************************************************************************************************************************************************************************************************************************************************************/
  482. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  483. "use strict";
  484. __webpack_require__.r(__webpack_exports__);
  485. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  486. /* harmony export */ "render": () => (/* binding */ render)
  487. /* harmony export */ });
  488. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  489. var _hoisted_1 = {
  490. key: 0,
  491. "class": "p-paginator p-component flex justify-content-start"
  492. };
  493. var _hoisted_2 = {
  494. "class": "p-paginator-pages"
  495. };
  496. var _hoisted_3 = ["innerHTML"];
  497. function render(_ctx, _cache, $props, $setup, $data, $options) {
  498. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  499. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  500. key: "link-".concat(key),
  501. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  502. 'p-disabled': link
  503. }]),
  504. innerHTML: link.label
  505. }, null, 10
  506. /* CLASS, PROPS */
  507. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  508. key: "link-".concat(key),
  509. href: link.url,
  510. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  511. 'p-highlight': link.active
  512. }, "p-paginator-page p-paginator-element p-link"]),
  513. innerHTML: link.label
  514. }, null, 8
  515. /* PROPS */
  516. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  517. /* STABLE_FRAGMENT */
  518. );
  519. }), 256
  520. /* UNKEYED_FRAGMENT */
  521. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  522. }
  523. /***/ }),
  524. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  525. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  526. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  527. \********************************************************************************************************************************************************************************************************************************************************************************************/
  528. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  529. "use strict";
  530. __webpack_require__.r(__webpack_exports__);
  531. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  532. /* harmony export */ "render": () => (/* binding */ render)
  533. /* harmony export */ });
  534. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  535. function render(_ctx, _cache, $props, $setup, $data, $options) {
  536. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  537. "class": "layout-menu",
  538. items: $props.menu,
  539. root: true
  540. }, null, 8
  541. /* PROPS */
  542. , ["items"])]);
  543. }
  544. /***/ }),
  545. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  546. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  547. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  548. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  550. "use strict";
  551. __webpack_require__.r(__webpack_exports__);
  552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  553. /* harmony export */ "render": () => (/* binding */ render)
  554. /* harmony export */ });
  555. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  556. var _withScopeId = function _withScopeId(n) {
  557. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  558. };
  559. var _hoisted_1 = {
  560. key: 0
  561. };
  562. var _hoisted_2 = ["aria-label"];
  563. var _hoisted_3 = ["aria-label"];
  564. function render(_ctx, _cache, $props, $setup, $data, $options) {
  565. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  566. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  567. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  568. key: i,
  569. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  570. 'layout-menuitem-category': $props.root
  571. }]),
  572. role: "none"
  573. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  574. key: 0
  575. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  576. "class": "layout-menuitem-root-text",
  577. "aria-label": item.label
  578. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  579. /* TEXT, PROPS */
  580. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  581. items: item.items
  582. }, null, 8
  583. /* PROPS */
  584. , ["items"])], 64
  585. /* STABLE_FRAGMENT */
  586. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  587. key: 1
  588. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  589. key: 0,
  590. role: "menuitem",
  591. href: item.to,
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  593. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  594. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  595. }]),
  596. "aria-label": item.label
  597. }, {
  598. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  599. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  600. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  601. }, null, 2
  602. /* CLASS */
  603. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  604. /* TEXT */
  605. )];
  606. }),
  607. _: 2
  608. /* DYNAMIC */
  609. }, 1032
  610. /* PROPS, DYNAMIC_SLOTS */
  611. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  612. key: 1,
  613. href: "#",
  614. role: "menuitem",
  615. "aria-label": item.label
  616. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  617. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  618. }, null, 2
  619. /* CLASS */
  620. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  621. /* TEXT */
  622. )], 8
  623. /* PROPS */
  624. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  625. items: item.items
  626. }, null, 8
  627. /* PROPS */
  628. , ["items"])], 64
  629. /* STABLE_FRAGMENT */
  630. ))], 2
  631. /* CLASS */
  632. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  633. /* STABLE_FRAGMENT */
  634. );
  635. }), 256
  636. /* UNKEYED_FRAGMENT */
  637. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  638. }
  639. /***/ }),
  640. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  641. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  642. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  643. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  645. "use strict";
  646. __webpack_require__.r(__webpack_exports__);
  647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  648. /* harmony export */ "render": () => (/* binding */ render)
  649. /* harmony export */ });
  650. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  651. var _withScopeId = function _withScopeId(n) {
  652. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  653. };
  654. var _hoisted_1 = {
  655. "class": "layout-topbar"
  656. };
  657. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  658. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  659. alt: "Logo",
  660. src: "/images/logo.svg",
  661. "class": "md:mr-3"
  662. }, null, -1
  663. /* HOISTED */
  664. );
  665. });
  666. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  668. /* HOISTED */
  669. );
  670. });
  671. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  672. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  673. "class": "pi pi-bars"
  674. }, null, -1
  675. /* HOISTED */
  676. );
  677. });
  678. var _hoisted_5 = [_hoisted_4];
  679. var _hoisted_6 = {
  680. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  681. };
  682. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  683. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  684. "class": "pi pi-ellipsis-v"
  685. }, null, -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_8 = [_hoisted_7];
  690. var _hoisted_9 = {
  691. "class": "layout-topbar-menu hidden lg:flex origin-top"
  692. };
  693. var _hoisted_10 = {
  694. "class": "align-self-center"
  695. };
  696. var _hoisted_11 = {
  697. "class": "hidden lg:inline"
  698. };
  699. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  700. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  701. "class": "pi pi-user"
  702. }, null, -1
  703. /* HOISTED */
  704. );
  705. });
  706. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  707. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "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: 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(props) {
  970. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  971. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  972. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  973. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  974. if (!props.initialDateRange) {
  975. return;
  976. }
  977. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  978. if (props.initialDateRange[1]) {
  979. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  980. } else {
  981. dates.value = [new Date(props.props.initialDateRange[1]), null];
  982. }
  983. }
  984. });
  985. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  986. if (dates.value[1]) {
  987. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  988. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  989. } else if (dates.value[0]) {
  990. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  991. endDate.value = null;
  992. }
  993. });
  994. return {
  995. dates: dates,
  996. startDate: startDate,
  997. endDate: endDate
  998. };
  999. }
  1000. /***/ }),
  1001. /***/ "./resources/js/components/useSearchText.js":
  1002. /*!**************************************************!*\
  1003. !*** ./resources/js/components/useSearchText.js ***!
  1004. \**************************************************/
  1005. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1006. "use strict";
  1007. __webpack_require__.r(__webpack_exports__);
  1008. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1009. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  1010. /* harmony export */ });
  1011. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1012. function useSearchText(props) {
  1013. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  1014. return {
  1015. search: search
  1016. };
  1017. }
  1018. /***/ }),
  1019. /***/ "./resources/js/pages/topup/tableHeader.js":
  1020. /*!*************************************************!*\
  1021. !*** ./resources/js/pages/topup/tableHeader.js ***!
  1022. \*************************************************/
  1023. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1024. "use strict";
  1025. __webpack_require__.r(__webpack_exports__);
  1026. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1027. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1028. /* harmony export */ "topUpTable": () => (/* binding */ topUpTable)
  1029. /* harmony export */ });
  1030. var indexTable = [{
  1031. field: 'updatedAt',
  1032. header: 'Diperbaharui'
  1033. }, {
  1034. field: 'name',
  1035. header: 'Nama'
  1036. }, {
  1037. field: 'platNumber',
  1038. header: 'Plat Kendaraan'
  1039. }, {
  1040. field: 'type',
  1041. header: 'Jenis Member'
  1042. }, {
  1043. field: 'amount',
  1044. header: 'Tarif Member'
  1045. }, {
  1046. field: 'expDate',
  1047. header: 'Berakhir'
  1048. }];
  1049. var topUpTable = [{
  1050. field: 'updatedAt',
  1051. header: 'Diperbaharui'
  1052. }, {
  1053. field: 'name',
  1054. header: 'Nama User'
  1055. }, {
  1056. field: 'platNumber',
  1057. header: 'Plat Kendaraan'
  1058. }, {
  1059. field: 'type',
  1060. header: 'Jenis Member'
  1061. }, {
  1062. field: 'amount',
  1063. header: 'Tarif Member'
  1064. }, {
  1065. field: 'expDate',
  1066. header: 'Berakhir'
  1067. }];
  1068. /***/ }),
  1069. /***/ "./resources/js/utils/menu.js":
  1070. /*!************************************!*\
  1071. !*** ./resources/js/utils/menu.js ***!
  1072. \************************************/
  1073. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1074. "use strict";
  1075. __webpack_require__.r(__webpack_exports__);
  1076. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1077. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1078. /* harmony export */ });
  1079. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1080. // Admin
  1081. 1: [{
  1082. label: 'Home',
  1083. items: [{
  1084. label: 'Dashboard',
  1085. icon: 'pi pi-home',
  1086. to: '/dashboards',
  1087. component: 'home/Index'
  1088. }]
  1089. }, {
  1090. label: 'Master',
  1091. items: [{
  1092. label: 'User',
  1093. icon: 'pi pi-user',
  1094. to: '/users',
  1095. component: 'user/Index'
  1096. }]
  1097. }],
  1098. // Supervisor
  1099. 2: [{
  1100. label: 'Home',
  1101. items: [{
  1102. label: 'Dashboard',
  1103. icon: 'pi pi-home',
  1104. to: '/dashboards',
  1105. component: 'home/Index'
  1106. }]
  1107. }, {
  1108. label: 'Menu',
  1109. items: [{
  1110. label: 'Pengeluaran',
  1111. icon: 'pi pi-wallet',
  1112. to: '/expenses',
  1113. component: 'expense/Index'
  1114. }, {
  1115. label: 'Laporan',
  1116. icon: 'pi pi-book',
  1117. items: [{
  1118. label: 'Mutasi',
  1119. icon: 'pi pi-circle',
  1120. to: '/reports/mutations',
  1121. component: 'mutation/Report'
  1122. }]
  1123. }]
  1124. }, {
  1125. label: 'Master',
  1126. items: [{
  1127. label: 'Jenis Kendaraan',
  1128. icon: 'pi pi-car',
  1129. to: '/type-vehicles',
  1130. component: 'typevehicle/Index'
  1131. }, {
  1132. label: 'Jenis Member',
  1133. icon: 'pi pi-id-card',
  1134. to: '/type-members',
  1135. component: 'typemember/Index'
  1136. }]
  1137. }, {
  1138. label: 'Pengaturan',
  1139. items: [{
  1140. label: 'Tarif Parkir',
  1141. icon: 'pi pi-car',
  1142. to: '/parking-fees/create',
  1143. component: 'parkingfee/Create'
  1144. }]
  1145. }],
  1146. // Operator
  1147. 3: [{
  1148. label: 'Home',
  1149. items: [{
  1150. label: 'Dashboard',
  1151. icon: 'pi pi-home',
  1152. to: '/dashboards',
  1153. component: 'home/Index'
  1154. }]
  1155. }, {
  1156. label: 'Menu',
  1157. items: [{
  1158. label: 'Pengeluaran',
  1159. icon: 'pi pi-wallet',
  1160. to: '/expenses',
  1161. component: 'expense/Index'
  1162. }, {
  1163. label: 'Member',
  1164. icon: 'pi pi-id-card',
  1165. to: '/members',
  1166. component: 'member/Index'
  1167. }, {
  1168. label: 'Top Up',
  1169. icon: 'pi pi-car',
  1170. to: '/top-ups',
  1171. component: 'topup/Index'
  1172. }]
  1173. }]
  1174. });
  1175. /***/ }),
  1176. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1177. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1178. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1179. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1180. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1181. "use strict";
  1182. __webpack_require__.r(__webpack_exports__);
  1183. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1184. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1185. /* harmony export */ });
  1186. /* 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");
  1187. /* 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__);
  1188. // Imports
  1189. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1190. // Module
  1191. ___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}", ""]);
  1192. // Exports
  1193. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1194. /***/ }),
  1195. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1196. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1197. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1198. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1199. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1200. "use strict";
  1201. __webpack_require__.r(__webpack_exports__);
  1202. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1203. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1204. /* harmony export */ });
  1205. /* 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");
  1206. /* 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__);
  1207. // Imports
  1208. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1209. // Module
  1210. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1211. // Exports
  1212. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1213. /***/ }),
  1214. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1215. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1216. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1217. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1218. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1219. "use strict";
  1220. __webpack_require__.r(__webpack_exports__);
  1221. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1222. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1223. /* harmony export */ });
  1224. /* 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");
  1225. /* 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__);
  1226. // Imports
  1227. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1228. // Module
  1229. ___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}", ""]);
  1230. // Exports
  1231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1232. /***/ }),
  1233. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1234. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1235. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1236. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1237. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1238. "use strict";
  1239. __webpack_require__.r(__webpack_exports__);
  1240. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1241. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1242. /* harmony export */ });
  1243. /* 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");
  1244. /* 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__);
  1245. // Imports
  1246. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1247. // Module
  1248. ___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}", ""]);
  1249. // Exports
  1250. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1251. /***/ }),
  1252. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1253. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1254. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1255. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1256. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1257. "use strict";
  1258. __webpack_require__.r(__webpack_exports__);
  1259. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1260. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1261. /* harmony export */ });
  1262. /* 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");
  1263. /* 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__);
  1264. // Imports
  1265. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1266. // Module
  1267. ___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}", ""]);
  1268. // Exports
  1269. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1270. /***/ }),
  1271. /***/ "./node_modules/dayjs/dayjs.min.js":
  1272. /*!*****************************************!*\
  1273. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1274. \*****************************************/
  1275. /***/ (function(module) {
  1276. !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}));
  1277. /***/ }),
  1278. /***/ "./node_modules/lodash/lodash.js":
  1279. /*!***************************************!*\
  1280. !*** ./node_modules/lodash/lodash.js ***!
  1281. \***************************************/
  1282. /***/ (function(module, exports, __webpack_require__) {
  1283. /* module decorator */ module = __webpack_require__.nmd(module);
  1284. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1285. * @license
  1286. * Lodash <https://lodash.com/>
  1287. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1288. * Released under MIT license <https://lodash.com/license>
  1289. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1290. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1291. */
  1292. ;(function() {
  1293. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1294. var undefined;
  1295. /** Used as the semantic version number. */
  1296. var VERSION = '4.17.21';
  1297. /** Used as the size to enable large array optimizations. */
  1298. var LARGE_ARRAY_SIZE = 200;
  1299. /** Error message constants. */
  1300. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1301. FUNC_ERROR_TEXT = 'Expected a function',
  1302. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1303. /** Used to stand-in for `undefined` hash values. */
  1304. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1305. /** Used as the maximum memoize cache size. */
  1306. var MAX_MEMOIZE_SIZE = 500;
  1307. /** Used as the internal argument placeholder. */
  1308. var PLACEHOLDER = '__lodash_placeholder__';
  1309. /** Used to compose bitmasks for cloning. */
  1310. var CLONE_DEEP_FLAG = 1,
  1311. CLONE_FLAT_FLAG = 2,
  1312. CLONE_SYMBOLS_FLAG = 4;
  1313. /** Used to compose bitmasks for value comparisons. */
  1314. var COMPARE_PARTIAL_FLAG = 1,
  1315. COMPARE_UNORDERED_FLAG = 2;
  1316. /** Used to compose bitmasks for function metadata. */
  1317. var WRAP_BIND_FLAG = 1,
  1318. WRAP_BIND_KEY_FLAG = 2,
  1319. WRAP_CURRY_BOUND_FLAG = 4,
  1320. WRAP_CURRY_FLAG = 8,
  1321. WRAP_CURRY_RIGHT_FLAG = 16,
  1322. WRAP_PARTIAL_FLAG = 32,
  1323. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1324. WRAP_ARY_FLAG = 128,
  1325. WRAP_REARG_FLAG = 256,
  1326. WRAP_FLIP_FLAG = 512;
  1327. /** Used as default options for `_.truncate`. */
  1328. var DEFAULT_TRUNC_LENGTH = 30,
  1329. DEFAULT_TRUNC_OMISSION = '...';
  1330. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1331. var HOT_COUNT = 800,
  1332. HOT_SPAN = 16;
  1333. /** Used to indicate the type of lazy iteratees. */
  1334. var LAZY_FILTER_FLAG = 1,
  1335. LAZY_MAP_FLAG = 2,
  1336. LAZY_WHILE_FLAG = 3;
  1337. /** Used as references for various `Number` constants. */
  1338. var INFINITY = 1 / 0,
  1339. MAX_SAFE_INTEGER = 9007199254740991,
  1340. MAX_INTEGER = 1.7976931348623157e+308,
  1341. NAN = 0 / 0;
  1342. /** Used as references for the maximum length and index of an array. */
  1343. var MAX_ARRAY_LENGTH = 4294967295,
  1344. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1345. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1346. /** Used to associate wrap methods with their bit flags. */
  1347. var wrapFlags = [
  1348. ['ary', WRAP_ARY_FLAG],
  1349. ['bind', WRAP_BIND_FLAG],
  1350. ['bindKey', WRAP_BIND_KEY_FLAG],
  1351. ['curry', WRAP_CURRY_FLAG],
  1352. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1353. ['flip', WRAP_FLIP_FLAG],
  1354. ['partial', WRAP_PARTIAL_FLAG],
  1355. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1356. ['rearg', WRAP_REARG_FLAG]
  1357. ];
  1358. /** `Object#toString` result references. */
  1359. var argsTag = '[object Arguments]',
  1360. arrayTag = '[object Array]',
  1361. asyncTag = '[object AsyncFunction]',
  1362. boolTag = '[object Boolean]',
  1363. dateTag = '[object Date]',
  1364. domExcTag = '[object DOMException]',
  1365. errorTag = '[object Error]',
  1366. funcTag = '[object Function]',
  1367. genTag = '[object GeneratorFunction]',
  1368. mapTag = '[object Map]',
  1369. numberTag = '[object Number]',
  1370. nullTag = '[object Null]',
  1371. objectTag = '[object Object]',
  1372. promiseTag = '[object Promise]',
  1373. proxyTag = '[object Proxy]',
  1374. regexpTag = '[object RegExp]',
  1375. setTag = '[object Set]',
  1376. stringTag = '[object String]',
  1377. symbolTag = '[object Symbol]',
  1378. undefinedTag = '[object Undefined]',
  1379. weakMapTag = '[object WeakMap]',
  1380. weakSetTag = '[object WeakSet]';
  1381. var arrayBufferTag = '[object ArrayBuffer]',
  1382. dataViewTag = '[object DataView]',
  1383. float32Tag = '[object Float32Array]',
  1384. float64Tag = '[object Float64Array]',
  1385. int8Tag = '[object Int8Array]',
  1386. int16Tag = '[object Int16Array]',
  1387. int32Tag = '[object Int32Array]',
  1388. uint8Tag = '[object Uint8Array]',
  1389. uint8ClampedTag = '[object Uint8ClampedArray]',
  1390. uint16Tag = '[object Uint16Array]',
  1391. uint32Tag = '[object Uint32Array]';
  1392. /** Used to match empty string literals in compiled template source. */
  1393. var reEmptyStringLeading = /\b__p \+= '';/g,
  1394. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1395. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1396. /** Used to match HTML entities and HTML characters. */
  1397. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1398. reUnescapedHtml = /[&<>"']/g,
  1399. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1400. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1401. /** Used to match template delimiters. */
  1402. var reEscape = /<%-([\s\S]+?)%>/g,
  1403. reEvaluate = /<%([\s\S]+?)%>/g,
  1404. reInterpolate = /<%=([\s\S]+?)%>/g;
  1405. /** Used to match property names within property paths. */
  1406. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1407. reIsPlainProp = /^\w*$/,
  1408. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1409. /**
  1410. * Used to match `RegExp`
  1411. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1412. */
  1413. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1414. reHasRegExpChar = RegExp(reRegExpChar.source);
  1415. /** Used to match leading whitespace. */
  1416. var reTrimStart = /^\s+/;
  1417. /** Used to match a single whitespace character. */
  1418. var reWhitespace = /\s/;
  1419. /** Used to match wrap detail comments. */
  1420. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1421. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1422. reSplitDetails = /,? & /;
  1423. /** Used to match words composed of alphanumeric characters. */
  1424. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1425. /**
  1426. * Used to validate the `validate` option in `_.template` variable.
  1427. *
  1428. * Forbids characters which could potentially change the meaning of the function argument definition:
  1429. * - "()," (modification of function parameters)
  1430. * - "=" (default value)
  1431. * - "[]{}" (destructuring of function parameters)
  1432. * - "/" (beginning of a comment)
  1433. * - whitespace
  1434. */
  1435. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1436. /** Used to match backslashes in property paths. */
  1437. var reEscapeChar = /\\(\\)?/g;
  1438. /**
  1439. * Used to match
  1440. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1441. */
  1442. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1443. /** Used to match `RegExp` flags from their coerced string values. */
  1444. var reFlags = /\w*$/;
  1445. /** Used to detect bad signed hexadecimal string values. */
  1446. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1447. /** Used to detect binary string values. */
  1448. var reIsBinary = /^0b[01]+$/i;
  1449. /** Used to detect host constructors (Safari). */
  1450. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1451. /** Used to detect octal string values. */
  1452. var reIsOctal = /^0o[0-7]+$/i;
  1453. /** Used to detect unsigned integer values. */
  1454. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1455. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1456. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1457. /** Used to ensure capturing order of template delimiters. */
  1458. var reNoMatch = /($^)/;
  1459. /** Used to match unescaped characters in compiled string literals. */
  1460. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1461. /** Used to compose unicode character classes. */
  1462. var rsAstralRange = '\\ud800-\\udfff',
  1463. rsComboMarksRange = '\\u0300-\\u036f',
  1464. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1465. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1466. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1467. rsDingbatRange = '\\u2700-\\u27bf',
  1468. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1469. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1470. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1471. rsPunctuationRange = '\\u2000-\\u206f',
  1472. 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',
  1473. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1474. rsVarRange = '\\ufe0e\\ufe0f',
  1475. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1476. /** Used to compose unicode capture groups. */
  1477. var rsApos = "['\u2019]",
  1478. rsAstral = '[' + rsAstralRange + ']',
  1479. rsBreak = '[' + rsBreakRange + ']',
  1480. rsCombo = '[' + rsComboRange + ']',
  1481. rsDigits = '\\d+',
  1482. rsDingbat = '[' + rsDingbatRange + ']',
  1483. rsLower = '[' + rsLowerRange + ']',
  1484. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1485. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1486. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1487. rsNonAstral = '[^' + rsAstralRange + ']',
  1488. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1489. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1490. rsUpper = '[' + rsUpperRange + ']',
  1491. rsZWJ = '\\u200d';
  1492. /** Used to compose unicode regexes. */
  1493. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1494. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1495. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1496. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1497. reOptMod = rsModifier + '?',
  1498. rsOptVar = '[' + rsVarRange + ']?',
  1499. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1500. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1501. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1502. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1503. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1504. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1505. /** Used to match apostrophes. */
  1506. var reApos = RegExp(rsApos, 'g');
  1507. /**
  1508. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1509. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1510. */
  1511. var reComboMark = RegExp(rsCombo, 'g');
  1512. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1513. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1514. /** Used to match complex or compound words. */
  1515. var reUnicodeWord = RegExp([
  1516. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1517. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1518. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1519. rsUpper + '+' + rsOptContrUpper,
  1520. rsOrdUpper,
  1521. rsOrdLower,
  1522. rsDigits,
  1523. rsEmoji
  1524. ].join('|'), 'g');
  1525. /** 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/). */
  1526. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1527. /** Used to detect strings that need a more robust regexp to match words. */
  1528. 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 ]/;
  1529. /** Used to assign default `context` object properties. */
  1530. var contextProps = [
  1531. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1532. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1533. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1534. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1535. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1536. ];
  1537. /** Used to make template sourceURLs easier to identify. */
  1538. var templateCounter = -1;
  1539. /** Used to identify `toStringTag` values of typed arrays. */
  1540. var typedArrayTags = {};
  1541. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1542. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1543. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1544. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1545. typedArrayTags[uint32Tag] = true;
  1546. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1547. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1548. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1549. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1550. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1551. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1552. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1553. typedArrayTags[weakMapTag] = false;
  1554. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1555. var cloneableTags = {};
  1556. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1557. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1558. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1559. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1560. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1561. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1562. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1563. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1564. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1565. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1566. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1567. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1568. cloneableTags[weakMapTag] = false;
  1569. /** Used to map Latin Unicode letters to basic Latin letters. */
  1570. var deburredLetters = {
  1571. // Latin-1 Supplement block.
  1572. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1573. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1574. '\xc7': 'C', '\xe7': 'c',
  1575. '\xd0': 'D', '\xf0': 'd',
  1576. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1577. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1578. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1579. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1580. '\xd1': 'N', '\xf1': 'n',
  1581. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1582. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1583. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1584. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1585. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1586. '\xc6': 'Ae', '\xe6': 'ae',
  1587. '\xde': 'Th', '\xfe': 'th',
  1588. '\xdf': 'ss',
  1589. // Latin Extended-A block.
  1590. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1591. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1592. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1593. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1594. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1595. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1596. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1597. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1598. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1599. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1600. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1601. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1602. '\u0134': 'J', '\u0135': 'j',
  1603. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1604. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1605. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1606. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1607. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1608. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1609. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1610. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1611. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1612. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1613. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1614. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1615. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1616. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1617. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1618. '\u0174': 'W', '\u0175': 'w',
  1619. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1620. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1621. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1622. '\u0132': 'IJ', '\u0133': 'ij',
  1623. '\u0152': 'Oe', '\u0153': 'oe',
  1624. '\u0149': "'n", '\u017f': 's'
  1625. };
  1626. /** Used to map characters to HTML entities. */
  1627. var htmlEscapes = {
  1628. '&': '&amp;',
  1629. '<': '&lt;',
  1630. '>': '&gt;',
  1631. '"': '&quot;',
  1632. "'": '&#39;'
  1633. };
  1634. /** Used to map HTML entities to characters. */
  1635. var htmlUnescapes = {
  1636. '&amp;': '&',
  1637. '&lt;': '<',
  1638. '&gt;': '>',
  1639. '&quot;': '"',
  1640. '&#39;': "'"
  1641. };
  1642. /** Used to escape characters for inclusion in compiled string literals. */
  1643. var stringEscapes = {
  1644. '\\': '\\',
  1645. "'": "'",
  1646. '\n': 'n',
  1647. '\r': 'r',
  1648. '\u2028': 'u2028',
  1649. '\u2029': 'u2029'
  1650. };
  1651. /** Built-in method references without a dependency on `root`. */
  1652. var freeParseFloat = parseFloat,
  1653. freeParseInt = parseInt;
  1654. /** Detect free variable `global` from Node.js. */
  1655. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1656. /** Detect free variable `self`. */
  1657. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1658. /** Used as a reference to the global object. */
  1659. var root = freeGlobal || freeSelf || Function('return this')();
  1660. /** Detect free variable `exports`. */
  1661. var freeExports = true && exports && !exports.nodeType && exports;
  1662. /** Detect free variable `module`. */
  1663. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1664. /** Detect the popular CommonJS extension `module.exports`. */
  1665. var moduleExports = freeModule && freeModule.exports === freeExports;
  1666. /** Detect free variable `process` from Node.js. */
  1667. var freeProcess = moduleExports && freeGlobal.process;
  1668. /** Used to access faster Node.js helpers. */
  1669. var nodeUtil = (function() {
  1670. try {
  1671. // Use `util.types` for Node.js 10+.
  1672. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1673. if (types) {
  1674. return types;
  1675. }
  1676. // Legacy `process.binding('util')` for Node.js < 10.
  1677. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1678. } catch (e) {}
  1679. }());
  1680. /* Node.js helper references. */
  1681. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1682. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1683. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1684. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1685. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1686. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1687. /*--------------------------------------------------------------------------*/
  1688. /**
  1689. * A faster alternative to `Function#apply`, this function invokes `func`
  1690. * with the `this` binding of `thisArg` and the arguments of `args`.
  1691. *
  1692. * @private
  1693. * @param {Function} func The function to invoke.
  1694. * @param {*} thisArg The `this` binding of `func`.
  1695. * @param {Array} args The arguments to invoke `func` with.
  1696. * @returns {*} Returns the result of `func`.
  1697. */
  1698. function apply(func, thisArg, args) {
  1699. switch (args.length) {
  1700. case 0: return func.call(thisArg);
  1701. case 1: return func.call(thisArg, args[0]);
  1702. case 2: return func.call(thisArg, args[0], args[1]);
  1703. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1704. }
  1705. return func.apply(thisArg, args);
  1706. }
  1707. /**
  1708. * A specialized version of `baseAggregator` for arrays.
  1709. *
  1710. * @private
  1711. * @param {Array} [array] The array to iterate over.
  1712. * @param {Function} setter The function to set `accumulator` values.
  1713. * @param {Function} iteratee The iteratee to transform keys.
  1714. * @param {Object} accumulator The initial aggregated object.
  1715. * @returns {Function} Returns `accumulator`.
  1716. */
  1717. function arrayAggregator(array, setter, iteratee, accumulator) {
  1718. var index = -1,
  1719. length = array == null ? 0 : array.length;
  1720. while (++index < length) {
  1721. var value = array[index];
  1722. setter(accumulator, value, iteratee(value), array);
  1723. }
  1724. return accumulator;
  1725. }
  1726. /**
  1727. * A specialized version of `_.forEach` for arrays without support for
  1728. * iteratee shorthands.
  1729. *
  1730. * @private
  1731. * @param {Array} [array] The array to iterate over.
  1732. * @param {Function} iteratee The function invoked per iteration.
  1733. * @returns {Array} Returns `array`.
  1734. */
  1735. function arrayEach(array, iteratee) {
  1736. var index = -1,
  1737. length = array == null ? 0 : array.length;
  1738. while (++index < length) {
  1739. if (iteratee(array[index], index, array) === false) {
  1740. break;
  1741. }
  1742. }
  1743. return array;
  1744. }
  1745. /**
  1746. * A specialized version of `_.forEachRight` for arrays without support for
  1747. * iteratee shorthands.
  1748. *
  1749. * @private
  1750. * @param {Array} [array] The array to iterate over.
  1751. * @param {Function} iteratee The function invoked per iteration.
  1752. * @returns {Array} Returns `array`.
  1753. */
  1754. function arrayEachRight(array, iteratee) {
  1755. var length = array == null ? 0 : array.length;
  1756. while (length--) {
  1757. if (iteratee(array[length], length, array) === false) {
  1758. break;
  1759. }
  1760. }
  1761. return array;
  1762. }
  1763. /**
  1764. * A specialized version of `_.every` for arrays without support for
  1765. * iteratee shorthands.
  1766. *
  1767. * @private
  1768. * @param {Array} [array] The array to iterate over.
  1769. * @param {Function} predicate The function invoked per iteration.
  1770. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1771. * else `false`.
  1772. */
  1773. function arrayEvery(array, predicate) {
  1774. var index = -1,
  1775. length = array == null ? 0 : array.length;
  1776. while (++index < length) {
  1777. if (!predicate(array[index], index, array)) {
  1778. return false;
  1779. }
  1780. }
  1781. return true;
  1782. }
  1783. /**
  1784. * A specialized version of `_.filter` for arrays without support for
  1785. * iteratee shorthands.
  1786. *
  1787. * @private
  1788. * @param {Array} [array] The array to iterate over.
  1789. * @param {Function} predicate The function invoked per iteration.
  1790. * @returns {Array} Returns the new filtered array.
  1791. */
  1792. function arrayFilter(array, predicate) {
  1793. var index = -1,
  1794. length = array == null ? 0 : array.length,
  1795. resIndex = 0,
  1796. result = [];
  1797. while (++index < length) {
  1798. var value = array[index];
  1799. if (predicate(value, index, array)) {
  1800. result[resIndex++] = value;
  1801. }
  1802. }
  1803. return result;
  1804. }
  1805. /**
  1806. * A specialized version of `_.includes` for arrays without support for
  1807. * specifying an index to search from.
  1808. *
  1809. * @private
  1810. * @param {Array} [array] The array to inspect.
  1811. * @param {*} target The value to search for.
  1812. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1813. */
  1814. function arrayIncludes(array, value) {
  1815. var length = array == null ? 0 : array.length;
  1816. return !!length && baseIndexOf(array, value, 0) > -1;
  1817. }
  1818. /**
  1819. * This function is like `arrayIncludes` except that it accepts a comparator.
  1820. *
  1821. * @private
  1822. * @param {Array} [array] The array to inspect.
  1823. * @param {*} target The value to search for.
  1824. * @param {Function} comparator The comparator invoked per element.
  1825. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1826. */
  1827. function arrayIncludesWith(array, value, comparator) {
  1828. var index = -1,
  1829. length = array == null ? 0 : array.length;
  1830. while (++index < length) {
  1831. if (comparator(value, array[index])) {
  1832. return true;
  1833. }
  1834. }
  1835. return false;
  1836. }
  1837. /**
  1838. * A specialized version of `_.map` for arrays without support for iteratee
  1839. * shorthands.
  1840. *
  1841. * @private
  1842. * @param {Array} [array] The array to iterate over.
  1843. * @param {Function} iteratee The function invoked per iteration.
  1844. * @returns {Array} Returns the new mapped array.
  1845. */
  1846. function arrayMap(array, iteratee) {
  1847. var index = -1,
  1848. length = array == null ? 0 : array.length,
  1849. result = Array(length);
  1850. while (++index < length) {
  1851. result[index] = iteratee(array[index], index, array);
  1852. }
  1853. return result;
  1854. }
  1855. /**
  1856. * Appends the elements of `values` to `array`.
  1857. *
  1858. * @private
  1859. * @param {Array} array The array to modify.
  1860. * @param {Array} values The values to append.
  1861. * @returns {Array} Returns `array`.
  1862. */
  1863. function arrayPush(array, values) {
  1864. var index = -1,
  1865. length = values.length,
  1866. offset = array.length;
  1867. while (++index < length) {
  1868. array[offset + index] = values[index];
  1869. }
  1870. return array;
  1871. }
  1872. /**
  1873. * A specialized version of `_.reduce` for arrays without support for
  1874. * iteratee shorthands.
  1875. *
  1876. * @private
  1877. * @param {Array} [array] The array to iterate over.
  1878. * @param {Function} iteratee The function invoked per iteration.
  1879. * @param {*} [accumulator] The initial value.
  1880. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1881. * the initial value.
  1882. * @returns {*} Returns the accumulated value.
  1883. */
  1884. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1885. var index = -1,
  1886. length = array == null ? 0 : array.length;
  1887. if (initAccum && length) {
  1888. accumulator = array[++index];
  1889. }
  1890. while (++index < length) {
  1891. accumulator = iteratee(accumulator, array[index], index, array);
  1892. }
  1893. return accumulator;
  1894. }
  1895. /**
  1896. * A specialized version of `_.reduceRight` for arrays without support for
  1897. * iteratee shorthands.
  1898. *
  1899. * @private
  1900. * @param {Array} [array] The array to iterate over.
  1901. * @param {Function} iteratee The function invoked per iteration.
  1902. * @param {*} [accumulator] The initial value.
  1903. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1904. * the initial value.
  1905. * @returns {*} Returns the accumulated value.
  1906. */
  1907. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1908. var length = array == null ? 0 : array.length;
  1909. if (initAccum && length) {
  1910. accumulator = array[--length];
  1911. }
  1912. while (length--) {
  1913. accumulator = iteratee(accumulator, array[length], length, array);
  1914. }
  1915. return accumulator;
  1916. }
  1917. /**
  1918. * A specialized version of `_.some` for arrays without support for iteratee
  1919. * shorthands.
  1920. *
  1921. * @private
  1922. * @param {Array} [array] The array to iterate over.
  1923. * @param {Function} predicate The function invoked per iteration.
  1924. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1925. * else `false`.
  1926. */
  1927. function arraySome(array, predicate) {
  1928. var index = -1,
  1929. length = array == null ? 0 : array.length;
  1930. while (++index < length) {
  1931. if (predicate(array[index], index, array)) {
  1932. return true;
  1933. }
  1934. }
  1935. return false;
  1936. }
  1937. /**
  1938. * Gets the size of an ASCII `string`.
  1939. *
  1940. * @private
  1941. * @param {string} string The string inspect.
  1942. * @returns {number} Returns the string size.
  1943. */
  1944. var asciiSize = baseProperty('length');
  1945. /**
  1946. * Converts an ASCII `string` to an array.
  1947. *
  1948. * @private
  1949. * @param {string} string The string to convert.
  1950. * @returns {Array} Returns the converted array.
  1951. */
  1952. function asciiToArray(string) {
  1953. return string.split('');
  1954. }
  1955. /**
  1956. * Splits an ASCII `string` into an array of its words.
  1957. *
  1958. * @private
  1959. * @param {string} The string to inspect.
  1960. * @returns {Array} Returns the words of `string`.
  1961. */
  1962. function asciiWords(string) {
  1963. return string.match(reAsciiWord) || [];
  1964. }
  1965. /**
  1966. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1967. * without support for iteratee shorthands, which iterates over `collection`
  1968. * using `eachFunc`.
  1969. *
  1970. * @private
  1971. * @param {Array|Object} collection The collection to inspect.
  1972. * @param {Function} predicate The function invoked per iteration.
  1973. * @param {Function} eachFunc The function to iterate over `collection`.
  1974. * @returns {*} Returns the found element or its key, else `undefined`.
  1975. */
  1976. function baseFindKey(collection, predicate, eachFunc) {
  1977. var result;
  1978. eachFunc(collection, function(value, key, collection) {
  1979. if (predicate(value, key, collection)) {
  1980. result = key;
  1981. return false;
  1982. }
  1983. });
  1984. return result;
  1985. }
  1986. /**
  1987. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1988. * support for iteratee shorthands.
  1989. *
  1990. * @private
  1991. * @param {Array} array The array to inspect.
  1992. * @param {Function} predicate The function invoked per iteration.
  1993. * @param {number} fromIndex The index to search from.
  1994. * @param {boolean} [fromRight] Specify iterating from right to left.
  1995. * @returns {number} Returns the index of the matched value, else `-1`.
  1996. */
  1997. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1998. var length = array.length,
  1999. index = fromIndex + (fromRight ? 1 : -1);
  2000. while ((fromRight ? index-- : ++index < length)) {
  2001. if (predicate(array[index], index, array)) {
  2002. return index;
  2003. }
  2004. }
  2005. return -1;
  2006. }
  2007. /**
  2008. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2009. *
  2010. * @private
  2011. * @param {Array} array The array to inspect.
  2012. * @param {*} value The value to search for.
  2013. * @param {number} fromIndex The index to search from.
  2014. * @returns {number} Returns the index of the matched value, else `-1`.
  2015. */
  2016. function baseIndexOf(array, value, fromIndex) {
  2017. return value === value
  2018. ? strictIndexOf(array, value, fromIndex)
  2019. : baseFindIndex(array, baseIsNaN, fromIndex);
  2020. }
  2021. /**
  2022. * This function is like `baseIndexOf` except that it accepts a comparator.
  2023. *
  2024. * @private
  2025. * @param {Array} array The array to inspect.
  2026. * @param {*} value The value to search for.
  2027. * @param {number} fromIndex The index to search from.
  2028. * @param {Function} comparator The comparator invoked per element.
  2029. * @returns {number} Returns the index of the matched value, else `-1`.
  2030. */
  2031. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2032. var index = fromIndex - 1,
  2033. length = array.length;
  2034. while (++index < length) {
  2035. if (comparator(array[index], value)) {
  2036. return index;
  2037. }
  2038. }
  2039. return -1;
  2040. }
  2041. /**
  2042. * The base implementation of `_.isNaN` without support for number objects.
  2043. *
  2044. * @private
  2045. * @param {*} value The value to check.
  2046. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2047. */
  2048. function baseIsNaN(value) {
  2049. return value !== value;
  2050. }
  2051. /**
  2052. * The base implementation of `_.mean` and `_.meanBy` without support for
  2053. * iteratee shorthands.
  2054. *
  2055. * @private
  2056. * @param {Array} array The array to iterate over.
  2057. * @param {Function} iteratee The function invoked per iteration.
  2058. * @returns {number} Returns the mean.
  2059. */
  2060. function baseMean(array, iteratee) {
  2061. var length = array == null ? 0 : array.length;
  2062. return length ? (baseSum(array, iteratee) / length) : NAN;
  2063. }
  2064. /**
  2065. * The base implementation of `_.property` without support for deep paths.
  2066. *
  2067. * @private
  2068. * @param {string} key The key of the property to get.
  2069. * @returns {Function} Returns the new accessor function.
  2070. */
  2071. function baseProperty(key) {
  2072. return function(object) {
  2073. return object == null ? undefined : object[key];
  2074. };
  2075. }
  2076. /**
  2077. * The base implementation of `_.propertyOf` without support for deep paths.
  2078. *
  2079. * @private
  2080. * @param {Object} object The object to query.
  2081. * @returns {Function} Returns the new accessor function.
  2082. */
  2083. function basePropertyOf(object) {
  2084. return function(key) {
  2085. return object == null ? undefined : object[key];
  2086. };
  2087. }
  2088. /**
  2089. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2090. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2091. *
  2092. * @private
  2093. * @param {Array|Object} collection The collection to iterate over.
  2094. * @param {Function} iteratee The function invoked per iteration.
  2095. * @param {*} accumulator The initial value.
  2096. * @param {boolean} initAccum Specify using the first or last element of
  2097. * `collection` as the initial value.
  2098. * @param {Function} eachFunc The function to iterate over `collection`.
  2099. * @returns {*} Returns the accumulated value.
  2100. */
  2101. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2102. eachFunc(collection, function(value, index, collection) {
  2103. accumulator = initAccum
  2104. ? (initAccum = false, value)
  2105. : iteratee(accumulator, value, index, collection);
  2106. });
  2107. return accumulator;
  2108. }
  2109. /**
  2110. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2111. * sort order of `array` and replaces criteria objects with their corresponding
  2112. * values.
  2113. *
  2114. * @private
  2115. * @param {Array} array The array to sort.
  2116. * @param {Function} comparer The function to define sort order.
  2117. * @returns {Array} Returns `array`.
  2118. */
  2119. function baseSortBy(array, comparer) {
  2120. var length = array.length;
  2121. array.sort(comparer);
  2122. while (length--) {
  2123. array[length] = array[length].value;
  2124. }
  2125. return array;
  2126. }
  2127. /**
  2128. * The base implementation of `_.sum` and `_.sumBy` without support for
  2129. * iteratee shorthands.
  2130. *
  2131. * @private
  2132. * @param {Array} array The array to iterate over.
  2133. * @param {Function} iteratee The function invoked per iteration.
  2134. * @returns {number} Returns the sum.
  2135. */
  2136. function baseSum(array, iteratee) {
  2137. var result,
  2138. index = -1,
  2139. length = array.length;
  2140. while (++index < length) {
  2141. var current = iteratee(array[index]);
  2142. if (current !== undefined) {
  2143. result = result === undefined ? current : (result + current);
  2144. }
  2145. }
  2146. return result;
  2147. }
  2148. /**
  2149. * The base implementation of `_.times` without support for iteratee shorthands
  2150. * or max array length checks.
  2151. *
  2152. * @private
  2153. * @param {number} n The number of times to invoke `iteratee`.
  2154. * @param {Function} iteratee The function invoked per iteration.
  2155. * @returns {Array} Returns the array of results.
  2156. */
  2157. function baseTimes(n, iteratee) {
  2158. var index = -1,
  2159. result = Array(n);
  2160. while (++index < n) {
  2161. result[index] = iteratee(index);
  2162. }
  2163. return result;
  2164. }
  2165. /**
  2166. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2167. * of key-value pairs for `object` corresponding to the property names of `props`.
  2168. *
  2169. * @private
  2170. * @param {Object} object The object to query.
  2171. * @param {Array} props The property names to get values for.
  2172. * @returns {Object} Returns the key-value pairs.
  2173. */
  2174. function baseToPairs(object, props) {
  2175. return arrayMap(props, function(key) {
  2176. return [key, object[key]];
  2177. });
  2178. }
  2179. /**
  2180. * The base implementation of `_.trim`.
  2181. *
  2182. * @private
  2183. * @param {string} string The string to trim.
  2184. * @returns {string} Returns the trimmed string.
  2185. */
  2186. function baseTrim(string) {
  2187. return string
  2188. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2189. : string;
  2190. }
  2191. /**
  2192. * The base implementation of `_.unary` without support for storing metadata.
  2193. *
  2194. * @private
  2195. * @param {Function} func The function to cap arguments for.
  2196. * @returns {Function} Returns the new capped function.
  2197. */
  2198. function baseUnary(func) {
  2199. return function(value) {
  2200. return func(value);
  2201. };
  2202. }
  2203. /**
  2204. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2205. * array of `object` property values corresponding to the property names
  2206. * of `props`.
  2207. *
  2208. * @private
  2209. * @param {Object} object The object to query.
  2210. * @param {Array} props The property names to get values for.
  2211. * @returns {Object} Returns the array of property values.
  2212. */
  2213. function baseValues(object, props) {
  2214. return arrayMap(props, function(key) {
  2215. return object[key];
  2216. });
  2217. }
  2218. /**
  2219. * Checks if a `cache` value for `key` exists.
  2220. *
  2221. * @private
  2222. * @param {Object} cache The cache to query.
  2223. * @param {string} key The key of the entry to check.
  2224. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2225. */
  2226. function cacheHas(cache, key) {
  2227. return cache.has(key);
  2228. }
  2229. /**
  2230. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2231. * that is not found in the character symbols.
  2232. *
  2233. * @private
  2234. * @param {Array} strSymbols The string symbols to inspect.
  2235. * @param {Array} chrSymbols The character symbols to find.
  2236. * @returns {number} Returns the index of the first unmatched string symbol.
  2237. */
  2238. function charsStartIndex(strSymbols, chrSymbols) {
  2239. var index = -1,
  2240. length = strSymbols.length;
  2241. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2242. return index;
  2243. }
  2244. /**
  2245. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2246. * that is not found in the character symbols.
  2247. *
  2248. * @private
  2249. * @param {Array} strSymbols The string symbols to inspect.
  2250. * @param {Array} chrSymbols The character symbols to find.
  2251. * @returns {number} Returns the index of the last unmatched string symbol.
  2252. */
  2253. function charsEndIndex(strSymbols, chrSymbols) {
  2254. var index = strSymbols.length;
  2255. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2256. return index;
  2257. }
  2258. /**
  2259. * Gets the number of `placeholder` occurrences in `array`.
  2260. *
  2261. * @private
  2262. * @param {Array} array The array to inspect.
  2263. * @param {*} placeholder The placeholder to search for.
  2264. * @returns {number} Returns the placeholder count.
  2265. */
  2266. function countHolders(array, placeholder) {
  2267. var length = array.length,
  2268. result = 0;
  2269. while (length--) {
  2270. if (array[length] === placeholder) {
  2271. ++result;
  2272. }
  2273. }
  2274. return result;
  2275. }
  2276. /**
  2277. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2278. * letters to basic Latin letters.
  2279. *
  2280. * @private
  2281. * @param {string} letter The matched letter to deburr.
  2282. * @returns {string} Returns the deburred letter.
  2283. */
  2284. var deburrLetter = basePropertyOf(deburredLetters);
  2285. /**
  2286. * Used by `_.escape` to convert characters to HTML entities.
  2287. *
  2288. * @private
  2289. * @param {string} chr The matched character to escape.
  2290. * @returns {string} Returns the escaped character.
  2291. */
  2292. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2293. /**
  2294. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2295. *
  2296. * @private
  2297. * @param {string} chr The matched character to escape.
  2298. * @returns {string} Returns the escaped character.
  2299. */
  2300. function escapeStringChar(chr) {
  2301. return '\\' + stringEscapes[chr];
  2302. }
  2303. /**
  2304. * Gets the value at `key` of `object`.
  2305. *
  2306. * @private
  2307. * @param {Object} [object] The object to query.
  2308. * @param {string} key The key of the property to get.
  2309. * @returns {*} Returns the property value.
  2310. */
  2311. function getValue(object, key) {
  2312. return object == null ? undefined : object[key];
  2313. }
  2314. /**
  2315. * Checks if `string` contains Unicode symbols.
  2316. *
  2317. * @private
  2318. * @param {string} string The string to inspect.
  2319. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2320. */
  2321. function hasUnicode(string) {
  2322. return reHasUnicode.test(string);
  2323. }
  2324. /**
  2325. * Checks if `string` contains a word composed of Unicode symbols.
  2326. *
  2327. * @private
  2328. * @param {string} string The string to inspect.
  2329. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2330. */
  2331. function hasUnicodeWord(string) {
  2332. return reHasUnicodeWord.test(string);
  2333. }
  2334. /**
  2335. * Converts `iterator` to an array.
  2336. *
  2337. * @private
  2338. * @param {Object} iterator The iterator to convert.
  2339. * @returns {Array} Returns the converted array.
  2340. */
  2341. function iteratorToArray(iterator) {
  2342. var data,
  2343. result = [];
  2344. while (!(data = iterator.next()).done) {
  2345. result.push(data.value);
  2346. }
  2347. return result;
  2348. }
  2349. /**
  2350. * Converts `map` to its key-value pairs.
  2351. *
  2352. * @private
  2353. * @param {Object} map The map to convert.
  2354. * @returns {Array} Returns the key-value pairs.
  2355. */
  2356. function mapToArray(map) {
  2357. var index = -1,
  2358. result = Array(map.size);
  2359. map.forEach(function(value, key) {
  2360. result[++index] = [key, value];
  2361. });
  2362. return result;
  2363. }
  2364. /**
  2365. * Creates a unary function that invokes `func` with its argument transformed.
  2366. *
  2367. * @private
  2368. * @param {Function} func The function to wrap.
  2369. * @param {Function} transform The argument transform.
  2370. * @returns {Function} Returns the new function.
  2371. */
  2372. function overArg(func, transform) {
  2373. return function(arg) {
  2374. return func(transform(arg));
  2375. };
  2376. }
  2377. /**
  2378. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2379. * and returns an array of their indexes.
  2380. *
  2381. * @private
  2382. * @param {Array} array The array to modify.
  2383. * @param {*} placeholder The placeholder to replace.
  2384. * @returns {Array} Returns the new array of placeholder indexes.
  2385. */
  2386. function replaceHolders(array, placeholder) {
  2387. var index = -1,
  2388. length = array.length,
  2389. resIndex = 0,
  2390. result = [];
  2391. while (++index < length) {
  2392. var value = array[index];
  2393. if (value === placeholder || value === PLACEHOLDER) {
  2394. array[index] = PLACEHOLDER;
  2395. result[resIndex++] = index;
  2396. }
  2397. }
  2398. return result;
  2399. }
  2400. /**
  2401. * Converts `set` to an array of its values.
  2402. *
  2403. * @private
  2404. * @param {Object} set The set to convert.
  2405. * @returns {Array} Returns the values.
  2406. */
  2407. function setToArray(set) {
  2408. var index = -1,
  2409. result = Array(set.size);
  2410. set.forEach(function(value) {
  2411. result[++index] = value;
  2412. });
  2413. return result;
  2414. }
  2415. /**
  2416. * Converts `set` to its value-value pairs.
  2417. *
  2418. * @private
  2419. * @param {Object} set The set to convert.
  2420. * @returns {Array} Returns the value-value pairs.
  2421. */
  2422. function setToPairs(set) {
  2423. var index = -1,
  2424. result = Array(set.size);
  2425. set.forEach(function(value) {
  2426. result[++index] = [value, value];
  2427. });
  2428. return result;
  2429. }
  2430. /**
  2431. * A specialized version of `_.indexOf` which performs strict equality
  2432. * comparisons of values, i.e. `===`.
  2433. *
  2434. * @private
  2435. * @param {Array} array The array to inspect.
  2436. * @param {*} value The value to search for.
  2437. * @param {number} fromIndex The index to search from.
  2438. * @returns {number} Returns the index of the matched value, else `-1`.
  2439. */
  2440. function strictIndexOf(array, value, fromIndex) {
  2441. var index = fromIndex - 1,
  2442. length = array.length;
  2443. while (++index < length) {
  2444. if (array[index] === value) {
  2445. return index;
  2446. }
  2447. }
  2448. return -1;
  2449. }
  2450. /**
  2451. * A specialized version of `_.lastIndexOf` which performs strict equality
  2452. * comparisons of values, i.e. `===`.
  2453. *
  2454. * @private
  2455. * @param {Array} array The array to inspect.
  2456. * @param {*} value The value to search for.
  2457. * @param {number} fromIndex The index to search from.
  2458. * @returns {number} Returns the index of the matched value, else `-1`.
  2459. */
  2460. function strictLastIndexOf(array, value, fromIndex) {
  2461. var index = fromIndex + 1;
  2462. while (index--) {
  2463. if (array[index] === value) {
  2464. return index;
  2465. }
  2466. }
  2467. return index;
  2468. }
  2469. /**
  2470. * Gets the number of symbols in `string`.
  2471. *
  2472. * @private
  2473. * @param {string} string The string to inspect.
  2474. * @returns {number} Returns the string size.
  2475. */
  2476. function stringSize(string) {
  2477. return hasUnicode(string)
  2478. ? unicodeSize(string)
  2479. : asciiSize(string);
  2480. }
  2481. /**
  2482. * Converts `string` to an array.
  2483. *
  2484. * @private
  2485. * @param {string} string The string to convert.
  2486. * @returns {Array} Returns the converted array.
  2487. */
  2488. function stringToArray(string) {
  2489. return hasUnicode(string)
  2490. ? unicodeToArray(string)
  2491. : asciiToArray(string);
  2492. }
  2493. /**
  2494. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2495. * character of `string`.
  2496. *
  2497. * @private
  2498. * @param {string} string The string to inspect.
  2499. * @returns {number} Returns the index of the last non-whitespace character.
  2500. */
  2501. function trimmedEndIndex(string) {
  2502. var index = string.length;
  2503. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2504. return index;
  2505. }
  2506. /**
  2507. * Used by `_.unescape` to convert HTML entities to characters.
  2508. *
  2509. * @private
  2510. * @param {string} chr The matched character to unescape.
  2511. * @returns {string} Returns the unescaped character.
  2512. */
  2513. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2514. /**
  2515. * Gets the size of a Unicode `string`.
  2516. *
  2517. * @private
  2518. * @param {string} string The string inspect.
  2519. * @returns {number} Returns the string size.
  2520. */
  2521. function unicodeSize(string) {
  2522. var result = reUnicode.lastIndex = 0;
  2523. while (reUnicode.test(string)) {
  2524. ++result;
  2525. }
  2526. return result;
  2527. }
  2528. /**
  2529. * Converts a Unicode `string` to an array.
  2530. *
  2531. * @private
  2532. * @param {string} string The string to convert.
  2533. * @returns {Array} Returns the converted array.
  2534. */
  2535. function unicodeToArray(string) {
  2536. return string.match(reUnicode) || [];
  2537. }
  2538. /**
  2539. * Splits a Unicode `string` into an array of its words.
  2540. *
  2541. * @private
  2542. * @param {string} The string to inspect.
  2543. * @returns {Array} Returns the words of `string`.
  2544. */
  2545. function unicodeWords(string) {
  2546. return string.match(reUnicodeWord) || [];
  2547. }
  2548. /*--------------------------------------------------------------------------*/
  2549. /**
  2550. * Create a new pristine `lodash` function using the `context` object.
  2551. *
  2552. * @static
  2553. * @memberOf _
  2554. * @since 1.1.0
  2555. * @category Util
  2556. * @param {Object} [context=root] The context object.
  2557. * @returns {Function} Returns a new `lodash` function.
  2558. * @example
  2559. *
  2560. * _.mixin({ 'foo': _.constant('foo') });
  2561. *
  2562. * var lodash = _.runInContext();
  2563. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2564. *
  2565. * _.isFunction(_.foo);
  2566. * // => true
  2567. * _.isFunction(_.bar);
  2568. * // => false
  2569. *
  2570. * lodash.isFunction(lodash.foo);
  2571. * // => false
  2572. * lodash.isFunction(lodash.bar);
  2573. * // => true
  2574. *
  2575. * // Create a suped-up `defer` in Node.js.
  2576. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2577. */
  2578. var runInContext = (function runInContext(context) {
  2579. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2580. /** Built-in constructor references. */
  2581. var Array = context.Array,
  2582. Date = context.Date,
  2583. Error = context.Error,
  2584. Function = context.Function,
  2585. Math = context.Math,
  2586. Object = context.Object,
  2587. RegExp = context.RegExp,
  2588. String = context.String,
  2589. TypeError = context.TypeError;
  2590. /** Used for built-in method references. */
  2591. var arrayProto = Array.prototype,
  2592. funcProto = Function.prototype,
  2593. objectProto = Object.prototype;
  2594. /** Used to detect overreaching core-js shims. */
  2595. var coreJsData = context['__core-js_shared__'];
  2596. /** Used to resolve the decompiled source of functions. */
  2597. var funcToString = funcProto.toString;
  2598. /** Used to check objects for own properties. */
  2599. var hasOwnProperty = objectProto.hasOwnProperty;
  2600. /** Used to generate unique IDs. */
  2601. var idCounter = 0;
  2602. /** Used to detect methods masquerading as native. */
  2603. var maskSrcKey = (function() {
  2604. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2605. return uid ? ('Symbol(src)_1.' + uid) : '';
  2606. }());
  2607. /**
  2608. * Used to resolve the
  2609. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2610. * of values.
  2611. */
  2612. var nativeObjectToString = objectProto.toString;
  2613. /** Used to infer the `Object` constructor. */
  2614. var objectCtorString = funcToString.call(Object);
  2615. /** Used to restore the original `_` reference in `_.noConflict`. */
  2616. var oldDash = root._;
  2617. /** Used to detect if a method is native. */
  2618. var reIsNative = RegExp('^' +
  2619. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2620. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2621. );
  2622. /** Built-in value references. */
  2623. var Buffer = moduleExports ? context.Buffer : undefined,
  2624. Symbol = context.Symbol,
  2625. Uint8Array = context.Uint8Array,
  2626. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2627. getPrototype = overArg(Object.getPrototypeOf, Object),
  2628. objectCreate = Object.create,
  2629. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2630. splice = arrayProto.splice,
  2631. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2632. symIterator = Symbol ? Symbol.iterator : undefined,
  2633. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2634. var defineProperty = (function() {
  2635. try {
  2636. var func = getNative(Object, 'defineProperty');
  2637. func({}, '', {});
  2638. return func;
  2639. } catch (e) {}
  2640. }());
  2641. /** Mocked built-ins. */
  2642. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2643. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2644. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2645. /* Built-in method references for those with the same name as other `lodash` methods. */
  2646. var nativeCeil = Math.ceil,
  2647. nativeFloor = Math.floor,
  2648. nativeGetSymbols = Object.getOwnPropertySymbols,
  2649. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2650. nativeIsFinite = context.isFinite,
  2651. nativeJoin = arrayProto.join,
  2652. nativeKeys = overArg(Object.keys, Object),
  2653. nativeMax = Math.max,
  2654. nativeMin = Math.min,
  2655. nativeNow = Date.now,
  2656. nativeParseInt = context.parseInt,
  2657. nativeRandom = Math.random,
  2658. nativeReverse = arrayProto.reverse;
  2659. /* Built-in method references that are verified to be native. */
  2660. var DataView = getNative(context, 'DataView'),
  2661. Map = getNative(context, 'Map'),
  2662. Promise = getNative(context, 'Promise'),
  2663. Set = getNative(context, 'Set'),
  2664. WeakMap = getNative(context, 'WeakMap'),
  2665. nativeCreate = getNative(Object, 'create');
  2666. /** Used to store function metadata. */
  2667. var metaMap = WeakMap && new WeakMap;
  2668. /** Used to lookup unminified function names. */
  2669. var realNames = {};
  2670. /** Used to detect maps, sets, and weakmaps. */
  2671. var dataViewCtorString = toSource(DataView),
  2672. mapCtorString = toSource(Map),
  2673. promiseCtorString = toSource(Promise),
  2674. setCtorString = toSource(Set),
  2675. weakMapCtorString = toSource(WeakMap);
  2676. /** Used to convert symbols to primitives and strings. */
  2677. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2678. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2679. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2680. /*------------------------------------------------------------------------*/
  2681. /**
  2682. * Creates a `lodash` object which wraps `value` to enable implicit method
  2683. * chain sequences. Methods that operate on and return arrays, collections,
  2684. * and functions can be chained together. Methods that retrieve a single value
  2685. * or may return a primitive value will automatically end the chain sequence
  2686. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2687. * with `_#value`.
  2688. *
  2689. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2690. * enabled using `_.chain`.
  2691. *
  2692. * The execution of chained methods is lazy, that is, it's deferred until
  2693. * `_#value` is implicitly or explicitly called.
  2694. *
  2695. * Lazy evaluation allows several methods to support shortcut fusion.
  2696. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2697. * the creation of intermediate arrays and can greatly reduce the number of
  2698. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2699. * fusion if the section is applied to an array and iteratees accept only
  2700. * one argument. The heuristic for whether a section qualifies for shortcut
  2701. * fusion is subject to change.
  2702. *
  2703. * Chaining is supported in custom builds as long as the `_#value` method is
  2704. * directly or indirectly included in the build.
  2705. *
  2706. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2707. *
  2708. * The wrapper `Array` methods are:
  2709. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2710. *
  2711. * The wrapper `String` methods are:
  2712. * `replace` and `split`
  2713. *
  2714. * The wrapper methods that support shortcut fusion are:
  2715. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2716. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2717. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2718. *
  2719. * The chainable wrapper methods are:
  2720. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2721. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2722. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2723. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2724. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2725. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2726. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2727. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2728. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2729. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2730. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2731. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2732. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2733. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2734. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2735. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2736. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2737. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2738. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2739. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2740. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2741. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2742. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2743. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2744. *
  2745. * The wrapper methods that are **not** chainable by default are:
  2746. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2747. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2748. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2749. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2750. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2751. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2752. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2753. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2754. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2755. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2756. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2757. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2758. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2759. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2760. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2761. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2762. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2763. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2764. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2765. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2766. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2767. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2768. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2769. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2770. * `upperFirst`, `value`, and `words`
  2771. *
  2772. * @name _
  2773. * @constructor
  2774. * @category Seq
  2775. * @param {*} value The value to wrap in a `lodash` instance.
  2776. * @returns {Object} Returns the new `lodash` wrapper instance.
  2777. * @example
  2778. *
  2779. * function square(n) {
  2780. * return n * n;
  2781. * }
  2782. *
  2783. * var wrapped = _([1, 2, 3]);
  2784. *
  2785. * // Returns an unwrapped value.
  2786. * wrapped.reduce(_.add);
  2787. * // => 6
  2788. *
  2789. * // Returns a wrapped value.
  2790. * var squares = wrapped.map(square);
  2791. *
  2792. * _.isArray(squares);
  2793. * // => false
  2794. *
  2795. * _.isArray(squares.value());
  2796. * // => true
  2797. */
  2798. function lodash(value) {
  2799. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2800. if (value instanceof LodashWrapper) {
  2801. return value;
  2802. }
  2803. if (hasOwnProperty.call(value, '__wrapped__')) {
  2804. return wrapperClone(value);
  2805. }
  2806. }
  2807. return new LodashWrapper(value);
  2808. }
  2809. /**
  2810. * The base implementation of `_.create` without support for assigning
  2811. * properties to the created object.
  2812. *
  2813. * @private
  2814. * @param {Object} proto The object to inherit from.
  2815. * @returns {Object} Returns the new object.
  2816. */
  2817. var baseCreate = (function() {
  2818. function object() {}
  2819. return function(proto) {
  2820. if (!isObject(proto)) {
  2821. return {};
  2822. }
  2823. if (objectCreate) {
  2824. return objectCreate(proto);
  2825. }
  2826. object.prototype = proto;
  2827. var result = new object;
  2828. object.prototype = undefined;
  2829. return result;
  2830. };
  2831. }());
  2832. /**
  2833. * The function whose prototype chain sequence wrappers inherit from.
  2834. *
  2835. * @private
  2836. */
  2837. function baseLodash() {
  2838. // No operation performed.
  2839. }
  2840. /**
  2841. * The base constructor for creating `lodash` wrapper objects.
  2842. *
  2843. * @private
  2844. * @param {*} value The value to wrap.
  2845. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2846. */
  2847. function LodashWrapper(value, chainAll) {
  2848. this.__wrapped__ = value;
  2849. this.__actions__ = [];
  2850. this.__chain__ = !!chainAll;
  2851. this.__index__ = 0;
  2852. this.__values__ = undefined;
  2853. }
  2854. /**
  2855. * By default, the template delimiters used by lodash are like those in
  2856. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2857. * following template settings to use alternative delimiters.
  2858. *
  2859. * @static
  2860. * @memberOf _
  2861. * @type {Object}
  2862. */
  2863. lodash.templateSettings = {
  2864. /**
  2865. * Used to detect `data` property values to be HTML-escaped.
  2866. *
  2867. * @memberOf _.templateSettings
  2868. * @type {RegExp}
  2869. */
  2870. 'escape': reEscape,
  2871. /**
  2872. * Used to detect code to be evaluated.
  2873. *
  2874. * @memberOf _.templateSettings
  2875. * @type {RegExp}
  2876. */
  2877. 'evaluate': reEvaluate,
  2878. /**
  2879. * Used to detect `data` property values to inject.
  2880. *
  2881. * @memberOf _.templateSettings
  2882. * @type {RegExp}
  2883. */
  2884. 'interpolate': reInterpolate,
  2885. /**
  2886. * Used to reference the data object in the template text.
  2887. *
  2888. * @memberOf _.templateSettings
  2889. * @type {string}
  2890. */
  2891. 'variable': '',
  2892. /**
  2893. * Used to import variables into the compiled template.
  2894. *
  2895. * @memberOf _.templateSettings
  2896. * @type {Object}
  2897. */
  2898. 'imports': {
  2899. /**
  2900. * A reference to the `lodash` function.
  2901. *
  2902. * @memberOf _.templateSettings.imports
  2903. * @type {Function}
  2904. */
  2905. '_': lodash
  2906. }
  2907. };
  2908. // Ensure wrappers are instances of `baseLodash`.
  2909. lodash.prototype = baseLodash.prototype;
  2910. lodash.prototype.constructor = lodash;
  2911. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2912. LodashWrapper.prototype.constructor = LodashWrapper;
  2913. /*------------------------------------------------------------------------*/
  2914. /**
  2915. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2916. *
  2917. * @private
  2918. * @constructor
  2919. * @param {*} value The value to wrap.
  2920. */
  2921. function LazyWrapper(value) {
  2922. this.__wrapped__ = value;
  2923. this.__actions__ = [];
  2924. this.__dir__ = 1;
  2925. this.__filtered__ = false;
  2926. this.__iteratees__ = [];
  2927. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2928. this.__views__ = [];
  2929. }
  2930. /**
  2931. * Creates a clone of the lazy wrapper object.
  2932. *
  2933. * @private
  2934. * @name clone
  2935. * @memberOf LazyWrapper
  2936. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2937. */
  2938. function lazyClone() {
  2939. var result = new LazyWrapper(this.__wrapped__);
  2940. result.__actions__ = copyArray(this.__actions__);
  2941. result.__dir__ = this.__dir__;
  2942. result.__filtered__ = this.__filtered__;
  2943. result.__iteratees__ = copyArray(this.__iteratees__);
  2944. result.__takeCount__ = this.__takeCount__;
  2945. result.__views__ = copyArray(this.__views__);
  2946. return result;
  2947. }
  2948. /**
  2949. * Reverses the direction of lazy iteration.
  2950. *
  2951. * @private
  2952. * @name reverse
  2953. * @memberOf LazyWrapper
  2954. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2955. */
  2956. function lazyReverse() {
  2957. if (this.__filtered__) {
  2958. var result = new LazyWrapper(this);
  2959. result.__dir__ = -1;
  2960. result.__filtered__ = true;
  2961. } else {
  2962. result = this.clone();
  2963. result.__dir__ *= -1;
  2964. }
  2965. return result;
  2966. }
  2967. /**
  2968. * Extracts the unwrapped value from its lazy wrapper.
  2969. *
  2970. * @private
  2971. * @name value
  2972. * @memberOf LazyWrapper
  2973. * @returns {*} Returns the unwrapped value.
  2974. */
  2975. function lazyValue() {
  2976. var array = this.__wrapped__.value(),
  2977. dir = this.__dir__,
  2978. isArr = isArray(array),
  2979. isRight = dir < 0,
  2980. arrLength = isArr ? array.length : 0,
  2981. view = getView(0, arrLength, this.__views__),
  2982. start = view.start,
  2983. end = view.end,
  2984. length = end - start,
  2985. index = isRight ? end : (start - 1),
  2986. iteratees = this.__iteratees__,
  2987. iterLength = iteratees.length,
  2988. resIndex = 0,
  2989. takeCount = nativeMin(length, this.__takeCount__);
  2990. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2991. return baseWrapperValue(array, this.__actions__);
  2992. }
  2993. var result = [];
  2994. outer:
  2995. while (length-- && resIndex < takeCount) {
  2996. index += dir;
  2997. var iterIndex = -1,
  2998. value = array[index];
  2999. while (++iterIndex < iterLength) {
  3000. var data = iteratees[iterIndex],
  3001. iteratee = data.iteratee,
  3002. type = data.type,
  3003. computed = iteratee(value);
  3004. if (type == LAZY_MAP_FLAG) {
  3005. value = computed;
  3006. } else if (!computed) {
  3007. if (type == LAZY_FILTER_FLAG) {
  3008. continue outer;
  3009. } else {
  3010. break outer;
  3011. }
  3012. }
  3013. }
  3014. result[resIndex++] = value;
  3015. }
  3016. return result;
  3017. }
  3018. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3019. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3020. LazyWrapper.prototype.constructor = LazyWrapper;
  3021. /*------------------------------------------------------------------------*/
  3022. /**
  3023. * Creates a hash object.
  3024. *
  3025. * @private
  3026. * @constructor
  3027. * @param {Array} [entries] The key-value pairs to cache.
  3028. */
  3029. function Hash(entries) {
  3030. var index = -1,
  3031. length = entries == null ? 0 : entries.length;
  3032. this.clear();
  3033. while (++index < length) {
  3034. var entry = entries[index];
  3035. this.set(entry[0], entry[1]);
  3036. }
  3037. }
  3038. /**
  3039. * Removes all key-value entries from the hash.
  3040. *
  3041. * @private
  3042. * @name clear
  3043. * @memberOf Hash
  3044. */
  3045. function hashClear() {
  3046. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3047. this.size = 0;
  3048. }
  3049. /**
  3050. * Removes `key` and its value from the hash.
  3051. *
  3052. * @private
  3053. * @name delete
  3054. * @memberOf Hash
  3055. * @param {Object} hash The hash to modify.
  3056. * @param {string} key The key of the value to remove.
  3057. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3058. */
  3059. function hashDelete(key) {
  3060. var result = this.has(key) && delete this.__data__[key];
  3061. this.size -= result ? 1 : 0;
  3062. return result;
  3063. }
  3064. /**
  3065. * Gets the hash value for `key`.
  3066. *
  3067. * @private
  3068. * @name get
  3069. * @memberOf Hash
  3070. * @param {string} key The key of the value to get.
  3071. * @returns {*} Returns the entry value.
  3072. */
  3073. function hashGet(key) {
  3074. var data = this.__data__;
  3075. if (nativeCreate) {
  3076. var result = data[key];
  3077. return result === HASH_UNDEFINED ? undefined : result;
  3078. }
  3079. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3080. }
  3081. /**
  3082. * Checks if a hash value for `key` exists.
  3083. *
  3084. * @private
  3085. * @name has
  3086. * @memberOf Hash
  3087. * @param {string} key The key of the entry to check.
  3088. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3089. */
  3090. function hashHas(key) {
  3091. var data = this.__data__;
  3092. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3093. }
  3094. /**
  3095. * Sets the hash `key` to `value`.
  3096. *
  3097. * @private
  3098. * @name set
  3099. * @memberOf Hash
  3100. * @param {string} key The key of the value to set.
  3101. * @param {*} value The value to set.
  3102. * @returns {Object} Returns the hash instance.
  3103. */
  3104. function hashSet(key, value) {
  3105. var data = this.__data__;
  3106. this.size += this.has(key) ? 0 : 1;
  3107. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3108. return this;
  3109. }
  3110. // Add methods to `Hash`.
  3111. Hash.prototype.clear = hashClear;
  3112. Hash.prototype['delete'] = hashDelete;
  3113. Hash.prototype.get = hashGet;
  3114. Hash.prototype.has = hashHas;
  3115. Hash.prototype.set = hashSet;
  3116. /*------------------------------------------------------------------------*/
  3117. /**
  3118. * Creates an list cache object.
  3119. *
  3120. * @private
  3121. * @constructor
  3122. * @param {Array} [entries] The key-value pairs to cache.
  3123. */
  3124. function ListCache(entries) {
  3125. var index = -1,
  3126. length = entries == null ? 0 : entries.length;
  3127. this.clear();
  3128. while (++index < length) {
  3129. var entry = entries[index];
  3130. this.set(entry[0], entry[1]);
  3131. }
  3132. }
  3133. /**
  3134. * Removes all key-value entries from the list cache.
  3135. *
  3136. * @private
  3137. * @name clear
  3138. * @memberOf ListCache
  3139. */
  3140. function listCacheClear() {
  3141. this.__data__ = [];
  3142. this.size = 0;
  3143. }
  3144. /**
  3145. * Removes `key` and its value from the list cache.
  3146. *
  3147. * @private
  3148. * @name delete
  3149. * @memberOf ListCache
  3150. * @param {string} key The key of the value to remove.
  3151. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3152. */
  3153. function listCacheDelete(key) {
  3154. var data = this.__data__,
  3155. index = assocIndexOf(data, key);
  3156. if (index < 0) {
  3157. return false;
  3158. }
  3159. var lastIndex = data.length - 1;
  3160. if (index == lastIndex) {
  3161. data.pop();
  3162. } else {
  3163. splice.call(data, index, 1);
  3164. }
  3165. --this.size;
  3166. return true;
  3167. }
  3168. /**
  3169. * Gets the list cache value for `key`.
  3170. *
  3171. * @private
  3172. * @name get
  3173. * @memberOf ListCache
  3174. * @param {string} key The key of the value to get.
  3175. * @returns {*} Returns the entry value.
  3176. */
  3177. function listCacheGet(key) {
  3178. var data = this.__data__,
  3179. index = assocIndexOf(data, key);
  3180. return index < 0 ? undefined : data[index][1];
  3181. }
  3182. /**
  3183. * Checks if a list cache value for `key` exists.
  3184. *
  3185. * @private
  3186. * @name has
  3187. * @memberOf ListCache
  3188. * @param {string} key The key of the entry to check.
  3189. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3190. */
  3191. function listCacheHas(key) {
  3192. return assocIndexOf(this.__data__, key) > -1;
  3193. }
  3194. /**
  3195. * Sets the list cache `key` to `value`.
  3196. *
  3197. * @private
  3198. * @name set
  3199. * @memberOf ListCache
  3200. * @param {string} key The key of the value to set.
  3201. * @param {*} value The value to set.
  3202. * @returns {Object} Returns the list cache instance.
  3203. */
  3204. function listCacheSet(key, value) {
  3205. var data = this.__data__,
  3206. index = assocIndexOf(data, key);
  3207. if (index < 0) {
  3208. ++this.size;
  3209. data.push([key, value]);
  3210. } else {
  3211. data[index][1] = value;
  3212. }
  3213. return this;
  3214. }
  3215. // Add methods to `ListCache`.
  3216. ListCache.prototype.clear = listCacheClear;
  3217. ListCache.prototype['delete'] = listCacheDelete;
  3218. ListCache.prototype.get = listCacheGet;
  3219. ListCache.prototype.has = listCacheHas;
  3220. ListCache.prototype.set = listCacheSet;
  3221. /*------------------------------------------------------------------------*/
  3222. /**
  3223. * Creates a map cache object to store key-value pairs.
  3224. *
  3225. * @private
  3226. * @constructor
  3227. * @param {Array} [entries] The key-value pairs to cache.
  3228. */
  3229. function MapCache(entries) {
  3230. var index = -1,
  3231. length = entries == null ? 0 : entries.length;
  3232. this.clear();
  3233. while (++index < length) {
  3234. var entry = entries[index];
  3235. this.set(entry[0], entry[1]);
  3236. }
  3237. }
  3238. /**
  3239. * Removes all key-value entries from the map.
  3240. *
  3241. * @private
  3242. * @name clear
  3243. * @memberOf MapCache
  3244. */
  3245. function mapCacheClear() {
  3246. this.size = 0;
  3247. this.__data__ = {
  3248. 'hash': new Hash,
  3249. 'map': new (Map || ListCache),
  3250. 'string': new Hash
  3251. };
  3252. }
  3253. /**
  3254. * Removes `key` and its value from the map.
  3255. *
  3256. * @private
  3257. * @name delete
  3258. * @memberOf MapCache
  3259. * @param {string} key The key of the value to remove.
  3260. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3261. */
  3262. function mapCacheDelete(key) {
  3263. var result = getMapData(this, key)['delete'](key);
  3264. this.size -= result ? 1 : 0;
  3265. return result;
  3266. }
  3267. /**
  3268. * Gets the map value for `key`.
  3269. *
  3270. * @private
  3271. * @name get
  3272. * @memberOf MapCache
  3273. * @param {string} key The key of the value to get.
  3274. * @returns {*} Returns the entry value.
  3275. */
  3276. function mapCacheGet(key) {
  3277. return getMapData(this, key).get(key);
  3278. }
  3279. /**
  3280. * Checks if a map value for `key` exists.
  3281. *
  3282. * @private
  3283. * @name has
  3284. * @memberOf MapCache
  3285. * @param {string} key The key of the entry to check.
  3286. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3287. */
  3288. function mapCacheHas(key) {
  3289. return getMapData(this, key).has(key);
  3290. }
  3291. /**
  3292. * Sets the map `key` to `value`.
  3293. *
  3294. * @private
  3295. * @name set
  3296. * @memberOf MapCache
  3297. * @param {string} key The key of the value to set.
  3298. * @param {*} value The value to set.
  3299. * @returns {Object} Returns the map cache instance.
  3300. */
  3301. function mapCacheSet(key, value) {
  3302. var data = getMapData(this, key),
  3303. size = data.size;
  3304. data.set(key, value);
  3305. this.size += data.size == size ? 0 : 1;
  3306. return this;
  3307. }
  3308. // Add methods to `MapCache`.
  3309. MapCache.prototype.clear = mapCacheClear;
  3310. MapCache.prototype['delete'] = mapCacheDelete;
  3311. MapCache.prototype.get = mapCacheGet;
  3312. MapCache.prototype.has = mapCacheHas;
  3313. MapCache.prototype.set = mapCacheSet;
  3314. /*------------------------------------------------------------------------*/
  3315. /**
  3316. *
  3317. * Creates an array cache object to store unique values.
  3318. *
  3319. * @private
  3320. * @constructor
  3321. * @param {Array} [values] The values to cache.
  3322. */
  3323. function SetCache(values) {
  3324. var index = -1,
  3325. length = values == null ? 0 : values.length;
  3326. this.__data__ = new MapCache;
  3327. while (++index < length) {
  3328. this.add(values[index]);
  3329. }
  3330. }
  3331. /**
  3332. * Adds `value` to the array cache.
  3333. *
  3334. * @private
  3335. * @name add
  3336. * @memberOf SetCache
  3337. * @alias push
  3338. * @param {*} value The value to cache.
  3339. * @returns {Object} Returns the cache instance.
  3340. */
  3341. function setCacheAdd(value) {
  3342. this.__data__.set(value, HASH_UNDEFINED);
  3343. return this;
  3344. }
  3345. /**
  3346. * Checks if `value` is in the array cache.
  3347. *
  3348. * @private
  3349. * @name has
  3350. * @memberOf SetCache
  3351. * @param {*} value The value to search for.
  3352. * @returns {number} Returns `true` if `value` is found, else `false`.
  3353. */
  3354. function setCacheHas(value) {
  3355. return this.__data__.has(value);
  3356. }
  3357. // Add methods to `SetCache`.
  3358. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3359. SetCache.prototype.has = setCacheHas;
  3360. /*------------------------------------------------------------------------*/
  3361. /**
  3362. * Creates a stack cache object to store key-value pairs.
  3363. *
  3364. * @private
  3365. * @constructor
  3366. * @param {Array} [entries] The key-value pairs to cache.
  3367. */
  3368. function Stack(entries) {
  3369. var data = this.__data__ = new ListCache(entries);
  3370. this.size = data.size;
  3371. }
  3372. /**
  3373. * Removes all key-value entries from the stack.
  3374. *
  3375. * @private
  3376. * @name clear
  3377. * @memberOf Stack
  3378. */
  3379. function stackClear() {
  3380. this.__data__ = new ListCache;
  3381. this.size = 0;
  3382. }
  3383. /**
  3384. * Removes `key` and its value from the stack.
  3385. *
  3386. * @private
  3387. * @name delete
  3388. * @memberOf Stack
  3389. * @param {string} key The key of the value to remove.
  3390. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3391. */
  3392. function stackDelete(key) {
  3393. var data = this.__data__,
  3394. result = data['delete'](key);
  3395. this.size = data.size;
  3396. return result;
  3397. }
  3398. /**
  3399. * Gets the stack value for `key`.
  3400. *
  3401. * @private
  3402. * @name get
  3403. * @memberOf Stack
  3404. * @param {string} key The key of the value to get.
  3405. * @returns {*} Returns the entry value.
  3406. */
  3407. function stackGet(key) {
  3408. return this.__data__.get(key);
  3409. }
  3410. /**
  3411. * Checks if a stack value for `key` exists.
  3412. *
  3413. * @private
  3414. * @name has
  3415. * @memberOf Stack
  3416. * @param {string} key The key of the entry to check.
  3417. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3418. */
  3419. function stackHas(key) {
  3420. return this.__data__.has(key);
  3421. }
  3422. /**
  3423. * Sets the stack `key` to `value`.
  3424. *
  3425. * @private
  3426. * @name set
  3427. * @memberOf Stack
  3428. * @param {string} key The key of the value to set.
  3429. * @param {*} value The value to set.
  3430. * @returns {Object} Returns the stack cache instance.
  3431. */
  3432. function stackSet(key, value) {
  3433. var data = this.__data__;
  3434. if (data instanceof ListCache) {
  3435. var pairs = data.__data__;
  3436. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3437. pairs.push([key, value]);
  3438. this.size = ++data.size;
  3439. return this;
  3440. }
  3441. data = this.__data__ = new MapCache(pairs);
  3442. }
  3443. data.set(key, value);
  3444. this.size = data.size;
  3445. return this;
  3446. }
  3447. // Add methods to `Stack`.
  3448. Stack.prototype.clear = stackClear;
  3449. Stack.prototype['delete'] = stackDelete;
  3450. Stack.prototype.get = stackGet;
  3451. Stack.prototype.has = stackHas;
  3452. Stack.prototype.set = stackSet;
  3453. /*------------------------------------------------------------------------*/
  3454. /**
  3455. * Creates an array of the enumerable property names of the array-like `value`.
  3456. *
  3457. * @private
  3458. * @param {*} value The value to query.
  3459. * @param {boolean} inherited Specify returning inherited property names.
  3460. * @returns {Array} Returns the array of property names.
  3461. */
  3462. function arrayLikeKeys(value, inherited) {
  3463. var isArr = isArray(value),
  3464. isArg = !isArr && isArguments(value),
  3465. isBuff = !isArr && !isArg && isBuffer(value),
  3466. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3467. skipIndexes = isArr || isArg || isBuff || isType,
  3468. result = skipIndexes ? baseTimes(value.length, String) : [],
  3469. length = result.length;
  3470. for (var key in value) {
  3471. if ((inherited || hasOwnProperty.call(value, key)) &&
  3472. !(skipIndexes && (
  3473. // Safari 9 has enumerable `arguments.length` in strict mode.
  3474. key == 'length' ||
  3475. // Node.js 0.10 has enumerable non-index properties on buffers.
  3476. (isBuff && (key == 'offset' || key == 'parent')) ||
  3477. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3478. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3479. // Skip index properties.
  3480. isIndex(key, length)
  3481. ))) {
  3482. result.push(key);
  3483. }
  3484. }
  3485. return result;
  3486. }
  3487. /**
  3488. * A specialized version of `_.sample` for arrays.
  3489. *
  3490. * @private
  3491. * @param {Array} array The array to sample.
  3492. * @returns {*} Returns the random element.
  3493. */
  3494. function arraySample(array) {
  3495. var length = array.length;
  3496. return length ? array[baseRandom(0, length - 1)] : undefined;
  3497. }
  3498. /**
  3499. * A specialized version of `_.sampleSize` for arrays.
  3500. *
  3501. * @private
  3502. * @param {Array} array The array to sample.
  3503. * @param {number} n The number of elements to sample.
  3504. * @returns {Array} Returns the random elements.
  3505. */
  3506. function arraySampleSize(array, n) {
  3507. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3508. }
  3509. /**
  3510. * A specialized version of `_.shuffle` for arrays.
  3511. *
  3512. * @private
  3513. * @param {Array} array The array to shuffle.
  3514. * @returns {Array} Returns the new shuffled array.
  3515. */
  3516. function arrayShuffle(array) {
  3517. return shuffleSelf(copyArray(array));
  3518. }
  3519. /**
  3520. * This function is like `assignValue` except that it doesn't assign
  3521. * `undefined` values.
  3522. *
  3523. * @private
  3524. * @param {Object} object The object to modify.
  3525. * @param {string} key The key of the property to assign.
  3526. * @param {*} value The value to assign.
  3527. */
  3528. function assignMergeValue(object, key, value) {
  3529. if ((value !== undefined && !eq(object[key], value)) ||
  3530. (value === undefined && !(key in object))) {
  3531. baseAssignValue(object, key, value);
  3532. }
  3533. }
  3534. /**
  3535. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3536. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3537. * for equality comparisons.
  3538. *
  3539. * @private
  3540. * @param {Object} object The object to modify.
  3541. * @param {string} key The key of the property to assign.
  3542. * @param {*} value The value to assign.
  3543. */
  3544. function assignValue(object, key, value) {
  3545. var objValue = object[key];
  3546. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3547. (value === undefined && !(key in object))) {
  3548. baseAssignValue(object, key, value);
  3549. }
  3550. }
  3551. /**
  3552. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3553. *
  3554. * @private
  3555. * @param {Array} array The array to inspect.
  3556. * @param {*} key The key to search for.
  3557. * @returns {number} Returns the index of the matched value, else `-1`.
  3558. */
  3559. function assocIndexOf(array, key) {
  3560. var length = array.length;
  3561. while (length--) {
  3562. if (eq(array[length][0], key)) {
  3563. return length;
  3564. }
  3565. }
  3566. return -1;
  3567. }
  3568. /**
  3569. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3570. * by `iteratee` and values set by `setter`.
  3571. *
  3572. * @private
  3573. * @param {Array|Object} collection The collection to iterate over.
  3574. * @param {Function} setter The function to set `accumulator` values.
  3575. * @param {Function} iteratee The iteratee to transform keys.
  3576. * @param {Object} accumulator The initial aggregated object.
  3577. * @returns {Function} Returns `accumulator`.
  3578. */
  3579. function baseAggregator(collection, setter, iteratee, accumulator) {
  3580. baseEach(collection, function(value, key, collection) {
  3581. setter(accumulator, value, iteratee(value), collection);
  3582. });
  3583. return accumulator;
  3584. }
  3585. /**
  3586. * The base implementation of `_.assign` without support for multiple sources
  3587. * or `customizer` functions.
  3588. *
  3589. * @private
  3590. * @param {Object} object The destination object.
  3591. * @param {Object} source The source object.
  3592. * @returns {Object} Returns `object`.
  3593. */
  3594. function baseAssign(object, source) {
  3595. return object && copyObject(source, keys(source), object);
  3596. }
  3597. /**
  3598. * The base implementation of `_.assignIn` without support for multiple sources
  3599. * or `customizer` functions.
  3600. *
  3601. * @private
  3602. * @param {Object} object The destination object.
  3603. * @param {Object} source The source object.
  3604. * @returns {Object} Returns `object`.
  3605. */
  3606. function baseAssignIn(object, source) {
  3607. return object && copyObject(source, keysIn(source), object);
  3608. }
  3609. /**
  3610. * The base implementation of `assignValue` and `assignMergeValue` without
  3611. * value checks.
  3612. *
  3613. * @private
  3614. * @param {Object} object The object to modify.
  3615. * @param {string} key The key of the property to assign.
  3616. * @param {*} value The value to assign.
  3617. */
  3618. function baseAssignValue(object, key, value) {
  3619. if (key == '__proto__' && defineProperty) {
  3620. defineProperty(object, key, {
  3621. 'configurable': true,
  3622. 'enumerable': true,
  3623. 'value': value,
  3624. 'writable': true
  3625. });
  3626. } else {
  3627. object[key] = value;
  3628. }
  3629. }
  3630. /**
  3631. * The base implementation of `_.at` without support for individual paths.
  3632. *
  3633. * @private
  3634. * @param {Object} object The object to iterate over.
  3635. * @param {string[]} paths The property paths to pick.
  3636. * @returns {Array} Returns the picked elements.
  3637. */
  3638. function baseAt(object, paths) {
  3639. var index = -1,
  3640. length = paths.length,
  3641. result = Array(length),
  3642. skip = object == null;
  3643. while (++index < length) {
  3644. result[index] = skip ? undefined : get(object, paths[index]);
  3645. }
  3646. return result;
  3647. }
  3648. /**
  3649. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3650. *
  3651. * @private
  3652. * @param {number} number The number to clamp.
  3653. * @param {number} [lower] The lower bound.
  3654. * @param {number} upper The upper bound.
  3655. * @returns {number} Returns the clamped number.
  3656. */
  3657. function baseClamp(number, lower, upper) {
  3658. if (number === number) {
  3659. if (upper !== undefined) {
  3660. number = number <= upper ? number : upper;
  3661. }
  3662. if (lower !== undefined) {
  3663. number = number >= lower ? number : lower;
  3664. }
  3665. }
  3666. return number;
  3667. }
  3668. /**
  3669. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3670. * traversed objects.
  3671. *
  3672. * @private
  3673. * @param {*} value The value to clone.
  3674. * @param {boolean} bitmask The bitmask flags.
  3675. * 1 - Deep clone
  3676. * 2 - Flatten inherited properties
  3677. * 4 - Clone symbols
  3678. * @param {Function} [customizer] The function to customize cloning.
  3679. * @param {string} [key] The key of `value`.
  3680. * @param {Object} [object] The parent object of `value`.
  3681. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3682. * @returns {*} Returns the cloned value.
  3683. */
  3684. function baseClone(value, bitmask, customizer, key, object, stack) {
  3685. var result,
  3686. isDeep = bitmask & CLONE_DEEP_FLAG,
  3687. isFlat = bitmask & CLONE_FLAT_FLAG,
  3688. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3689. if (customizer) {
  3690. result = object ? customizer(value, key, object, stack) : customizer(value);
  3691. }
  3692. if (result !== undefined) {
  3693. return result;
  3694. }
  3695. if (!isObject(value)) {
  3696. return value;
  3697. }
  3698. var isArr = isArray(value);
  3699. if (isArr) {
  3700. result = initCloneArray(value);
  3701. if (!isDeep) {
  3702. return copyArray(value, result);
  3703. }
  3704. } else {
  3705. var tag = getTag(value),
  3706. isFunc = tag == funcTag || tag == genTag;
  3707. if (isBuffer(value)) {
  3708. return cloneBuffer(value, isDeep);
  3709. }
  3710. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3711. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3712. if (!isDeep) {
  3713. return isFlat
  3714. ? copySymbolsIn(value, baseAssignIn(result, value))
  3715. : copySymbols(value, baseAssign(result, value));
  3716. }
  3717. } else {
  3718. if (!cloneableTags[tag]) {
  3719. return object ? value : {};
  3720. }
  3721. result = initCloneByTag(value, tag, isDeep);
  3722. }
  3723. }
  3724. // Check for circular references and return its corresponding clone.
  3725. stack || (stack = new Stack);
  3726. var stacked = stack.get(value);
  3727. if (stacked) {
  3728. return stacked;
  3729. }
  3730. stack.set(value, result);
  3731. if (isSet(value)) {
  3732. value.forEach(function(subValue) {
  3733. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3734. });
  3735. } else if (isMap(value)) {
  3736. value.forEach(function(subValue, key) {
  3737. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3738. });
  3739. }
  3740. var keysFunc = isFull
  3741. ? (isFlat ? getAllKeysIn : getAllKeys)
  3742. : (isFlat ? keysIn : keys);
  3743. var props = isArr ? undefined : keysFunc(value);
  3744. arrayEach(props || value, function(subValue, key) {
  3745. if (props) {
  3746. key = subValue;
  3747. subValue = value[key];
  3748. }
  3749. // Recursively populate clone (susceptible to call stack limits).
  3750. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3751. });
  3752. return result;
  3753. }
  3754. /**
  3755. * The base implementation of `_.conforms` which doesn't clone `source`.
  3756. *
  3757. * @private
  3758. * @param {Object} source The object of property predicates to conform to.
  3759. * @returns {Function} Returns the new spec function.
  3760. */
  3761. function baseConforms(source) {
  3762. var props = keys(source);
  3763. return function(object) {
  3764. return baseConformsTo(object, source, props);
  3765. };
  3766. }
  3767. /**
  3768. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3769. *
  3770. * @private
  3771. * @param {Object} object The object to inspect.
  3772. * @param {Object} source The object of property predicates to conform to.
  3773. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3774. */
  3775. function baseConformsTo(object, source, props) {
  3776. var length = props.length;
  3777. if (object == null) {
  3778. return !length;
  3779. }
  3780. object = Object(object);
  3781. while (length--) {
  3782. var key = props[length],
  3783. predicate = source[key],
  3784. value = object[key];
  3785. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3786. return false;
  3787. }
  3788. }
  3789. return true;
  3790. }
  3791. /**
  3792. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3793. * to provide to `func`.
  3794. *
  3795. * @private
  3796. * @param {Function} func The function to delay.
  3797. * @param {number} wait The number of milliseconds to delay invocation.
  3798. * @param {Array} args The arguments to provide to `func`.
  3799. * @returns {number|Object} Returns the timer id or timeout object.
  3800. */
  3801. function baseDelay(func, wait, args) {
  3802. if (typeof func != 'function') {
  3803. throw new TypeError(FUNC_ERROR_TEXT);
  3804. }
  3805. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3806. }
  3807. /**
  3808. * The base implementation of methods like `_.difference` without support
  3809. * for excluding multiple arrays or iteratee shorthands.
  3810. *
  3811. * @private
  3812. * @param {Array} array The array to inspect.
  3813. * @param {Array} values The values to exclude.
  3814. * @param {Function} [iteratee] The iteratee invoked per element.
  3815. * @param {Function} [comparator] The comparator invoked per element.
  3816. * @returns {Array} Returns the new array of filtered values.
  3817. */
  3818. function baseDifference(array, values, iteratee, comparator) {
  3819. var index = -1,
  3820. includes = arrayIncludes,
  3821. isCommon = true,
  3822. length = array.length,
  3823. result = [],
  3824. valuesLength = values.length;
  3825. if (!length) {
  3826. return result;
  3827. }
  3828. if (iteratee) {
  3829. values = arrayMap(values, baseUnary(iteratee));
  3830. }
  3831. if (comparator) {
  3832. includes = arrayIncludesWith;
  3833. isCommon = false;
  3834. }
  3835. else if (values.length >= LARGE_ARRAY_SIZE) {
  3836. includes = cacheHas;
  3837. isCommon = false;
  3838. values = new SetCache(values);
  3839. }
  3840. outer:
  3841. while (++index < length) {
  3842. var value = array[index],
  3843. computed = iteratee == null ? value : iteratee(value);
  3844. value = (comparator || value !== 0) ? value : 0;
  3845. if (isCommon && computed === computed) {
  3846. var valuesIndex = valuesLength;
  3847. while (valuesIndex--) {
  3848. if (values[valuesIndex] === computed) {
  3849. continue outer;
  3850. }
  3851. }
  3852. result.push(value);
  3853. }
  3854. else if (!includes(values, computed, comparator)) {
  3855. result.push(value);
  3856. }
  3857. }
  3858. return result;
  3859. }
  3860. /**
  3861. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3862. *
  3863. * @private
  3864. * @param {Array|Object} collection The collection to iterate over.
  3865. * @param {Function} iteratee The function invoked per iteration.
  3866. * @returns {Array|Object} Returns `collection`.
  3867. */
  3868. var baseEach = createBaseEach(baseForOwn);
  3869. /**
  3870. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3871. *
  3872. * @private
  3873. * @param {Array|Object} collection The collection to iterate over.
  3874. * @param {Function} iteratee The function invoked per iteration.
  3875. * @returns {Array|Object} Returns `collection`.
  3876. */
  3877. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3878. /**
  3879. * The base implementation of `_.every` without support for iteratee shorthands.
  3880. *
  3881. * @private
  3882. * @param {Array|Object} collection The collection to iterate over.
  3883. * @param {Function} predicate The function invoked per iteration.
  3884. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3885. * else `false`
  3886. */
  3887. function baseEvery(collection, predicate) {
  3888. var result = true;
  3889. baseEach(collection, function(value, index, collection) {
  3890. result = !!predicate(value, index, collection);
  3891. return result;
  3892. });
  3893. return result;
  3894. }
  3895. /**
  3896. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3897. * `comparator` to determine the extremum value.
  3898. *
  3899. * @private
  3900. * @param {Array} array The array to iterate over.
  3901. * @param {Function} iteratee The iteratee invoked per iteration.
  3902. * @param {Function} comparator The comparator used to compare values.
  3903. * @returns {*} Returns the extremum value.
  3904. */
  3905. function baseExtremum(array, iteratee, comparator) {
  3906. var index = -1,
  3907. length = array.length;
  3908. while (++index < length) {
  3909. var value = array[index],
  3910. current = iteratee(value);
  3911. if (current != null && (computed === undefined
  3912. ? (current === current && !isSymbol(current))
  3913. : comparator(current, computed)
  3914. )) {
  3915. var computed = current,
  3916. result = value;
  3917. }
  3918. }
  3919. return result;
  3920. }
  3921. /**
  3922. * The base implementation of `_.fill` without an iteratee call guard.
  3923. *
  3924. * @private
  3925. * @param {Array} array The array to fill.
  3926. * @param {*} value The value to fill `array` with.
  3927. * @param {number} [start=0] The start position.
  3928. * @param {number} [end=array.length] The end position.
  3929. * @returns {Array} Returns `array`.
  3930. */
  3931. function baseFill(array, value, start, end) {
  3932. var length = array.length;
  3933. start = toInteger(start);
  3934. if (start < 0) {
  3935. start = -start > length ? 0 : (length + start);
  3936. }
  3937. end = (end === undefined || end > length) ? length : toInteger(end);
  3938. if (end < 0) {
  3939. end += length;
  3940. }
  3941. end = start > end ? 0 : toLength(end);
  3942. while (start < end) {
  3943. array[start++] = value;
  3944. }
  3945. return array;
  3946. }
  3947. /**
  3948. * The base implementation of `_.filter` without support for iteratee shorthands.
  3949. *
  3950. * @private
  3951. * @param {Array|Object} collection The collection to iterate over.
  3952. * @param {Function} predicate The function invoked per iteration.
  3953. * @returns {Array} Returns the new filtered array.
  3954. */
  3955. function baseFilter(collection, predicate) {
  3956. var result = [];
  3957. baseEach(collection, function(value, index, collection) {
  3958. if (predicate(value, index, collection)) {
  3959. result.push(value);
  3960. }
  3961. });
  3962. return result;
  3963. }
  3964. /**
  3965. * The base implementation of `_.flatten` with support for restricting flattening.
  3966. *
  3967. * @private
  3968. * @param {Array} array The array to flatten.
  3969. * @param {number} depth The maximum recursion depth.
  3970. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3971. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3972. * @param {Array} [result=[]] The initial result value.
  3973. * @returns {Array} Returns the new flattened array.
  3974. */
  3975. function baseFlatten(array, depth, predicate, isStrict, result) {
  3976. var index = -1,
  3977. length = array.length;
  3978. predicate || (predicate = isFlattenable);
  3979. result || (result = []);
  3980. while (++index < length) {
  3981. var value = array[index];
  3982. if (depth > 0 && predicate(value)) {
  3983. if (depth > 1) {
  3984. // Recursively flatten arrays (susceptible to call stack limits).
  3985. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3986. } else {
  3987. arrayPush(result, value);
  3988. }
  3989. } else if (!isStrict) {
  3990. result[result.length] = value;
  3991. }
  3992. }
  3993. return result;
  3994. }
  3995. /**
  3996. * The base implementation of `baseForOwn` which iterates over `object`
  3997. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3998. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3999. *
  4000. * @private
  4001. * @param {Object} object The object to iterate over.
  4002. * @param {Function} iteratee The function invoked per iteration.
  4003. * @param {Function} keysFunc The function to get the keys of `object`.
  4004. * @returns {Object} Returns `object`.
  4005. */
  4006. var baseFor = createBaseFor();
  4007. /**
  4008. * This function is like `baseFor` except that it iterates over properties
  4009. * in the opposite order.
  4010. *
  4011. * @private
  4012. * @param {Object} object The object to iterate over.
  4013. * @param {Function} iteratee The function invoked per iteration.
  4014. * @param {Function} keysFunc The function to get the keys of `object`.
  4015. * @returns {Object} Returns `object`.
  4016. */
  4017. var baseForRight = createBaseFor(true);
  4018. /**
  4019. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4020. *
  4021. * @private
  4022. * @param {Object} object The object to iterate over.
  4023. * @param {Function} iteratee The function invoked per iteration.
  4024. * @returns {Object} Returns `object`.
  4025. */
  4026. function baseForOwn(object, iteratee) {
  4027. return object && baseFor(object, iteratee, keys);
  4028. }
  4029. /**
  4030. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4031. *
  4032. * @private
  4033. * @param {Object} object The object to iterate over.
  4034. * @param {Function} iteratee The function invoked per iteration.
  4035. * @returns {Object} Returns `object`.
  4036. */
  4037. function baseForOwnRight(object, iteratee) {
  4038. return object && baseForRight(object, iteratee, keys);
  4039. }
  4040. /**
  4041. * The base implementation of `_.functions` which creates an array of
  4042. * `object` function property names filtered from `props`.
  4043. *
  4044. * @private
  4045. * @param {Object} object The object to inspect.
  4046. * @param {Array} props The property names to filter.
  4047. * @returns {Array} Returns the function names.
  4048. */
  4049. function baseFunctions(object, props) {
  4050. return arrayFilter(props, function(key) {
  4051. return isFunction(object[key]);
  4052. });
  4053. }
  4054. /**
  4055. * The base implementation of `_.get` without support for default values.
  4056. *
  4057. * @private
  4058. * @param {Object} object The object to query.
  4059. * @param {Array|string} path The path of the property to get.
  4060. * @returns {*} Returns the resolved value.
  4061. */
  4062. function baseGet(object, path) {
  4063. path = castPath(path, object);
  4064. var index = 0,
  4065. length = path.length;
  4066. while (object != null && index < length) {
  4067. object = object[toKey(path[index++])];
  4068. }
  4069. return (index && index == length) ? object : undefined;
  4070. }
  4071. /**
  4072. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4073. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4074. * symbols of `object`.
  4075. *
  4076. * @private
  4077. * @param {Object} object The object to query.
  4078. * @param {Function} keysFunc The function to get the keys of `object`.
  4079. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4080. * @returns {Array} Returns the array of property names and symbols.
  4081. */
  4082. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4083. var result = keysFunc(object);
  4084. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4085. }
  4086. /**
  4087. * The base implementation of `getTag` without fallbacks for buggy environments.
  4088. *
  4089. * @private
  4090. * @param {*} value The value to query.
  4091. * @returns {string} Returns the `toStringTag`.
  4092. */
  4093. function baseGetTag(value) {
  4094. if (value == null) {
  4095. return value === undefined ? undefinedTag : nullTag;
  4096. }
  4097. return (symToStringTag && symToStringTag in Object(value))
  4098. ? getRawTag(value)
  4099. : objectToString(value);
  4100. }
  4101. /**
  4102. * The base implementation of `_.gt` which doesn't coerce arguments.
  4103. *
  4104. * @private
  4105. * @param {*} value The value to compare.
  4106. * @param {*} other The other value to compare.
  4107. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4108. * else `false`.
  4109. */
  4110. function baseGt(value, other) {
  4111. return value > other;
  4112. }
  4113. /**
  4114. * The base implementation of `_.has` without support for deep paths.
  4115. *
  4116. * @private
  4117. * @param {Object} [object] The object to query.
  4118. * @param {Array|string} key The key to check.
  4119. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4120. */
  4121. function baseHas(object, key) {
  4122. return object != null && hasOwnProperty.call(object, key);
  4123. }
  4124. /**
  4125. * The base implementation of `_.hasIn` without support for deep paths.
  4126. *
  4127. * @private
  4128. * @param {Object} [object] The object to query.
  4129. * @param {Array|string} key The key to check.
  4130. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4131. */
  4132. function baseHasIn(object, key) {
  4133. return object != null && key in Object(object);
  4134. }
  4135. /**
  4136. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4137. *
  4138. * @private
  4139. * @param {number} number The number to check.
  4140. * @param {number} start The start of the range.
  4141. * @param {number} end The end of the range.
  4142. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4143. */
  4144. function baseInRange(number, start, end) {
  4145. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4146. }
  4147. /**
  4148. * The base implementation of methods like `_.intersection`, without support
  4149. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4150. *
  4151. * @private
  4152. * @param {Array} arrays The arrays to inspect.
  4153. * @param {Function} [iteratee] The iteratee invoked per element.
  4154. * @param {Function} [comparator] The comparator invoked per element.
  4155. * @returns {Array} Returns the new array of shared values.
  4156. */
  4157. function baseIntersection(arrays, iteratee, comparator) {
  4158. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4159. length = arrays[0].length,
  4160. othLength = arrays.length,
  4161. othIndex = othLength,
  4162. caches = Array(othLength),
  4163. maxLength = Infinity,
  4164. result = [];
  4165. while (othIndex--) {
  4166. var array = arrays[othIndex];
  4167. if (othIndex && iteratee) {
  4168. array = arrayMap(array, baseUnary(iteratee));
  4169. }
  4170. maxLength = nativeMin(array.length, maxLength);
  4171. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4172. ? new SetCache(othIndex && array)
  4173. : undefined;
  4174. }
  4175. array = arrays[0];
  4176. var index = -1,
  4177. seen = caches[0];
  4178. outer:
  4179. while (++index < length && result.length < maxLength) {
  4180. var value = array[index],
  4181. computed = iteratee ? iteratee(value) : value;
  4182. value = (comparator || value !== 0) ? value : 0;
  4183. if (!(seen
  4184. ? cacheHas(seen, computed)
  4185. : includes(result, computed, comparator)
  4186. )) {
  4187. othIndex = othLength;
  4188. while (--othIndex) {
  4189. var cache = caches[othIndex];
  4190. if (!(cache
  4191. ? cacheHas(cache, computed)
  4192. : includes(arrays[othIndex], computed, comparator))
  4193. ) {
  4194. continue outer;
  4195. }
  4196. }
  4197. if (seen) {
  4198. seen.push(computed);
  4199. }
  4200. result.push(value);
  4201. }
  4202. }
  4203. return result;
  4204. }
  4205. /**
  4206. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4207. * `object` with values transformed by `iteratee` and set by `setter`.
  4208. *
  4209. * @private
  4210. * @param {Object} object The object to iterate over.
  4211. * @param {Function} setter The function to set `accumulator` values.
  4212. * @param {Function} iteratee The iteratee to transform values.
  4213. * @param {Object} accumulator The initial inverted object.
  4214. * @returns {Function} Returns `accumulator`.
  4215. */
  4216. function baseInverter(object, setter, iteratee, accumulator) {
  4217. baseForOwn(object, function(value, key, object) {
  4218. setter(accumulator, iteratee(value), key, object);
  4219. });
  4220. return accumulator;
  4221. }
  4222. /**
  4223. * The base implementation of `_.invoke` without support for individual
  4224. * method arguments.
  4225. *
  4226. * @private
  4227. * @param {Object} object The object to query.
  4228. * @param {Array|string} path The path of the method to invoke.
  4229. * @param {Array} args The arguments to invoke the method with.
  4230. * @returns {*} Returns the result of the invoked method.
  4231. */
  4232. function baseInvoke(object, path, args) {
  4233. path = castPath(path, object);
  4234. object = parent(object, path);
  4235. var func = object == null ? object : object[toKey(last(path))];
  4236. return func == null ? undefined : apply(func, object, args);
  4237. }
  4238. /**
  4239. * The base implementation of `_.isArguments`.
  4240. *
  4241. * @private
  4242. * @param {*} value The value to check.
  4243. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4244. */
  4245. function baseIsArguments(value) {
  4246. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4247. }
  4248. /**
  4249. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4250. *
  4251. * @private
  4252. * @param {*} value The value to check.
  4253. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4254. */
  4255. function baseIsArrayBuffer(value) {
  4256. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4257. }
  4258. /**
  4259. * The base implementation of `_.isDate` without Node.js optimizations.
  4260. *
  4261. * @private
  4262. * @param {*} value The value to check.
  4263. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4264. */
  4265. function baseIsDate(value) {
  4266. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4267. }
  4268. /**
  4269. * The base implementation of `_.isEqual` which supports partial comparisons
  4270. * and tracks traversed objects.
  4271. *
  4272. * @private
  4273. * @param {*} value The value to compare.
  4274. * @param {*} other The other value to compare.
  4275. * @param {boolean} bitmask The bitmask flags.
  4276. * 1 - Unordered comparison
  4277. * 2 - Partial comparison
  4278. * @param {Function} [customizer] The function to customize comparisons.
  4279. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4280. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4281. */
  4282. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4283. if (value === other) {
  4284. return true;
  4285. }
  4286. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4287. return value !== value && other !== other;
  4288. }
  4289. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4290. }
  4291. /**
  4292. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4293. * deep comparisons and tracks traversed objects enabling objects with circular
  4294. * references to be compared.
  4295. *
  4296. * @private
  4297. * @param {Object} object The object to compare.
  4298. * @param {Object} other The other object to compare.
  4299. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4300. * @param {Function} customizer The function to customize comparisons.
  4301. * @param {Function} equalFunc The function to determine equivalents of values.
  4302. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4303. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4304. */
  4305. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4306. var objIsArr = isArray(object),
  4307. othIsArr = isArray(other),
  4308. objTag = objIsArr ? arrayTag : getTag(object),
  4309. othTag = othIsArr ? arrayTag : getTag(other);
  4310. objTag = objTag == argsTag ? objectTag : objTag;
  4311. othTag = othTag == argsTag ? objectTag : othTag;
  4312. var objIsObj = objTag == objectTag,
  4313. othIsObj = othTag == objectTag,
  4314. isSameTag = objTag == othTag;
  4315. if (isSameTag && isBuffer(object)) {
  4316. if (!isBuffer(other)) {
  4317. return false;
  4318. }
  4319. objIsArr = true;
  4320. objIsObj = false;
  4321. }
  4322. if (isSameTag && !objIsObj) {
  4323. stack || (stack = new Stack);
  4324. return (objIsArr || isTypedArray(object))
  4325. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4326. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4327. }
  4328. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4329. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4330. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4331. if (objIsWrapped || othIsWrapped) {
  4332. var objUnwrapped = objIsWrapped ? object.value() : object,
  4333. othUnwrapped = othIsWrapped ? other.value() : other;
  4334. stack || (stack = new Stack);
  4335. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4336. }
  4337. }
  4338. if (!isSameTag) {
  4339. return false;
  4340. }
  4341. stack || (stack = new Stack);
  4342. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4343. }
  4344. /**
  4345. * The base implementation of `_.isMap` without Node.js optimizations.
  4346. *
  4347. * @private
  4348. * @param {*} value The value to check.
  4349. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4350. */
  4351. function baseIsMap(value) {
  4352. return isObjectLike(value) && getTag(value) == mapTag;
  4353. }
  4354. /**
  4355. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4356. *
  4357. * @private
  4358. * @param {Object} object The object to inspect.
  4359. * @param {Object} source The object of property values to match.
  4360. * @param {Array} matchData The property names, values, and compare flags to match.
  4361. * @param {Function} [customizer] The function to customize comparisons.
  4362. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4363. */
  4364. function baseIsMatch(object, source, matchData, customizer) {
  4365. var index = matchData.length,
  4366. length = index,
  4367. noCustomizer = !customizer;
  4368. if (object == null) {
  4369. return !length;
  4370. }
  4371. object = Object(object);
  4372. while (index--) {
  4373. var data = matchData[index];
  4374. if ((noCustomizer && data[2])
  4375. ? data[1] !== object[data[0]]
  4376. : !(data[0] in object)
  4377. ) {
  4378. return false;
  4379. }
  4380. }
  4381. while (++index < length) {
  4382. data = matchData[index];
  4383. var key = data[0],
  4384. objValue = object[key],
  4385. srcValue = data[1];
  4386. if (noCustomizer && data[2]) {
  4387. if (objValue === undefined && !(key in object)) {
  4388. return false;
  4389. }
  4390. } else {
  4391. var stack = new Stack;
  4392. if (customizer) {
  4393. var result = customizer(objValue, srcValue, key, object, source, stack);
  4394. }
  4395. if (!(result === undefined
  4396. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4397. : result
  4398. )) {
  4399. return false;
  4400. }
  4401. }
  4402. }
  4403. return true;
  4404. }
  4405. /**
  4406. * The base implementation of `_.isNative` without bad shim checks.
  4407. *
  4408. * @private
  4409. * @param {*} value The value to check.
  4410. * @returns {boolean} Returns `true` if `value` is a native function,
  4411. * else `false`.
  4412. */
  4413. function baseIsNative(value) {
  4414. if (!isObject(value) || isMasked(value)) {
  4415. return false;
  4416. }
  4417. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4418. return pattern.test(toSource(value));
  4419. }
  4420. /**
  4421. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4422. *
  4423. * @private
  4424. * @param {*} value The value to check.
  4425. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4426. */
  4427. function baseIsRegExp(value) {
  4428. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4429. }
  4430. /**
  4431. * The base implementation of `_.isSet` without Node.js optimizations.
  4432. *
  4433. * @private
  4434. * @param {*} value The value to check.
  4435. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4436. */
  4437. function baseIsSet(value) {
  4438. return isObjectLike(value) && getTag(value) == setTag;
  4439. }
  4440. /**
  4441. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4442. *
  4443. * @private
  4444. * @param {*} value The value to check.
  4445. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4446. */
  4447. function baseIsTypedArray(value) {
  4448. return isObjectLike(value) &&
  4449. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4450. }
  4451. /**
  4452. * The base implementation of `_.iteratee`.
  4453. *
  4454. * @private
  4455. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4456. * @returns {Function} Returns the iteratee.
  4457. */
  4458. function baseIteratee(value) {
  4459. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4460. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4461. if (typeof value == 'function') {
  4462. return value;
  4463. }
  4464. if (value == null) {
  4465. return identity;
  4466. }
  4467. if (typeof value == 'object') {
  4468. return isArray(value)
  4469. ? baseMatchesProperty(value[0], value[1])
  4470. : baseMatches(value);
  4471. }
  4472. return property(value);
  4473. }
  4474. /**
  4475. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4476. *
  4477. * @private
  4478. * @param {Object} object The object to query.
  4479. * @returns {Array} Returns the array of property names.
  4480. */
  4481. function baseKeys(object) {
  4482. if (!isPrototype(object)) {
  4483. return nativeKeys(object);
  4484. }
  4485. var result = [];
  4486. for (var key in Object(object)) {
  4487. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4488. result.push(key);
  4489. }
  4490. }
  4491. return result;
  4492. }
  4493. /**
  4494. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4495. *
  4496. * @private
  4497. * @param {Object} object The object to query.
  4498. * @returns {Array} Returns the array of property names.
  4499. */
  4500. function baseKeysIn(object) {
  4501. if (!isObject(object)) {
  4502. return nativeKeysIn(object);
  4503. }
  4504. var isProto = isPrototype(object),
  4505. result = [];
  4506. for (var key in object) {
  4507. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4508. result.push(key);
  4509. }
  4510. }
  4511. return result;
  4512. }
  4513. /**
  4514. * The base implementation of `_.lt` which doesn't coerce arguments.
  4515. *
  4516. * @private
  4517. * @param {*} value The value to compare.
  4518. * @param {*} other The other value to compare.
  4519. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4520. * else `false`.
  4521. */
  4522. function baseLt(value, other) {
  4523. return value < other;
  4524. }
  4525. /**
  4526. * The base implementation of `_.map` without support for iteratee shorthands.
  4527. *
  4528. * @private
  4529. * @param {Array|Object} collection The collection to iterate over.
  4530. * @param {Function} iteratee The function invoked per iteration.
  4531. * @returns {Array} Returns the new mapped array.
  4532. */
  4533. function baseMap(collection, iteratee) {
  4534. var index = -1,
  4535. result = isArrayLike(collection) ? Array(collection.length) : [];
  4536. baseEach(collection, function(value, key, collection) {
  4537. result[++index] = iteratee(value, key, collection);
  4538. });
  4539. return result;
  4540. }
  4541. /**
  4542. * The base implementation of `_.matches` which doesn't clone `source`.
  4543. *
  4544. * @private
  4545. * @param {Object} source The object of property values to match.
  4546. * @returns {Function} Returns the new spec function.
  4547. */
  4548. function baseMatches(source) {
  4549. var matchData = getMatchData(source);
  4550. if (matchData.length == 1 && matchData[0][2]) {
  4551. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4552. }
  4553. return function(object) {
  4554. return object === source || baseIsMatch(object, source, matchData);
  4555. };
  4556. }
  4557. /**
  4558. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4559. *
  4560. * @private
  4561. * @param {string} path The path of the property to get.
  4562. * @param {*} srcValue The value to match.
  4563. * @returns {Function} Returns the new spec function.
  4564. */
  4565. function baseMatchesProperty(path, srcValue) {
  4566. if (isKey(path) && isStrictComparable(srcValue)) {
  4567. return matchesStrictComparable(toKey(path), srcValue);
  4568. }
  4569. return function(object) {
  4570. var objValue = get(object, path);
  4571. return (objValue === undefined && objValue === srcValue)
  4572. ? hasIn(object, path)
  4573. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4574. };
  4575. }
  4576. /**
  4577. * The base implementation of `_.merge` without support for multiple sources.
  4578. *
  4579. * @private
  4580. * @param {Object} object The destination object.
  4581. * @param {Object} source The source object.
  4582. * @param {number} srcIndex The index of `source`.
  4583. * @param {Function} [customizer] The function to customize merged values.
  4584. * @param {Object} [stack] Tracks traversed source values and their merged
  4585. * counterparts.
  4586. */
  4587. function baseMerge(object, source, srcIndex, customizer, stack) {
  4588. if (object === source) {
  4589. return;
  4590. }
  4591. baseFor(source, function(srcValue, key) {
  4592. stack || (stack = new Stack);
  4593. if (isObject(srcValue)) {
  4594. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4595. }
  4596. else {
  4597. var newValue = customizer
  4598. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4599. : undefined;
  4600. if (newValue === undefined) {
  4601. newValue = srcValue;
  4602. }
  4603. assignMergeValue(object, key, newValue);
  4604. }
  4605. }, keysIn);
  4606. }
  4607. /**
  4608. * A specialized version of `baseMerge` for arrays and objects which performs
  4609. * deep merges and tracks traversed objects enabling objects with circular
  4610. * references to be merged.
  4611. *
  4612. * @private
  4613. * @param {Object} object The destination object.
  4614. * @param {Object} source The source object.
  4615. * @param {string} key The key of the value to merge.
  4616. * @param {number} srcIndex The index of `source`.
  4617. * @param {Function} mergeFunc The function to merge values.
  4618. * @param {Function} [customizer] The function to customize assigned values.
  4619. * @param {Object} [stack] Tracks traversed source values and their merged
  4620. * counterparts.
  4621. */
  4622. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4623. var objValue = safeGet(object, key),
  4624. srcValue = safeGet(source, key),
  4625. stacked = stack.get(srcValue);
  4626. if (stacked) {
  4627. assignMergeValue(object, key, stacked);
  4628. return;
  4629. }
  4630. var newValue = customizer
  4631. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4632. : undefined;
  4633. var isCommon = newValue === undefined;
  4634. if (isCommon) {
  4635. var isArr = isArray(srcValue),
  4636. isBuff = !isArr && isBuffer(srcValue),
  4637. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4638. newValue = srcValue;
  4639. if (isArr || isBuff || isTyped) {
  4640. if (isArray(objValue)) {
  4641. newValue = objValue;
  4642. }
  4643. else if (isArrayLikeObject(objValue)) {
  4644. newValue = copyArray(objValue);
  4645. }
  4646. else if (isBuff) {
  4647. isCommon = false;
  4648. newValue = cloneBuffer(srcValue, true);
  4649. }
  4650. else if (isTyped) {
  4651. isCommon = false;
  4652. newValue = cloneTypedArray(srcValue, true);
  4653. }
  4654. else {
  4655. newValue = [];
  4656. }
  4657. }
  4658. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4659. newValue = objValue;
  4660. if (isArguments(objValue)) {
  4661. newValue = toPlainObject(objValue);
  4662. }
  4663. else if (!isObject(objValue) || isFunction(objValue)) {
  4664. newValue = initCloneObject(srcValue);
  4665. }
  4666. }
  4667. else {
  4668. isCommon = false;
  4669. }
  4670. }
  4671. if (isCommon) {
  4672. // Recursively merge objects and arrays (susceptible to call stack limits).
  4673. stack.set(srcValue, newValue);
  4674. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4675. stack['delete'](srcValue);
  4676. }
  4677. assignMergeValue(object, key, newValue);
  4678. }
  4679. /**
  4680. * The base implementation of `_.nth` which doesn't coerce arguments.
  4681. *
  4682. * @private
  4683. * @param {Array} array The array to query.
  4684. * @param {number} n The index of the element to return.
  4685. * @returns {*} Returns the nth element of `array`.
  4686. */
  4687. function baseNth(array, n) {
  4688. var length = array.length;
  4689. if (!length) {
  4690. return;
  4691. }
  4692. n += n < 0 ? length : 0;
  4693. return isIndex(n, length) ? array[n] : undefined;
  4694. }
  4695. /**
  4696. * The base implementation of `_.orderBy` without param guards.
  4697. *
  4698. * @private
  4699. * @param {Array|Object} collection The collection to iterate over.
  4700. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4701. * @param {string[]} orders The sort orders of `iteratees`.
  4702. * @returns {Array} Returns the new sorted array.
  4703. */
  4704. function baseOrderBy(collection, iteratees, orders) {
  4705. if (iteratees.length) {
  4706. iteratees = arrayMap(iteratees, function(iteratee) {
  4707. if (isArray(iteratee)) {
  4708. return function(value) {
  4709. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4710. }
  4711. }
  4712. return iteratee;
  4713. });
  4714. } else {
  4715. iteratees = [identity];
  4716. }
  4717. var index = -1;
  4718. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4719. var result = baseMap(collection, function(value, key, collection) {
  4720. var criteria = arrayMap(iteratees, function(iteratee) {
  4721. return iteratee(value);
  4722. });
  4723. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4724. });
  4725. return baseSortBy(result, function(object, other) {
  4726. return compareMultiple(object, other, orders);
  4727. });
  4728. }
  4729. /**
  4730. * The base implementation of `_.pick` without support for individual
  4731. * property identifiers.
  4732. *
  4733. * @private
  4734. * @param {Object} object The source object.
  4735. * @param {string[]} paths The property paths to pick.
  4736. * @returns {Object} Returns the new object.
  4737. */
  4738. function basePick(object, paths) {
  4739. return basePickBy(object, paths, function(value, path) {
  4740. return hasIn(object, path);
  4741. });
  4742. }
  4743. /**
  4744. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4745. *
  4746. * @private
  4747. * @param {Object} object The source object.
  4748. * @param {string[]} paths The property paths to pick.
  4749. * @param {Function} predicate The function invoked per property.
  4750. * @returns {Object} Returns the new object.
  4751. */
  4752. function basePickBy(object, paths, predicate) {
  4753. var index = -1,
  4754. length = paths.length,
  4755. result = {};
  4756. while (++index < length) {
  4757. var path = paths[index],
  4758. value = baseGet(object, path);
  4759. if (predicate(value, path)) {
  4760. baseSet(result, castPath(path, object), value);
  4761. }
  4762. }
  4763. return result;
  4764. }
  4765. /**
  4766. * A specialized version of `baseProperty` which supports deep paths.
  4767. *
  4768. * @private
  4769. * @param {Array|string} path The path of the property to get.
  4770. * @returns {Function} Returns the new accessor function.
  4771. */
  4772. function basePropertyDeep(path) {
  4773. return function(object) {
  4774. return baseGet(object, path);
  4775. };
  4776. }
  4777. /**
  4778. * The base implementation of `_.pullAllBy` without support for iteratee
  4779. * shorthands.
  4780. *
  4781. * @private
  4782. * @param {Array} array The array to modify.
  4783. * @param {Array} values The values to remove.
  4784. * @param {Function} [iteratee] The iteratee invoked per element.
  4785. * @param {Function} [comparator] The comparator invoked per element.
  4786. * @returns {Array} Returns `array`.
  4787. */
  4788. function basePullAll(array, values, iteratee, comparator) {
  4789. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4790. index = -1,
  4791. length = values.length,
  4792. seen = array;
  4793. if (array === values) {
  4794. values = copyArray(values);
  4795. }
  4796. if (iteratee) {
  4797. seen = arrayMap(array, baseUnary(iteratee));
  4798. }
  4799. while (++index < length) {
  4800. var fromIndex = 0,
  4801. value = values[index],
  4802. computed = iteratee ? iteratee(value) : value;
  4803. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4804. if (seen !== array) {
  4805. splice.call(seen, fromIndex, 1);
  4806. }
  4807. splice.call(array, fromIndex, 1);
  4808. }
  4809. }
  4810. return array;
  4811. }
  4812. /**
  4813. * The base implementation of `_.pullAt` without support for individual
  4814. * indexes or capturing the removed elements.
  4815. *
  4816. * @private
  4817. * @param {Array} array The array to modify.
  4818. * @param {number[]} indexes The indexes of elements to remove.
  4819. * @returns {Array} Returns `array`.
  4820. */
  4821. function basePullAt(array, indexes) {
  4822. var length = array ? indexes.length : 0,
  4823. lastIndex = length - 1;
  4824. while (length--) {
  4825. var index = indexes[length];
  4826. if (length == lastIndex || index !== previous) {
  4827. var previous = index;
  4828. if (isIndex(index)) {
  4829. splice.call(array, index, 1);
  4830. } else {
  4831. baseUnset(array, index);
  4832. }
  4833. }
  4834. }
  4835. return array;
  4836. }
  4837. /**
  4838. * The base implementation of `_.random` without support for returning
  4839. * floating-point numbers.
  4840. *
  4841. * @private
  4842. * @param {number} lower The lower bound.
  4843. * @param {number} upper The upper bound.
  4844. * @returns {number} Returns the random number.
  4845. */
  4846. function baseRandom(lower, upper) {
  4847. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4848. }
  4849. /**
  4850. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4851. * coerce arguments.
  4852. *
  4853. * @private
  4854. * @param {number} start The start of the range.
  4855. * @param {number} end The end of the range.
  4856. * @param {number} step The value to increment or decrement by.
  4857. * @param {boolean} [fromRight] Specify iterating from right to left.
  4858. * @returns {Array} Returns the range of numbers.
  4859. */
  4860. function baseRange(start, end, step, fromRight) {
  4861. var index = -1,
  4862. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4863. result = Array(length);
  4864. while (length--) {
  4865. result[fromRight ? length : ++index] = start;
  4866. start += step;
  4867. }
  4868. return result;
  4869. }
  4870. /**
  4871. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4872. *
  4873. * @private
  4874. * @param {string} string The string to repeat.
  4875. * @param {number} n The number of times to repeat the string.
  4876. * @returns {string} Returns the repeated string.
  4877. */
  4878. function baseRepeat(string, n) {
  4879. var result = '';
  4880. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4881. return result;
  4882. }
  4883. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4884. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4885. do {
  4886. if (n % 2) {
  4887. result += string;
  4888. }
  4889. n = nativeFloor(n / 2);
  4890. if (n) {
  4891. string += string;
  4892. }
  4893. } while (n);
  4894. return result;
  4895. }
  4896. /**
  4897. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4898. *
  4899. * @private
  4900. * @param {Function} func The function to apply a rest parameter to.
  4901. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4902. * @returns {Function} Returns the new function.
  4903. */
  4904. function baseRest(func, start) {
  4905. return setToString(overRest(func, start, identity), func + '');
  4906. }
  4907. /**
  4908. * The base implementation of `_.sample`.
  4909. *
  4910. * @private
  4911. * @param {Array|Object} collection The collection to sample.
  4912. * @returns {*} Returns the random element.
  4913. */
  4914. function baseSample(collection) {
  4915. return arraySample(values(collection));
  4916. }
  4917. /**
  4918. * The base implementation of `_.sampleSize` without param guards.
  4919. *
  4920. * @private
  4921. * @param {Array|Object} collection The collection to sample.
  4922. * @param {number} n The number of elements to sample.
  4923. * @returns {Array} Returns the random elements.
  4924. */
  4925. function baseSampleSize(collection, n) {
  4926. var array = values(collection);
  4927. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4928. }
  4929. /**
  4930. * The base implementation of `_.set`.
  4931. *
  4932. * @private
  4933. * @param {Object} object The object to modify.
  4934. * @param {Array|string} path The path of the property to set.
  4935. * @param {*} value The value to set.
  4936. * @param {Function} [customizer] The function to customize path creation.
  4937. * @returns {Object} Returns `object`.
  4938. */
  4939. function baseSet(object, path, value, customizer) {
  4940. if (!isObject(object)) {
  4941. return object;
  4942. }
  4943. path = castPath(path, object);
  4944. var index = -1,
  4945. length = path.length,
  4946. lastIndex = length - 1,
  4947. nested = object;
  4948. while (nested != null && ++index < length) {
  4949. var key = toKey(path[index]),
  4950. newValue = value;
  4951. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4952. return object;
  4953. }
  4954. if (index != lastIndex) {
  4955. var objValue = nested[key];
  4956. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4957. if (newValue === undefined) {
  4958. newValue = isObject(objValue)
  4959. ? objValue
  4960. : (isIndex(path[index + 1]) ? [] : {});
  4961. }
  4962. }
  4963. assignValue(nested, key, newValue);
  4964. nested = nested[key];
  4965. }
  4966. return object;
  4967. }
  4968. /**
  4969. * The base implementation of `setData` without support for hot loop shorting.
  4970. *
  4971. * @private
  4972. * @param {Function} func The function to associate metadata with.
  4973. * @param {*} data The metadata.
  4974. * @returns {Function} Returns `func`.
  4975. */
  4976. var baseSetData = !metaMap ? identity : function(func, data) {
  4977. metaMap.set(func, data);
  4978. return func;
  4979. };
  4980. /**
  4981. * The base implementation of `setToString` without support for hot loop shorting.
  4982. *
  4983. * @private
  4984. * @param {Function} func The function to modify.
  4985. * @param {Function} string The `toString` result.
  4986. * @returns {Function} Returns `func`.
  4987. */
  4988. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4989. return defineProperty(func, 'toString', {
  4990. 'configurable': true,
  4991. 'enumerable': false,
  4992. 'value': constant(string),
  4993. 'writable': true
  4994. });
  4995. };
  4996. /**
  4997. * The base implementation of `_.shuffle`.
  4998. *
  4999. * @private
  5000. * @param {Array|Object} collection The collection to shuffle.
  5001. * @returns {Array} Returns the new shuffled array.
  5002. */
  5003. function baseShuffle(collection) {
  5004. return shuffleSelf(values(collection));
  5005. }
  5006. /**
  5007. * The base implementation of `_.slice` without an iteratee call guard.
  5008. *
  5009. * @private
  5010. * @param {Array} array The array to slice.
  5011. * @param {number} [start=0] The start position.
  5012. * @param {number} [end=array.length] The end position.
  5013. * @returns {Array} Returns the slice of `array`.
  5014. */
  5015. function baseSlice(array, start, end) {
  5016. var index = -1,
  5017. length = array.length;
  5018. if (start < 0) {
  5019. start = -start > length ? 0 : (length + start);
  5020. }
  5021. end = end > length ? length : end;
  5022. if (end < 0) {
  5023. end += length;
  5024. }
  5025. length = start > end ? 0 : ((end - start) >>> 0);
  5026. start >>>= 0;
  5027. var result = Array(length);
  5028. while (++index < length) {
  5029. result[index] = array[index + start];
  5030. }
  5031. return result;
  5032. }
  5033. /**
  5034. * The base implementation of `_.some` without support for iteratee shorthands.
  5035. *
  5036. * @private
  5037. * @param {Array|Object} collection The collection to iterate over.
  5038. * @param {Function} predicate The function invoked per iteration.
  5039. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5040. * else `false`.
  5041. */
  5042. function baseSome(collection, predicate) {
  5043. var result;
  5044. baseEach(collection, function(value, index, collection) {
  5045. result = predicate(value, index, collection);
  5046. return !result;
  5047. });
  5048. return !!result;
  5049. }
  5050. /**
  5051. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5052. * performs a binary search of `array` to determine the index at which `value`
  5053. * should be inserted into `array` in order to maintain its sort order.
  5054. *
  5055. * @private
  5056. * @param {Array} array The sorted array to inspect.
  5057. * @param {*} value The value to evaluate.
  5058. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5059. * @returns {number} Returns the index at which `value` should be inserted
  5060. * into `array`.
  5061. */
  5062. function baseSortedIndex(array, value, retHighest) {
  5063. var low = 0,
  5064. high = array == null ? low : array.length;
  5065. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5066. while (low < high) {
  5067. var mid = (low + high) >>> 1,
  5068. computed = array[mid];
  5069. if (computed !== null && !isSymbol(computed) &&
  5070. (retHighest ? (computed <= value) : (computed < value))) {
  5071. low = mid + 1;
  5072. } else {
  5073. high = mid;
  5074. }
  5075. }
  5076. return high;
  5077. }
  5078. return baseSortedIndexBy(array, value, identity, retHighest);
  5079. }
  5080. /**
  5081. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5082. * which invokes `iteratee` for `value` and each element of `array` to compute
  5083. * their sort ranking. The iteratee is invoked with one argument; (value).
  5084. *
  5085. * @private
  5086. * @param {Array} array The sorted array to inspect.
  5087. * @param {*} value The value to evaluate.
  5088. * @param {Function} iteratee The iteratee invoked per element.
  5089. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5090. * @returns {number} Returns the index at which `value` should be inserted
  5091. * into `array`.
  5092. */
  5093. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5094. var low = 0,
  5095. high = array == null ? 0 : array.length;
  5096. if (high === 0) {
  5097. return 0;
  5098. }
  5099. value = iteratee(value);
  5100. var valIsNaN = value !== value,
  5101. valIsNull = value === null,
  5102. valIsSymbol = isSymbol(value),
  5103. valIsUndefined = value === undefined;
  5104. while (low < high) {
  5105. var mid = nativeFloor((low + high) / 2),
  5106. computed = iteratee(array[mid]),
  5107. othIsDefined = computed !== undefined,
  5108. othIsNull = computed === null,
  5109. othIsReflexive = computed === computed,
  5110. othIsSymbol = isSymbol(computed);
  5111. if (valIsNaN) {
  5112. var setLow = retHighest || othIsReflexive;
  5113. } else if (valIsUndefined) {
  5114. setLow = othIsReflexive && (retHighest || othIsDefined);
  5115. } else if (valIsNull) {
  5116. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5117. } else if (valIsSymbol) {
  5118. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5119. } else if (othIsNull || othIsSymbol) {
  5120. setLow = false;
  5121. } else {
  5122. setLow = retHighest ? (computed <= value) : (computed < value);
  5123. }
  5124. if (setLow) {
  5125. low = mid + 1;
  5126. } else {
  5127. high = mid;
  5128. }
  5129. }
  5130. return nativeMin(high, MAX_ARRAY_INDEX);
  5131. }
  5132. /**
  5133. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5134. * support for iteratee shorthands.
  5135. *
  5136. * @private
  5137. * @param {Array} array The array to inspect.
  5138. * @param {Function} [iteratee] The iteratee invoked per element.
  5139. * @returns {Array} Returns the new duplicate free array.
  5140. */
  5141. function baseSortedUniq(array, iteratee) {
  5142. var index = -1,
  5143. length = array.length,
  5144. resIndex = 0,
  5145. result = [];
  5146. while (++index < length) {
  5147. var value = array[index],
  5148. computed = iteratee ? iteratee(value) : value;
  5149. if (!index || !eq(computed, seen)) {
  5150. var seen = computed;
  5151. result[resIndex++] = value === 0 ? 0 : value;
  5152. }
  5153. }
  5154. return result;
  5155. }
  5156. /**
  5157. * The base implementation of `_.toNumber` which doesn't ensure correct
  5158. * conversions of binary, hexadecimal, or octal string values.
  5159. *
  5160. * @private
  5161. * @param {*} value The value to process.
  5162. * @returns {number} Returns the number.
  5163. */
  5164. function baseToNumber(value) {
  5165. if (typeof value == 'number') {
  5166. return value;
  5167. }
  5168. if (isSymbol(value)) {
  5169. return NAN;
  5170. }
  5171. return +value;
  5172. }
  5173. /**
  5174. * The base implementation of `_.toString` which doesn't convert nullish
  5175. * values to empty strings.
  5176. *
  5177. * @private
  5178. * @param {*} value The value to process.
  5179. * @returns {string} Returns the string.
  5180. */
  5181. function baseToString(value) {
  5182. // Exit early for strings to avoid a performance hit in some environments.
  5183. if (typeof value == 'string') {
  5184. return value;
  5185. }
  5186. if (isArray(value)) {
  5187. // Recursively convert values (susceptible to call stack limits).
  5188. return arrayMap(value, baseToString) + '';
  5189. }
  5190. if (isSymbol(value)) {
  5191. return symbolToString ? symbolToString.call(value) : '';
  5192. }
  5193. var result = (value + '');
  5194. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5195. }
  5196. /**
  5197. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5198. *
  5199. * @private
  5200. * @param {Array} array The array to inspect.
  5201. * @param {Function} [iteratee] The iteratee invoked per element.
  5202. * @param {Function} [comparator] The comparator invoked per element.
  5203. * @returns {Array} Returns the new duplicate free array.
  5204. */
  5205. function baseUniq(array, iteratee, comparator) {
  5206. var index = -1,
  5207. includes = arrayIncludes,
  5208. length = array.length,
  5209. isCommon = true,
  5210. result = [],
  5211. seen = result;
  5212. if (comparator) {
  5213. isCommon = false;
  5214. includes = arrayIncludesWith;
  5215. }
  5216. else if (length >= LARGE_ARRAY_SIZE) {
  5217. var set = iteratee ? null : createSet(array);
  5218. if (set) {
  5219. return setToArray(set);
  5220. }
  5221. isCommon = false;
  5222. includes = cacheHas;
  5223. seen = new SetCache;
  5224. }
  5225. else {
  5226. seen = iteratee ? [] : result;
  5227. }
  5228. outer:
  5229. while (++index < length) {
  5230. var value = array[index],
  5231. computed = iteratee ? iteratee(value) : value;
  5232. value = (comparator || value !== 0) ? value : 0;
  5233. if (isCommon && computed === computed) {
  5234. var seenIndex = seen.length;
  5235. while (seenIndex--) {
  5236. if (seen[seenIndex] === computed) {
  5237. continue outer;
  5238. }
  5239. }
  5240. if (iteratee) {
  5241. seen.push(computed);
  5242. }
  5243. result.push(value);
  5244. }
  5245. else if (!includes(seen, computed, comparator)) {
  5246. if (seen !== result) {
  5247. seen.push(computed);
  5248. }
  5249. result.push(value);
  5250. }
  5251. }
  5252. return result;
  5253. }
  5254. /**
  5255. * The base implementation of `_.unset`.
  5256. *
  5257. * @private
  5258. * @param {Object} object The object to modify.
  5259. * @param {Array|string} path The property path to unset.
  5260. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5261. */
  5262. function baseUnset(object, path) {
  5263. path = castPath(path, object);
  5264. object = parent(object, path);
  5265. return object == null || delete object[toKey(last(path))];
  5266. }
  5267. /**
  5268. * The base implementation of `_.update`.
  5269. *
  5270. * @private
  5271. * @param {Object} object The object to modify.
  5272. * @param {Array|string} path The path of the property to update.
  5273. * @param {Function} updater The function to produce the updated value.
  5274. * @param {Function} [customizer] The function to customize path creation.
  5275. * @returns {Object} Returns `object`.
  5276. */
  5277. function baseUpdate(object, path, updater, customizer) {
  5278. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5279. }
  5280. /**
  5281. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5282. * without support for iteratee shorthands.
  5283. *
  5284. * @private
  5285. * @param {Array} array The array to query.
  5286. * @param {Function} predicate The function invoked per iteration.
  5287. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5288. * @param {boolean} [fromRight] Specify iterating from right to left.
  5289. * @returns {Array} Returns the slice of `array`.
  5290. */
  5291. function baseWhile(array, predicate, isDrop, fromRight) {
  5292. var length = array.length,
  5293. index = fromRight ? length : -1;
  5294. while ((fromRight ? index-- : ++index < length) &&
  5295. predicate(array[index], index, array)) {}
  5296. return isDrop
  5297. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5298. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5299. }
  5300. /**
  5301. * The base implementation of `wrapperValue` which returns the result of
  5302. * performing a sequence of actions on the unwrapped `value`, where each
  5303. * successive action is supplied the return value of the previous.
  5304. *
  5305. * @private
  5306. * @param {*} value The unwrapped value.
  5307. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5308. * @returns {*} Returns the resolved value.
  5309. */
  5310. function baseWrapperValue(value, actions) {
  5311. var result = value;
  5312. if (result instanceof LazyWrapper) {
  5313. result = result.value();
  5314. }
  5315. return arrayReduce(actions, function(result, action) {
  5316. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5317. }, result);
  5318. }
  5319. /**
  5320. * The base implementation of methods like `_.xor`, without support for
  5321. * iteratee shorthands, that accepts an array of arrays to inspect.
  5322. *
  5323. * @private
  5324. * @param {Array} arrays The arrays to inspect.
  5325. * @param {Function} [iteratee] The iteratee invoked per element.
  5326. * @param {Function} [comparator] The comparator invoked per element.
  5327. * @returns {Array} Returns the new array of values.
  5328. */
  5329. function baseXor(arrays, iteratee, comparator) {
  5330. var length = arrays.length;
  5331. if (length < 2) {
  5332. return length ? baseUniq(arrays[0]) : [];
  5333. }
  5334. var index = -1,
  5335. result = Array(length);
  5336. while (++index < length) {
  5337. var array = arrays[index],
  5338. othIndex = -1;
  5339. while (++othIndex < length) {
  5340. if (othIndex != index) {
  5341. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5342. }
  5343. }
  5344. }
  5345. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5346. }
  5347. /**
  5348. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5349. *
  5350. * @private
  5351. * @param {Array} props The property identifiers.
  5352. * @param {Array} values The property values.
  5353. * @param {Function} assignFunc The function to assign values.
  5354. * @returns {Object} Returns the new object.
  5355. */
  5356. function baseZipObject(props, values, assignFunc) {
  5357. var index = -1,
  5358. length = props.length,
  5359. valsLength = values.length,
  5360. result = {};
  5361. while (++index < length) {
  5362. var value = index < valsLength ? values[index] : undefined;
  5363. assignFunc(result, props[index], value);
  5364. }
  5365. return result;
  5366. }
  5367. /**
  5368. * Casts `value` to an empty array if it's not an array like object.
  5369. *
  5370. * @private
  5371. * @param {*} value The value to inspect.
  5372. * @returns {Array|Object} Returns the cast array-like object.
  5373. */
  5374. function castArrayLikeObject(value) {
  5375. return isArrayLikeObject(value) ? value : [];
  5376. }
  5377. /**
  5378. * Casts `value` to `identity` if it's not a function.
  5379. *
  5380. * @private
  5381. * @param {*} value The value to inspect.
  5382. * @returns {Function} Returns cast function.
  5383. */
  5384. function castFunction(value) {
  5385. return typeof value == 'function' ? value : identity;
  5386. }
  5387. /**
  5388. * Casts `value` to a path array if it's not one.
  5389. *
  5390. * @private
  5391. * @param {*} value The value to inspect.
  5392. * @param {Object} [object] The object to query keys on.
  5393. * @returns {Array} Returns the cast property path array.
  5394. */
  5395. function castPath(value, object) {
  5396. if (isArray(value)) {
  5397. return value;
  5398. }
  5399. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5400. }
  5401. /**
  5402. * A `baseRest` alias which can be replaced with `identity` by module
  5403. * replacement plugins.
  5404. *
  5405. * @private
  5406. * @type {Function}
  5407. * @param {Function} func The function to apply a rest parameter to.
  5408. * @returns {Function} Returns the new function.
  5409. */
  5410. var castRest = baseRest;
  5411. /**
  5412. * Casts `array` to a slice if it's needed.
  5413. *
  5414. * @private
  5415. * @param {Array} array The array to inspect.
  5416. * @param {number} start The start position.
  5417. * @param {number} [end=array.length] The end position.
  5418. * @returns {Array} Returns the cast slice.
  5419. */
  5420. function castSlice(array, start, end) {
  5421. var length = array.length;
  5422. end = end === undefined ? length : end;
  5423. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5424. }
  5425. /**
  5426. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5427. *
  5428. * @private
  5429. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5430. */
  5431. var clearTimeout = ctxClearTimeout || function(id) {
  5432. return root.clearTimeout(id);
  5433. };
  5434. /**
  5435. * Creates a clone of `buffer`.
  5436. *
  5437. * @private
  5438. * @param {Buffer} buffer The buffer to clone.
  5439. * @param {boolean} [isDeep] Specify a deep clone.
  5440. * @returns {Buffer} Returns the cloned buffer.
  5441. */
  5442. function cloneBuffer(buffer, isDeep) {
  5443. if (isDeep) {
  5444. return buffer.slice();
  5445. }
  5446. var length = buffer.length,
  5447. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5448. buffer.copy(result);
  5449. return result;
  5450. }
  5451. /**
  5452. * Creates a clone of `arrayBuffer`.
  5453. *
  5454. * @private
  5455. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5456. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5457. */
  5458. function cloneArrayBuffer(arrayBuffer) {
  5459. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5460. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5461. return result;
  5462. }
  5463. /**
  5464. * Creates a clone of `dataView`.
  5465. *
  5466. * @private
  5467. * @param {Object} dataView The data view to clone.
  5468. * @param {boolean} [isDeep] Specify a deep clone.
  5469. * @returns {Object} Returns the cloned data view.
  5470. */
  5471. function cloneDataView(dataView, isDeep) {
  5472. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5473. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5474. }
  5475. /**
  5476. * Creates a clone of `regexp`.
  5477. *
  5478. * @private
  5479. * @param {Object} regexp The regexp to clone.
  5480. * @returns {Object} Returns the cloned regexp.
  5481. */
  5482. function cloneRegExp(regexp) {
  5483. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5484. result.lastIndex = regexp.lastIndex;
  5485. return result;
  5486. }
  5487. /**
  5488. * Creates a clone of the `symbol` object.
  5489. *
  5490. * @private
  5491. * @param {Object} symbol The symbol object to clone.
  5492. * @returns {Object} Returns the cloned symbol object.
  5493. */
  5494. function cloneSymbol(symbol) {
  5495. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5496. }
  5497. /**
  5498. * Creates a clone of `typedArray`.
  5499. *
  5500. * @private
  5501. * @param {Object} typedArray The typed array to clone.
  5502. * @param {boolean} [isDeep] Specify a deep clone.
  5503. * @returns {Object} Returns the cloned typed array.
  5504. */
  5505. function cloneTypedArray(typedArray, isDeep) {
  5506. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5507. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5508. }
  5509. /**
  5510. * Compares values to sort them in ascending order.
  5511. *
  5512. * @private
  5513. * @param {*} value The value to compare.
  5514. * @param {*} other The other value to compare.
  5515. * @returns {number} Returns the sort order indicator for `value`.
  5516. */
  5517. function compareAscending(value, other) {
  5518. if (value !== other) {
  5519. var valIsDefined = value !== undefined,
  5520. valIsNull = value === null,
  5521. valIsReflexive = value === value,
  5522. valIsSymbol = isSymbol(value);
  5523. var othIsDefined = other !== undefined,
  5524. othIsNull = other === null,
  5525. othIsReflexive = other === other,
  5526. othIsSymbol = isSymbol(other);
  5527. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5528. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5529. (valIsNull && othIsDefined && othIsReflexive) ||
  5530. (!valIsDefined && othIsReflexive) ||
  5531. !valIsReflexive) {
  5532. return 1;
  5533. }
  5534. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5535. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5536. (othIsNull && valIsDefined && valIsReflexive) ||
  5537. (!othIsDefined && valIsReflexive) ||
  5538. !othIsReflexive) {
  5539. return -1;
  5540. }
  5541. }
  5542. return 0;
  5543. }
  5544. /**
  5545. * Used by `_.orderBy` to compare multiple properties of a value to another
  5546. * and stable sort them.
  5547. *
  5548. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5549. * specify an order of "desc" for descending or "asc" for ascending sort order
  5550. * of corresponding values.
  5551. *
  5552. * @private
  5553. * @param {Object} object The object to compare.
  5554. * @param {Object} other The other object to compare.
  5555. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5556. * @returns {number} Returns the sort order indicator for `object`.
  5557. */
  5558. function compareMultiple(object, other, orders) {
  5559. var index = -1,
  5560. objCriteria = object.criteria,
  5561. othCriteria = other.criteria,
  5562. length = objCriteria.length,
  5563. ordersLength = orders.length;
  5564. while (++index < length) {
  5565. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5566. if (result) {
  5567. if (index >= ordersLength) {
  5568. return result;
  5569. }
  5570. var order = orders[index];
  5571. return result * (order == 'desc' ? -1 : 1);
  5572. }
  5573. }
  5574. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5575. // that causes it, under certain circumstances, to provide the same value for
  5576. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5577. // for more details.
  5578. //
  5579. // This also ensures a stable sort in V8 and other engines.
  5580. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5581. return object.index - other.index;
  5582. }
  5583. /**
  5584. * Creates an array that is the composition of partially applied arguments,
  5585. * placeholders, and provided arguments into a single array of arguments.
  5586. *
  5587. * @private
  5588. * @param {Array} args The provided arguments.
  5589. * @param {Array} partials The arguments to prepend to those provided.
  5590. * @param {Array} holders The `partials` placeholder indexes.
  5591. * @params {boolean} [isCurried] Specify composing for a curried function.
  5592. * @returns {Array} Returns the new array of composed arguments.
  5593. */
  5594. function composeArgs(args, partials, holders, isCurried) {
  5595. var argsIndex = -1,
  5596. argsLength = args.length,
  5597. holdersLength = holders.length,
  5598. leftIndex = -1,
  5599. leftLength = partials.length,
  5600. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5601. result = Array(leftLength + rangeLength),
  5602. isUncurried = !isCurried;
  5603. while (++leftIndex < leftLength) {
  5604. result[leftIndex] = partials[leftIndex];
  5605. }
  5606. while (++argsIndex < holdersLength) {
  5607. if (isUncurried || argsIndex < argsLength) {
  5608. result[holders[argsIndex]] = args[argsIndex];
  5609. }
  5610. }
  5611. while (rangeLength--) {
  5612. result[leftIndex++] = args[argsIndex++];
  5613. }
  5614. return result;
  5615. }
  5616. /**
  5617. * This function is like `composeArgs` except that the arguments composition
  5618. * is tailored for `_.partialRight`.
  5619. *
  5620. * @private
  5621. * @param {Array} args The provided arguments.
  5622. * @param {Array} partials The arguments to append to those provided.
  5623. * @param {Array} holders The `partials` placeholder indexes.
  5624. * @params {boolean} [isCurried] Specify composing for a curried function.
  5625. * @returns {Array} Returns the new array of composed arguments.
  5626. */
  5627. function composeArgsRight(args, partials, holders, isCurried) {
  5628. var argsIndex = -1,
  5629. argsLength = args.length,
  5630. holdersIndex = -1,
  5631. holdersLength = holders.length,
  5632. rightIndex = -1,
  5633. rightLength = partials.length,
  5634. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5635. result = Array(rangeLength + rightLength),
  5636. isUncurried = !isCurried;
  5637. while (++argsIndex < rangeLength) {
  5638. result[argsIndex] = args[argsIndex];
  5639. }
  5640. var offset = argsIndex;
  5641. while (++rightIndex < rightLength) {
  5642. result[offset + rightIndex] = partials[rightIndex];
  5643. }
  5644. while (++holdersIndex < holdersLength) {
  5645. if (isUncurried || argsIndex < argsLength) {
  5646. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5647. }
  5648. }
  5649. return result;
  5650. }
  5651. /**
  5652. * Copies the values of `source` to `array`.
  5653. *
  5654. * @private
  5655. * @param {Array} source The array to copy values from.
  5656. * @param {Array} [array=[]] The array to copy values to.
  5657. * @returns {Array} Returns `array`.
  5658. */
  5659. function copyArray(source, array) {
  5660. var index = -1,
  5661. length = source.length;
  5662. array || (array = Array(length));
  5663. while (++index < length) {
  5664. array[index] = source[index];
  5665. }
  5666. return array;
  5667. }
  5668. /**
  5669. * Copies properties of `source` to `object`.
  5670. *
  5671. * @private
  5672. * @param {Object} source The object to copy properties from.
  5673. * @param {Array} props The property identifiers to copy.
  5674. * @param {Object} [object={}] The object to copy properties to.
  5675. * @param {Function} [customizer] The function to customize copied values.
  5676. * @returns {Object} Returns `object`.
  5677. */
  5678. function copyObject(source, props, object, customizer) {
  5679. var isNew = !object;
  5680. object || (object = {});
  5681. var index = -1,
  5682. length = props.length;
  5683. while (++index < length) {
  5684. var key = props[index];
  5685. var newValue = customizer
  5686. ? customizer(object[key], source[key], key, object, source)
  5687. : undefined;
  5688. if (newValue === undefined) {
  5689. newValue = source[key];
  5690. }
  5691. if (isNew) {
  5692. baseAssignValue(object, key, newValue);
  5693. } else {
  5694. assignValue(object, key, newValue);
  5695. }
  5696. }
  5697. return object;
  5698. }
  5699. /**
  5700. * Copies own symbols of `source` to `object`.
  5701. *
  5702. * @private
  5703. * @param {Object} source The object to copy symbols from.
  5704. * @param {Object} [object={}] The object to copy symbols to.
  5705. * @returns {Object} Returns `object`.
  5706. */
  5707. function copySymbols(source, object) {
  5708. return copyObject(source, getSymbols(source), object);
  5709. }
  5710. /**
  5711. * Copies own and inherited symbols of `source` to `object`.
  5712. *
  5713. * @private
  5714. * @param {Object} source The object to copy symbols from.
  5715. * @param {Object} [object={}] The object to copy symbols to.
  5716. * @returns {Object} Returns `object`.
  5717. */
  5718. function copySymbolsIn(source, object) {
  5719. return copyObject(source, getSymbolsIn(source), object);
  5720. }
  5721. /**
  5722. * Creates a function like `_.groupBy`.
  5723. *
  5724. * @private
  5725. * @param {Function} setter The function to set accumulator values.
  5726. * @param {Function} [initializer] The accumulator object initializer.
  5727. * @returns {Function} Returns the new aggregator function.
  5728. */
  5729. function createAggregator(setter, initializer) {
  5730. return function(collection, iteratee) {
  5731. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5732. accumulator = initializer ? initializer() : {};
  5733. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5734. };
  5735. }
  5736. /**
  5737. * Creates a function like `_.assign`.
  5738. *
  5739. * @private
  5740. * @param {Function} assigner The function to assign values.
  5741. * @returns {Function} Returns the new assigner function.
  5742. */
  5743. function createAssigner(assigner) {
  5744. return baseRest(function(object, sources) {
  5745. var index = -1,
  5746. length = sources.length,
  5747. customizer = length > 1 ? sources[length - 1] : undefined,
  5748. guard = length > 2 ? sources[2] : undefined;
  5749. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5750. ? (length--, customizer)
  5751. : undefined;
  5752. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5753. customizer = length < 3 ? undefined : customizer;
  5754. length = 1;
  5755. }
  5756. object = Object(object);
  5757. while (++index < length) {
  5758. var source = sources[index];
  5759. if (source) {
  5760. assigner(object, source, index, customizer);
  5761. }
  5762. }
  5763. return object;
  5764. });
  5765. }
  5766. /**
  5767. * Creates a `baseEach` or `baseEachRight` function.
  5768. *
  5769. * @private
  5770. * @param {Function} eachFunc The function to iterate over a collection.
  5771. * @param {boolean} [fromRight] Specify iterating from right to left.
  5772. * @returns {Function} Returns the new base function.
  5773. */
  5774. function createBaseEach(eachFunc, fromRight) {
  5775. return function(collection, iteratee) {
  5776. if (collection == null) {
  5777. return collection;
  5778. }
  5779. if (!isArrayLike(collection)) {
  5780. return eachFunc(collection, iteratee);
  5781. }
  5782. var length = collection.length,
  5783. index = fromRight ? length : -1,
  5784. iterable = Object(collection);
  5785. while ((fromRight ? index-- : ++index < length)) {
  5786. if (iteratee(iterable[index], index, iterable) === false) {
  5787. break;
  5788. }
  5789. }
  5790. return collection;
  5791. };
  5792. }
  5793. /**
  5794. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5795. *
  5796. * @private
  5797. * @param {boolean} [fromRight] Specify iterating from right to left.
  5798. * @returns {Function} Returns the new base function.
  5799. */
  5800. function createBaseFor(fromRight) {
  5801. return function(object, iteratee, keysFunc) {
  5802. var index = -1,
  5803. iterable = Object(object),
  5804. props = keysFunc(object),
  5805. length = props.length;
  5806. while (length--) {
  5807. var key = props[fromRight ? length : ++index];
  5808. if (iteratee(iterable[key], key, iterable) === false) {
  5809. break;
  5810. }
  5811. }
  5812. return object;
  5813. };
  5814. }
  5815. /**
  5816. * Creates a function that wraps `func` to invoke it with the optional `this`
  5817. * binding of `thisArg`.
  5818. *
  5819. * @private
  5820. * @param {Function} func The function to wrap.
  5821. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5822. * @param {*} [thisArg] The `this` binding of `func`.
  5823. * @returns {Function} Returns the new wrapped function.
  5824. */
  5825. function createBind(func, bitmask, thisArg) {
  5826. var isBind = bitmask & WRAP_BIND_FLAG,
  5827. Ctor = createCtor(func);
  5828. function wrapper() {
  5829. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5830. return fn.apply(isBind ? thisArg : this, arguments);
  5831. }
  5832. return wrapper;
  5833. }
  5834. /**
  5835. * Creates a function like `_.lowerFirst`.
  5836. *
  5837. * @private
  5838. * @param {string} methodName The name of the `String` case method to use.
  5839. * @returns {Function} Returns the new case function.
  5840. */
  5841. function createCaseFirst(methodName) {
  5842. return function(string) {
  5843. string = toString(string);
  5844. var strSymbols = hasUnicode(string)
  5845. ? stringToArray(string)
  5846. : undefined;
  5847. var chr = strSymbols
  5848. ? strSymbols[0]
  5849. : string.charAt(0);
  5850. var trailing = strSymbols
  5851. ? castSlice(strSymbols, 1).join('')
  5852. : string.slice(1);
  5853. return chr[methodName]() + trailing;
  5854. };
  5855. }
  5856. /**
  5857. * Creates a function like `_.camelCase`.
  5858. *
  5859. * @private
  5860. * @param {Function} callback The function to combine each word.
  5861. * @returns {Function} Returns the new compounder function.
  5862. */
  5863. function createCompounder(callback) {
  5864. return function(string) {
  5865. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5866. };
  5867. }
  5868. /**
  5869. * Creates a function that produces an instance of `Ctor` regardless of
  5870. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5871. *
  5872. * @private
  5873. * @param {Function} Ctor The constructor to wrap.
  5874. * @returns {Function} Returns the new wrapped function.
  5875. */
  5876. function createCtor(Ctor) {
  5877. return function() {
  5878. // Use a `switch` statement to work with class constructors. See
  5879. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5880. // for more details.
  5881. var args = arguments;
  5882. switch (args.length) {
  5883. case 0: return new Ctor;
  5884. case 1: return new Ctor(args[0]);
  5885. case 2: return new Ctor(args[0], args[1]);
  5886. case 3: return new Ctor(args[0], args[1], args[2]);
  5887. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5888. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5889. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5890. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5891. }
  5892. var thisBinding = baseCreate(Ctor.prototype),
  5893. result = Ctor.apply(thisBinding, args);
  5894. // Mimic the constructor's `return` behavior.
  5895. // See https://es5.github.io/#x13.2.2 for more details.
  5896. return isObject(result) ? result : thisBinding;
  5897. };
  5898. }
  5899. /**
  5900. * Creates a function that wraps `func` to enable currying.
  5901. *
  5902. * @private
  5903. * @param {Function} func The function to wrap.
  5904. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5905. * @param {number} arity The arity of `func`.
  5906. * @returns {Function} Returns the new wrapped function.
  5907. */
  5908. function createCurry(func, bitmask, arity) {
  5909. var Ctor = createCtor(func);
  5910. function wrapper() {
  5911. var length = arguments.length,
  5912. args = Array(length),
  5913. index = length,
  5914. placeholder = getHolder(wrapper);
  5915. while (index--) {
  5916. args[index] = arguments[index];
  5917. }
  5918. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5919. ? []
  5920. : replaceHolders(args, placeholder);
  5921. length -= holders.length;
  5922. if (length < arity) {
  5923. return createRecurry(
  5924. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5925. args, holders, undefined, undefined, arity - length);
  5926. }
  5927. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5928. return apply(fn, this, args);
  5929. }
  5930. return wrapper;
  5931. }
  5932. /**
  5933. * Creates a `_.find` or `_.findLast` function.
  5934. *
  5935. * @private
  5936. * @param {Function} findIndexFunc The function to find the collection index.
  5937. * @returns {Function} Returns the new find function.
  5938. */
  5939. function createFind(findIndexFunc) {
  5940. return function(collection, predicate, fromIndex) {
  5941. var iterable = Object(collection);
  5942. if (!isArrayLike(collection)) {
  5943. var iteratee = getIteratee(predicate, 3);
  5944. collection = keys(collection);
  5945. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5946. }
  5947. var index = findIndexFunc(collection, predicate, fromIndex);
  5948. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5949. };
  5950. }
  5951. /**
  5952. * Creates a `_.flow` or `_.flowRight` function.
  5953. *
  5954. * @private
  5955. * @param {boolean} [fromRight] Specify iterating from right to left.
  5956. * @returns {Function} Returns the new flow function.
  5957. */
  5958. function createFlow(fromRight) {
  5959. return flatRest(function(funcs) {
  5960. var length = funcs.length,
  5961. index = length,
  5962. prereq = LodashWrapper.prototype.thru;
  5963. if (fromRight) {
  5964. funcs.reverse();
  5965. }
  5966. while (index--) {
  5967. var func = funcs[index];
  5968. if (typeof func != 'function') {
  5969. throw new TypeError(FUNC_ERROR_TEXT);
  5970. }
  5971. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5972. var wrapper = new LodashWrapper([], true);
  5973. }
  5974. }
  5975. index = wrapper ? index : length;
  5976. while (++index < length) {
  5977. func = funcs[index];
  5978. var funcName = getFuncName(func),
  5979. data = funcName == 'wrapper' ? getData(func) : undefined;
  5980. if (data && isLaziable(data[0]) &&
  5981. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5982. !data[4].length && data[9] == 1
  5983. ) {
  5984. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5985. } else {
  5986. wrapper = (func.length == 1 && isLaziable(func))
  5987. ? wrapper[funcName]()
  5988. : wrapper.thru(func);
  5989. }
  5990. }
  5991. return function() {
  5992. var args = arguments,
  5993. value = args[0];
  5994. if (wrapper && args.length == 1 && isArray(value)) {
  5995. return wrapper.plant(value).value();
  5996. }
  5997. var index = 0,
  5998. result = length ? funcs[index].apply(this, args) : value;
  5999. while (++index < length) {
  6000. result = funcs[index].call(this, result);
  6001. }
  6002. return result;
  6003. };
  6004. });
  6005. }
  6006. /**
  6007. * Creates a function that wraps `func` to invoke it with optional `this`
  6008. * binding of `thisArg`, partial application, and currying.
  6009. *
  6010. * @private
  6011. * @param {Function|string} func The function or method name to wrap.
  6012. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6013. * @param {*} [thisArg] The `this` binding of `func`.
  6014. * @param {Array} [partials] The arguments to prepend to those provided to
  6015. * the new function.
  6016. * @param {Array} [holders] The `partials` placeholder indexes.
  6017. * @param {Array} [partialsRight] The arguments to append to those provided
  6018. * to the new function.
  6019. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6020. * @param {Array} [argPos] The argument positions of the new function.
  6021. * @param {number} [ary] The arity cap of `func`.
  6022. * @param {number} [arity] The arity of `func`.
  6023. * @returns {Function} Returns the new wrapped function.
  6024. */
  6025. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6026. var isAry = bitmask & WRAP_ARY_FLAG,
  6027. isBind = bitmask & WRAP_BIND_FLAG,
  6028. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6029. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6030. isFlip = bitmask & WRAP_FLIP_FLAG,
  6031. Ctor = isBindKey ? undefined : createCtor(func);
  6032. function wrapper() {
  6033. var length = arguments.length,
  6034. args = Array(length),
  6035. index = length;
  6036. while (index--) {
  6037. args[index] = arguments[index];
  6038. }
  6039. if (isCurried) {
  6040. var placeholder = getHolder(wrapper),
  6041. holdersCount = countHolders(args, placeholder);
  6042. }
  6043. if (partials) {
  6044. args = composeArgs(args, partials, holders, isCurried);
  6045. }
  6046. if (partialsRight) {
  6047. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6048. }
  6049. length -= holdersCount;
  6050. if (isCurried && length < arity) {
  6051. var newHolders = replaceHolders(args, placeholder);
  6052. return createRecurry(
  6053. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6054. args, newHolders, argPos, ary, arity - length
  6055. );
  6056. }
  6057. var thisBinding = isBind ? thisArg : this,
  6058. fn = isBindKey ? thisBinding[func] : func;
  6059. length = args.length;
  6060. if (argPos) {
  6061. args = reorder(args, argPos);
  6062. } else if (isFlip && length > 1) {
  6063. args.reverse();
  6064. }
  6065. if (isAry && ary < length) {
  6066. args.length = ary;
  6067. }
  6068. if (this && this !== root && this instanceof wrapper) {
  6069. fn = Ctor || createCtor(fn);
  6070. }
  6071. return fn.apply(thisBinding, args);
  6072. }
  6073. return wrapper;
  6074. }
  6075. /**
  6076. * Creates a function like `_.invertBy`.
  6077. *
  6078. * @private
  6079. * @param {Function} setter The function to set accumulator values.
  6080. * @param {Function} toIteratee The function to resolve iteratees.
  6081. * @returns {Function} Returns the new inverter function.
  6082. */
  6083. function createInverter(setter, toIteratee) {
  6084. return function(object, iteratee) {
  6085. return baseInverter(object, setter, toIteratee(iteratee), {});
  6086. };
  6087. }
  6088. /**
  6089. * Creates a function that performs a mathematical operation on two values.
  6090. *
  6091. * @private
  6092. * @param {Function} operator The function to perform the operation.
  6093. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6094. * @returns {Function} Returns the new mathematical operation function.
  6095. */
  6096. function createMathOperation(operator, defaultValue) {
  6097. return function(value, other) {
  6098. var result;
  6099. if (value === undefined && other === undefined) {
  6100. return defaultValue;
  6101. }
  6102. if (value !== undefined) {
  6103. result = value;
  6104. }
  6105. if (other !== undefined) {
  6106. if (result === undefined) {
  6107. return other;
  6108. }
  6109. if (typeof value == 'string' || typeof other == 'string') {
  6110. value = baseToString(value);
  6111. other = baseToString(other);
  6112. } else {
  6113. value = baseToNumber(value);
  6114. other = baseToNumber(other);
  6115. }
  6116. result = operator(value, other);
  6117. }
  6118. return result;
  6119. };
  6120. }
  6121. /**
  6122. * Creates a function like `_.over`.
  6123. *
  6124. * @private
  6125. * @param {Function} arrayFunc The function to iterate over iteratees.
  6126. * @returns {Function} Returns the new over function.
  6127. */
  6128. function createOver(arrayFunc) {
  6129. return flatRest(function(iteratees) {
  6130. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6131. return baseRest(function(args) {
  6132. var thisArg = this;
  6133. return arrayFunc(iteratees, function(iteratee) {
  6134. return apply(iteratee, thisArg, args);
  6135. });
  6136. });
  6137. });
  6138. }
  6139. /**
  6140. * Creates the padding for `string` based on `length`. The `chars` string
  6141. * is truncated if the number of characters exceeds `length`.
  6142. *
  6143. * @private
  6144. * @param {number} length The padding length.
  6145. * @param {string} [chars=' '] The string used as padding.
  6146. * @returns {string} Returns the padding for `string`.
  6147. */
  6148. function createPadding(length, chars) {
  6149. chars = chars === undefined ? ' ' : baseToString(chars);
  6150. var charsLength = chars.length;
  6151. if (charsLength < 2) {
  6152. return charsLength ? baseRepeat(chars, length) : chars;
  6153. }
  6154. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6155. return hasUnicode(chars)
  6156. ? castSlice(stringToArray(result), 0, length).join('')
  6157. : result.slice(0, length);
  6158. }
  6159. /**
  6160. * Creates a function that wraps `func` to invoke it with the `this` binding
  6161. * of `thisArg` and `partials` prepended to the arguments it receives.
  6162. *
  6163. * @private
  6164. * @param {Function} func The function to wrap.
  6165. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6166. * @param {*} thisArg The `this` binding of `func`.
  6167. * @param {Array} partials The arguments to prepend to those provided to
  6168. * the new function.
  6169. * @returns {Function} Returns the new wrapped function.
  6170. */
  6171. function createPartial(func, bitmask, thisArg, partials) {
  6172. var isBind = bitmask & WRAP_BIND_FLAG,
  6173. Ctor = createCtor(func);
  6174. function wrapper() {
  6175. var argsIndex = -1,
  6176. argsLength = arguments.length,
  6177. leftIndex = -1,
  6178. leftLength = partials.length,
  6179. args = Array(leftLength + argsLength),
  6180. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6181. while (++leftIndex < leftLength) {
  6182. args[leftIndex] = partials[leftIndex];
  6183. }
  6184. while (argsLength--) {
  6185. args[leftIndex++] = arguments[++argsIndex];
  6186. }
  6187. return apply(fn, isBind ? thisArg : this, args);
  6188. }
  6189. return wrapper;
  6190. }
  6191. /**
  6192. * Creates a `_.range` or `_.rangeRight` function.
  6193. *
  6194. * @private
  6195. * @param {boolean} [fromRight] Specify iterating from right to left.
  6196. * @returns {Function} Returns the new range function.
  6197. */
  6198. function createRange(fromRight) {
  6199. return function(start, end, step) {
  6200. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6201. end = step = undefined;
  6202. }
  6203. // Ensure the sign of `-0` is preserved.
  6204. start = toFinite(start);
  6205. if (end === undefined) {
  6206. end = start;
  6207. start = 0;
  6208. } else {
  6209. end = toFinite(end);
  6210. }
  6211. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6212. return baseRange(start, end, step, fromRight);
  6213. };
  6214. }
  6215. /**
  6216. * Creates a function that performs a relational operation on two values.
  6217. *
  6218. * @private
  6219. * @param {Function} operator The function to perform the operation.
  6220. * @returns {Function} Returns the new relational operation function.
  6221. */
  6222. function createRelationalOperation(operator) {
  6223. return function(value, other) {
  6224. if (!(typeof value == 'string' && typeof other == 'string')) {
  6225. value = toNumber(value);
  6226. other = toNumber(other);
  6227. }
  6228. return operator(value, other);
  6229. };
  6230. }
  6231. /**
  6232. * Creates a function that wraps `func` to continue currying.
  6233. *
  6234. * @private
  6235. * @param {Function} func The function to wrap.
  6236. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6237. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6238. * @param {*} placeholder The placeholder value.
  6239. * @param {*} [thisArg] The `this` binding of `func`.
  6240. * @param {Array} [partials] The arguments to prepend to those provided to
  6241. * the new function.
  6242. * @param {Array} [holders] The `partials` placeholder indexes.
  6243. * @param {Array} [argPos] The argument positions of the new function.
  6244. * @param {number} [ary] The arity cap of `func`.
  6245. * @param {number} [arity] The arity of `func`.
  6246. * @returns {Function} Returns the new wrapped function.
  6247. */
  6248. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6249. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6250. newHolders = isCurry ? holders : undefined,
  6251. newHoldersRight = isCurry ? undefined : holders,
  6252. newPartials = isCurry ? partials : undefined,
  6253. newPartialsRight = isCurry ? undefined : partials;
  6254. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6255. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6256. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6257. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6258. }
  6259. var newData = [
  6260. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6261. newHoldersRight, argPos, ary, arity
  6262. ];
  6263. var result = wrapFunc.apply(undefined, newData);
  6264. if (isLaziable(func)) {
  6265. setData(result, newData);
  6266. }
  6267. result.placeholder = placeholder;
  6268. return setWrapToString(result, func, bitmask);
  6269. }
  6270. /**
  6271. * Creates a function like `_.round`.
  6272. *
  6273. * @private
  6274. * @param {string} methodName The name of the `Math` method to use when rounding.
  6275. * @returns {Function} Returns the new round function.
  6276. */
  6277. function createRound(methodName) {
  6278. var func = Math[methodName];
  6279. return function(number, precision) {
  6280. number = toNumber(number);
  6281. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6282. if (precision && nativeIsFinite(number)) {
  6283. // Shift with exponential notation to avoid floating-point issues.
  6284. // See [MDN](https://mdn.io/round#Examples) for more details.
  6285. var pair = (toString(number) + 'e').split('e'),
  6286. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6287. pair = (toString(value) + 'e').split('e');
  6288. return +(pair[0] + 'e' + (+pair[1] - precision));
  6289. }
  6290. return func(number);
  6291. };
  6292. }
  6293. /**
  6294. * Creates a set object of `values`.
  6295. *
  6296. * @private
  6297. * @param {Array} values The values to add to the set.
  6298. * @returns {Object} Returns the new set.
  6299. */
  6300. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6301. return new Set(values);
  6302. };
  6303. /**
  6304. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6305. *
  6306. * @private
  6307. * @param {Function} keysFunc The function to get the keys of a given object.
  6308. * @returns {Function} Returns the new pairs function.
  6309. */
  6310. function createToPairs(keysFunc) {
  6311. return function(object) {
  6312. var tag = getTag(object);
  6313. if (tag == mapTag) {
  6314. return mapToArray(object);
  6315. }
  6316. if (tag == setTag) {
  6317. return setToPairs(object);
  6318. }
  6319. return baseToPairs(object, keysFunc(object));
  6320. };
  6321. }
  6322. /**
  6323. * Creates a function that either curries or invokes `func` with optional
  6324. * `this` binding and partially applied arguments.
  6325. *
  6326. * @private
  6327. * @param {Function|string} func The function or method name to wrap.
  6328. * @param {number} bitmask The bitmask flags.
  6329. * 1 - `_.bind`
  6330. * 2 - `_.bindKey`
  6331. * 4 - `_.curry` or `_.curryRight` of a bound function
  6332. * 8 - `_.curry`
  6333. * 16 - `_.curryRight`
  6334. * 32 - `_.partial`
  6335. * 64 - `_.partialRight`
  6336. * 128 - `_.rearg`
  6337. * 256 - `_.ary`
  6338. * 512 - `_.flip`
  6339. * @param {*} [thisArg] The `this` binding of `func`.
  6340. * @param {Array} [partials] The arguments to be partially applied.
  6341. * @param {Array} [holders] The `partials` placeholder indexes.
  6342. * @param {Array} [argPos] The argument positions of the new function.
  6343. * @param {number} [ary] The arity cap of `func`.
  6344. * @param {number} [arity] The arity of `func`.
  6345. * @returns {Function} Returns the new wrapped function.
  6346. */
  6347. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6348. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6349. if (!isBindKey && typeof func != 'function') {
  6350. throw new TypeError(FUNC_ERROR_TEXT);
  6351. }
  6352. var length = partials ? partials.length : 0;
  6353. if (!length) {
  6354. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6355. partials = holders = undefined;
  6356. }
  6357. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6358. arity = arity === undefined ? arity : toInteger(arity);
  6359. length -= holders ? holders.length : 0;
  6360. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6361. var partialsRight = partials,
  6362. holdersRight = holders;
  6363. partials = holders = undefined;
  6364. }
  6365. var data = isBindKey ? undefined : getData(func);
  6366. var newData = [
  6367. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6368. argPos, ary, arity
  6369. ];
  6370. if (data) {
  6371. mergeData(newData, data);
  6372. }
  6373. func = newData[0];
  6374. bitmask = newData[1];
  6375. thisArg = newData[2];
  6376. partials = newData[3];
  6377. holders = newData[4];
  6378. arity = newData[9] = newData[9] === undefined
  6379. ? (isBindKey ? 0 : func.length)
  6380. : nativeMax(newData[9] - length, 0);
  6381. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6382. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6383. }
  6384. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6385. var result = createBind(func, bitmask, thisArg);
  6386. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6387. result = createCurry(func, bitmask, arity);
  6388. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6389. result = createPartial(func, bitmask, thisArg, partials);
  6390. } else {
  6391. result = createHybrid.apply(undefined, newData);
  6392. }
  6393. var setter = data ? baseSetData : setData;
  6394. return setWrapToString(setter(result, newData), func, bitmask);
  6395. }
  6396. /**
  6397. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6398. * of source objects to the destination object for all destination properties
  6399. * that resolve to `undefined`.
  6400. *
  6401. * @private
  6402. * @param {*} objValue The destination value.
  6403. * @param {*} srcValue The source value.
  6404. * @param {string} key The key of the property to assign.
  6405. * @param {Object} object The parent object of `objValue`.
  6406. * @returns {*} Returns the value to assign.
  6407. */
  6408. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6409. if (objValue === undefined ||
  6410. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6411. return srcValue;
  6412. }
  6413. return objValue;
  6414. }
  6415. /**
  6416. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6417. * objects into destination objects that are passed thru.
  6418. *
  6419. * @private
  6420. * @param {*} objValue The destination value.
  6421. * @param {*} srcValue The source value.
  6422. * @param {string} key The key of the property to merge.
  6423. * @param {Object} object The parent object of `objValue`.
  6424. * @param {Object} source The parent object of `srcValue`.
  6425. * @param {Object} [stack] Tracks traversed source values and their merged
  6426. * counterparts.
  6427. * @returns {*} Returns the value to assign.
  6428. */
  6429. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6430. if (isObject(objValue) && isObject(srcValue)) {
  6431. // Recursively merge objects and arrays (susceptible to call stack limits).
  6432. stack.set(srcValue, objValue);
  6433. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6434. stack['delete'](srcValue);
  6435. }
  6436. return objValue;
  6437. }
  6438. /**
  6439. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6440. * objects.
  6441. *
  6442. * @private
  6443. * @param {*} value The value to inspect.
  6444. * @param {string} key The key of the property to inspect.
  6445. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6446. */
  6447. function customOmitClone(value) {
  6448. return isPlainObject(value) ? undefined : value;
  6449. }
  6450. /**
  6451. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6452. * partial deep comparisons.
  6453. *
  6454. * @private
  6455. * @param {Array} array The array to compare.
  6456. * @param {Array} other The other array to compare.
  6457. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6458. * @param {Function} customizer The function to customize comparisons.
  6459. * @param {Function} equalFunc The function to determine equivalents of values.
  6460. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6461. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6462. */
  6463. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6464. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6465. arrLength = array.length,
  6466. othLength = other.length;
  6467. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6468. return false;
  6469. }
  6470. // Check that cyclic values are equal.
  6471. var arrStacked = stack.get(array);
  6472. var othStacked = stack.get(other);
  6473. if (arrStacked && othStacked) {
  6474. return arrStacked == other && othStacked == array;
  6475. }
  6476. var index = -1,
  6477. result = true,
  6478. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6479. stack.set(array, other);
  6480. stack.set(other, array);
  6481. // Ignore non-index properties.
  6482. while (++index < arrLength) {
  6483. var arrValue = array[index],
  6484. othValue = other[index];
  6485. if (customizer) {
  6486. var compared = isPartial
  6487. ? customizer(othValue, arrValue, index, other, array, stack)
  6488. : customizer(arrValue, othValue, index, array, other, stack);
  6489. }
  6490. if (compared !== undefined) {
  6491. if (compared) {
  6492. continue;
  6493. }
  6494. result = false;
  6495. break;
  6496. }
  6497. // Recursively compare arrays (susceptible to call stack limits).
  6498. if (seen) {
  6499. if (!arraySome(other, function(othValue, othIndex) {
  6500. if (!cacheHas(seen, othIndex) &&
  6501. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6502. return seen.push(othIndex);
  6503. }
  6504. })) {
  6505. result = false;
  6506. break;
  6507. }
  6508. } else if (!(
  6509. arrValue === othValue ||
  6510. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6511. )) {
  6512. result = false;
  6513. break;
  6514. }
  6515. }
  6516. stack['delete'](array);
  6517. stack['delete'](other);
  6518. return result;
  6519. }
  6520. /**
  6521. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6522. * the same `toStringTag`.
  6523. *
  6524. * **Note:** This function only supports comparing values with tags of
  6525. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6526. *
  6527. * @private
  6528. * @param {Object} object The object to compare.
  6529. * @param {Object} other The other object to compare.
  6530. * @param {string} tag The `toStringTag` of the objects to compare.
  6531. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6532. * @param {Function} customizer The function to customize comparisons.
  6533. * @param {Function} equalFunc The function to determine equivalents of values.
  6534. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6535. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6536. */
  6537. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6538. switch (tag) {
  6539. case dataViewTag:
  6540. if ((object.byteLength != other.byteLength) ||
  6541. (object.byteOffset != other.byteOffset)) {
  6542. return false;
  6543. }
  6544. object = object.buffer;
  6545. other = other.buffer;
  6546. case arrayBufferTag:
  6547. if ((object.byteLength != other.byteLength) ||
  6548. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6549. return false;
  6550. }
  6551. return true;
  6552. case boolTag:
  6553. case dateTag:
  6554. case numberTag:
  6555. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6556. // Invalid dates are coerced to `NaN`.
  6557. return eq(+object, +other);
  6558. case errorTag:
  6559. return object.name == other.name && object.message == other.message;
  6560. case regexpTag:
  6561. case stringTag:
  6562. // Coerce regexes to strings and treat strings, primitives and objects,
  6563. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6564. // for more details.
  6565. return object == (other + '');
  6566. case mapTag:
  6567. var convert = mapToArray;
  6568. case setTag:
  6569. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6570. convert || (convert = setToArray);
  6571. if (object.size != other.size && !isPartial) {
  6572. return false;
  6573. }
  6574. // Assume cyclic values are equal.
  6575. var stacked = stack.get(object);
  6576. if (stacked) {
  6577. return stacked == other;
  6578. }
  6579. bitmask |= COMPARE_UNORDERED_FLAG;
  6580. // Recursively compare objects (susceptible to call stack limits).
  6581. stack.set(object, other);
  6582. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6583. stack['delete'](object);
  6584. return result;
  6585. case symbolTag:
  6586. if (symbolValueOf) {
  6587. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6588. }
  6589. }
  6590. return false;
  6591. }
  6592. /**
  6593. * A specialized version of `baseIsEqualDeep` for objects with support for
  6594. * partial deep comparisons.
  6595. *
  6596. * @private
  6597. * @param {Object} object The object to compare.
  6598. * @param {Object} other The other object to compare.
  6599. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6600. * @param {Function} customizer The function to customize comparisons.
  6601. * @param {Function} equalFunc The function to determine equivalents of values.
  6602. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6603. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6604. */
  6605. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6606. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6607. objProps = getAllKeys(object),
  6608. objLength = objProps.length,
  6609. othProps = getAllKeys(other),
  6610. othLength = othProps.length;
  6611. if (objLength != othLength && !isPartial) {
  6612. return false;
  6613. }
  6614. var index = objLength;
  6615. while (index--) {
  6616. var key = objProps[index];
  6617. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6618. return false;
  6619. }
  6620. }
  6621. // Check that cyclic values are equal.
  6622. var objStacked = stack.get(object);
  6623. var othStacked = stack.get(other);
  6624. if (objStacked && othStacked) {
  6625. return objStacked == other && othStacked == object;
  6626. }
  6627. var result = true;
  6628. stack.set(object, other);
  6629. stack.set(other, object);
  6630. var skipCtor = isPartial;
  6631. while (++index < objLength) {
  6632. key = objProps[index];
  6633. var objValue = object[key],
  6634. othValue = other[key];
  6635. if (customizer) {
  6636. var compared = isPartial
  6637. ? customizer(othValue, objValue, key, other, object, stack)
  6638. : customizer(objValue, othValue, key, object, other, stack);
  6639. }
  6640. // Recursively compare objects (susceptible to call stack limits).
  6641. if (!(compared === undefined
  6642. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6643. : compared
  6644. )) {
  6645. result = false;
  6646. break;
  6647. }
  6648. skipCtor || (skipCtor = key == 'constructor');
  6649. }
  6650. if (result && !skipCtor) {
  6651. var objCtor = object.constructor,
  6652. othCtor = other.constructor;
  6653. // Non `Object` object instances with different constructors are not equal.
  6654. if (objCtor != othCtor &&
  6655. ('constructor' in object && 'constructor' in other) &&
  6656. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6657. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6658. result = false;
  6659. }
  6660. }
  6661. stack['delete'](object);
  6662. stack['delete'](other);
  6663. return result;
  6664. }
  6665. /**
  6666. * A specialized version of `baseRest` which flattens the rest array.
  6667. *
  6668. * @private
  6669. * @param {Function} func The function to apply a rest parameter to.
  6670. * @returns {Function} Returns the new function.
  6671. */
  6672. function flatRest(func) {
  6673. return setToString(overRest(func, undefined, flatten), func + '');
  6674. }
  6675. /**
  6676. * Creates an array of own enumerable property names and symbols of `object`.
  6677. *
  6678. * @private
  6679. * @param {Object} object The object to query.
  6680. * @returns {Array} Returns the array of property names and symbols.
  6681. */
  6682. function getAllKeys(object) {
  6683. return baseGetAllKeys(object, keys, getSymbols);
  6684. }
  6685. /**
  6686. * Creates an array of own and inherited enumerable property names and
  6687. * symbols of `object`.
  6688. *
  6689. * @private
  6690. * @param {Object} object The object to query.
  6691. * @returns {Array} Returns the array of property names and symbols.
  6692. */
  6693. function getAllKeysIn(object) {
  6694. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6695. }
  6696. /**
  6697. * Gets metadata for `func`.
  6698. *
  6699. * @private
  6700. * @param {Function} func The function to query.
  6701. * @returns {*} Returns the metadata for `func`.
  6702. */
  6703. var getData = !metaMap ? noop : function(func) {
  6704. return metaMap.get(func);
  6705. };
  6706. /**
  6707. * Gets the name of `func`.
  6708. *
  6709. * @private
  6710. * @param {Function} func The function to query.
  6711. * @returns {string} Returns the function name.
  6712. */
  6713. function getFuncName(func) {
  6714. var result = (func.name + ''),
  6715. array = realNames[result],
  6716. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6717. while (length--) {
  6718. var data = array[length],
  6719. otherFunc = data.func;
  6720. if (otherFunc == null || otherFunc == func) {
  6721. return data.name;
  6722. }
  6723. }
  6724. return result;
  6725. }
  6726. /**
  6727. * Gets the argument placeholder value for `func`.
  6728. *
  6729. * @private
  6730. * @param {Function} func The function to inspect.
  6731. * @returns {*} Returns the placeholder value.
  6732. */
  6733. function getHolder(func) {
  6734. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6735. return object.placeholder;
  6736. }
  6737. /**
  6738. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6739. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6740. * If arguments are provided, the chosen function is invoked with them and
  6741. * its result is returned.
  6742. *
  6743. * @private
  6744. * @param {*} [value] The value to convert to an iteratee.
  6745. * @param {number} [arity] The arity of the created iteratee.
  6746. * @returns {Function} Returns the chosen function or its result.
  6747. */
  6748. function getIteratee() {
  6749. var result = lodash.iteratee || iteratee;
  6750. result = result === iteratee ? baseIteratee : result;
  6751. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6752. }
  6753. /**
  6754. * Gets the data for `map`.
  6755. *
  6756. * @private
  6757. * @param {Object} map The map to query.
  6758. * @param {string} key The reference key.
  6759. * @returns {*} Returns the map data.
  6760. */
  6761. function getMapData(map, key) {
  6762. var data = map.__data__;
  6763. return isKeyable(key)
  6764. ? data[typeof key == 'string' ? 'string' : 'hash']
  6765. : data.map;
  6766. }
  6767. /**
  6768. * Gets the property names, values, and compare flags of `object`.
  6769. *
  6770. * @private
  6771. * @param {Object} object The object to query.
  6772. * @returns {Array} Returns the match data of `object`.
  6773. */
  6774. function getMatchData(object) {
  6775. var result = keys(object),
  6776. length = result.length;
  6777. while (length--) {
  6778. var key = result[length],
  6779. value = object[key];
  6780. result[length] = [key, value, isStrictComparable(value)];
  6781. }
  6782. return result;
  6783. }
  6784. /**
  6785. * Gets the native function at `key` of `object`.
  6786. *
  6787. * @private
  6788. * @param {Object} object The object to query.
  6789. * @param {string} key The key of the method to get.
  6790. * @returns {*} Returns the function if it's native, else `undefined`.
  6791. */
  6792. function getNative(object, key) {
  6793. var value = getValue(object, key);
  6794. return baseIsNative(value) ? value : undefined;
  6795. }
  6796. /**
  6797. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6798. *
  6799. * @private
  6800. * @param {*} value The value to query.
  6801. * @returns {string} Returns the raw `toStringTag`.
  6802. */
  6803. function getRawTag(value) {
  6804. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6805. tag = value[symToStringTag];
  6806. try {
  6807. value[symToStringTag] = undefined;
  6808. var unmasked = true;
  6809. } catch (e) {}
  6810. var result = nativeObjectToString.call(value);
  6811. if (unmasked) {
  6812. if (isOwn) {
  6813. value[symToStringTag] = tag;
  6814. } else {
  6815. delete value[symToStringTag];
  6816. }
  6817. }
  6818. return result;
  6819. }
  6820. /**
  6821. * Creates an array of the own enumerable symbols of `object`.
  6822. *
  6823. * @private
  6824. * @param {Object} object The object to query.
  6825. * @returns {Array} Returns the array of symbols.
  6826. */
  6827. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6828. if (object == null) {
  6829. return [];
  6830. }
  6831. object = Object(object);
  6832. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6833. return propertyIsEnumerable.call(object, symbol);
  6834. });
  6835. };
  6836. /**
  6837. * Creates an array of the own and inherited enumerable symbols of `object`.
  6838. *
  6839. * @private
  6840. * @param {Object} object The object to query.
  6841. * @returns {Array} Returns the array of symbols.
  6842. */
  6843. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6844. var result = [];
  6845. while (object) {
  6846. arrayPush(result, getSymbols(object));
  6847. object = getPrototype(object);
  6848. }
  6849. return result;
  6850. };
  6851. /**
  6852. * Gets the `toStringTag` of `value`.
  6853. *
  6854. * @private
  6855. * @param {*} value The value to query.
  6856. * @returns {string} Returns the `toStringTag`.
  6857. */
  6858. var getTag = baseGetTag;
  6859. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6860. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6861. (Map && getTag(new Map) != mapTag) ||
  6862. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6863. (Set && getTag(new Set) != setTag) ||
  6864. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6865. getTag = function(value) {
  6866. var result = baseGetTag(value),
  6867. Ctor = result == objectTag ? value.constructor : undefined,
  6868. ctorString = Ctor ? toSource(Ctor) : '';
  6869. if (ctorString) {
  6870. switch (ctorString) {
  6871. case dataViewCtorString: return dataViewTag;
  6872. case mapCtorString: return mapTag;
  6873. case promiseCtorString: return promiseTag;
  6874. case setCtorString: return setTag;
  6875. case weakMapCtorString: return weakMapTag;
  6876. }
  6877. }
  6878. return result;
  6879. };
  6880. }
  6881. /**
  6882. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6883. *
  6884. * @private
  6885. * @param {number} start The start of the view.
  6886. * @param {number} end The end of the view.
  6887. * @param {Array} transforms The transformations to apply to the view.
  6888. * @returns {Object} Returns an object containing the `start` and `end`
  6889. * positions of the view.
  6890. */
  6891. function getView(start, end, transforms) {
  6892. var index = -1,
  6893. length = transforms.length;
  6894. while (++index < length) {
  6895. var data = transforms[index],
  6896. size = data.size;
  6897. switch (data.type) {
  6898. case 'drop': start += size; break;
  6899. case 'dropRight': end -= size; break;
  6900. case 'take': end = nativeMin(end, start + size); break;
  6901. case 'takeRight': start = nativeMax(start, end - size); break;
  6902. }
  6903. }
  6904. return { 'start': start, 'end': end };
  6905. }
  6906. /**
  6907. * Extracts wrapper details from the `source` body comment.
  6908. *
  6909. * @private
  6910. * @param {string} source The source to inspect.
  6911. * @returns {Array} Returns the wrapper details.
  6912. */
  6913. function getWrapDetails(source) {
  6914. var match = source.match(reWrapDetails);
  6915. return match ? match[1].split(reSplitDetails) : [];
  6916. }
  6917. /**
  6918. * Checks if `path` exists on `object`.
  6919. *
  6920. * @private
  6921. * @param {Object} object The object to query.
  6922. * @param {Array|string} path The path to check.
  6923. * @param {Function} hasFunc The function to check properties.
  6924. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6925. */
  6926. function hasPath(object, path, hasFunc) {
  6927. path = castPath(path, object);
  6928. var index = -1,
  6929. length = path.length,
  6930. result = false;
  6931. while (++index < length) {
  6932. var key = toKey(path[index]);
  6933. if (!(result = object != null && hasFunc(object, key))) {
  6934. break;
  6935. }
  6936. object = object[key];
  6937. }
  6938. if (result || ++index != length) {
  6939. return result;
  6940. }
  6941. length = object == null ? 0 : object.length;
  6942. return !!length && isLength(length) && isIndex(key, length) &&
  6943. (isArray(object) || isArguments(object));
  6944. }
  6945. /**
  6946. * Initializes an array clone.
  6947. *
  6948. * @private
  6949. * @param {Array} array The array to clone.
  6950. * @returns {Array} Returns the initialized clone.
  6951. */
  6952. function initCloneArray(array) {
  6953. var length = array.length,
  6954. result = new array.constructor(length);
  6955. // Add properties assigned by `RegExp#exec`.
  6956. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6957. result.index = array.index;
  6958. result.input = array.input;
  6959. }
  6960. return result;
  6961. }
  6962. /**
  6963. * Initializes an object clone.
  6964. *
  6965. * @private
  6966. * @param {Object} object The object to clone.
  6967. * @returns {Object} Returns the initialized clone.
  6968. */
  6969. function initCloneObject(object) {
  6970. return (typeof object.constructor == 'function' && !isPrototype(object))
  6971. ? baseCreate(getPrototype(object))
  6972. : {};
  6973. }
  6974. /**
  6975. * Initializes an object clone based on its `toStringTag`.
  6976. *
  6977. * **Note:** This function only supports cloning values with tags of
  6978. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6979. *
  6980. * @private
  6981. * @param {Object} object The object to clone.
  6982. * @param {string} tag The `toStringTag` of the object to clone.
  6983. * @param {boolean} [isDeep] Specify a deep clone.
  6984. * @returns {Object} Returns the initialized clone.
  6985. */
  6986. function initCloneByTag(object, tag, isDeep) {
  6987. var Ctor = object.constructor;
  6988. switch (tag) {
  6989. case arrayBufferTag:
  6990. return cloneArrayBuffer(object);
  6991. case boolTag:
  6992. case dateTag:
  6993. return new Ctor(+object);
  6994. case dataViewTag:
  6995. return cloneDataView(object, isDeep);
  6996. case float32Tag: case float64Tag:
  6997. case int8Tag: case int16Tag: case int32Tag:
  6998. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6999. return cloneTypedArray(object, isDeep);
  7000. case mapTag:
  7001. return new Ctor;
  7002. case numberTag:
  7003. case stringTag:
  7004. return new Ctor(object);
  7005. case regexpTag:
  7006. return cloneRegExp(object);
  7007. case setTag:
  7008. return new Ctor;
  7009. case symbolTag:
  7010. return cloneSymbol(object);
  7011. }
  7012. }
  7013. /**
  7014. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7015. *
  7016. * @private
  7017. * @param {string} source The source to modify.
  7018. * @returns {Array} details The details to insert.
  7019. * @returns {string} Returns the modified source.
  7020. */
  7021. function insertWrapDetails(source, details) {
  7022. var length = details.length;
  7023. if (!length) {
  7024. return source;
  7025. }
  7026. var lastIndex = length - 1;
  7027. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7028. details = details.join(length > 2 ? ', ' : ' ');
  7029. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7030. }
  7031. /**
  7032. * Checks if `value` is a flattenable `arguments` object or array.
  7033. *
  7034. * @private
  7035. * @param {*} value The value to check.
  7036. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7037. */
  7038. function isFlattenable(value) {
  7039. return isArray(value) || isArguments(value) ||
  7040. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7041. }
  7042. /**
  7043. * Checks if `value` is a valid array-like index.
  7044. *
  7045. * @private
  7046. * @param {*} value The value to check.
  7047. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7048. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7049. */
  7050. function isIndex(value, length) {
  7051. var type = typeof value;
  7052. length = length == null ? MAX_SAFE_INTEGER : length;
  7053. return !!length &&
  7054. (type == 'number' ||
  7055. (type != 'symbol' && reIsUint.test(value))) &&
  7056. (value > -1 && value % 1 == 0 && value < length);
  7057. }
  7058. /**
  7059. * Checks if the given arguments are from an iteratee call.
  7060. *
  7061. * @private
  7062. * @param {*} value The potential iteratee value argument.
  7063. * @param {*} index The potential iteratee index or key argument.
  7064. * @param {*} object The potential iteratee object argument.
  7065. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7066. * else `false`.
  7067. */
  7068. function isIterateeCall(value, index, object) {
  7069. if (!isObject(object)) {
  7070. return false;
  7071. }
  7072. var type = typeof index;
  7073. if (type == 'number'
  7074. ? (isArrayLike(object) && isIndex(index, object.length))
  7075. : (type == 'string' && index in object)
  7076. ) {
  7077. return eq(object[index], value);
  7078. }
  7079. return false;
  7080. }
  7081. /**
  7082. * Checks if `value` is a property name and not a property path.
  7083. *
  7084. * @private
  7085. * @param {*} value The value to check.
  7086. * @param {Object} [object] The object to query keys on.
  7087. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7088. */
  7089. function isKey(value, object) {
  7090. if (isArray(value)) {
  7091. return false;
  7092. }
  7093. var type = typeof value;
  7094. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7095. value == null || isSymbol(value)) {
  7096. return true;
  7097. }
  7098. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7099. (object != null && value in Object(object));
  7100. }
  7101. /**
  7102. * Checks if `value` is suitable for use as unique object key.
  7103. *
  7104. * @private
  7105. * @param {*} value The value to check.
  7106. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7107. */
  7108. function isKeyable(value) {
  7109. var type = typeof value;
  7110. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7111. ? (value !== '__proto__')
  7112. : (value === null);
  7113. }
  7114. /**
  7115. * Checks if `func` has a lazy counterpart.
  7116. *
  7117. * @private
  7118. * @param {Function} func The function to check.
  7119. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7120. * else `false`.
  7121. */
  7122. function isLaziable(func) {
  7123. var funcName = getFuncName(func),
  7124. other = lodash[funcName];
  7125. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7126. return false;
  7127. }
  7128. if (func === other) {
  7129. return true;
  7130. }
  7131. var data = getData(other);
  7132. return !!data && func === data[0];
  7133. }
  7134. /**
  7135. * Checks if `func` has its source masked.
  7136. *
  7137. * @private
  7138. * @param {Function} func The function to check.
  7139. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7140. */
  7141. function isMasked(func) {
  7142. return !!maskSrcKey && (maskSrcKey in func);
  7143. }
  7144. /**
  7145. * Checks if `func` is capable of being masked.
  7146. *
  7147. * @private
  7148. * @param {*} value The value to check.
  7149. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7150. */
  7151. var isMaskable = coreJsData ? isFunction : stubFalse;
  7152. /**
  7153. * Checks if `value` is likely a prototype object.
  7154. *
  7155. * @private
  7156. * @param {*} value The value to check.
  7157. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7158. */
  7159. function isPrototype(value) {
  7160. var Ctor = value && value.constructor,
  7161. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7162. return value === proto;
  7163. }
  7164. /**
  7165. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7166. *
  7167. * @private
  7168. * @param {*} value The value to check.
  7169. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7170. * equality comparisons, else `false`.
  7171. */
  7172. function isStrictComparable(value) {
  7173. return value === value && !isObject(value);
  7174. }
  7175. /**
  7176. * A specialized version of `matchesProperty` for source values suitable
  7177. * for strict equality comparisons, i.e. `===`.
  7178. *
  7179. * @private
  7180. * @param {string} key The key of the property to get.
  7181. * @param {*} srcValue The value to match.
  7182. * @returns {Function} Returns the new spec function.
  7183. */
  7184. function matchesStrictComparable(key, srcValue) {
  7185. return function(object) {
  7186. if (object == null) {
  7187. return false;
  7188. }
  7189. return object[key] === srcValue &&
  7190. (srcValue !== undefined || (key in Object(object)));
  7191. };
  7192. }
  7193. /**
  7194. * A specialized version of `_.memoize` which clears the memoized function's
  7195. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7196. *
  7197. * @private
  7198. * @param {Function} func The function to have its output memoized.
  7199. * @returns {Function} Returns the new memoized function.
  7200. */
  7201. function memoizeCapped(func) {
  7202. var result = memoize(func, function(key) {
  7203. if (cache.size === MAX_MEMOIZE_SIZE) {
  7204. cache.clear();
  7205. }
  7206. return key;
  7207. });
  7208. var cache = result.cache;
  7209. return result;
  7210. }
  7211. /**
  7212. * Merges the function metadata of `source` into `data`.
  7213. *
  7214. * Merging metadata reduces the number of wrappers used to invoke a function.
  7215. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7216. * may be applied regardless of execution order. Methods like `_.ary` and
  7217. * `_.rearg` modify function arguments, making the order in which they are
  7218. * executed important, preventing the merging of metadata. However, we make
  7219. * an exception for a safe combined case where curried functions have `_.ary`
  7220. * and or `_.rearg` applied.
  7221. *
  7222. * @private
  7223. * @param {Array} data The destination metadata.
  7224. * @param {Array} source The source metadata.
  7225. * @returns {Array} Returns `data`.
  7226. */
  7227. function mergeData(data, source) {
  7228. var bitmask = data[1],
  7229. srcBitmask = source[1],
  7230. newBitmask = bitmask | srcBitmask,
  7231. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7232. var isCombo =
  7233. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7234. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7235. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7236. // Exit early if metadata can't be merged.
  7237. if (!(isCommon || isCombo)) {
  7238. return data;
  7239. }
  7240. // Use source `thisArg` if available.
  7241. if (srcBitmask & WRAP_BIND_FLAG) {
  7242. data[2] = source[2];
  7243. // Set when currying a bound function.
  7244. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7245. }
  7246. // Compose partial arguments.
  7247. var value = source[3];
  7248. if (value) {
  7249. var partials = data[3];
  7250. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7251. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7252. }
  7253. // Compose partial right arguments.
  7254. value = source[5];
  7255. if (value) {
  7256. partials = data[5];
  7257. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7258. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7259. }
  7260. // Use source `argPos` if available.
  7261. value = source[7];
  7262. if (value) {
  7263. data[7] = value;
  7264. }
  7265. // Use source `ary` if it's smaller.
  7266. if (srcBitmask & WRAP_ARY_FLAG) {
  7267. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7268. }
  7269. // Use source `arity` if one is not provided.
  7270. if (data[9] == null) {
  7271. data[9] = source[9];
  7272. }
  7273. // Use source `func` and merge bitmasks.
  7274. data[0] = source[0];
  7275. data[1] = newBitmask;
  7276. return data;
  7277. }
  7278. /**
  7279. * This function is like
  7280. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7281. * except that it includes inherited enumerable properties.
  7282. *
  7283. * @private
  7284. * @param {Object} object The object to query.
  7285. * @returns {Array} Returns the array of property names.
  7286. */
  7287. function nativeKeysIn(object) {
  7288. var result = [];
  7289. if (object != null) {
  7290. for (var key in Object(object)) {
  7291. result.push(key);
  7292. }
  7293. }
  7294. return result;
  7295. }
  7296. /**
  7297. * Converts `value` to a string using `Object.prototype.toString`.
  7298. *
  7299. * @private
  7300. * @param {*} value The value to convert.
  7301. * @returns {string} Returns the converted string.
  7302. */
  7303. function objectToString(value) {
  7304. return nativeObjectToString.call(value);
  7305. }
  7306. /**
  7307. * A specialized version of `baseRest` which transforms the rest array.
  7308. *
  7309. * @private
  7310. * @param {Function} func The function to apply a rest parameter to.
  7311. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7312. * @param {Function} transform The rest array transform.
  7313. * @returns {Function} Returns the new function.
  7314. */
  7315. function overRest(func, start, transform) {
  7316. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7317. return function() {
  7318. var args = arguments,
  7319. index = -1,
  7320. length = nativeMax(args.length - start, 0),
  7321. array = Array(length);
  7322. while (++index < length) {
  7323. array[index] = args[start + index];
  7324. }
  7325. index = -1;
  7326. var otherArgs = Array(start + 1);
  7327. while (++index < start) {
  7328. otherArgs[index] = args[index];
  7329. }
  7330. otherArgs[start] = transform(array);
  7331. return apply(func, this, otherArgs);
  7332. };
  7333. }
  7334. /**
  7335. * Gets the parent value at `path` of `object`.
  7336. *
  7337. * @private
  7338. * @param {Object} object The object to query.
  7339. * @param {Array} path The path to get the parent value of.
  7340. * @returns {*} Returns the parent value.
  7341. */
  7342. function parent(object, path) {
  7343. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7344. }
  7345. /**
  7346. * Reorder `array` according to the specified indexes where the element at
  7347. * the first index is assigned as the first element, the element at
  7348. * the second index is assigned as the second element, and so on.
  7349. *
  7350. * @private
  7351. * @param {Array} array The array to reorder.
  7352. * @param {Array} indexes The arranged array indexes.
  7353. * @returns {Array} Returns `array`.
  7354. */
  7355. function reorder(array, indexes) {
  7356. var arrLength = array.length,
  7357. length = nativeMin(indexes.length, arrLength),
  7358. oldArray = copyArray(array);
  7359. while (length--) {
  7360. var index = indexes[length];
  7361. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7362. }
  7363. return array;
  7364. }
  7365. /**
  7366. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7367. *
  7368. * @private
  7369. * @param {Object} object The object to query.
  7370. * @param {string} key The key of the property to get.
  7371. * @returns {*} Returns the property value.
  7372. */
  7373. function safeGet(object, key) {
  7374. if (key === 'constructor' && typeof object[key] === 'function') {
  7375. return;
  7376. }
  7377. if (key == '__proto__') {
  7378. return;
  7379. }
  7380. return object[key];
  7381. }
  7382. /**
  7383. * Sets metadata for `func`.
  7384. *
  7385. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7386. * period of time, it will trip its breaker and transition to an identity
  7387. * function to avoid garbage collection pauses in V8. See
  7388. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7389. * for more details.
  7390. *
  7391. * @private
  7392. * @param {Function} func The function to associate metadata with.
  7393. * @param {*} data The metadata.
  7394. * @returns {Function} Returns `func`.
  7395. */
  7396. var setData = shortOut(baseSetData);
  7397. /**
  7398. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7399. *
  7400. * @private
  7401. * @param {Function} func The function to delay.
  7402. * @param {number} wait The number of milliseconds to delay invocation.
  7403. * @returns {number|Object} Returns the timer id or timeout object.
  7404. */
  7405. var setTimeout = ctxSetTimeout || function(func, wait) {
  7406. return root.setTimeout(func, wait);
  7407. };
  7408. /**
  7409. * Sets the `toString` method of `func` to return `string`.
  7410. *
  7411. * @private
  7412. * @param {Function} func The function to modify.
  7413. * @param {Function} string The `toString` result.
  7414. * @returns {Function} Returns `func`.
  7415. */
  7416. var setToString = shortOut(baseSetToString);
  7417. /**
  7418. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7419. * with wrapper details in a comment at the top of the source body.
  7420. *
  7421. * @private
  7422. * @param {Function} wrapper The function to modify.
  7423. * @param {Function} reference The reference function.
  7424. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7425. * @returns {Function} Returns `wrapper`.
  7426. */
  7427. function setWrapToString(wrapper, reference, bitmask) {
  7428. var source = (reference + '');
  7429. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7430. }
  7431. /**
  7432. * Creates a function that'll short out and invoke `identity` instead
  7433. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7434. * milliseconds.
  7435. *
  7436. * @private
  7437. * @param {Function} func The function to restrict.
  7438. * @returns {Function} Returns the new shortable function.
  7439. */
  7440. function shortOut(func) {
  7441. var count = 0,
  7442. lastCalled = 0;
  7443. return function() {
  7444. var stamp = nativeNow(),
  7445. remaining = HOT_SPAN - (stamp - lastCalled);
  7446. lastCalled = stamp;
  7447. if (remaining > 0) {
  7448. if (++count >= HOT_COUNT) {
  7449. return arguments[0];
  7450. }
  7451. } else {
  7452. count = 0;
  7453. }
  7454. return func.apply(undefined, arguments);
  7455. };
  7456. }
  7457. /**
  7458. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7459. *
  7460. * @private
  7461. * @param {Array} array The array to shuffle.
  7462. * @param {number} [size=array.length] The size of `array`.
  7463. * @returns {Array} Returns `array`.
  7464. */
  7465. function shuffleSelf(array, size) {
  7466. var index = -1,
  7467. length = array.length,
  7468. lastIndex = length - 1;
  7469. size = size === undefined ? length : size;
  7470. while (++index < size) {
  7471. var rand = baseRandom(index, lastIndex),
  7472. value = array[rand];
  7473. array[rand] = array[index];
  7474. array[index] = value;
  7475. }
  7476. array.length = size;
  7477. return array;
  7478. }
  7479. /**
  7480. * Converts `string` to a property path array.
  7481. *
  7482. * @private
  7483. * @param {string} string The string to convert.
  7484. * @returns {Array} Returns the property path array.
  7485. */
  7486. var stringToPath = memoizeCapped(function(string) {
  7487. var result = [];
  7488. if (string.charCodeAt(0) === 46 /* . */) {
  7489. result.push('');
  7490. }
  7491. string.replace(rePropName, function(match, number, quote, subString) {
  7492. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7493. });
  7494. return result;
  7495. });
  7496. /**
  7497. * Converts `value` to a string key if it's not a string or symbol.
  7498. *
  7499. * @private
  7500. * @param {*} value The value to inspect.
  7501. * @returns {string|symbol} Returns the key.
  7502. */
  7503. function toKey(value) {
  7504. if (typeof value == 'string' || isSymbol(value)) {
  7505. return value;
  7506. }
  7507. var result = (value + '');
  7508. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7509. }
  7510. /**
  7511. * Converts `func` to its source code.
  7512. *
  7513. * @private
  7514. * @param {Function} func The function to convert.
  7515. * @returns {string} Returns the source code.
  7516. */
  7517. function toSource(func) {
  7518. if (func != null) {
  7519. try {
  7520. return funcToString.call(func);
  7521. } catch (e) {}
  7522. try {
  7523. return (func + '');
  7524. } catch (e) {}
  7525. }
  7526. return '';
  7527. }
  7528. /**
  7529. * Updates wrapper `details` based on `bitmask` flags.
  7530. *
  7531. * @private
  7532. * @returns {Array} details The details to modify.
  7533. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7534. * @returns {Array} Returns `details`.
  7535. */
  7536. function updateWrapDetails(details, bitmask) {
  7537. arrayEach(wrapFlags, function(pair) {
  7538. var value = '_.' + pair[0];
  7539. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7540. details.push(value);
  7541. }
  7542. });
  7543. return details.sort();
  7544. }
  7545. /**
  7546. * Creates a clone of `wrapper`.
  7547. *
  7548. * @private
  7549. * @param {Object} wrapper The wrapper to clone.
  7550. * @returns {Object} Returns the cloned wrapper.
  7551. */
  7552. function wrapperClone(wrapper) {
  7553. if (wrapper instanceof LazyWrapper) {
  7554. return wrapper.clone();
  7555. }
  7556. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7557. result.__actions__ = copyArray(wrapper.__actions__);
  7558. result.__index__ = wrapper.__index__;
  7559. result.__values__ = wrapper.__values__;
  7560. return result;
  7561. }
  7562. /*------------------------------------------------------------------------*/
  7563. /**
  7564. * Creates an array of elements split into groups the length of `size`.
  7565. * If `array` can't be split evenly, the final chunk will be the remaining
  7566. * elements.
  7567. *
  7568. * @static
  7569. * @memberOf _
  7570. * @since 3.0.0
  7571. * @category Array
  7572. * @param {Array} array The array to process.
  7573. * @param {number} [size=1] The length of each chunk
  7574. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7575. * @returns {Array} Returns the new array of chunks.
  7576. * @example
  7577. *
  7578. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7579. * // => [['a', 'b'], ['c', 'd']]
  7580. *
  7581. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7582. * // => [['a', 'b', 'c'], ['d']]
  7583. */
  7584. function chunk(array, size, guard) {
  7585. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7586. size = 1;
  7587. } else {
  7588. size = nativeMax(toInteger(size), 0);
  7589. }
  7590. var length = array == null ? 0 : array.length;
  7591. if (!length || size < 1) {
  7592. return [];
  7593. }
  7594. var index = 0,
  7595. resIndex = 0,
  7596. result = Array(nativeCeil(length / size));
  7597. while (index < length) {
  7598. result[resIndex++] = baseSlice(array, index, (index += size));
  7599. }
  7600. return result;
  7601. }
  7602. /**
  7603. * Creates an array with all falsey values removed. The values `false`, `null`,
  7604. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7605. *
  7606. * @static
  7607. * @memberOf _
  7608. * @since 0.1.0
  7609. * @category Array
  7610. * @param {Array} array The array to compact.
  7611. * @returns {Array} Returns the new array of filtered values.
  7612. * @example
  7613. *
  7614. * _.compact([0, 1, false, 2, '', 3]);
  7615. * // => [1, 2, 3]
  7616. */
  7617. function compact(array) {
  7618. var index = -1,
  7619. length = array == null ? 0 : array.length,
  7620. resIndex = 0,
  7621. result = [];
  7622. while (++index < length) {
  7623. var value = array[index];
  7624. if (value) {
  7625. result[resIndex++] = value;
  7626. }
  7627. }
  7628. return result;
  7629. }
  7630. /**
  7631. * Creates a new array concatenating `array` with any additional arrays
  7632. * and/or values.
  7633. *
  7634. * @static
  7635. * @memberOf _
  7636. * @since 4.0.0
  7637. * @category Array
  7638. * @param {Array} array The array to concatenate.
  7639. * @param {...*} [values] The values to concatenate.
  7640. * @returns {Array} Returns the new concatenated array.
  7641. * @example
  7642. *
  7643. * var array = [1];
  7644. * var other = _.concat(array, 2, [3], [[4]]);
  7645. *
  7646. * console.log(other);
  7647. * // => [1, 2, 3, [4]]
  7648. *
  7649. * console.log(array);
  7650. * // => [1]
  7651. */
  7652. function concat() {
  7653. var length = arguments.length;
  7654. if (!length) {
  7655. return [];
  7656. }
  7657. var args = Array(length - 1),
  7658. array = arguments[0],
  7659. index = length;
  7660. while (index--) {
  7661. args[index - 1] = arguments[index];
  7662. }
  7663. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7664. }
  7665. /**
  7666. * Creates an array of `array` values not included in the other given arrays
  7667. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7668. * for equality comparisons. The order and references of result values are
  7669. * determined by the first array.
  7670. *
  7671. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7672. *
  7673. * @static
  7674. * @memberOf _
  7675. * @since 0.1.0
  7676. * @category Array
  7677. * @param {Array} array The array to inspect.
  7678. * @param {...Array} [values] The values to exclude.
  7679. * @returns {Array} Returns the new array of filtered values.
  7680. * @see _.without, _.xor
  7681. * @example
  7682. *
  7683. * _.difference([2, 1], [2, 3]);
  7684. * // => [1]
  7685. */
  7686. var difference = baseRest(function(array, values) {
  7687. return isArrayLikeObject(array)
  7688. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7689. : [];
  7690. });
  7691. /**
  7692. * This method is like `_.difference` except that it accepts `iteratee` which
  7693. * is invoked for each element of `array` and `values` to generate the criterion
  7694. * by which they're compared. The order and references of result values are
  7695. * determined by the first array. The iteratee is invoked with one argument:
  7696. * (value).
  7697. *
  7698. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7699. *
  7700. * @static
  7701. * @memberOf _
  7702. * @since 4.0.0
  7703. * @category Array
  7704. * @param {Array} array The array to inspect.
  7705. * @param {...Array} [values] The values to exclude.
  7706. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7707. * @returns {Array} Returns the new array of filtered values.
  7708. * @example
  7709. *
  7710. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7711. * // => [1.2]
  7712. *
  7713. * // The `_.property` iteratee shorthand.
  7714. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7715. * // => [{ 'x': 2 }]
  7716. */
  7717. var differenceBy = baseRest(function(array, values) {
  7718. var iteratee = last(values);
  7719. if (isArrayLikeObject(iteratee)) {
  7720. iteratee = undefined;
  7721. }
  7722. return isArrayLikeObject(array)
  7723. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7724. : [];
  7725. });
  7726. /**
  7727. * This method is like `_.difference` except that it accepts `comparator`
  7728. * which is invoked to compare elements of `array` to `values`. The order and
  7729. * references of result values are determined by the first array. The comparator
  7730. * is invoked with two arguments: (arrVal, othVal).
  7731. *
  7732. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7733. *
  7734. * @static
  7735. * @memberOf _
  7736. * @since 4.0.0
  7737. * @category Array
  7738. * @param {Array} array The array to inspect.
  7739. * @param {...Array} [values] The values to exclude.
  7740. * @param {Function} [comparator] The comparator invoked per element.
  7741. * @returns {Array} Returns the new array of filtered values.
  7742. * @example
  7743. *
  7744. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7745. *
  7746. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7747. * // => [{ 'x': 2, 'y': 1 }]
  7748. */
  7749. var differenceWith = baseRest(function(array, values) {
  7750. var comparator = last(values);
  7751. if (isArrayLikeObject(comparator)) {
  7752. comparator = undefined;
  7753. }
  7754. return isArrayLikeObject(array)
  7755. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7756. : [];
  7757. });
  7758. /**
  7759. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7760. *
  7761. * @static
  7762. * @memberOf _
  7763. * @since 0.5.0
  7764. * @category Array
  7765. * @param {Array} array The array to query.
  7766. * @param {number} [n=1] The number of elements to drop.
  7767. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7768. * @returns {Array} Returns the slice of `array`.
  7769. * @example
  7770. *
  7771. * _.drop([1, 2, 3]);
  7772. * // => [2, 3]
  7773. *
  7774. * _.drop([1, 2, 3], 2);
  7775. * // => [3]
  7776. *
  7777. * _.drop([1, 2, 3], 5);
  7778. * // => []
  7779. *
  7780. * _.drop([1, 2, 3], 0);
  7781. * // => [1, 2, 3]
  7782. */
  7783. function drop(array, n, guard) {
  7784. var length = array == null ? 0 : array.length;
  7785. if (!length) {
  7786. return [];
  7787. }
  7788. n = (guard || n === undefined) ? 1 : toInteger(n);
  7789. return baseSlice(array, n < 0 ? 0 : n, length);
  7790. }
  7791. /**
  7792. * Creates a slice of `array` with `n` elements dropped from the end.
  7793. *
  7794. * @static
  7795. * @memberOf _
  7796. * @since 3.0.0
  7797. * @category Array
  7798. * @param {Array} array The array to query.
  7799. * @param {number} [n=1] The number of elements to drop.
  7800. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7801. * @returns {Array} Returns the slice of `array`.
  7802. * @example
  7803. *
  7804. * _.dropRight([1, 2, 3]);
  7805. * // => [1, 2]
  7806. *
  7807. * _.dropRight([1, 2, 3], 2);
  7808. * // => [1]
  7809. *
  7810. * _.dropRight([1, 2, 3], 5);
  7811. * // => []
  7812. *
  7813. * _.dropRight([1, 2, 3], 0);
  7814. * // => [1, 2, 3]
  7815. */
  7816. function dropRight(array, n, guard) {
  7817. var length = array == null ? 0 : array.length;
  7818. if (!length) {
  7819. return [];
  7820. }
  7821. n = (guard || n === undefined) ? 1 : toInteger(n);
  7822. n = length - n;
  7823. return baseSlice(array, 0, n < 0 ? 0 : n);
  7824. }
  7825. /**
  7826. * Creates a slice of `array` excluding elements dropped from the end.
  7827. * Elements are dropped until `predicate` returns falsey. The predicate is
  7828. * invoked with three arguments: (value, index, array).
  7829. *
  7830. * @static
  7831. * @memberOf _
  7832. * @since 3.0.0
  7833. * @category Array
  7834. * @param {Array} array The array to query.
  7835. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7836. * @returns {Array} Returns the slice of `array`.
  7837. * @example
  7838. *
  7839. * var users = [
  7840. * { 'user': 'barney', 'active': true },
  7841. * { 'user': 'fred', 'active': false },
  7842. * { 'user': 'pebbles', 'active': false }
  7843. * ];
  7844. *
  7845. * _.dropRightWhile(users, function(o) { return !o.active; });
  7846. * // => objects for ['barney']
  7847. *
  7848. * // The `_.matches` iteratee shorthand.
  7849. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7850. * // => objects for ['barney', 'fred']
  7851. *
  7852. * // The `_.matchesProperty` iteratee shorthand.
  7853. * _.dropRightWhile(users, ['active', false]);
  7854. * // => objects for ['barney']
  7855. *
  7856. * // The `_.property` iteratee shorthand.
  7857. * _.dropRightWhile(users, 'active');
  7858. * // => objects for ['barney', 'fred', 'pebbles']
  7859. */
  7860. function dropRightWhile(array, predicate) {
  7861. return (array && array.length)
  7862. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7863. : [];
  7864. }
  7865. /**
  7866. * Creates a slice of `array` excluding elements dropped from the beginning.
  7867. * Elements are dropped until `predicate` returns falsey. The predicate is
  7868. * invoked with three arguments: (value, index, array).
  7869. *
  7870. * @static
  7871. * @memberOf _
  7872. * @since 3.0.0
  7873. * @category Array
  7874. * @param {Array} array The array to query.
  7875. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7876. * @returns {Array} Returns the slice of `array`.
  7877. * @example
  7878. *
  7879. * var users = [
  7880. * { 'user': 'barney', 'active': false },
  7881. * { 'user': 'fred', 'active': false },
  7882. * { 'user': 'pebbles', 'active': true }
  7883. * ];
  7884. *
  7885. * _.dropWhile(users, function(o) { return !o.active; });
  7886. * // => objects for ['pebbles']
  7887. *
  7888. * // The `_.matches` iteratee shorthand.
  7889. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7890. * // => objects for ['fred', 'pebbles']
  7891. *
  7892. * // The `_.matchesProperty` iteratee shorthand.
  7893. * _.dropWhile(users, ['active', false]);
  7894. * // => objects for ['pebbles']
  7895. *
  7896. * // The `_.property` iteratee shorthand.
  7897. * _.dropWhile(users, 'active');
  7898. * // => objects for ['barney', 'fred', 'pebbles']
  7899. */
  7900. function dropWhile(array, predicate) {
  7901. return (array && array.length)
  7902. ? baseWhile(array, getIteratee(predicate, 3), true)
  7903. : [];
  7904. }
  7905. /**
  7906. * Fills elements of `array` with `value` from `start` up to, but not
  7907. * including, `end`.
  7908. *
  7909. * **Note:** This method mutates `array`.
  7910. *
  7911. * @static
  7912. * @memberOf _
  7913. * @since 3.2.0
  7914. * @category Array
  7915. * @param {Array} array The array to fill.
  7916. * @param {*} value The value to fill `array` with.
  7917. * @param {number} [start=0] The start position.
  7918. * @param {number} [end=array.length] The end position.
  7919. * @returns {Array} Returns `array`.
  7920. * @example
  7921. *
  7922. * var array = [1, 2, 3];
  7923. *
  7924. * _.fill(array, 'a');
  7925. * console.log(array);
  7926. * // => ['a', 'a', 'a']
  7927. *
  7928. * _.fill(Array(3), 2);
  7929. * // => [2, 2, 2]
  7930. *
  7931. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7932. * // => [4, '*', '*', 10]
  7933. */
  7934. function fill(array, value, start, end) {
  7935. var length = array == null ? 0 : array.length;
  7936. if (!length) {
  7937. return [];
  7938. }
  7939. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7940. start = 0;
  7941. end = length;
  7942. }
  7943. return baseFill(array, value, start, end);
  7944. }
  7945. /**
  7946. * This method is like `_.find` except that it returns the index of the first
  7947. * element `predicate` returns truthy for instead of the element itself.
  7948. *
  7949. * @static
  7950. * @memberOf _
  7951. * @since 1.1.0
  7952. * @category Array
  7953. * @param {Array} array The array to inspect.
  7954. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7955. * @param {number} [fromIndex=0] The index to search from.
  7956. * @returns {number} Returns the index of the found element, else `-1`.
  7957. * @example
  7958. *
  7959. * var users = [
  7960. * { 'user': 'barney', 'active': false },
  7961. * { 'user': 'fred', 'active': false },
  7962. * { 'user': 'pebbles', 'active': true }
  7963. * ];
  7964. *
  7965. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7966. * // => 0
  7967. *
  7968. * // The `_.matches` iteratee shorthand.
  7969. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7970. * // => 1
  7971. *
  7972. * // The `_.matchesProperty` iteratee shorthand.
  7973. * _.findIndex(users, ['active', false]);
  7974. * // => 0
  7975. *
  7976. * // The `_.property` iteratee shorthand.
  7977. * _.findIndex(users, 'active');
  7978. * // => 2
  7979. */
  7980. function findIndex(array, predicate, fromIndex) {
  7981. var length = array == null ? 0 : array.length;
  7982. if (!length) {
  7983. return -1;
  7984. }
  7985. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7986. if (index < 0) {
  7987. index = nativeMax(length + index, 0);
  7988. }
  7989. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7990. }
  7991. /**
  7992. * This method is like `_.findIndex` except that it iterates over elements
  7993. * of `collection` from right to left.
  7994. *
  7995. * @static
  7996. * @memberOf _
  7997. * @since 2.0.0
  7998. * @category Array
  7999. * @param {Array} array The array to inspect.
  8000. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8001. * @param {number} [fromIndex=array.length-1] The index to search from.
  8002. * @returns {number} Returns the index of the found element, else `-1`.
  8003. * @example
  8004. *
  8005. * var users = [
  8006. * { 'user': 'barney', 'active': true },
  8007. * { 'user': 'fred', 'active': false },
  8008. * { 'user': 'pebbles', 'active': false }
  8009. * ];
  8010. *
  8011. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8012. * // => 2
  8013. *
  8014. * // The `_.matches` iteratee shorthand.
  8015. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8016. * // => 0
  8017. *
  8018. * // The `_.matchesProperty` iteratee shorthand.
  8019. * _.findLastIndex(users, ['active', false]);
  8020. * // => 2
  8021. *
  8022. * // The `_.property` iteratee shorthand.
  8023. * _.findLastIndex(users, 'active');
  8024. * // => 0
  8025. */
  8026. function findLastIndex(array, predicate, fromIndex) {
  8027. var length = array == null ? 0 : array.length;
  8028. if (!length) {
  8029. return -1;
  8030. }
  8031. var index = length - 1;
  8032. if (fromIndex !== undefined) {
  8033. index = toInteger(fromIndex);
  8034. index = fromIndex < 0
  8035. ? nativeMax(length + index, 0)
  8036. : nativeMin(index, length - 1);
  8037. }
  8038. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8039. }
  8040. /**
  8041. * Flattens `array` a single level deep.
  8042. *
  8043. * @static
  8044. * @memberOf _
  8045. * @since 0.1.0
  8046. * @category Array
  8047. * @param {Array} array The array to flatten.
  8048. * @returns {Array} Returns the new flattened array.
  8049. * @example
  8050. *
  8051. * _.flatten([1, [2, [3, [4]], 5]]);
  8052. * // => [1, 2, [3, [4]], 5]
  8053. */
  8054. function flatten(array) {
  8055. var length = array == null ? 0 : array.length;
  8056. return length ? baseFlatten(array, 1) : [];
  8057. }
  8058. /**
  8059. * Recursively flattens `array`.
  8060. *
  8061. * @static
  8062. * @memberOf _
  8063. * @since 3.0.0
  8064. * @category Array
  8065. * @param {Array} array The array to flatten.
  8066. * @returns {Array} Returns the new flattened array.
  8067. * @example
  8068. *
  8069. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8070. * // => [1, 2, 3, 4, 5]
  8071. */
  8072. function flattenDeep(array) {
  8073. var length = array == null ? 0 : array.length;
  8074. return length ? baseFlatten(array, INFINITY) : [];
  8075. }
  8076. /**
  8077. * Recursively flatten `array` up to `depth` times.
  8078. *
  8079. * @static
  8080. * @memberOf _
  8081. * @since 4.4.0
  8082. * @category Array
  8083. * @param {Array} array The array to flatten.
  8084. * @param {number} [depth=1] The maximum recursion depth.
  8085. * @returns {Array} Returns the new flattened array.
  8086. * @example
  8087. *
  8088. * var array = [1, [2, [3, [4]], 5]];
  8089. *
  8090. * _.flattenDepth(array, 1);
  8091. * // => [1, 2, [3, [4]], 5]
  8092. *
  8093. * _.flattenDepth(array, 2);
  8094. * // => [1, 2, 3, [4], 5]
  8095. */
  8096. function flattenDepth(array, depth) {
  8097. var length = array == null ? 0 : array.length;
  8098. if (!length) {
  8099. return [];
  8100. }
  8101. depth = depth === undefined ? 1 : toInteger(depth);
  8102. return baseFlatten(array, depth);
  8103. }
  8104. /**
  8105. * The inverse of `_.toPairs`; this method returns an object composed
  8106. * from key-value `pairs`.
  8107. *
  8108. * @static
  8109. * @memberOf _
  8110. * @since 4.0.0
  8111. * @category Array
  8112. * @param {Array} pairs The key-value pairs.
  8113. * @returns {Object} Returns the new object.
  8114. * @example
  8115. *
  8116. * _.fromPairs([['a', 1], ['b', 2]]);
  8117. * // => { 'a': 1, 'b': 2 }
  8118. */
  8119. function fromPairs(pairs) {
  8120. var index = -1,
  8121. length = pairs == null ? 0 : pairs.length,
  8122. result = {};
  8123. while (++index < length) {
  8124. var pair = pairs[index];
  8125. result[pair[0]] = pair[1];
  8126. }
  8127. return result;
  8128. }
  8129. /**
  8130. * Gets the first element of `array`.
  8131. *
  8132. * @static
  8133. * @memberOf _
  8134. * @since 0.1.0
  8135. * @alias first
  8136. * @category Array
  8137. * @param {Array} array The array to query.
  8138. * @returns {*} Returns the first element of `array`.
  8139. * @example
  8140. *
  8141. * _.head([1, 2, 3]);
  8142. * // => 1
  8143. *
  8144. * _.head([]);
  8145. * // => undefined
  8146. */
  8147. function head(array) {
  8148. return (array && array.length) ? array[0] : undefined;
  8149. }
  8150. /**
  8151. * Gets the index at which the first occurrence of `value` is found in `array`
  8152. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8153. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8154. * offset from the end of `array`.
  8155. *
  8156. * @static
  8157. * @memberOf _
  8158. * @since 0.1.0
  8159. * @category Array
  8160. * @param {Array} array The array to inspect.
  8161. * @param {*} value The value to search for.
  8162. * @param {number} [fromIndex=0] The index to search from.
  8163. * @returns {number} Returns the index of the matched value, else `-1`.
  8164. * @example
  8165. *
  8166. * _.indexOf([1, 2, 1, 2], 2);
  8167. * // => 1
  8168. *
  8169. * // Search from the `fromIndex`.
  8170. * _.indexOf([1, 2, 1, 2], 2, 2);
  8171. * // => 3
  8172. */
  8173. function indexOf(array, value, fromIndex) {
  8174. var length = array == null ? 0 : array.length;
  8175. if (!length) {
  8176. return -1;
  8177. }
  8178. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8179. if (index < 0) {
  8180. index = nativeMax(length + index, 0);
  8181. }
  8182. return baseIndexOf(array, value, index);
  8183. }
  8184. /**
  8185. * Gets all but the last element of `array`.
  8186. *
  8187. * @static
  8188. * @memberOf _
  8189. * @since 0.1.0
  8190. * @category Array
  8191. * @param {Array} array The array to query.
  8192. * @returns {Array} Returns the slice of `array`.
  8193. * @example
  8194. *
  8195. * _.initial([1, 2, 3]);
  8196. * // => [1, 2]
  8197. */
  8198. function initial(array) {
  8199. var length = array == null ? 0 : array.length;
  8200. return length ? baseSlice(array, 0, -1) : [];
  8201. }
  8202. /**
  8203. * Creates an array of unique values that are included in all given arrays
  8204. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8205. * for equality comparisons. The order and references of result values are
  8206. * determined by the first array.
  8207. *
  8208. * @static
  8209. * @memberOf _
  8210. * @since 0.1.0
  8211. * @category Array
  8212. * @param {...Array} [arrays] The arrays to inspect.
  8213. * @returns {Array} Returns the new array of intersecting values.
  8214. * @example
  8215. *
  8216. * _.intersection([2, 1], [2, 3]);
  8217. * // => [2]
  8218. */
  8219. var intersection = baseRest(function(arrays) {
  8220. var mapped = arrayMap(arrays, castArrayLikeObject);
  8221. return (mapped.length && mapped[0] === arrays[0])
  8222. ? baseIntersection(mapped)
  8223. : [];
  8224. });
  8225. /**
  8226. * This method is like `_.intersection` except that it accepts `iteratee`
  8227. * which is invoked for each element of each `arrays` to generate the criterion
  8228. * by which they're compared. The order and references of result values are
  8229. * determined by the first array. The iteratee is invoked with one argument:
  8230. * (value).
  8231. *
  8232. * @static
  8233. * @memberOf _
  8234. * @since 4.0.0
  8235. * @category Array
  8236. * @param {...Array} [arrays] The arrays to inspect.
  8237. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8238. * @returns {Array} Returns the new array of intersecting values.
  8239. * @example
  8240. *
  8241. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8242. * // => [2.1]
  8243. *
  8244. * // The `_.property` iteratee shorthand.
  8245. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8246. * // => [{ 'x': 1 }]
  8247. */
  8248. var intersectionBy = baseRest(function(arrays) {
  8249. var iteratee = last(arrays),
  8250. mapped = arrayMap(arrays, castArrayLikeObject);
  8251. if (iteratee === last(mapped)) {
  8252. iteratee = undefined;
  8253. } else {
  8254. mapped.pop();
  8255. }
  8256. return (mapped.length && mapped[0] === arrays[0])
  8257. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8258. : [];
  8259. });
  8260. /**
  8261. * This method is like `_.intersection` except that it accepts `comparator`
  8262. * which is invoked to compare elements of `arrays`. The order and references
  8263. * of result values are determined by the first array. The comparator is
  8264. * invoked with two arguments: (arrVal, othVal).
  8265. *
  8266. * @static
  8267. * @memberOf _
  8268. * @since 4.0.0
  8269. * @category Array
  8270. * @param {...Array} [arrays] The arrays to inspect.
  8271. * @param {Function} [comparator] The comparator invoked per element.
  8272. * @returns {Array} Returns the new array of intersecting values.
  8273. * @example
  8274. *
  8275. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8276. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8277. *
  8278. * _.intersectionWith(objects, others, _.isEqual);
  8279. * // => [{ 'x': 1, 'y': 2 }]
  8280. */
  8281. var intersectionWith = baseRest(function(arrays) {
  8282. var comparator = last(arrays),
  8283. mapped = arrayMap(arrays, castArrayLikeObject);
  8284. comparator = typeof comparator == 'function' ? comparator : undefined;
  8285. if (comparator) {
  8286. mapped.pop();
  8287. }
  8288. return (mapped.length && mapped[0] === arrays[0])
  8289. ? baseIntersection(mapped, undefined, comparator)
  8290. : [];
  8291. });
  8292. /**
  8293. * Converts all elements in `array` into a string separated by `separator`.
  8294. *
  8295. * @static
  8296. * @memberOf _
  8297. * @since 4.0.0
  8298. * @category Array
  8299. * @param {Array} array The array to convert.
  8300. * @param {string} [separator=','] The element separator.
  8301. * @returns {string} Returns the joined string.
  8302. * @example
  8303. *
  8304. * _.join(['a', 'b', 'c'], '~');
  8305. * // => 'a~b~c'
  8306. */
  8307. function join(array, separator) {
  8308. return array == null ? '' : nativeJoin.call(array, separator);
  8309. }
  8310. /**
  8311. * Gets the last element of `array`.
  8312. *
  8313. * @static
  8314. * @memberOf _
  8315. * @since 0.1.0
  8316. * @category Array
  8317. * @param {Array} array The array to query.
  8318. * @returns {*} Returns the last element of `array`.
  8319. * @example
  8320. *
  8321. * _.last([1, 2, 3]);
  8322. * // => 3
  8323. */
  8324. function last(array) {
  8325. var length = array == null ? 0 : array.length;
  8326. return length ? array[length - 1] : undefined;
  8327. }
  8328. /**
  8329. * This method is like `_.indexOf` except that it iterates over elements of
  8330. * `array` from right to left.
  8331. *
  8332. * @static
  8333. * @memberOf _
  8334. * @since 0.1.0
  8335. * @category Array
  8336. * @param {Array} array The array to inspect.
  8337. * @param {*} value The value to search for.
  8338. * @param {number} [fromIndex=array.length-1] The index to search from.
  8339. * @returns {number} Returns the index of the matched value, else `-1`.
  8340. * @example
  8341. *
  8342. * _.lastIndexOf([1, 2, 1, 2], 2);
  8343. * // => 3
  8344. *
  8345. * // Search from the `fromIndex`.
  8346. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8347. * // => 1
  8348. */
  8349. function lastIndexOf(array, value, fromIndex) {
  8350. var length = array == null ? 0 : array.length;
  8351. if (!length) {
  8352. return -1;
  8353. }
  8354. var index = length;
  8355. if (fromIndex !== undefined) {
  8356. index = toInteger(fromIndex);
  8357. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8358. }
  8359. return value === value
  8360. ? strictLastIndexOf(array, value, index)
  8361. : baseFindIndex(array, baseIsNaN, index, true);
  8362. }
  8363. /**
  8364. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8365. * element from the end is returned.
  8366. *
  8367. * @static
  8368. * @memberOf _
  8369. * @since 4.11.0
  8370. * @category Array
  8371. * @param {Array} array The array to query.
  8372. * @param {number} [n=0] The index of the element to return.
  8373. * @returns {*} Returns the nth element of `array`.
  8374. * @example
  8375. *
  8376. * var array = ['a', 'b', 'c', 'd'];
  8377. *
  8378. * _.nth(array, 1);
  8379. * // => 'b'
  8380. *
  8381. * _.nth(array, -2);
  8382. * // => 'c';
  8383. */
  8384. function nth(array, n) {
  8385. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8386. }
  8387. /**
  8388. * Removes all given values from `array` using
  8389. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8390. * for equality comparisons.
  8391. *
  8392. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8393. * to remove elements from an array by predicate.
  8394. *
  8395. * @static
  8396. * @memberOf _
  8397. * @since 2.0.0
  8398. * @category Array
  8399. * @param {Array} array The array to modify.
  8400. * @param {...*} [values] The values to remove.
  8401. * @returns {Array} Returns `array`.
  8402. * @example
  8403. *
  8404. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8405. *
  8406. * _.pull(array, 'a', 'c');
  8407. * console.log(array);
  8408. * // => ['b', 'b']
  8409. */
  8410. var pull = baseRest(pullAll);
  8411. /**
  8412. * This method is like `_.pull` except that it accepts an array of values to remove.
  8413. *
  8414. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8415. *
  8416. * @static
  8417. * @memberOf _
  8418. * @since 4.0.0
  8419. * @category Array
  8420. * @param {Array} array The array to modify.
  8421. * @param {Array} values The values to remove.
  8422. * @returns {Array} Returns `array`.
  8423. * @example
  8424. *
  8425. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8426. *
  8427. * _.pullAll(array, ['a', 'c']);
  8428. * console.log(array);
  8429. * // => ['b', 'b']
  8430. */
  8431. function pullAll(array, values) {
  8432. return (array && array.length && values && values.length)
  8433. ? basePullAll(array, values)
  8434. : array;
  8435. }
  8436. /**
  8437. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8438. * invoked for each element of `array` and `values` to generate the criterion
  8439. * by which they're compared. The iteratee is invoked with one argument: (value).
  8440. *
  8441. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8442. *
  8443. * @static
  8444. * @memberOf _
  8445. * @since 4.0.0
  8446. * @category Array
  8447. * @param {Array} array The array to modify.
  8448. * @param {Array} values The values to remove.
  8449. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8450. * @returns {Array} Returns `array`.
  8451. * @example
  8452. *
  8453. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8454. *
  8455. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8456. * console.log(array);
  8457. * // => [{ 'x': 2 }]
  8458. */
  8459. function pullAllBy(array, values, iteratee) {
  8460. return (array && array.length && values && values.length)
  8461. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8462. : array;
  8463. }
  8464. /**
  8465. * This method is like `_.pullAll` except that it accepts `comparator` which
  8466. * is invoked to compare elements of `array` to `values`. The comparator is
  8467. * invoked with two arguments: (arrVal, othVal).
  8468. *
  8469. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8470. *
  8471. * @static
  8472. * @memberOf _
  8473. * @since 4.6.0
  8474. * @category Array
  8475. * @param {Array} array The array to modify.
  8476. * @param {Array} values The values to remove.
  8477. * @param {Function} [comparator] The comparator invoked per element.
  8478. * @returns {Array} Returns `array`.
  8479. * @example
  8480. *
  8481. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8482. *
  8483. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8484. * console.log(array);
  8485. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8486. */
  8487. function pullAllWith(array, values, comparator) {
  8488. return (array && array.length && values && values.length)
  8489. ? basePullAll(array, values, undefined, comparator)
  8490. : array;
  8491. }
  8492. /**
  8493. * Removes elements from `array` corresponding to `indexes` and returns an
  8494. * array of removed elements.
  8495. *
  8496. * **Note:** Unlike `_.at`, this method mutates `array`.
  8497. *
  8498. * @static
  8499. * @memberOf _
  8500. * @since 3.0.0
  8501. * @category Array
  8502. * @param {Array} array The array to modify.
  8503. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8504. * @returns {Array} Returns the new array of removed elements.
  8505. * @example
  8506. *
  8507. * var array = ['a', 'b', 'c', 'd'];
  8508. * var pulled = _.pullAt(array, [1, 3]);
  8509. *
  8510. * console.log(array);
  8511. * // => ['a', 'c']
  8512. *
  8513. * console.log(pulled);
  8514. * // => ['b', 'd']
  8515. */
  8516. var pullAt = flatRest(function(array, indexes) {
  8517. var length = array == null ? 0 : array.length,
  8518. result = baseAt(array, indexes);
  8519. basePullAt(array, arrayMap(indexes, function(index) {
  8520. return isIndex(index, length) ? +index : index;
  8521. }).sort(compareAscending));
  8522. return result;
  8523. });
  8524. /**
  8525. * Removes all elements from `array` that `predicate` returns truthy for
  8526. * and returns an array of the removed elements. The predicate is invoked
  8527. * with three arguments: (value, index, array).
  8528. *
  8529. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8530. * to pull elements from an array by value.
  8531. *
  8532. * @static
  8533. * @memberOf _
  8534. * @since 2.0.0
  8535. * @category Array
  8536. * @param {Array} array The array to modify.
  8537. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8538. * @returns {Array} Returns the new array of removed elements.
  8539. * @example
  8540. *
  8541. * var array = [1, 2, 3, 4];
  8542. * var evens = _.remove(array, function(n) {
  8543. * return n % 2 == 0;
  8544. * });
  8545. *
  8546. * console.log(array);
  8547. * // => [1, 3]
  8548. *
  8549. * console.log(evens);
  8550. * // => [2, 4]
  8551. */
  8552. function remove(array, predicate) {
  8553. var result = [];
  8554. if (!(array && array.length)) {
  8555. return result;
  8556. }
  8557. var index = -1,
  8558. indexes = [],
  8559. length = array.length;
  8560. predicate = getIteratee(predicate, 3);
  8561. while (++index < length) {
  8562. var value = array[index];
  8563. if (predicate(value, index, array)) {
  8564. result.push(value);
  8565. indexes.push(index);
  8566. }
  8567. }
  8568. basePullAt(array, indexes);
  8569. return result;
  8570. }
  8571. /**
  8572. * Reverses `array` so that the first element becomes the last, the second
  8573. * element becomes the second to last, and so on.
  8574. *
  8575. * **Note:** This method mutates `array` and is based on
  8576. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8577. *
  8578. * @static
  8579. * @memberOf _
  8580. * @since 4.0.0
  8581. * @category Array
  8582. * @param {Array} array The array to modify.
  8583. * @returns {Array} Returns `array`.
  8584. * @example
  8585. *
  8586. * var array = [1, 2, 3];
  8587. *
  8588. * _.reverse(array);
  8589. * // => [3, 2, 1]
  8590. *
  8591. * console.log(array);
  8592. * // => [3, 2, 1]
  8593. */
  8594. function reverse(array) {
  8595. return array == null ? array : nativeReverse.call(array);
  8596. }
  8597. /**
  8598. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8599. *
  8600. * **Note:** This method is used instead of
  8601. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8602. * returned.
  8603. *
  8604. * @static
  8605. * @memberOf _
  8606. * @since 3.0.0
  8607. * @category Array
  8608. * @param {Array} array The array to slice.
  8609. * @param {number} [start=0] The start position.
  8610. * @param {number} [end=array.length] The end position.
  8611. * @returns {Array} Returns the slice of `array`.
  8612. */
  8613. function slice(array, start, end) {
  8614. var length = array == null ? 0 : array.length;
  8615. if (!length) {
  8616. return [];
  8617. }
  8618. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8619. start = 0;
  8620. end = length;
  8621. }
  8622. else {
  8623. start = start == null ? 0 : toInteger(start);
  8624. end = end === undefined ? length : toInteger(end);
  8625. }
  8626. return baseSlice(array, start, end);
  8627. }
  8628. /**
  8629. * Uses a binary search to determine the lowest index at which `value`
  8630. * should be inserted into `array` in order to maintain its sort order.
  8631. *
  8632. * @static
  8633. * @memberOf _
  8634. * @since 0.1.0
  8635. * @category Array
  8636. * @param {Array} array The sorted array to inspect.
  8637. * @param {*} value The value to evaluate.
  8638. * @returns {number} Returns the index at which `value` should be inserted
  8639. * into `array`.
  8640. * @example
  8641. *
  8642. * _.sortedIndex([30, 50], 40);
  8643. * // => 1
  8644. */
  8645. function sortedIndex(array, value) {
  8646. return baseSortedIndex(array, value);
  8647. }
  8648. /**
  8649. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8650. * which is invoked for `value` and each element of `array` to compute their
  8651. * sort ranking. The iteratee is invoked with one argument: (value).
  8652. *
  8653. * @static
  8654. * @memberOf _
  8655. * @since 4.0.0
  8656. * @category Array
  8657. * @param {Array} array The sorted array to inspect.
  8658. * @param {*} value The value to evaluate.
  8659. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8660. * @returns {number} Returns the index at which `value` should be inserted
  8661. * into `array`.
  8662. * @example
  8663. *
  8664. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8665. *
  8666. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8667. * // => 0
  8668. *
  8669. * // The `_.property` iteratee shorthand.
  8670. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8671. * // => 0
  8672. */
  8673. function sortedIndexBy(array, value, iteratee) {
  8674. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8675. }
  8676. /**
  8677. * This method is like `_.indexOf` except that it performs a binary
  8678. * search on a sorted `array`.
  8679. *
  8680. * @static
  8681. * @memberOf _
  8682. * @since 4.0.0
  8683. * @category Array
  8684. * @param {Array} array The array to inspect.
  8685. * @param {*} value The value to search for.
  8686. * @returns {number} Returns the index of the matched value, else `-1`.
  8687. * @example
  8688. *
  8689. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8690. * // => 1
  8691. */
  8692. function sortedIndexOf(array, value) {
  8693. var length = array == null ? 0 : array.length;
  8694. if (length) {
  8695. var index = baseSortedIndex(array, value);
  8696. if (index < length && eq(array[index], value)) {
  8697. return index;
  8698. }
  8699. }
  8700. return -1;
  8701. }
  8702. /**
  8703. * This method is like `_.sortedIndex` except that it returns the highest
  8704. * index at which `value` should be inserted into `array` in order to
  8705. * maintain its sort order.
  8706. *
  8707. * @static
  8708. * @memberOf _
  8709. * @since 3.0.0
  8710. * @category Array
  8711. * @param {Array} array The sorted array to inspect.
  8712. * @param {*} value The value to evaluate.
  8713. * @returns {number} Returns the index at which `value` should be inserted
  8714. * into `array`.
  8715. * @example
  8716. *
  8717. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8718. * // => 4
  8719. */
  8720. function sortedLastIndex(array, value) {
  8721. return baseSortedIndex(array, value, true);
  8722. }
  8723. /**
  8724. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8725. * which is invoked for `value` and each element of `array` to compute their
  8726. * sort ranking. The iteratee is invoked with one argument: (value).
  8727. *
  8728. * @static
  8729. * @memberOf _
  8730. * @since 4.0.0
  8731. * @category Array
  8732. * @param {Array} array The sorted array to inspect.
  8733. * @param {*} value The value to evaluate.
  8734. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8735. * @returns {number} Returns the index at which `value` should be inserted
  8736. * into `array`.
  8737. * @example
  8738. *
  8739. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8740. *
  8741. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8742. * // => 1
  8743. *
  8744. * // The `_.property` iteratee shorthand.
  8745. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8746. * // => 1
  8747. */
  8748. function sortedLastIndexBy(array, value, iteratee) {
  8749. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8750. }
  8751. /**
  8752. * This method is like `_.lastIndexOf` except that it performs a binary
  8753. * search on a sorted `array`.
  8754. *
  8755. * @static
  8756. * @memberOf _
  8757. * @since 4.0.0
  8758. * @category Array
  8759. * @param {Array} array The array to inspect.
  8760. * @param {*} value The value to search for.
  8761. * @returns {number} Returns the index of the matched value, else `-1`.
  8762. * @example
  8763. *
  8764. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8765. * // => 3
  8766. */
  8767. function sortedLastIndexOf(array, value) {
  8768. var length = array == null ? 0 : array.length;
  8769. if (length) {
  8770. var index = baseSortedIndex(array, value, true) - 1;
  8771. if (eq(array[index], value)) {
  8772. return index;
  8773. }
  8774. }
  8775. return -1;
  8776. }
  8777. /**
  8778. * This method is like `_.uniq` except that it's designed and optimized
  8779. * for sorted arrays.
  8780. *
  8781. * @static
  8782. * @memberOf _
  8783. * @since 4.0.0
  8784. * @category Array
  8785. * @param {Array} array The array to inspect.
  8786. * @returns {Array} Returns the new duplicate free array.
  8787. * @example
  8788. *
  8789. * _.sortedUniq([1, 1, 2]);
  8790. * // => [1, 2]
  8791. */
  8792. function sortedUniq(array) {
  8793. return (array && array.length)
  8794. ? baseSortedUniq(array)
  8795. : [];
  8796. }
  8797. /**
  8798. * This method is like `_.uniqBy` except that it's designed and optimized
  8799. * for sorted arrays.
  8800. *
  8801. * @static
  8802. * @memberOf _
  8803. * @since 4.0.0
  8804. * @category Array
  8805. * @param {Array} array The array to inspect.
  8806. * @param {Function} [iteratee] The iteratee invoked per element.
  8807. * @returns {Array} Returns the new duplicate free array.
  8808. * @example
  8809. *
  8810. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8811. * // => [1.1, 2.3]
  8812. */
  8813. function sortedUniqBy(array, iteratee) {
  8814. return (array && array.length)
  8815. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8816. : [];
  8817. }
  8818. /**
  8819. * Gets all but the first element of `array`.
  8820. *
  8821. * @static
  8822. * @memberOf _
  8823. * @since 4.0.0
  8824. * @category Array
  8825. * @param {Array} array The array to query.
  8826. * @returns {Array} Returns the slice of `array`.
  8827. * @example
  8828. *
  8829. * _.tail([1, 2, 3]);
  8830. * // => [2, 3]
  8831. */
  8832. function tail(array) {
  8833. var length = array == null ? 0 : array.length;
  8834. return length ? baseSlice(array, 1, length) : [];
  8835. }
  8836. /**
  8837. * Creates a slice of `array` with `n` elements taken from the beginning.
  8838. *
  8839. * @static
  8840. * @memberOf _
  8841. * @since 0.1.0
  8842. * @category Array
  8843. * @param {Array} array The array to query.
  8844. * @param {number} [n=1] The number of elements to take.
  8845. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8846. * @returns {Array} Returns the slice of `array`.
  8847. * @example
  8848. *
  8849. * _.take([1, 2, 3]);
  8850. * // => [1]
  8851. *
  8852. * _.take([1, 2, 3], 2);
  8853. * // => [1, 2]
  8854. *
  8855. * _.take([1, 2, 3], 5);
  8856. * // => [1, 2, 3]
  8857. *
  8858. * _.take([1, 2, 3], 0);
  8859. * // => []
  8860. */
  8861. function take(array, n, guard) {
  8862. if (!(array && array.length)) {
  8863. return [];
  8864. }
  8865. n = (guard || n === undefined) ? 1 : toInteger(n);
  8866. return baseSlice(array, 0, n < 0 ? 0 : n);
  8867. }
  8868. /**
  8869. * Creates a slice of `array` with `n` elements taken from the end.
  8870. *
  8871. * @static
  8872. * @memberOf _
  8873. * @since 3.0.0
  8874. * @category Array
  8875. * @param {Array} array The array to query.
  8876. * @param {number} [n=1] The number of elements to take.
  8877. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8878. * @returns {Array} Returns the slice of `array`.
  8879. * @example
  8880. *
  8881. * _.takeRight([1, 2, 3]);
  8882. * // => [3]
  8883. *
  8884. * _.takeRight([1, 2, 3], 2);
  8885. * // => [2, 3]
  8886. *
  8887. * _.takeRight([1, 2, 3], 5);
  8888. * // => [1, 2, 3]
  8889. *
  8890. * _.takeRight([1, 2, 3], 0);
  8891. * // => []
  8892. */
  8893. function takeRight(array, n, guard) {
  8894. var length = array == null ? 0 : array.length;
  8895. if (!length) {
  8896. return [];
  8897. }
  8898. n = (guard || n === undefined) ? 1 : toInteger(n);
  8899. n = length - n;
  8900. return baseSlice(array, n < 0 ? 0 : n, length);
  8901. }
  8902. /**
  8903. * Creates a slice of `array` with elements taken from the end. Elements are
  8904. * taken until `predicate` returns falsey. The predicate is invoked with
  8905. * three arguments: (value, index, array).
  8906. *
  8907. * @static
  8908. * @memberOf _
  8909. * @since 3.0.0
  8910. * @category Array
  8911. * @param {Array} array The array to query.
  8912. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8913. * @returns {Array} Returns the slice of `array`.
  8914. * @example
  8915. *
  8916. * var users = [
  8917. * { 'user': 'barney', 'active': true },
  8918. * { 'user': 'fred', 'active': false },
  8919. * { 'user': 'pebbles', 'active': false }
  8920. * ];
  8921. *
  8922. * _.takeRightWhile(users, function(o) { return !o.active; });
  8923. * // => objects for ['fred', 'pebbles']
  8924. *
  8925. * // The `_.matches` iteratee shorthand.
  8926. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8927. * // => objects for ['pebbles']
  8928. *
  8929. * // The `_.matchesProperty` iteratee shorthand.
  8930. * _.takeRightWhile(users, ['active', false]);
  8931. * // => objects for ['fred', 'pebbles']
  8932. *
  8933. * // The `_.property` iteratee shorthand.
  8934. * _.takeRightWhile(users, 'active');
  8935. * // => []
  8936. */
  8937. function takeRightWhile(array, predicate) {
  8938. return (array && array.length)
  8939. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8940. : [];
  8941. }
  8942. /**
  8943. * Creates a slice of `array` with elements taken from the beginning. Elements
  8944. * are taken until `predicate` returns falsey. The predicate is invoked with
  8945. * three arguments: (value, index, array).
  8946. *
  8947. * @static
  8948. * @memberOf _
  8949. * @since 3.0.0
  8950. * @category Array
  8951. * @param {Array} array The array to query.
  8952. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8953. * @returns {Array} Returns the slice of `array`.
  8954. * @example
  8955. *
  8956. * var users = [
  8957. * { 'user': 'barney', 'active': false },
  8958. * { 'user': 'fred', 'active': false },
  8959. * { 'user': 'pebbles', 'active': true }
  8960. * ];
  8961. *
  8962. * _.takeWhile(users, function(o) { return !o.active; });
  8963. * // => objects for ['barney', 'fred']
  8964. *
  8965. * // The `_.matches` iteratee shorthand.
  8966. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8967. * // => objects for ['barney']
  8968. *
  8969. * // The `_.matchesProperty` iteratee shorthand.
  8970. * _.takeWhile(users, ['active', false]);
  8971. * // => objects for ['barney', 'fred']
  8972. *
  8973. * // The `_.property` iteratee shorthand.
  8974. * _.takeWhile(users, 'active');
  8975. * // => []
  8976. */
  8977. function takeWhile(array, predicate) {
  8978. return (array && array.length)
  8979. ? baseWhile(array, getIteratee(predicate, 3))
  8980. : [];
  8981. }
  8982. /**
  8983. * Creates an array of unique values, in order, from all given arrays using
  8984. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8985. * for equality comparisons.
  8986. *
  8987. * @static
  8988. * @memberOf _
  8989. * @since 0.1.0
  8990. * @category Array
  8991. * @param {...Array} [arrays] The arrays to inspect.
  8992. * @returns {Array} Returns the new array of combined values.
  8993. * @example
  8994. *
  8995. * _.union([2], [1, 2]);
  8996. * // => [2, 1]
  8997. */
  8998. var union = baseRest(function(arrays) {
  8999. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9000. });
  9001. /**
  9002. * This method is like `_.union` except that it accepts `iteratee` which is
  9003. * invoked for each element of each `arrays` to generate the criterion by
  9004. * which uniqueness is computed. Result values are chosen from the first
  9005. * array in which the value occurs. The iteratee is invoked with one argument:
  9006. * (value).
  9007. *
  9008. * @static
  9009. * @memberOf _
  9010. * @since 4.0.0
  9011. * @category Array
  9012. * @param {...Array} [arrays] The arrays to inspect.
  9013. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9014. * @returns {Array} Returns the new array of combined values.
  9015. * @example
  9016. *
  9017. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9018. * // => [2.1, 1.2]
  9019. *
  9020. * // The `_.property` iteratee shorthand.
  9021. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9022. * // => [{ 'x': 1 }, { 'x': 2 }]
  9023. */
  9024. var unionBy = baseRest(function(arrays) {
  9025. var iteratee = last(arrays);
  9026. if (isArrayLikeObject(iteratee)) {
  9027. iteratee = undefined;
  9028. }
  9029. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9030. });
  9031. /**
  9032. * This method is like `_.union` except that it accepts `comparator` which
  9033. * is invoked to compare elements of `arrays`. Result values are chosen from
  9034. * the first array in which the value occurs. The comparator is invoked
  9035. * with two arguments: (arrVal, othVal).
  9036. *
  9037. * @static
  9038. * @memberOf _
  9039. * @since 4.0.0
  9040. * @category Array
  9041. * @param {...Array} [arrays] The arrays to inspect.
  9042. * @param {Function} [comparator] The comparator invoked per element.
  9043. * @returns {Array} Returns the new array of combined values.
  9044. * @example
  9045. *
  9046. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9047. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9048. *
  9049. * _.unionWith(objects, others, _.isEqual);
  9050. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9051. */
  9052. var unionWith = baseRest(function(arrays) {
  9053. var comparator = last(arrays);
  9054. comparator = typeof comparator == 'function' ? comparator : undefined;
  9055. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9056. });
  9057. /**
  9058. * Creates a duplicate-free version of an array, using
  9059. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9060. * for equality comparisons, in which only the first occurrence of each element
  9061. * is kept. The order of result values is determined by the order they occur
  9062. * in the array.
  9063. *
  9064. * @static
  9065. * @memberOf _
  9066. * @since 0.1.0
  9067. * @category Array
  9068. * @param {Array} array The array to inspect.
  9069. * @returns {Array} Returns the new duplicate free array.
  9070. * @example
  9071. *
  9072. * _.uniq([2, 1, 2]);
  9073. * // => [2, 1]
  9074. */
  9075. function uniq(array) {
  9076. return (array && array.length) ? baseUniq(array) : [];
  9077. }
  9078. /**
  9079. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9080. * invoked for each element in `array` to generate the criterion by which
  9081. * uniqueness is computed. The order of result values is determined by the
  9082. * order they occur in the array. The iteratee is invoked with one argument:
  9083. * (value).
  9084. *
  9085. * @static
  9086. * @memberOf _
  9087. * @since 4.0.0
  9088. * @category Array
  9089. * @param {Array} array The array to inspect.
  9090. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9091. * @returns {Array} Returns the new duplicate free array.
  9092. * @example
  9093. *
  9094. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9095. * // => [2.1, 1.2]
  9096. *
  9097. * // The `_.property` iteratee shorthand.
  9098. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9099. * // => [{ 'x': 1 }, { 'x': 2 }]
  9100. */
  9101. function uniqBy(array, iteratee) {
  9102. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9103. }
  9104. /**
  9105. * This method is like `_.uniq` except that it accepts `comparator` which
  9106. * is invoked to compare elements of `array`. The order of result values is
  9107. * determined by the order they occur in the array.The comparator is invoked
  9108. * with two arguments: (arrVal, othVal).
  9109. *
  9110. * @static
  9111. * @memberOf _
  9112. * @since 4.0.0
  9113. * @category Array
  9114. * @param {Array} array The array to inspect.
  9115. * @param {Function} [comparator] The comparator invoked per element.
  9116. * @returns {Array} Returns the new duplicate free array.
  9117. * @example
  9118. *
  9119. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9120. *
  9121. * _.uniqWith(objects, _.isEqual);
  9122. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9123. */
  9124. function uniqWith(array, comparator) {
  9125. comparator = typeof comparator == 'function' ? comparator : undefined;
  9126. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9127. }
  9128. /**
  9129. * This method is like `_.zip` except that it accepts an array of grouped
  9130. * elements and creates an array regrouping the elements to their pre-zip
  9131. * configuration.
  9132. *
  9133. * @static
  9134. * @memberOf _
  9135. * @since 1.2.0
  9136. * @category Array
  9137. * @param {Array} array The array of grouped elements to process.
  9138. * @returns {Array} Returns the new array of regrouped elements.
  9139. * @example
  9140. *
  9141. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9142. * // => [['a', 1, true], ['b', 2, false]]
  9143. *
  9144. * _.unzip(zipped);
  9145. * // => [['a', 'b'], [1, 2], [true, false]]
  9146. */
  9147. function unzip(array) {
  9148. if (!(array && array.length)) {
  9149. return [];
  9150. }
  9151. var length = 0;
  9152. array = arrayFilter(array, function(group) {
  9153. if (isArrayLikeObject(group)) {
  9154. length = nativeMax(group.length, length);
  9155. return true;
  9156. }
  9157. });
  9158. return baseTimes(length, function(index) {
  9159. return arrayMap(array, baseProperty(index));
  9160. });
  9161. }
  9162. /**
  9163. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9164. * how regrouped values should be combined. The iteratee is invoked with the
  9165. * elements of each group: (...group).
  9166. *
  9167. * @static
  9168. * @memberOf _
  9169. * @since 3.8.0
  9170. * @category Array
  9171. * @param {Array} array The array of grouped elements to process.
  9172. * @param {Function} [iteratee=_.identity] The function to combine
  9173. * regrouped values.
  9174. * @returns {Array} Returns the new array of regrouped elements.
  9175. * @example
  9176. *
  9177. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9178. * // => [[1, 10, 100], [2, 20, 200]]
  9179. *
  9180. * _.unzipWith(zipped, _.add);
  9181. * // => [3, 30, 300]
  9182. */
  9183. function unzipWith(array, iteratee) {
  9184. if (!(array && array.length)) {
  9185. return [];
  9186. }
  9187. var result = unzip(array);
  9188. if (iteratee == null) {
  9189. return result;
  9190. }
  9191. return arrayMap(result, function(group) {
  9192. return apply(iteratee, undefined, group);
  9193. });
  9194. }
  9195. /**
  9196. * Creates an array excluding all given values using
  9197. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9198. * for equality comparisons.
  9199. *
  9200. * **Note:** Unlike `_.pull`, this method returns a new array.
  9201. *
  9202. * @static
  9203. * @memberOf _
  9204. * @since 0.1.0
  9205. * @category Array
  9206. * @param {Array} array The array to inspect.
  9207. * @param {...*} [values] The values to exclude.
  9208. * @returns {Array} Returns the new array of filtered values.
  9209. * @see _.difference, _.xor
  9210. * @example
  9211. *
  9212. * _.without([2, 1, 2, 3], 1, 2);
  9213. * // => [3]
  9214. */
  9215. var without = baseRest(function(array, values) {
  9216. return isArrayLikeObject(array)
  9217. ? baseDifference(array, values)
  9218. : [];
  9219. });
  9220. /**
  9221. * Creates an array of unique values that is the
  9222. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9223. * of the given arrays. The order of result values is determined by the order
  9224. * they occur in the arrays.
  9225. *
  9226. * @static
  9227. * @memberOf _
  9228. * @since 2.4.0
  9229. * @category Array
  9230. * @param {...Array} [arrays] The arrays to inspect.
  9231. * @returns {Array} Returns the new array of filtered values.
  9232. * @see _.difference, _.without
  9233. * @example
  9234. *
  9235. * _.xor([2, 1], [2, 3]);
  9236. * // => [1, 3]
  9237. */
  9238. var xor = baseRest(function(arrays) {
  9239. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9240. });
  9241. /**
  9242. * This method is like `_.xor` except that it accepts `iteratee` which is
  9243. * invoked for each element of each `arrays` to generate the criterion by
  9244. * which by which they're compared. The order of result values is determined
  9245. * by the order they occur in the arrays. The iteratee is invoked with one
  9246. * argument: (value).
  9247. *
  9248. * @static
  9249. * @memberOf _
  9250. * @since 4.0.0
  9251. * @category Array
  9252. * @param {...Array} [arrays] The arrays to inspect.
  9253. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9254. * @returns {Array} Returns the new array of filtered values.
  9255. * @example
  9256. *
  9257. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9258. * // => [1.2, 3.4]
  9259. *
  9260. * // The `_.property` iteratee shorthand.
  9261. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9262. * // => [{ 'x': 2 }]
  9263. */
  9264. var xorBy = baseRest(function(arrays) {
  9265. var iteratee = last(arrays);
  9266. if (isArrayLikeObject(iteratee)) {
  9267. iteratee = undefined;
  9268. }
  9269. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9270. });
  9271. /**
  9272. * This method is like `_.xor` except that it accepts `comparator` which is
  9273. * invoked to compare elements of `arrays`. The order of result values is
  9274. * determined by the order they occur in the arrays. The comparator is invoked
  9275. * with two arguments: (arrVal, othVal).
  9276. *
  9277. * @static
  9278. * @memberOf _
  9279. * @since 4.0.0
  9280. * @category Array
  9281. * @param {...Array} [arrays] The arrays to inspect.
  9282. * @param {Function} [comparator] The comparator invoked per element.
  9283. * @returns {Array} Returns the new array of filtered values.
  9284. * @example
  9285. *
  9286. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9287. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9288. *
  9289. * _.xorWith(objects, others, _.isEqual);
  9290. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9291. */
  9292. var xorWith = baseRest(function(arrays) {
  9293. var comparator = last(arrays);
  9294. comparator = typeof comparator == 'function' ? comparator : undefined;
  9295. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9296. });
  9297. /**
  9298. * Creates an array of grouped elements, the first of which contains the
  9299. * first elements of the given arrays, the second of which contains the
  9300. * second elements of the given arrays, and so on.
  9301. *
  9302. * @static
  9303. * @memberOf _
  9304. * @since 0.1.0
  9305. * @category Array
  9306. * @param {...Array} [arrays] The arrays to process.
  9307. * @returns {Array} Returns the new array of grouped elements.
  9308. * @example
  9309. *
  9310. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9311. * // => [['a', 1, true], ['b', 2, false]]
  9312. */
  9313. var zip = baseRest(unzip);
  9314. /**
  9315. * This method is like `_.fromPairs` except that it accepts two arrays,
  9316. * one of property identifiers and one of corresponding values.
  9317. *
  9318. * @static
  9319. * @memberOf _
  9320. * @since 0.4.0
  9321. * @category Array
  9322. * @param {Array} [props=[]] The property identifiers.
  9323. * @param {Array} [values=[]] The property values.
  9324. * @returns {Object} Returns the new object.
  9325. * @example
  9326. *
  9327. * _.zipObject(['a', 'b'], [1, 2]);
  9328. * // => { 'a': 1, 'b': 2 }
  9329. */
  9330. function zipObject(props, values) {
  9331. return baseZipObject(props || [], values || [], assignValue);
  9332. }
  9333. /**
  9334. * This method is like `_.zipObject` except that it supports property paths.
  9335. *
  9336. * @static
  9337. * @memberOf _
  9338. * @since 4.1.0
  9339. * @category Array
  9340. * @param {Array} [props=[]] The property identifiers.
  9341. * @param {Array} [values=[]] The property values.
  9342. * @returns {Object} Returns the new object.
  9343. * @example
  9344. *
  9345. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9346. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9347. */
  9348. function zipObjectDeep(props, values) {
  9349. return baseZipObject(props || [], values || [], baseSet);
  9350. }
  9351. /**
  9352. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9353. * how grouped values should be combined. The iteratee is invoked with the
  9354. * elements of each group: (...group).
  9355. *
  9356. * @static
  9357. * @memberOf _
  9358. * @since 3.8.0
  9359. * @category Array
  9360. * @param {...Array} [arrays] The arrays to process.
  9361. * @param {Function} [iteratee=_.identity] The function to combine
  9362. * grouped values.
  9363. * @returns {Array} Returns the new array of grouped elements.
  9364. * @example
  9365. *
  9366. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9367. * return a + b + c;
  9368. * });
  9369. * // => [111, 222]
  9370. */
  9371. var zipWith = baseRest(function(arrays) {
  9372. var length = arrays.length,
  9373. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9374. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9375. return unzipWith(arrays, iteratee);
  9376. });
  9377. /*------------------------------------------------------------------------*/
  9378. /**
  9379. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9380. * chain sequences enabled. The result of such sequences must be unwrapped
  9381. * with `_#value`.
  9382. *
  9383. * @static
  9384. * @memberOf _
  9385. * @since 1.3.0
  9386. * @category Seq
  9387. * @param {*} value The value to wrap.
  9388. * @returns {Object} Returns the new `lodash` wrapper instance.
  9389. * @example
  9390. *
  9391. * var users = [
  9392. * { 'user': 'barney', 'age': 36 },
  9393. * { 'user': 'fred', 'age': 40 },
  9394. * { 'user': 'pebbles', 'age': 1 }
  9395. * ];
  9396. *
  9397. * var youngest = _
  9398. * .chain(users)
  9399. * .sortBy('age')
  9400. * .map(function(o) {
  9401. * return o.user + ' is ' + o.age;
  9402. * })
  9403. * .head()
  9404. * .value();
  9405. * // => 'pebbles is 1'
  9406. */
  9407. function chain(value) {
  9408. var result = lodash(value);
  9409. result.__chain__ = true;
  9410. return result;
  9411. }
  9412. /**
  9413. * This method invokes `interceptor` and returns `value`. The interceptor
  9414. * is invoked with one argument; (value). The purpose of this method is to
  9415. * "tap into" a method chain sequence in order to modify intermediate results.
  9416. *
  9417. * @static
  9418. * @memberOf _
  9419. * @since 0.1.0
  9420. * @category Seq
  9421. * @param {*} value The value to provide to `interceptor`.
  9422. * @param {Function} interceptor The function to invoke.
  9423. * @returns {*} Returns `value`.
  9424. * @example
  9425. *
  9426. * _([1, 2, 3])
  9427. * .tap(function(array) {
  9428. * // Mutate input array.
  9429. * array.pop();
  9430. * })
  9431. * .reverse()
  9432. * .value();
  9433. * // => [2, 1]
  9434. */
  9435. function tap(value, interceptor) {
  9436. interceptor(value);
  9437. return value;
  9438. }
  9439. /**
  9440. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9441. * The purpose of this method is to "pass thru" values replacing intermediate
  9442. * results in a method chain sequence.
  9443. *
  9444. * @static
  9445. * @memberOf _
  9446. * @since 3.0.0
  9447. * @category Seq
  9448. * @param {*} value The value to provide to `interceptor`.
  9449. * @param {Function} interceptor The function to invoke.
  9450. * @returns {*} Returns the result of `interceptor`.
  9451. * @example
  9452. *
  9453. * _(' abc ')
  9454. * .chain()
  9455. * .trim()
  9456. * .thru(function(value) {
  9457. * return [value];
  9458. * })
  9459. * .value();
  9460. * // => ['abc']
  9461. */
  9462. function thru(value, interceptor) {
  9463. return interceptor(value);
  9464. }
  9465. /**
  9466. * This method is the wrapper version of `_.at`.
  9467. *
  9468. * @name at
  9469. * @memberOf _
  9470. * @since 1.0.0
  9471. * @category Seq
  9472. * @param {...(string|string[])} [paths] The property paths to pick.
  9473. * @returns {Object} Returns the new `lodash` wrapper instance.
  9474. * @example
  9475. *
  9476. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9477. *
  9478. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9479. * // => [3, 4]
  9480. */
  9481. var wrapperAt = flatRest(function(paths) {
  9482. var length = paths.length,
  9483. start = length ? paths[0] : 0,
  9484. value = this.__wrapped__,
  9485. interceptor = function(object) { return baseAt(object, paths); };
  9486. if (length > 1 || this.__actions__.length ||
  9487. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9488. return this.thru(interceptor);
  9489. }
  9490. value = value.slice(start, +start + (length ? 1 : 0));
  9491. value.__actions__.push({
  9492. 'func': thru,
  9493. 'args': [interceptor],
  9494. 'thisArg': undefined
  9495. });
  9496. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9497. if (length && !array.length) {
  9498. array.push(undefined);
  9499. }
  9500. return array;
  9501. });
  9502. });
  9503. /**
  9504. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9505. *
  9506. * @name chain
  9507. * @memberOf _
  9508. * @since 0.1.0
  9509. * @category Seq
  9510. * @returns {Object} Returns the new `lodash` wrapper instance.
  9511. * @example
  9512. *
  9513. * var users = [
  9514. * { 'user': 'barney', 'age': 36 },
  9515. * { 'user': 'fred', 'age': 40 }
  9516. * ];
  9517. *
  9518. * // A sequence without explicit chaining.
  9519. * _(users).head();
  9520. * // => { 'user': 'barney', 'age': 36 }
  9521. *
  9522. * // A sequence with explicit chaining.
  9523. * _(users)
  9524. * .chain()
  9525. * .head()
  9526. * .pick('user')
  9527. * .value();
  9528. * // => { 'user': 'barney' }
  9529. */
  9530. function wrapperChain() {
  9531. return chain(this);
  9532. }
  9533. /**
  9534. * Executes the chain sequence and returns the wrapped result.
  9535. *
  9536. * @name commit
  9537. * @memberOf _
  9538. * @since 3.2.0
  9539. * @category Seq
  9540. * @returns {Object} Returns the new `lodash` wrapper instance.
  9541. * @example
  9542. *
  9543. * var array = [1, 2];
  9544. * var wrapped = _(array).push(3);
  9545. *
  9546. * console.log(array);
  9547. * // => [1, 2]
  9548. *
  9549. * wrapped = wrapped.commit();
  9550. * console.log(array);
  9551. * // => [1, 2, 3]
  9552. *
  9553. * wrapped.last();
  9554. * // => 3
  9555. *
  9556. * console.log(array);
  9557. * // => [1, 2, 3]
  9558. */
  9559. function wrapperCommit() {
  9560. return new LodashWrapper(this.value(), this.__chain__);
  9561. }
  9562. /**
  9563. * Gets the next value on a wrapped object following the
  9564. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9565. *
  9566. * @name next
  9567. * @memberOf _
  9568. * @since 4.0.0
  9569. * @category Seq
  9570. * @returns {Object} Returns the next iterator value.
  9571. * @example
  9572. *
  9573. * var wrapped = _([1, 2]);
  9574. *
  9575. * wrapped.next();
  9576. * // => { 'done': false, 'value': 1 }
  9577. *
  9578. * wrapped.next();
  9579. * // => { 'done': false, 'value': 2 }
  9580. *
  9581. * wrapped.next();
  9582. * // => { 'done': true, 'value': undefined }
  9583. */
  9584. function wrapperNext() {
  9585. if (this.__values__ === undefined) {
  9586. this.__values__ = toArray(this.value());
  9587. }
  9588. var done = this.__index__ >= this.__values__.length,
  9589. value = done ? undefined : this.__values__[this.__index__++];
  9590. return { 'done': done, 'value': value };
  9591. }
  9592. /**
  9593. * Enables the wrapper to be iterable.
  9594. *
  9595. * @name Symbol.iterator
  9596. * @memberOf _
  9597. * @since 4.0.0
  9598. * @category Seq
  9599. * @returns {Object} Returns the wrapper object.
  9600. * @example
  9601. *
  9602. * var wrapped = _([1, 2]);
  9603. *
  9604. * wrapped[Symbol.iterator]() === wrapped;
  9605. * // => true
  9606. *
  9607. * Array.from(wrapped);
  9608. * // => [1, 2]
  9609. */
  9610. function wrapperToIterator() {
  9611. return this;
  9612. }
  9613. /**
  9614. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9615. *
  9616. * @name plant
  9617. * @memberOf _
  9618. * @since 3.2.0
  9619. * @category Seq
  9620. * @param {*} value The value to plant.
  9621. * @returns {Object} Returns the new `lodash` wrapper instance.
  9622. * @example
  9623. *
  9624. * function square(n) {
  9625. * return n * n;
  9626. * }
  9627. *
  9628. * var wrapped = _([1, 2]).map(square);
  9629. * var other = wrapped.plant([3, 4]);
  9630. *
  9631. * other.value();
  9632. * // => [9, 16]
  9633. *
  9634. * wrapped.value();
  9635. * // => [1, 4]
  9636. */
  9637. function wrapperPlant(value) {
  9638. var result,
  9639. parent = this;
  9640. while (parent instanceof baseLodash) {
  9641. var clone = wrapperClone(parent);
  9642. clone.__index__ = 0;
  9643. clone.__values__ = undefined;
  9644. if (result) {
  9645. previous.__wrapped__ = clone;
  9646. } else {
  9647. result = clone;
  9648. }
  9649. var previous = clone;
  9650. parent = parent.__wrapped__;
  9651. }
  9652. previous.__wrapped__ = value;
  9653. return result;
  9654. }
  9655. /**
  9656. * This method is the wrapper version of `_.reverse`.
  9657. *
  9658. * **Note:** This method mutates the wrapped array.
  9659. *
  9660. * @name reverse
  9661. * @memberOf _
  9662. * @since 0.1.0
  9663. * @category Seq
  9664. * @returns {Object} Returns the new `lodash` wrapper instance.
  9665. * @example
  9666. *
  9667. * var array = [1, 2, 3];
  9668. *
  9669. * _(array).reverse().value()
  9670. * // => [3, 2, 1]
  9671. *
  9672. * console.log(array);
  9673. * // => [3, 2, 1]
  9674. */
  9675. function wrapperReverse() {
  9676. var value = this.__wrapped__;
  9677. if (value instanceof LazyWrapper) {
  9678. var wrapped = value;
  9679. if (this.__actions__.length) {
  9680. wrapped = new LazyWrapper(this);
  9681. }
  9682. wrapped = wrapped.reverse();
  9683. wrapped.__actions__.push({
  9684. 'func': thru,
  9685. 'args': [reverse],
  9686. 'thisArg': undefined
  9687. });
  9688. return new LodashWrapper(wrapped, this.__chain__);
  9689. }
  9690. return this.thru(reverse);
  9691. }
  9692. /**
  9693. * Executes the chain sequence to resolve the unwrapped value.
  9694. *
  9695. * @name value
  9696. * @memberOf _
  9697. * @since 0.1.0
  9698. * @alias toJSON, valueOf
  9699. * @category Seq
  9700. * @returns {*} Returns the resolved unwrapped value.
  9701. * @example
  9702. *
  9703. * _([1, 2, 3]).value();
  9704. * // => [1, 2, 3]
  9705. */
  9706. function wrapperValue() {
  9707. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9708. }
  9709. /*------------------------------------------------------------------------*/
  9710. /**
  9711. * Creates an object composed of keys generated from the results of running
  9712. * each element of `collection` thru `iteratee`. The corresponding value of
  9713. * each key is the number of times the key was returned by `iteratee`. The
  9714. * iteratee is invoked with one argument: (value).
  9715. *
  9716. * @static
  9717. * @memberOf _
  9718. * @since 0.5.0
  9719. * @category Collection
  9720. * @param {Array|Object} collection The collection to iterate over.
  9721. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9722. * @returns {Object} Returns the composed aggregate object.
  9723. * @example
  9724. *
  9725. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9726. * // => { '4': 1, '6': 2 }
  9727. *
  9728. * // The `_.property` iteratee shorthand.
  9729. * _.countBy(['one', 'two', 'three'], 'length');
  9730. * // => { '3': 2, '5': 1 }
  9731. */
  9732. var countBy = createAggregator(function(result, value, key) {
  9733. if (hasOwnProperty.call(result, key)) {
  9734. ++result[key];
  9735. } else {
  9736. baseAssignValue(result, key, 1);
  9737. }
  9738. });
  9739. /**
  9740. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9741. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9742. * invoked with three arguments: (value, index|key, collection).
  9743. *
  9744. * **Note:** This method returns `true` for
  9745. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9746. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9747. * elements of empty collections.
  9748. *
  9749. * @static
  9750. * @memberOf _
  9751. * @since 0.1.0
  9752. * @category Collection
  9753. * @param {Array|Object} collection The collection to iterate over.
  9754. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9755. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9756. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9757. * else `false`.
  9758. * @example
  9759. *
  9760. * _.every([true, 1, null, 'yes'], Boolean);
  9761. * // => false
  9762. *
  9763. * var users = [
  9764. * { 'user': 'barney', 'age': 36, 'active': false },
  9765. * { 'user': 'fred', 'age': 40, 'active': false }
  9766. * ];
  9767. *
  9768. * // The `_.matches` iteratee shorthand.
  9769. * _.every(users, { 'user': 'barney', 'active': false });
  9770. * // => false
  9771. *
  9772. * // The `_.matchesProperty` iteratee shorthand.
  9773. * _.every(users, ['active', false]);
  9774. * // => true
  9775. *
  9776. * // The `_.property` iteratee shorthand.
  9777. * _.every(users, 'active');
  9778. * // => false
  9779. */
  9780. function every(collection, predicate, guard) {
  9781. var func = isArray(collection) ? arrayEvery : baseEvery;
  9782. if (guard && isIterateeCall(collection, predicate, guard)) {
  9783. predicate = undefined;
  9784. }
  9785. return func(collection, getIteratee(predicate, 3));
  9786. }
  9787. /**
  9788. * Iterates over elements of `collection`, returning an array of all elements
  9789. * `predicate` returns truthy for. The predicate is invoked with three
  9790. * arguments: (value, index|key, collection).
  9791. *
  9792. * **Note:** Unlike `_.remove`, this method returns a new array.
  9793. *
  9794. * @static
  9795. * @memberOf _
  9796. * @since 0.1.0
  9797. * @category Collection
  9798. * @param {Array|Object} collection The collection to iterate over.
  9799. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9800. * @returns {Array} Returns the new filtered array.
  9801. * @see _.reject
  9802. * @example
  9803. *
  9804. * var users = [
  9805. * { 'user': 'barney', 'age': 36, 'active': true },
  9806. * { 'user': 'fred', 'age': 40, 'active': false }
  9807. * ];
  9808. *
  9809. * _.filter(users, function(o) { return !o.active; });
  9810. * // => objects for ['fred']
  9811. *
  9812. * // The `_.matches` iteratee shorthand.
  9813. * _.filter(users, { 'age': 36, 'active': true });
  9814. * // => objects for ['barney']
  9815. *
  9816. * // The `_.matchesProperty` iteratee shorthand.
  9817. * _.filter(users, ['active', false]);
  9818. * // => objects for ['fred']
  9819. *
  9820. * // The `_.property` iteratee shorthand.
  9821. * _.filter(users, 'active');
  9822. * // => objects for ['barney']
  9823. *
  9824. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9825. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9826. * // => objects for ['fred', 'barney']
  9827. */
  9828. function filter(collection, predicate) {
  9829. var func = isArray(collection) ? arrayFilter : baseFilter;
  9830. return func(collection, getIteratee(predicate, 3));
  9831. }
  9832. /**
  9833. * Iterates over elements of `collection`, returning the first element
  9834. * `predicate` returns truthy for. The predicate is invoked with three
  9835. * arguments: (value, index|key, collection).
  9836. *
  9837. * @static
  9838. * @memberOf _
  9839. * @since 0.1.0
  9840. * @category Collection
  9841. * @param {Array|Object} collection The collection to inspect.
  9842. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9843. * @param {number} [fromIndex=0] The index to search from.
  9844. * @returns {*} Returns the matched element, else `undefined`.
  9845. * @example
  9846. *
  9847. * var users = [
  9848. * { 'user': 'barney', 'age': 36, 'active': true },
  9849. * { 'user': 'fred', 'age': 40, 'active': false },
  9850. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9851. * ];
  9852. *
  9853. * _.find(users, function(o) { return o.age < 40; });
  9854. * // => object for 'barney'
  9855. *
  9856. * // The `_.matches` iteratee shorthand.
  9857. * _.find(users, { 'age': 1, 'active': true });
  9858. * // => object for 'pebbles'
  9859. *
  9860. * // The `_.matchesProperty` iteratee shorthand.
  9861. * _.find(users, ['active', false]);
  9862. * // => object for 'fred'
  9863. *
  9864. * // The `_.property` iteratee shorthand.
  9865. * _.find(users, 'active');
  9866. * // => object for 'barney'
  9867. */
  9868. var find = createFind(findIndex);
  9869. /**
  9870. * This method is like `_.find` except that it iterates over elements of
  9871. * `collection` from right to left.
  9872. *
  9873. * @static
  9874. * @memberOf _
  9875. * @since 2.0.0
  9876. * @category Collection
  9877. * @param {Array|Object} collection The collection to inspect.
  9878. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9879. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9880. * @returns {*} Returns the matched element, else `undefined`.
  9881. * @example
  9882. *
  9883. * _.findLast([1, 2, 3, 4], function(n) {
  9884. * return n % 2 == 1;
  9885. * });
  9886. * // => 3
  9887. */
  9888. var findLast = createFind(findLastIndex);
  9889. /**
  9890. * Creates a flattened array of values by running each element in `collection`
  9891. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9892. * with three arguments: (value, index|key, collection).
  9893. *
  9894. * @static
  9895. * @memberOf _
  9896. * @since 4.0.0
  9897. * @category Collection
  9898. * @param {Array|Object} collection The collection to iterate over.
  9899. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9900. * @returns {Array} Returns the new flattened array.
  9901. * @example
  9902. *
  9903. * function duplicate(n) {
  9904. * return [n, n];
  9905. * }
  9906. *
  9907. * _.flatMap([1, 2], duplicate);
  9908. * // => [1, 1, 2, 2]
  9909. */
  9910. function flatMap(collection, iteratee) {
  9911. return baseFlatten(map(collection, iteratee), 1);
  9912. }
  9913. /**
  9914. * This method is like `_.flatMap` except that it recursively flattens the
  9915. * mapped results.
  9916. *
  9917. * @static
  9918. * @memberOf _
  9919. * @since 4.7.0
  9920. * @category Collection
  9921. * @param {Array|Object} collection The collection to iterate over.
  9922. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9923. * @returns {Array} Returns the new flattened array.
  9924. * @example
  9925. *
  9926. * function duplicate(n) {
  9927. * return [[[n, n]]];
  9928. * }
  9929. *
  9930. * _.flatMapDeep([1, 2], duplicate);
  9931. * // => [1, 1, 2, 2]
  9932. */
  9933. function flatMapDeep(collection, iteratee) {
  9934. return baseFlatten(map(collection, iteratee), INFINITY);
  9935. }
  9936. /**
  9937. * This method is like `_.flatMap` except that it recursively flattens the
  9938. * mapped results up to `depth` times.
  9939. *
  9940. * @static
  9941. * @memberOf _
  9942. * @since 4.7.0
  9943. * @category Collection
  9944. * @param {Array|Object} collection The collection to iterate over.
  9945. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9946. * @param {number} [depth=1] The maximum recursion depth.
  9947. * @returns {Array} Returns the new flattened array.
  9948. * @example
  9949. *
  9950. * function duplicate(n) {
  9951. * return [[[n, n]]];
  9952. * }
  9953. *
  9954. * _.flatMapDepth([1, 2], duplicate, 2);
  9955. * // => [[1, 1], [2, 2]]
  9956. */
  9957. function flatMapDepth(collection, iteratee, depth) {
  9958. depth = depth === undefined ? 1 : toInteger(depth);
  9959. return baseFlatten(map(collection, iteratee), depth);
  9960. }
  9961. /**
  9962. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9963. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9964. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9965. *
  9966. * **Note:** As with other "Collections" methods, objects with a "length"
  9967. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9968. * or `_.forOwn` for object iteration.
  9969. *
  9970. * @static
  9971. * @memberOf _
  9972. * @since 0.1.0
  9973. * @alias each
  9974. * @category Collection
  9975. * @param {Array|Object} collection The collection to iterate over.
  9976. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9977. * @returns {Array|Object} Returns `collection`.
  9978. * @see _.forEachRight
  9979. * @example
  9980. *
  9981. * _.forEach([1, 2], function(value) {
  9982. * console.log(value);
  9983. * });
  9984. * // => Logs `1` then `2`.
  9985. *
  9986. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9987. * console.log(key);
  9988. * });
  9989. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9990. */
  9991. function forEach(collection, iteratee) {
  9992. var func = isArray(collection) ? arrayEach : baseEach;
  9993. return func(collection, getIteratee(iteratee, 3));
  9994. }
  9995. /**
  9996. * This method is like `_.forEach` except that it iterates over elements of
  9997. * `collection` from right to left.
  9998. *
  9999. * @static
  10000. * @memberOf _
  10001. * @since 2.0.0
  10002. * @alias eachRight
  10003. * @category Collection
  10004. * @param {Array|Object} collection The collection to iterate over.
  10005. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10006. * @returns {Array|Object} Returns `collection`.
  10007. * @see _.forEach
  10008. * @example
  10009. *
  10010. * _.forEachRight([1, 2], function(value) {
  10011. * console.log(value);
  10012. * });
  10013. * // => Logs `2` then `1`.
  10014. */
  10015. function forEachRight(collection, iteratee) {
  10016. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10017. return func(collection, getIteratee(iteratee, 3));
  10018. }
  10019. /**
  10020. * Creates an object composed of keys generated from the results of running
  10021. * each element of `collection` thru `iteratee`. The order of grouped values
  10022. * is determined by the order they occur in `collection`. The corresponding
  10023. * value of each key is an array of elements responsible for generating the
  10024. * key. The iteratee is invoked with one argument: (value).
  10025. *
  10026. * @static
  10027. * @memberOf _
  10028. * @since 0.1.0
  10029. * @category Collection
  10030. * @param {Array|Object} collection The collection to iterate over.
  10031. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10032. * @returns {Object} Returns the composed aggregate object.
  10033. * @example
  10034. *
  10035. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10036. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10037. *
  10038. * // The `_.property` iteratee shorthand.
  10039. * _.groupBy(['one', 'two', 'three'], 'length');
  10040. * // => { '3': ['one', 'two'], '5': ['three'] }
  10041. */
  10042. var groupBy = createAggregator(function(result, value, key) {
  10043. if (hasOwnProperty.call(result, key)) {
  10044. result[key].push(value);
  10045. } else {
  10046. baseAssignValue(result, key, [value]);
  10047. }
  10048. });
  10049. /**
  10050. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10051. * checked for a substring of `value`, otherwise
  10052. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10053. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10054. * the offset from the end of `collection`.
  10055. *
  10056. * @static
  10057. * @memberOf _
  10058. * @since 0.1.0
  10059. * @category Collection
  10060. * @param {Array|Object|string} collection The collection to inspect.
  10061. * @param {*} value The value to search for.
  10062. * @param {number} [fromIndex=0] The index to search from.
  10063. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10064. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10065. * @example
  10066. *
  10067. * _.includes([1, 2, 3], 1);
  10068. * // => true
  10069. *
  10070. * _.includes([1, 2, 3], 1, 2);
  10071. * // => false
  10072. *
  10073. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10074. * // => true
  10075. *
  10076. * _.includes('abcd', 'bc');
  10077. * // => true
  10078. */
  10079. function includes(collection, value, fromIndex, guard) {
  10080. collection = isArrayLike(collection) ? collection : values(collection);
  10081. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10082. var length = collection.length;
  10083. if (fromIndex < 0) {
  10084. fromIndex = nativeMax(length + fromIndex, 0);
  10085. }
  10086. return isString(collection)
  10087. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10088. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10089. }
  10090. /**
  10091. * Invokes the method at `path` of each element in `collection`, returning
  10092. * an array of the results of each invoked method. Any additional arguments
  10093. * are provided to each invoked method. If `path` is a function, it's invoked
  10094. * for, and `this` bound to, each element in `collection`.
  10095. *
  10096. * @static
  10097. * @memberOf _
  10098. * @since 4.0.0
  10099. * @category Collection
  10100. * @param {Array|Object} collection The collection to iterate over.
  10101. * @param {Array|Function|string} path The path of the method to invoke or
  10102. * the function invoked per iteration.
  10103. * @param {...*} [args] The arguments to invoke each method with.
  10104. * @returns {Array} Returns the array of results.
  10105. * @example
  10106. *
  10107. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10108. * // => [[1, 5, 7], [1, 2, 3]]
  10109. *
  10110. * _.invokeMap([123, 456], String.prototype.split, '');
  10111. * // => [['1', '2', '3'], ['4', '5', '6']]
  10112. */
  10113. var invokeMap = baseRest(function(collection, path, args) {
  10114. var index = -1,
  10115. isFunc = typeof path == 'function',
  10116. result = isArrayLike(collection) ? Array(collection.length) : [];
  10117. baseEach(collection, function(value) {
  10118. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10119. });
  10120. return result;
  10121. });
  10122. /**
  10123. * Creates an object composed of keys generated from the results of running
  10124. * each element of `collection` thru `iteratee`. The corresponding value of
  10125. * each key is the last element responsible for generating the key. The
  10126. * iteratee is invoked with one argument: (value).
  10127. *
  10128. * @static
  10129. * @memberOf _
  10130. * @since 4.0.0
  10131. * @category Collection
  10132. * @param {Array|Object} collection The collection to iterate over.
  10133. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10134. * @returns {Object} Returns the composed aggregate object.
  10135. * @example
  10136. *
  10137. * var array = [
  10138. * { 'dir': 'left', 'code': 97 },
  10139. * { 'dir': 'right', 'code': 100 }
  10140. * ];
  10141. *
  10142. * _.keyBy(array, function(o) {
  10143. * return String.fromCharCode(o.code);
  10144. * });
  10145. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10146. *
  10147. * _.keyBy(array, 'dir');
  10148. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10149. */
  10150. var keyBy = createAggregator(function(result, value, key) {
  10151. baseAssignValue(result, key, value);
  10152. });
  10153. /**
  10154. * Creates an array of values by running each element in `collection` thru
  10155. * `iteratee`. The iteratee is invoked with three arguments:
  10156. * (value, index|key, collection).
  10157. *
  10158. * Many lodash methods are guarded to work as iteratees for methods like
  10159. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10160. *
  10161. * The guarded methods are:
  10162. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10163. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10164. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10165. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10166. *
  10167. * @static
  10168. * @memberOf _
  10169. * @since 0.1.0
  10170. * @category Collection
  10171. * @param {Array|Object} collection The collection to iterate over.
  10172. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10173. * @returns {Array} Returns the new mapped array.
  10174. * @example
  10175. *
  10176. * function square(n) {
  10177. * return n * n;
  10178. * }
  10179. *
  10180. * _.map([4, 8], square);
  10181. * // => [16, 64]
  10182. *
  10183. * _.map({ 'a': 4, 'b': 8 }, square);
  10184. * // => [16, 64] (iteration order is not guaranteed)
  10185. *
  10186. * var users = [
  10187. * { 'user': 'barney' },
  10188. * { 'user': 'fred' }
  10189. * ];
  10190. *
  10191. * // The `_.property` iteratee shorthand.
  10192. * _.map(users, 'user');
  10193. * // => ['barney', 'fred']
  10194. */
  10195. function map(collection, iteratee) {
  10196. var func = isArray(collection) ? arrayMap : baseMap;
  10197. return func(collection, getIteratee(iteratee, 3));
  10198. }
  10199. /**
  10200. * This method is like `_.sortBy` except that it allows specifying the sort
  10201. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10202. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10203. * descending or "asc" for ascending sort order of corresponding values.
  10204. *
  10205. * @static
  10206. * @memberOf _
  10207. * @since 4.0.0
  10208. * @category Collection
  10209. * @param {Array|Object} collection The collection to iterate over.
  10210. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10211. * The iteratees to sort by.
  10212. * @param {string[]} [orders] The sort orders of `iteratees`.
  10213. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10214. * @returns {Array} Returns the new sorted array.
  10215. * @example
  10216. *
  10217. * var users = [
  10218. * { 'user': 'fred', 'age': 48 },
  10219. * { 'user': 'barney', 'age': 34 },
  10220. * { 'user': 'fred', 'age': 40 },
  10221. * { 'user': 'barney', 'age': 36 }
  10222. * ];
  10223. *
  10224. * // Sort by `user` in ascending order and by `age` in descending order.
  10225. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10226. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10227. */
  10228. function orderBy(collection, iteratees, orders, guard) {
  10229. if (collection == null) {
  10230. return [];
  10231. }
  10232. if (!isArray(iteratees)) {
  10233. iteratees = iteratees == null ? [] : [iteratees];
  10234. }
  10235. orders = guard ? undefined : orders;
  10236. if (!isArray(orders)) {
  10237. orders = orders == null ? [] : [orders];
  10238. }
  10239. return baseOrderBy(collection, iteratees, orders);
  10240. }
  10241. /**
  10242. * Creates an array of elements split into two groups, the first of which
  10243. * contains elements `predicate` returns truthy for, the second of which
  10244. * contains elements `predicate` returns falsey for. The predicate is
  10245. * invoked with one argument: (value).
  10246. *
  10247. * @static
  10248. * @memberOf _
  10249. * @since 3.0.0
  10250. * @category Collection
  10251. * @param {Array|Object} collection The collection to iterate over.
  10252. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10253. * @returns {Array} Returns the array of grouped elements.
  10254. * @example
  10255. *
  10256. * var users = [
  10257. * { 'user': 'barney', 'age': 36, 'active': false },
  10258. * { 'user': 'fred', 'age': 40, 'active': true },
  10259. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10260. * ];
  10261. *
  10262. * _.partition(users, function(o) { return o.active; });
  10263. * // => objects for [['fred'], ['barney', 'pebbles']]
  10264. *
  10265. * // The `_.matches` iteratee shorthand.
  10266. * _.partition(users, { 'age': 1, 'active': false });
  10267. * // => objects for [['pebbles'], ['barney', 'fred']]
  10268. *
  10269. * // The `_.matchesProperty` iteratee shorthand.
  10270. * _.partition(users, ['active', false]);
  10271. * // => objects for [['barney', 'pebbles'], ['fred']]
  10272. *
  10273. * // The `_.property` iteratee shorthand.
  10274. * _.partition(users, 'active');
  10275. * // => objects for [['fred'], ['barney', 'pebbles']]
  10276. */
  10277. var partition = createAggregator(function(result, value, key) {
  10278. result[key ? 0 : 1].push(value);
  10279. }, function() { return [[], []]; });
  10280. /**
  10281. * Reduces `collection` to a value which is the accumulated result of running
  10282. * each element in `collection` thru `iteratee`, where each successive
  10283. * invocation is supplied the return value of the previous. If `accumulator`
  10284. * is not given, the first element of `collection` is used as the initial
  10285. * value. The iteratee is invoked with four arguments:
  10286. * (accumulator, value, index|key, collection).
  10287. *
  10288. * Many lodash methods are guarded to work as iteratees for methods like
  10289. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10290. *
  10291. * The guarded methods are:
  10292. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10293. * and `sortBy`
  10294. *
  10295. * @static
  10296. * @memberOf _
  10297. * @since 0.1.0
  10298. * @category Collection
  10299. * @param {Array|Object} collection The collection to iterate over.
  10300. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10301. * @param {*} [accumulator] The initial value.
  10302. * @returns {*} Returns the accumulated value.
  10303. * @see _.reduceRight
  10304. * @example
  10305. *
  10306. * _.reduce([1, 2], function(sum, n) {
  10307. * return sum + n;
  10308. * }, 0);
  10309. * // => 3
  10310. *
  10311. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10312. * (result[value] || (result[value] = [])).push(key);
  10313. * return result;
  10314. * }, {});
  10315. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10316. */
  10317. function reduce(collection, iteratee, accumulator) {
  10318. var func = isArray(collection) ? arrayReduce : baseReduce,
  10319. initAccum = arguments.length < 3;
  10320. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10321. }
  10322. /**
  10323. * This method is like `_.reduce` except that it iterates over elements of
  10324. * `collection` from right to left.
  10325. *
  10326. * @static
  10327. * @memberOf _
  10328. * @since 0.1.0
  10329. * @category Collection
  10330. * @param {Array|Object} collection The collection to iterate over.
  10331. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10332. * @param {*} [accumulator] The initial value.
  10333. * @returns {*} Returns the accumulated value.
  10334. * @see _.reduce
  10335. * @example
  10336. *
  10337. * var array = [[0, 1], [2, 3], [4, 5]];
  10338. *
  10339. * _.reduceRight(array, function(flattened, other) {
  10340. * return flattened.concat(other);
  10341. * }, []);
  10342. * // => [4, 5, 2, 3, 0, 1]
  10343. */
  10344. function reduceRight(collection, iteratee, accumulator) {
  10345. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10346. initAccum = arguments.length < 3;
  10347. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10348. }
  10349. /**
  10350. * The opposite of `_.filter`; this method returns the elements of `collection`
  10351. * that `predicate` does **not** return truthy for.
  10352. *
  10353. * @static
  10354. * @memberOf _
  10355. * @since 0.1.0
  10356. * @category Collection
  10357. * @param {Array|Object} collection The collection to iterate over.
  10358. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10359. * @returns {Array} Returns the new filtered array.
  10360. * @see _.filter
  10361. * @example
  10362. *
  10363. * var users = [
  10364. * { 'user': 'barney', 'age': 36, 'active': false },
  10365. * { 'user': 'fred', 'age': 40, 'active': true }
  10366. * ];
  10367. *
  10368. * _.reject(users, function(o) { return !o.active; });
  10369. * // => objects for ['fred']
  10370. *
  10371. * // The `_.matches` iteratee shorthand.
  10372. * _.reject(users, { 'age': 40, 'active': true });
  10373. * // => objects for ['barney']
  10374. *
  10375. * // The `_.matchesProperty` iteratee shorthand.
  10376. * _.reject(users, ['active', false]);
  10377. * // => objects for ['fred']
  10378. *
  10379. * // The `_.property` iteratee shorthand.
  10380. * _.reject(users, 'active');
  10381. * // => objects for ['barney']
  10382. */
  10383. function reject(collection, predicate) {
  10384. var func = isArray(collection) ? arrayFilter : baseFilter;
  10385. return func(collection, negate(getIteratee(predicate, 3)));
  10386. }
  10387. /**
  10388. * Gets a random element from `collection`.
  10389. *
  10390. * @static
  10391. * @memberOf _
  10392. * @since 2.0.0
  10393. * @category Collection
  10394. * @param {Array|Object} collection The collection to sample.
  10395. * @returns {*} Returns the random element.
  10396. * @example
  10397. *
  10398. * _.sample([1, 2, 3, 4]);
  10399. * // => 2
  10400. */
  10401. function sample(collection) {
  10402. var func = isArray(collection) ? arraySample : baseSample;
  10403. return func(collection);
  10404. }
  10405. /**
  10406. * Gets `n` random elements at unique keys from `collection` up to the
  10407. * size of `collection`.
  10408. *
  10409. * @static
  10410. * @memberOf _
  10411. * @since 4.0.0
  10412. * @category Collection
  10413. * @param {Array|Object} collection The collection to sample.
  10414. * @param {number} [n=1] The number of elements to sample.
  10415. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10416. * @returns {Array} Returns the random elements.
  10417. * @example
  10418. *
  10419. * _.sampleSize([1, 2, 3], 2);
  10420. * // => [3, 1]
  10421. *
  10422. * _.sampleSize([1, 2, 3], 4);
  10423. * // => [2, 3, 1]
  10424. */
  10425. function sampleSize(collection, n, guard) {
  10426. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10427. n = 1;
  10428. } else {
  10429. n = toInteger(n);
  10430. }
  10431. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10432. return func(collection, n);
  10433. }
  10434. /**
  10435. * Creates an array of shuffled values, using a version of the
  10436. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10437. *
  10438. * @static
  10439. * @memberOf _
  10440. * @since 0.1.0
  10441. * @category Collection
  10442. * @param {Array|Object} collection The collection to shuffle.
  10443. * @returns {Array} Returns the new shuffled array.
  10444. * @example
  10445. *
  10446. * _.shuffle([1, 2, 3, 4]);
  10447. * // => [4, 1, 3, 2]
  10448. */
  10449. function shuffle(collection) {
  10450. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10451. return func(collection);
  10452. }
  10453. /**
  10454. * Gets the size of `collection` by returning its length for array-like
  10455. * values or the number of own enumerable string keyed properties for objects.
  10456. *
  10457. * @static
  10458. * @memberOf _
  10459. * @since 0.1.0
  10460. * @category Collection
  10461. * @param {Array|Object|string} collection The collection to inspect.
  10462. * @returns {number} Returns the collection size.
  10463. * @example
  10464. *
  10465. * _.size([1, 2, 3]);
  10466. * // => 3
  10467. *
  10468. * _.size({ 'a': 1, 'b': 2 });
  10469. * // => 2
  10470. *
  10471. * _.size('pebbles');
  10472. * // => 7
  10473. */
  10474. function size(collection) {
  10475. if (collection == null) {
  10476. return 0;
  10477. }
  10478. if (isArrayLike(collection)) {
  10479. return isString(collection) ? stringSize(collection) : collection.length;
  10480. }
  10481. var tag = getTag(collection);
  10482. if (tag == mapTag || tag == setTag) {
  10483. return collection.size;
  10484. }
  10485. return baseKeys(collection).length;
  10486. }
  10487. /**
  10488. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10489. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10490. * invoked with three arguments: (value, index|key, collection).
  10491. *
  10492. * @static
  10493. * @memberOf _
  10494. * @since 0.1.0
  10495. * @category Collection
  10496. * @param {Array|Object} collection The collection to iterate over.
  10497. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10498. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10499. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10500. * else `false`.
  10501. * @example
  10502. *
  10503. * _.some([null, 0, 'yes', false], Boolean);
  10504. * // => true
  10505. *
  10506. * var users = [
  10507. * { 'user': 'barney', 'active': true },
  10508. * { 'user': 'fred', 'active': false }
  10509. * ];
  10510. *
  10511. * // The `_.matches` iteratee shorthand.
  10512. * _.some(users, { 'user': 'barney', 'active': false });
  10513. * // => false
  10514. *
  10515. * // The `_.matchesProperty` iteratee shorthand.
  10516. * _.some(users, ['active', false]);
  10517. * // => true
  10518. *
  10519. * // The `_.property` iteratee shorthand.
  10520. * _.some(users, 'active');
  10521. * // => true
  10522. */
  10523. function some(collection, predicate, guard) {
  10524. var func = isArray(collection) ? arraySome : baseSome;
  10525. if (guard && isIterateeCall(collection, predicate, guard)) {
  10526. predicate = undefined;
  10527. }
  10528. return func(collection, getIteratee(predicate, 3));
  10529. }
  10530. /**
  10531. * Creates an array of elements, sorted in ascending order by the results of
  10532. * running each element in a collection thru each iteratee. This method
  10533. * performs a stable sort, that is, it preserves the original sort order of
  10534. * equal elements. The iteratees are invoked with one argument: (value).
  10535. *
  10536. * @static
  10537. * @memberOf _
  10538. * @since 0.1.0
  10539. * @category Collection
  10540. * @param {Array|Object} collection The collection to iterate over.
  10541. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10542. * The iteratees to sort by.
  10543. * @returns {Array} Returns the new sorted array.
  10544. * @example
  10545. *
  10546. * var users = [
  10547. * { 'user': 'fred', 'age': 48 },
  10548. * { 'user': 'barney', 'age': 36 },
  10549. * { 'user': 'fred', 'age': 30 },
  10550. * { 'user': 'barney', 'age': 34 }
  10551. * ];
  10552. *
  10553. * _.sortBy(users, [function(o) { return o.user; }]);
  10554. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10555. *
  10556. * _.sortBy(users, ['user', 'age']);
  10557. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10558. */
  10559. var sortBy = baseRest(function(collection, iteratees) {
  10560. if (collection == null) {
  10561. return [];
  10562. }
  10563. var length = iteratees.length;
  10564. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10565. iteratees = [];
  10566. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10567. iteratees = [iteratees[0]];
  10568. }
  10569. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10570. });
  10571. /*------------------------------------------------------------------------*/
  10572. /**
  10573. * Gets the timestamp of the number of milliseconds that have elapsed since
  10574. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10575. *
  10576. * @static
  10577. * @memberOf _
  10578. * @since 2.4.0
  10579. * @category Date
  10580. * @returns {number} Returns the timestamp.
  10581. * @example
  10582. *
  10583. * _.defer(function(stamp) {
  10584. * console.log(_.now() - stamp);
  10585. * }, _.now());
  10586. * // => Logs the number of milliseconds it took for the deferred invocation.
  10587. */
  10588. var now = ctxNow || function() {
  10589. return root.Date.now();
  10590. };
  10591. /*------------------------------------------------------------------------*/
  10592. /**
  10593. * The opposite of `_.before`; this method creates a function that invokes
  10594. * `func` once it's called `n` or more times.
  10595. *
  10596. * @static
  10597. * @memberOf _
  10598. * @since 0.1.0
  10599. * @category Function
  10600. * @param {number} n The number of calls before `func` is invoked.
  10601. * @param {Function} func The function to restrict.
  10602. * @returns {Function} Returns the new restricted function.
  10603. * @example
  10604. *
  10605. * var saves = ['profile', 'settings'];
  10606. *
  10607. * var done = _.after(saves.length, function() {
  10608. * console.log('done saving!');
  10609. * });
  10610. *
  10611. * _.forEach(saves, function(type) {
  10612. * asyncSave({ 'type': type, 'complete': done });
  10613. * });
  10614. * // => Logs 'done saving!' after the two async saves have completed.
  10615. */
  10616. function after(n, func) {
  10617. if (typeof func != 'function') {
  10618. throw new TypeError(FUNC_ERROR_TEXT);
  10619. }
  10620. n = toInteger(n);
  10621. return function() {
  10622. if (--n < 1) {
  10623. return func.apply(this, arguments);
  10624. }
  10625. };
  10626. }
  10627. /**
  10628. * Creates a function that invokes `func`, with up to `n` arguments,
  10629. * ignoring any additional arguments.
  10630. *
  10631. * @static
  10632. * @memberOf _
  10633. * @since 3.0.0
  10634. * @category Function
  10635. * @param {Function} func The function to cap arguments for.
  10636. * @param {number} [n=func.length] The arity cap.
  10637. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10638. * @returns {Function} Returns the new capped function.
  10639. * @example
  10640. *
  10641. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10642. * // => [6, 8, 10]
  10643. */
  10644. function ary(func, n, guard) {
  10645. n = guard ? undefined : n;
  10646. n = (func && n == null) ? func.length : n;
  10647. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10648. }
  10649. /**
  10650. * Creates a function that invokes `func`, with the `this` binding and arguments
  10651. * of the created function, while it's called less than `n` times. Subsequent
  10652. * calls to the created function return the result of the last `func` invocation.
  10653. *
  10654. * @static
  10655. * @memberOf _
  10656. * @since 3.0.0
  10657. * @category Function
  10658. * @param {number} n The number of calls at which `func` is no longer invoked.
  10659. * @param {Function} func The function to restrict.
  10660. * @returns {Function} Returns the new restricted function.
  10661. * @example
  10662. *
  10663. * jQuery(element).on('click', _.before(5, addContactToList));
  10664. * // => Allows adding up to 4 contacts to the list.
  10665. */
  10666. function before(n, func) {
  10667. var result;
  10668. if (typeof func != 'function') {
  10669. throw new TypeError(FUNC_ERROR_TEXT);
  10670. }
  10671. n = toInteger(n);
  10672. return function() {
  10673. if (--n > 0) {
  10674. result = func.apply(this, arguments);
  10675. }
  10676. if (n <= 1) {
  10677. func = undefined;
  10678. }
  10679. return result;
  10680. };
  10681. }
  10682. /**
  10683. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10684. * and `partials` prepended to the arguments it receives.
  10685. *
  10686. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10687. * may be used as a placeholder for partially applied arguments.
  10688. *
  10689. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10690. * property of bound functions.
  10691. *
  10692. * @static
  10693. * @memberOf _
  10694. * @since 0.1.0
  10695. * @category Function
  10696. * @param {Function} func The function to bind.
  10697. * @param {*} thisArg The `this` binding of `func`.
  10698. * @param {...*} [partials] The arguments to be partially applied.
  10699. * @returns {Function} Returns the new bound function.
  10700. * @example
  10701. *
  10702. * function greet(greeting, punctuation) {
  10703. * return greeting + ' ' + this.user + punctuation;
  10704. * }
  10705. *
  10706. * var object = { 'user': 'fred' };
  10707. *
  10708. * var bound = _.bind(greet, object, 'hi');
  10709. * bound('!');
  10710. * // => 'hi fred!'
  10711. *
  10712. * // Bound with placeholders.
  10713. * var bound = _.bind(greet, object, _, '!');
  10714. * bound('hi');
  10715. * // => 'hi fred!'
  10716. */
  10717. var bind = baseRest(function(func, thisArg, partials) {
  10718. var bitmask = WRAP_BIND_FLAG;
  10719. if (partials.length) {
  10720. var holders = replaceHolders(partials, getHolder(bind));
  10721. bitmask |= WRAP_PARTIAL_FLAG;
  10722. }
  10723. return createWrap(func, bitmask, thisArg, partials, holders);
  10724. });
  10725. /**
  10726. * Creates a function that invokes the method at `object[key]` with `partials`
  10727. * prepended to the arguments it receives.
  10728. *
  10729. * This method differs from `_.bind` by allowing bound functions to reference
  10730. * methods that may be redefined or don't yet exist. See
  10731. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10732. * for more details.
  10733. *
  10734. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10735. * builds, may be used as a placeholder for partially applied arguments.
  10736. *
  10737. * @static
  10738. * @memberOf _
  10739. * @since 0.10.0
  10740. * @category Function
  10741. * @param {Object} object The object to invoke the method on.
  10742. * @param {string} key The key of the method.
  10743. * @param {...*} [partials] The arguments to be partially applied.
  10744. * @returns {Function} Returns the new bound function.
  10745. * @example
  10746. *
  10747. * var object = {
  10748. * 'user': 'fred',
  10749. * 'greet': function(greeting, punctuation) {
  10750. * return greeting + ' ' + this.user + punctuation;
  10751. * }
  10752. * };
  10753. *
  10754. * var bound = _.bindKey(object, 'greet', 'hi');
  10755. * bound('!');
  10756. * // => 'hi fred!'
  10757. *
  10758. * object.greet = function(greeting, punctuation) {
  10759. * return greeting + 'ya ' + this.user + punctuation;
  10760. * };
  10761. *
  10762. * bound('!');
  10763. * // => 'hiya fred!'
  10764. *
  10765. * // Bound with placeholders.
  10766. * var bound = _.bindKey(object, 'greet', _, '!');
  10767. * bound('hi');
  10768. * // => 'hiya fred!'
  10769. */
  10770. var bindKey = baseRest(function(object, key, partials) {
  10771. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10772. if (partials.length) {
  10773. var holders = replaceHolders(partials, getHolder(bindKey));
  10774. bitmask |= WRAP_PARTIAL_FLAG;
  10775. }
  10776. return createWrap(key, bitmask, object, partials, holders);
  10777. });
  10778. /**
  10779. * Creates a function that accepts arguments of `func` and either invokes
  10780. * `func` returning its result, if at least `arity` number of arguments have
  10781. * been provided, or returns a function that accepts the remaining `func`
  10782. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10783. * is not sufficient.
  10784. *
  10785. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10786. * may be used as a placeholder for provided arguments.
  10787. *
  10788. * **Note:** This method doesn't set the "length" property of curried functions.
  10789. *
  10790. * @static
  10791. * @memberOf _
  10792. * @since 2.0.0
  10793. * @category Function
  10794. * @param {Function} func The function to curry.
  10795. * @param {number} [arity=func.length] The arity of `func`.
  10796. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10797. * @returns {Function} Returns the new curried function.
  10798. * @example
  10799. *
  10800. * var abc = function(a, b, c) {
  10801. * return [a, b, c];
  10802. * };
  10803. *
  10804. * var curried = _.curry(abc);
  10805. *
  10806. * curried(1)(2)(3);
  10807. * // => [1, 2, 3]
  10808. *
  10809. * curried(1, 2)(3);
  10810. * // => [1, 2, 3]
  10811. *
  10812. * curried(1, 2, 3);
  10813. * // => [1, 2, 3]
  10814. *
  10815. * // Curried with placeholders.
  10816. * curried(1)(_, 3)(2);
  10817. * // => [1, 2, 3]
  10818. */
  10819. function curry(func, arity, guard) {
  10820. arity = guard ? undefined : arity;
  10821. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10822. result.placeholder = curry.placeholder;
  10823. return result;
  10824. }
  10825. /**
  10826. * This method is like `_.curry` except that arguments are applied to `func`
  10827. * in the manner of `_.partialRight` instead of `_.partial`.
  10828. *
  10829. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10830. * builds, may be used as a placeholder for provided arguments.
  10831. *
  10832. * **Note:** This method doesn't set the "length" property of curried functions.
  10833. *
  10834. * @static
  10835. * @memberOf _
  10836. * @since 3.0.0
  10837. * @category Function
  10838. * @param {Function} func The function to curry.
  10839. * @param {number} [arity=func.length] The arity of `func`.
  10840. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10841. * @returns {Function} Returns the new curried function.
  10842. * @example
  10843. *
  10844. * var abc = function(a, b, c) {
  10845. * return [a, b, c];
  10846. * };
  10847. *
  10848. * var curried = _.curryRight(abc);
  10849. *
  10850. * curried(3)(2)(1);
  10851. * // => [1, 2, 3]
  10852. *
  10853. * curried(2, 3)(1);
  10854. * // => [1, 2, 3]
  10855. *
  10856. * curried(1, 2, 3);
  10857. * // => [1, 2, 3]
  10858. *
  10859. * // Curried with placeholders.
  10860. * curried(3)(1, _)(2);
  10861. * // => [1, 2, 3]
  10862. */
  10863. function curryRight(func, arity, guard) {
  10864. arity = guard ? undefined : arity;
  10865. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10866. result.placeholder = curryRight.placeholder;
  10867. return result;
  10868. }
  10869. /**
  10870. * Creates a debounced function that delays invoking `func` until after `wait`
  10871. * milliseconds have elapsed since the last time the debounced function was
  10872. * invoked. The debounced function comes with a `cancel` method to cancel
  10873. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10874. * Provide `options` to indicate whether `func` should be invoked on the
  10875. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10876. * with the last arguments provided to the debounced function. Subsequent
  10877. * calls to the debounced function return the result of the last `func`
  10878. * invocation.
  10879. *
  10880. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10881. * invoked on the trailing edge of the timeout only if the debounced function
  10882. * is invoked more than once during the `wait` timeout.
  10883. *
  10884. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10885. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10886. *
  10887. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10888. * for details over the differences between `_.debounce` and `_.throttle`.
  10889. *
  10890. * @static
  10891. * @memberOf _
  10892. * @since 0.1.0
  10893. * @category Function
  10894. * @param {Function} func The function to debounce.
  10895. * @param {number} [wait=0] The number of milliseconds to delay.
  10896. * @param {Object} [options={}] The options object.
  10897. * @param {boolean} [options.leading=false]
  10898. * Specify invoking on the leading edge of the timeout.
  10899. * @param {number} [options.maxWait]
  10900. * The maximum time `func` is allowed to be delayed before it's invoked.
  10901. * @param {boolean} [options.trailing=true]
  10902. * Specify invoking on the trailing edge of the timeout.
  10903. * @returns {Function} Returns the new debounced function.
  10904. * @example
  10905. *
  10906. * // Avoid costly calculations while the window size is in flux.
  10907. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10908. *
  10909. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10910. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10911. * 'leading': true,
  10912. * 'trailing': false
  10913. * }));
  10914. *
  10915. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10916. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10917. * var source = new EventSource('/stream');
  10918. * jQuery(source).on('message', debounced);
  10919. *
  10920. * // Cancel the trailing debounced invocation.
  10921. * jQuery(window).on('popstate', debounced.cancel);
  10922. */
  10923. function debounce(func, wait, options) {
  10924. var lastArgs,
  10925. lastThis,
  10926. maxWait,
  10927. result,
  10928. timerId,
  10929. lastCallTime,
  10930. lastInvokeTime = 0,
  10931. leading = false,
  10932. maxing = false,
  10933. trailing = true;
  10934. if (typeof func != 'function') {
  10935. throw new TypeError(FUNC_ERROR_TEXT);
  10936. }
  10937. wait = toNumber(wait) || 0;
  10938. if (isObject(options)) {
  10939. leading = !!options.leading;
  10940. maxing = 'maxWait' in options;
  10941. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10942. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10943. }
  10944. function invokeFunc(time) {
  10945. var args = lastArgs,
  10946. thisArg = lastThis;
  10947. lastArgs = lastThis = undefined;
  10948. lastInvokeTime = time;
  10949. result = func.apply(thisArg, args);
  10950. return result;
  10951. }
  10952. function leadingEdge(time) {
  10953. // Reset any `maxWait` timer.
  10954. lastInvokeTime = time;
  10955. // Start the timer for the trailing edge.
  10956. timerId = setTimeout(timerExpired, wait);
  10957. // Invoke the leading edge.
  10958. return leading ? invokeFunc(time) : result;
  10959. }
  10960. function remainingWait(time) {
  10961. var timeSinceLastCall = time - lastCallTime,
  10962. timeSinceLastInvoke = time - lastInvokeTime,
  10963. timeWaiting = wait - timeSinceLastCall;
  10964. return maxing
  10965. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10966. : timeWaiting;
  10967. }
  10968. function shouldInvoke(time) {
  10969. var timeSinceLastCall = time - lastCallTime,
  10970. timeSinceLastInvoke = time - lastInvokeTime;
  10971. // Either this is the first call, activity has stopped and we're at the
  10972. // trailing edge, the system time has gone backwards and we're treating
  10973. // it as the trailing edge, or we've hit the `maxWait` limit.
  10974. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10975. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10976. }
  10977. function timerExpired() {
  10978. var time = now();
  10979. if (shouldInvoke(time)) {
  10980. return trailingEdge(time);
  10981. }
  10982. // Restart the timer.
  10983. timerId = setTimeout(timerExpired, remainingWait(time));
  10984. }
  10985. function trailingEdge(time) {
  10986. timerId = undefined;
  10987. // Only invoke if we have `lastArgs` which means `func` has been
  10988. // debounced at least once.
  10989. if (trailing && lastArgs) {
  10990. return invokeFunc(time);
  10991. }
  10992. lastArgs = lastThis = undefined;
  10993. return result;
  10994. }
  10995. function cancel() {
  10996. if (timerId !== undefined) {
  10997. clearTimeout(timerId);
  10998. }
  10999. lastInvokeTime = 0;
  11000. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11001. }
  11002. function flush() {
  11003. return timerId === undefined ? result : trailingEdge(now());
  11004. }
  11005. function debounced() {
  11006. var time = now(),
  11007. isInvoking = shouldInvoke(time);
  11008. lastArgs = arguments;
  11009. lastThis = this;
  11010. lastCallTime = time;
  11011. if (isInvoking) {
  11012. if (timerId === undefined) {
  11013. return leadingEdge(lastCallTime);
  11014. }
  11015. if (maxing) {
  11016. // Handle invocations in a tight loop.
  11017. clearTimeout(timerId);
  11018. timerId = setTimeout(timerExpired, wait);
  11019. return invokeFunc(lastCallTime);
  11020. }
  11021. }
  11022. if (timerId === undefined) {
  11023. timerId = setTimeout(timerExpired, wait);
  11024. }
  11025. return result;
  11026. }
  11027. debounced.cancel = cancel;
  11028. debounced.flush = flush;
  11029. return debounced;
  11030. }
  11031. /**
  11032. * Defers invoking the `func` until the current call stack has cleared. Any
  11033. * additional arguments are provided to `func` when it's invoked.
  11034. *
  11035. * @static
  11036. * @memberOf _
  11037. * @since 0.1.0
  11038. * @category Function
  11039. * @param {Function} func The function to defer.
  11040. * @param {...*} [args] The arguments to invoke `func` with.
  11041. * @returns {number} Returns the timer id.
  11042. * @example
  11043. *
  11044. * _.defer(function(text) {
  11045. * console.log(text);
  11046. * }, 'deferred');
  11047. * // => Logs 'deferred' after one millisecond.
  11048. */
  11049. var defer = baseRest(function(func, args) {
  11050. return baseDelay(func, 1, args);
  11051. });
  11052. /**
  11053. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11054. * provided to `func` when it's invoked.
  11055. *
  11056. * @static
  11057. * @memberOf _
  11058. * @since 0.1.0
  11059. * @category Function
  11060. * @param {Function} func The function to delay.
  11061. * @param {number} wait The number of milliseconds to delay invocation.
  11062. * @param {...*} [args] The arguments to invoke `func` with.
  11063. * @returns {number} Returns the timer id.
  11064. * @example
  11065. *
  11066. * _.delay(function(text) {
  11067. * console.log(text);
  11068. * }, 1000, 'later');
  11069. * // => Logs 'later' after one second.
  11070. */
  11071. var delay = baseRest(function(func, wait, args) {
  11072. return baseDelay(func, toNumber(wait) || 0, args);
  11073. });
  11074. /**
  11075. * Creates a function that invokes `func` with arguments reversed.
  11076. *
  11077. * @static
  11078. * @memberOf _
  11079. * @since 4.0.0
  11080. * @category Function
  11081. * @param {Function} func The function to flip arguments for.
  11082. * @returns {Function} Returns the new flipped function.
  11083. * @example
  11084. *
  11085. * var flipped = _.flip(function() {
  11086. * return _.toArray(arguments);
  11087. * });
  11088. *
  11089. * flipped('a', 'b', 'c', 'd');
  11090. * // => ['d', 'c', 'b', 'a']
  11091. */
  11092. function flip(func) {
  11093. return createWrap(func, WRAP_FLIP_FLAG);
  11094. }
  11095. /**
  11096. * Creates a function that memoizes the result of `func`. If `resolver` is
  11097. * provided, it determines the cache key for storing the result based on the
  11098. * arguments provided to the memoized function. By default, the first argument
  11099. * provided to the memoized function is used as the map cache key. The `func`
  11100. * is invoked with the `this` binding of the memoized function.
  11101. *
  11102. * **Note:** The cache is exposed as the `cache` property on the memoized
  11103. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11104. * constructor with one whose instances implement the
  11105. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11106. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11107. *
  11108. * @static
  11109. * @memberOf _
  11110. * @since 0.1.0
  11111. * @category Function
  11112. * @param {Function} func The function to have its output memoized.
  11113. * @param {Function} [resolver] The function to resolve the cache key.
  11114. * @returns {Function} Returns the new memoized function.
  11115. * @example
  11116. *
  11117. * var object = { 'a': 1, 'b': 2 };
  11118. * var other = { 'c': 3, 'd': 4 };
  11119. *
  11120. * var values = _.memoize(_.values);
  11121. * values(object);
  11122. * // => [1, 2]
  11123. *
  11124. * values(other);
  11125. * // => [3, 4]
  11126. *
  11127. * object.a = 2;
  11128. * values(object);
  11129. * // => [1, 2]
  11130. *
  11131. * // Modify the result cache.
  11132. * values.cache.set(object, ['a', 'b']);
  11133. * values(object);
  11134. * // => ['a', 'b']
  11135. *
  11136. * // Replace `_.memoize.Cache`.
  11137. * _.memoize.Cache = WeakMap;
  11138. */
  11139. function memoize(func, resolver) {
  11140. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11141. throw new TypeError(FUNC_ERROR_TEXT);
  11142. }
  11143. var memoized = function() {
  11144. var args = arguments,
  11145. key = resolver ? resolver.apply(this, args) : args[0],
  11146. cache = memoized.cache;
  11147. if (cache.has(key)) {
  11148. return cache.get(key);
  11149. }
  11150. var result = func.apply(this, args);
  11151. memoized.cache = cache.set(key, result) || cache;
  11152. return result;
  11153. };
  11154. memoized.cache = new (memoize.Cache || MapCache);
  11155. return memoized;
  11156. }
  11157. // Expose `MapCache`.
  11158. memoize.Cache = MapCache;
  11159. /**
  11160. * Creates a function that negates the result of the predicate `func`. The
  11161. * `func` predicate is invoked with the `this` binding and arguments of the
  11162. * created function.
  11163. *
  11164. * @static
  11165. * @memberOf _
  11166. * @since 3.0.0
  11167. * @category Function
  11168. * @param {Function} predicate The predicate to negate.
  11169. * @returns {Function} Returns the new negated function.
  11170. * @example
  11171. *
  11172. * function isEven(n) {
  11173. * return n % 2 == 0;
  11174. * }
  11175. *
  11176. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11177. * // => [1, 3, 5]
  11178. */
  11179. function negate(predicate) {
  11180. if (typeof predicate != 'function') {
  11181. throw new TypeError(FUNC_ERROR_TEXT);
  11182. }
  11183. return function() {
  11184. var args = arguments;
  11185. switch (args.length) {
  11186. case 0: return !predicate.call(this);
  11187. case 1: return !predicate.call(this, args[0]);
  11188. case 2: return !predicate.call(this, args[0], args[1]);
  11189. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11190. }
  11191. return !predicate.apply(this, args);
  11192. };
  11193. }
  11194. /**
  11195. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11196. * to the function return the value of the first invocation. The `func` is
  11197. * invoked with the `this` binding and arguments of the created function.
  11198. *
  11199. * @static
  11200. * @memberOf _
  11201. * @since 0.1.0
  11202. * @category Function
  11203. * @param {Function} func The function to restrict.
  11204. * @returns {Function} Returns the new restricted function.
  11205. * @example
  11206. *
  11207. * var initialize = _.once(createApplication);
  11208. * initialize();
  11209. * initialize();
  11210. * // => `createApplication` is invoked once
  11211. */
  11212. function once(func) {
  11213. return before(2, func);
  11214. }
  11215. /**
  11216. * Creates a function that invokes `func` with its arguments transformed.
  11217. *
  11218. * @static
  11219. * @since 4.0.0
  11220. * @memberOf _
  11221. * @category Function
  11222. * @param {Function} func The function to wrap.
  11223. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11224. * The argument transforms.
  11225. * @returns {Function} Returns the new function.
  11226. * @example
  11227. *
  11228. * function doubled(n) {
  11229. * return n * 2;
  11230. * }
  11231. *
  11232. * function square(n) {
  11233. * return n * n;
  11234. * }
  11235. *
  11236. * var func = _.overArgs(function(x, y) {
  11237. * return [x, y];
  11238. * }, [square, doubled]);
  11239. *
  11240. * func(9, 3);
  11241. * // => [81, 6]
  11242. *
  11243. * func(10, 5);
  11244. * // => [100, 10]
  11245. */
  11246. var overArgs = castRest(function(func, transforms) {
  11247. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11248. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11249. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11250. var funcsLength = transforms.length;
  11251. return baseRest(function(args) {
  11252. var index = -1,
  11253. length = nativeMin(args.length, funcsLength);
  11254. while (++index < length) {
  11255. args[index] = transforms[index].call(this, args[index]);
  11256. }
  11257. return apply(func, this, args);
  11258. });
  11259. });
  11260. /**
  11261. * Creates a function that invokes `func` with `partials` prepended to the
  11262. * arguments it receives. This method is like `_.bind` except it does **not**
  11263. * alter the `this` binding.
  11264. *
  11265. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11266. * builds, may be used as a placeholder for partially applied arguments.
  11267. *
  11268. * **Note:** This method doesn't set the "length" property of partially
  11269. * applied functions.
  11270. *
  11271. * @static
  11272. * @memberOf _
  11273. * @since 0.2.0
  11274. * @category Function
  11275. * @param {Function} func The function to partially apply arguments to.
  11276. * @param {...*} [partials] The arguments to be partially applied.
  11277. * @returns {Function} Returns the new partially applied function.
  11278. * @example
  11279. *
  11280. * function greet(greeting, name) {
  11281. * return greeting + ' ' + name;
  11282. * }
  11283. *
  11284. * var sayHelloTo = _.partial(greet, 'hello');
  11285. * sayHelloTo('fred');
  11286. * // => 'hello fred'
  11287. *
  11288. * // Partially applied with placeholders.
  11289. * var greetFred = _.partial(greet, _, 'fred');
  11290. * greetFred('hi');
  11291. * // => 'hi fred'
  11292. */
  11293. var partial = baseRest(function(func, partials) {
  11294. var holders = replaceHolders(partials, getHolder(partial));
  11295. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11296. });
  11297. /**
  11298. * This method is like `_.partial` except that partially applied arguments
  11299. * are appended to the arguments it receives.
  11300. *
  11301. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11302. * builds, may be used as a placeholder for partially applied arguments.
  11303. *
  11304. * **Note:** This method doesn't set the "length" property of partially
  11305. * applied functions.
  11306. *
  11307. * @static
  11308. * @memberOf _
  11309. * @since 1.0.0
  11310. * @category Function
  11311. * @param {Function} func The function to partially apply arguments to.
  11312. * @param {...*} [partials] The arguments to be partially applied.
  11313. * @returns {Function} Returns the new partially applied function.
  11314. * @example
  11315. *
  11316. * function greet(greeting, name) {
  11317. * return greeting + ' ' + name;
  11318. * }
  11319. *
  11320. * var greetFred = _.partialRight(greet, 'fred');
  11321. * greetFred('hi');
  11322. * // => 'hi fred'
  11323. *
  11324. * // Partially applied with placeholders.
  11325. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11326. * sayHelloTo('fred');
  11327. * // => 'hello fred'
  11328. */
  11329. var partialRight = baseRest(function(func, partials) {
  11330. var holders = replaceHolders(partials, getHolder(partialRight));
  11331. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11332. });
  11333. /**
  11334. * Creates a function that invokes `func` with arguments arranged according
  11335. * to the specified `indexes` where the argument value at the first index is
  11336. * provided as the first argument, the argument value at the second index is
  11337. * provided as the second argument, and so on.
  11338. *
  11339. * @static
  11340. * @memberOf _
  11341. * @since 3.0.0
  11342. * @category Function
  11343. * @param {Function} func The function to rearrange arguments for.
  11344. * @param {...(number|number[])} indexes The arranged argument indexes.
  11345. * @returns {Function} Returns the new function.
  11346. * @example
  11347. *
  11348. * var rearged = _.rearg(function(a, b, c) {
  11349. * return [a, b, c];
  11350. * }, [2, 0, 1]);
  11351. *
  11352. * rearged('b', 'c', 'a')
  11353. * // => ['a', 'b', 'c']
  11354. */
  11355. var rearg = flatRest(function(func, indexes) {
  11356. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11357. });
  11358. /**
  11359. * Creates a function that invokes `func` with the `this` binding of the
  11360. * created function and arguments from `start` and beyond provided as
  11361. * an array.
  11362. *
  11363. * **Note:** This method is based on the
  11364. * [rest parameter](https://mdn.io/rest_parameters).
  11365. *
  11366. * @static
  11367. * @memberOf _
  11368. * @since 4.0.0
  11369. * @category Function
  11370. * @param {Function} func The function to apply a rest parameter to.
  11371. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11372. * @returns {Function} Returns the new function.
  11373. * @example
  11374. *
  11375. * var say = _.rest(function(what, names) {
  11376. * return what + ' ' + _.initial(names).join(', ') +
  11377. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11378. * });
  11379. *
  11380. * say('hello', 'fred', 'barney', 'pebbles');
  11381. * // => 'hello fred, barney, & pebbles'
  11382. */
  11383. function rest(func, start) {
  11384. if (typeof func != 'function') {
  11385. throw new TypeError(FUNC_ERROR_TEXT);
  11386. }
  11387. start = start === undefined ? start : toInteger(start);
  11388. return baseRest(func, start);
  11389. }
  11390. /**
  11391. * Creates a function that invokes `func` with the `this` binding of the
  11392. * create function and an array of arguments much like
  11393. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11394. *
  11395. * **Note:** This method is based on the
  11396. * [spread operator](https://mdn.io/spread_operator).
  11397. *
  11398. * @static
  11399. * @memberOf _
  11400. * @since 3.2.0
  11401. * @category Function
  11402. * @param {Function} func The function to spread arguments over.
  11403. * @param {number} [start=0] The start position of the spread.
  11404. * @returns {Function} Returns the new function.
  11405. * @example
  11406. *
  11407. * var say = _.spread(function(who, what) {
  11408. * return who + ' says ' + what;
  11409. * });
  11410. *
  11411. * say(['fred', 'hello']);
  11412. * // => 'fred says hello'
  11413. *
  11414. * var numbers = Promise.all([
  11415. * Promise.resolve(40),
  11416. * Promise.resolve(36)
  11417. * ]);
  11418. *
  11419. * numbers.then(_.spread(function(x, y) {
  11420. * return x + y;
  11421. * }));
  11422. * // => a Promise of 76
  11423. */
  11424. function spread(func, start) {
  11425. if (typeof func != 'function') {
  11426. throw new TypeError(FUNC_ERROR_TEXT);
  11427. }
  11428. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11429. return baseRest(function(args) {
  11430. var array = args[start],
  11431. otherArgs = castSlice(args, 0, start);
  11432. if (array) {
  11433. arrayPush(otherArgs, array);
  11434. }
  11435. return apply(func, this, otherArgs);
  11436. });
  11437. }
  11438. /**
  11439. * Creates a throttled function that only invokes `func` at most once per
  11440. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11441. * method to cancel delayed `func` invocations and a `flush` method to
  11442. * immediately invoke them. Provide `options` to indicate whether `func`
  11443. * should be invoked on the leading and/or trailing edge of the `wait`
  11444. * timeout. The `func` is invoked with the last arguments provided to the
  11445. * throttled function. Subsequent calls to the throttled function return the
  11446. * result of the last `func` invocation.
  11447. *
  11448. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11449. * invoked on the trailing edge of the timeout only if the throttled function
  11450. * is invoked more than once during the `wait` timeout.
  11451. *
  11452. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11453. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11454. *
  11455. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11456. * for details over the differences between `_.throttle` and `_.debounce`.
  11457. *
  11458. * @static
  11459. * @memberOf _
  11460. * @since 0.1.0
  11461. * @category Function
  11462. * @param {Function} func The function to throttle.
  11463. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11464. * @param {Object} [options={}] The options object.
  11465. * @param {boolean} [options.leading=true]
  11466. * Specify invoking on the leading edge of the timeout.
  11467. * @param {boolean} [options.trailing=true]
  11468. * Specify invoking on the trailing edge of the timeout.
  11469. * @returns {Function} Returns the new throttled function.
  11470. * @example
  11471. *
  11472. * // Avoid excessively updating the position while scrolling.
  11473. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11474. *
  11475. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11476. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11477. * jQuery(element).on('click', throttled);
  11478. *
  11479. * // Cancel the trailing throttled invocation.
  11480. * jQuery(window).on('popstate', throttled.cancel);
  11481. */
  11482. function throttle(func, wait, options) {
  11483. var leading = true,
  11484. trailing = true;
  11485. if (typeof func != 'function') {
  11486. throw new TypeError(FUNC_ERROR_TEXT);
  11487. }
  11488. if (isObject(options)) {
  11489. leading = 'leading' in options ? !!options.leading : leading;
  11490. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11491. }
  11492. return debounce(func, wait, {
  11493. 'leading': leading,
  11494. 'maxWait': wait,
  11495. 'trailing': trailing
  11496. });
  11497. }
  11498. /**
  11499. * Creates a function that accepts up to one argument, ignoring any
  11500. * additional arguments.
  11501. *
  11502. * @static
  11503. * @memberOf _
  11504. * @since 4.0.0
  11505. * @category Function
  11506. * @param {Function} func The function to cap arguments for.
  11507. * @returns {Function} Returns the new capped function.
  11508. * @example
  11509. *
  11510. * _.map(['6', '8', '10'], _.unary(parseInt));
  11511. * // => [6, 8, 10]
  11512. */
  11513. function unary(func) {
  11514. return ary(func, 1);
  11515. }
  11516. /**
  11517. * Creates a function that provides `value` to `wrapper` as its first
  11518. * argument. Any additional arguments provided to the function are appended
  11519. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11520. * binding of the created function.
  11521. *
  11522. * @static
  11523. * @memberOf _
  11524. * @since 0.1.0
  11525. * @category Function
  11526. * @param {*} value The value to wrap.
  11527. * @param {Function} [wrapper=identity] The wrapper function.
  11528. * @returns {Function} Returns the new function.
  11529. * @example
  11530. *
  11531. * var p = _.wrap(_.escape, function(func, text) {
  11532. * return '<p>' + func(text) + '</p>';
  11533. * });
  11534. *
  11535. * p('fred, barney, & pebbles');
  11536. * // => '<p>fred, barney, &amp; pebbles</p>'
  11537. */
  11538. function wrap(value, wrapper) {
  11539. return partial(castFunction(wrapper), value);
  11540. }
  11541. /*------------------------------------------------------------------------*/
  11542. /**
  11543. * Casts `value` as an array if it's not one.
  11544. *
  11545. * @static
  11546. * @memberOf _
  11547. * @since 4.4.0
  11548. * @category Lang
  11549. * @param {*} value The value to inspect.
  11550. * @returns {Array} Returns the cast array.
  11551. * @example
  11552. *
  11553. * _.castArray(1);
  11554. * // => [1]
  11555. *
  11556. * _.castArray({ 'a': 1 });
  11557. * // => [{ 'a': 1 }]
  11558. *
  11559. * _.castArray('abc');
  11560. * // => ['abc']
  11561. *
  11562. * _.castArray(null);
  11563. * // => [null]
  11564. *
  11565. * _.castArray(undefined);
  11566. * // => [undefined]
  11567. *
  11568. * _.castArray();
  11569. * // => []
  11570. *
  11571. * var array = [1, 2, 3];
  11572. * console.log(_.castArray(array) === array);
  11573. * // => true
  11574. */
  11575. function castArray() {
  11576. if (!arguments.length) {
  11577. return [];
  11578. }
  11579. var value = arguments[0];
  11580. return isArray(value) ? value : [value];
  11581. }
  11582. /**
  11583. * Creates a shallow clone of `value`.
  11584. *
  11585. * **Note:** This method is loosely based on the
  11586. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11587. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11588. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11589. * arrays. The own enumerable properties of `arguments` objects are cloned
  11590. * as plain objects. An empty object is returned for uncloneable values such
  11591. * as error objects, functions, DOM nodes, and WeakMaps.
  11592. *
  11593. * @static
  11594. * @memberOf _
  11595. * @since 0.1.0
  11596. * @category Lang
  11597. * @param {*} value The value to clone.
  11598. * @returns {*} Returns the cloned value.
  11599. * @see _.cloneDeep
  11600. * @example
  11601. *
  11602. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11603. *
  11604. * var shallow = _.clone(objects);
  11605. * console.log(shallow[0] === objects[0]);
  11606. * // => true
  11607. */
  11608. function clone(value) {
  11609. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11610. }
  11611. /**
  11612. * This method is like `_.clone` except that it accepts `customizer` which
  11613. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11614. * cloning is handled by the method instead. The `customizer` is invoked with
  11615. * up to four arguments; (value [, index|key, object, stack]).
  11616. *
  11617. * @static
  11618. * @memberOf _
  11619. * @since 4.0.0
  11620. * @category Lang
  11621. * @param {*} value The value to clone.
  11622. * @param {Function} [customizer] The function to customize cloning.
  11623. * @returns {*} Returns the cloned value.
  11624. * @see _.cloneDeepWith
  11625. * @example
  11626. *
  11627. * function customizer(value) {
  11628. * if (_.isElement(value)) {
  11629. * return value.cloneNode(false);
  11630. * }
  11631. * }
  11632. *
  11633. * var el = _.cloneWith(document.body, customizer);
  11634. *
  11635. * console.log(el === document.body);
  11636. * // => false
  11637. * console.log(el.nodeName);
  11638. * // => 'BODY'
  11639. * console.log(el.childNodes.length);
  11640. * // => 0
  11641. */
  11642. function cloneWith(value, customizer) {
  11643. customizer = typeof customizer == 'function' ? customizer : undefined;
  11644. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11645. }
  11646. /**
  11647. * This method is like `_.clone` except that it recursively clones `value`.
  11648. *
  11649. * @static
  11650. * @memberOf _
  11651. * @since 1.0.0
  11652. * @category Lang
  11653. * @param {*} value The value to recursively clone.
  11654. * @returns {*} Returns the deep cloned value.
  11655. * @see _.clone
  11656. * @example
  11657. *
  11658. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11659. *
  11660. * var deep = _.cloneDeep(objects);
  11661. * console.log(deep[0] === objects[0]);
  11662. * // => false
  11663. */
  11664. function cloneDeep(value) {
  11665. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11666. }
  11667. /**
  11668. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11669. *
  11670. * @static
  11671. * @memberOf _
  11672. * @since 4.0.0
  11673. * @category Lang
  11674. * @param {*} value The value to recursively clone.
  11675. * @param {Function} [customizer] The function to customize cloning.
  11676. * @returns {*} Returns the deep cloned value.
  11677. * @see _.cloneWith
  11678. * @example
  11679. *
  11680. * function customizer(value) {
  11681. * if (_.isElement(value)) {
  11682. * return value.cloneNode(true);
  11683. * }
  11684. * }
  11685. *
  11686. * var el = _.cloneDeepWith(document.body, customizer);
  11687. *
  11688. * console.log(el === document.body);
  11689. * // => false
  11690. * console.log(el.nodeName);
  11691. * // => 'BODY'
  11692. * console.log(el.childNodes.length);
  11693. * // => 20
  11694. */
  11695. function cloneDeepWith(value, customizer) {
  11696. customizer = typeof customizer == 'function' ? customizer : undefined;
  11697. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11698. }
  11699. /**
  11700. * Checks if `object` conforms to `source` by invoking the predicate
  11701. * properties of `source` with the corresponding property values of `object`.
  11702. *
  11703. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11704. * partially applied.
  11705. *
  11706. * @static
  11707. * @memberOf _
  11708. * @since 4.14.0
  11709. * @category Lang
  11710. * @param {Object} object The object to inspect.
  11711. * @param {Object} source The object of property predicates to conform to.
  11712. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11713. * @example
  11714. *
  11715. * var object = { 'a': 1, 'b': 2 };
  11716. *
  11717. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11718. * // => true
  11719. *
  11720. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11721. * // => false
  11722. */
  11723. function conformsTo(object, source) {
  11724. return source == null || baseConformsTo(object, source, keys(source));
  11725. }
  11726. /**
  11727. * Performs a
  11728. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11729. * comparison between two values to determine if they are equivalent.
  11730. *
  11731. * @static
  11732. * @memberOf _
  11733. * @since 4.0.0
  11734. * @category Lang
  11735. * @param {*} value The value to compare.
  11736. * @param {*} other The other value to compare.
  11737. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11738. * @example
  11739. *
  11740. * var object = { 'a': 1 };
  11741. * var other = { 'a': 1 };
  11742. *
  11743. * _.eq(object, object);
  11744. * // => true
  11745. *
  11746. * _.eq(object, other);
  11747. * // => false
  11748. *
  11749. * _.eq('a', 'a');
  11750. * // => true
  11751. *
  11752. * _.eq('a', Object('a'));
  11753. * // => false
  11754. *
  11755. * _.eq(NaN, NaN);
  11756. * // => true
  11757. */
  11758. function eq(value, other) {
  11759. return value === other || (value !== value && other !== other);
  11760. }
  11761. /**
  11762. * Checks if `value` is greater than `other`.
  11763. *
  11764. * @static
  11765. * @memberOf _
  11766. * @since 3.9.0
  11767. * @category Lang
  11768. * @param {*} value The value to compare.
  11769. * @param {*} other The other value to compare.
  11770. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11771. * else `false`.
  11772. * @see _.lt
  11773. * @example
  11774. *
  11775. * _.gt(3, 1);
  11776. * // => true
  11777. *
  11778. * _.gt(3, 3);
  11779. * // => false
  11780. *
  11781. * _.gt(1, 3);
  11782. * // => false
  11783. */
  11784. var gt = createRelationalOperation(baseGt);
  11785. /**
  11786. * Checks if `value` is greater than or equal to `other`.
  11787. *
  11788. * @static
  11789. * @memberOf _
  11790. * @since 3.9.0
  11791. * @category Lang
  11792. * @param {*} value The value to compare.
  11793. * @param {*} other The other value to compare.
  11794. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11795. * `other`, else `false`.
  11796. * @see _.lte
  11797. * @example
  11798. *
  11799. * _.gte(3, 1);
  11800. * // => true
  11801. *
  11802. * _.gte(3, 3);
  11803. * // => true
  11804. *
  11805. * _.gte(1, 3);
  11806. * // => false
  11807. */
  11808. var gte = createRelationalOperation(function(value, other) {
  11809. return value >= other;
  11810. });
  11811. /**
  11812. * Checks if `value` is likely an `arguments` object.
  11813. *
  11814. * @static
  11815. * @memberOf _
  11816. * @since 0.1.0
  11817. * @category Lang
  11818. * @param {*} value The value to check.
  11819. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11820. * else `false`.
  11821. * @example
  11822. *
  11823. * _.isArguments(function() { return arguments; }());
  11824. * // => true
  11825. *
  11826. * _.isArguments([1, 2, 3]);
  11827. * // => false
  11828. */
  11829. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11830. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11831. !propertyIsEnumerable.call(value, 'callee');
  11832. };
  11833. /**
  11834. * Checks if `value` is classified as an `Array` object.
  11835. *
  11836. * @static
  11837. * @memberOf _
  11838. * @since 0.1.0
  11839. * @category Lang
  11840. * @param {*} value The value to check.
  11841. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11842. * @example
  11843. *
  11844. * _.isArray([1, 2, 3]);
  11845. * // => true
  11846. *
  11847. * _.isArray(document.body.children);
  11848. * // => false
  11849. *
  11850. * _.isArray('abc');
  11851. * // => false
  11852. *
  11853. * _.isArray(_.noop);
  11854. * // => false
  11855. */
  11856. var isArray = Array.isArray;
  11857. /**
  11858. * Checks if `value` is classified as an `ArrayBuffer` object.
  11859. *
  11860. * @static
  11861. * @memberOf _
  11862. * @since 4.3.0
  11863. * @category Lang
  11864. * @param {*} value The value to check.
  11865. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11866. * @example
  11867. *
  11868. * _.isArrayBuffer(new ArrayBuffer(2));
  11869. * // => true
  11870. *
  11871. * _.isArrayBuffer(new Array(2));
  11872. * // => false
  11873. */
  11874. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11875. /**
  11876. * Checks if `value` is array-like. A value is considered array-like if it's
  11877. * not a function and has a `value.length` that's an integer greater than or
  11878. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11879. *
  11880. * @static
  11881. * @memberOf _
  11882. * @since 4.0.0
  11883. * @category Lang
  11884. * @param {*} value The value to check.
  11885. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11886. * @example
  11887. *
  11888. * _.isArrayLike([1, 2, 3]);
  11889. * // => true
  11890. *
  11891. * _.isArrayLike(document.body.children);
  11892. * // => true
  11893. *
  11894. * _.isArrayLike('abc');
  11895. * // => true
  11896. *
  11897. * _.isArrayLike(_.noop);
  11898. * // => false
  11899. */
  11900. function isArrayLike(value) {
  11901. return value != null && isLength(value.length) && !isFunction(value);
  11902. }
  11903. /**
  11904. * This method is like `_.isArrayLike` except that it also checks if `value`
  11905. * is an object.
  11906. *
  11907. * @static
  11908. * @memberOf _
  11909. * @since 4.0.0
  11910. * @category Lang
  11911. * @param {*} value The value to check.
  11912. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11913. * else `false`.
  11914. * @example
  11915. *
  11916. * _.isArrayLikeObject([1, 2, 3]);
  11917. * // => true
  11918. *
  11919. * _.isArrayLikeObject(document.body.children);
  11920. * // => true
  11921. *
  11922. * _.isArrayLikeObject('abc');
  11923. * // => false
  11924. *
  11925. * _.isArrayLikeObject(_.noop);
  11926. * // => false
  11927. */
  11928. function isArrayLikeObject(value) {
  11929. return isObjectLike(value) && isArrayLike(value);
  11930. }
  11931. /**
  11932. * Checks if `value` is classified as a boolean primitive or object.
  11933. *
  11934. * @static
  11935. * @memberOf _
  11936. * @since 0.1.0
  11937. * @category Lang
  11938. * @param {*} value The value to check.
  11939. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11940. * @example
  11941. *
  11942. * _.isBoolean(false);
  11943. * // => true
  11944. *
  11945. * _.isBoolean(null);
  11946. * // => false
  11947. */
  11948. function isBoolean(value) {
  11949. return value === true || value === false ||
  11950. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11951. }
  11952. /**
  11953. * Checks if `value` is a buffer.
  11954. *
  11955. * @static
  11956. * @memberOf _
  11957. * @since 4.3.0
  11958. * @category Lang
  11959. * @param {*} value The value to check.
  11960. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11961. * @example
  11962. *
  11963. * _.isBuffer(new Buffer(2));
  11964. * // => true
  11965. *
  11966. * _.isBuffer(new Uint8Array(2));
  11967. * // => false
  11968. */
  11969. var isBuffer = nativeIsBuffer || stubFalse;
  11970. /**
  11971. * Checks if `value` is classified as a `Date` object.
  11972. *
  11973. * @static
  11974. * @memberOf _
  11975. * @since 0.1.0
  11976. * @category Lang
  11977. * @param {*} value The value to check.
  11978. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11979. * @example
  11980. *
  11981. * _.isDate(new Date);
  11982. * // => true
  11983. *
  11984. * _.isDate('Mon April 23 2012');
  11985. * // => false
  11986. */
  11987. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11988. /**
  11989. * Checks if `value` is likely a DOM element.
  11990. *
  11991. * @static
  11992. * @memberOf _
  11993. * @since 0.1.0
  11994. * @category Lang
  11995. * @param {*} value The value to check.
  11996. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11997. * @example
  11998. *
  11999. * _.isElement(document.body);
  12000. * // => true
  12001. *
  12002. * _.isElement('<body>');
  12003. * // => false
  12004. */
  12005. function isElement(value) {
  12006. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12007. }
  12008. /**
  12009. * Checks if `value` is an empty object, collection, map, or set.
  12010. *
  12011. * Objects are considered empty if they have no own enumerable string keyed
  12012. * properties.
  12013. *
  12014. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12015. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12016. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12017. *
  12018. * @static
  12019. * @memberOf _
  12020. * @since 0.1.0
  12021. * @category Lang
  12022. * @param {*} value The value to check.
  12023. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12024. * @example
  12025. *
  12026. * _.isEmpty(null);
  12027. * // => true
  12028. *
  12029. * _.isEmpty(true);
  12030. * // => true
  12031. *
  12032. * _.isEmpty(1);
  12033. * // => true
  12034. *
  12035. * _.isEmpty([1, 2, 3]);
  12036. * // => false
  12037. *
  12038. * _.isEmpty({ 'a': 1 });
  12039. * // => false
  12040. */
  12041. function isEmpty(value) {
  12042. if (value == null) {
  12043. return true;
  12044. }
  12045. if (isArrayLike(value) &&
  12046. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12047. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12048. return !value.length;
  12049. }
  12050. var tag = getTag(value);
  12051. if (tag == mapTag || tag == setTag) {
  12052. return !value.size;
  12053. }
  12054. if (isPrototype(value)) {
  12055. return !baseKeys(value).length;
  12056. }
  12057. for (var key in value) {
  12058. if (hasOwnProperty.call(value, key)) {
  12059. return false;
  12060. }
  12061. }
  12062. return true;
  12063. }
  12064. /**
  12065. * Performs a deep comparison between two values to determine if they are
  12066. * equivalent.
  12067. *
  12068. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12069. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12070. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12071. * by their own, not inherited, enumerable properties. Functions and DOM
  12072. * nodes are compared by strict equality, i.e. `===`.
  12073. *
  12074. * @static
  12075. * @memberOf _
  12076. * @since 0.1.0
  12077. * @category Lang
  12078. * @param {*} value The value to compare.
  12079. * @param {*} other The other value to compare.
  12080. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12081. * @example
  12082. *
  12083. * var object = { 'a': 1 };
  12084. * var other = { 'a': 1 };
  12085. *
  12086. * _.isEqual(object, other);
  12087. * // => true
  12088. *
  12089. * object === other;
  12090. * // => false
  12091. */
  12092. function isEqual(value, other) {
  12093. return baseIsEqual(value, other);
  12094. }
  12095. /**
  12096. * This method is like `_.isEqual` except that it accepts `customizer` which
  12097. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12098. * are handled by the method instead. The `customizer` is invoked with up to
  12099. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12100. *
  12101. * @static
  12102. * @memberOf _
  12103. * @since 4.0.0
  12104. * @category Lang
  12105. * @param {*} value The value to compare.
  12106. * @param {*} other The other value to compare.
  12107. * @param {Function} [customizer] The function to customize comparisons.
  12108. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12109. * @example
  12110. *
  12111. * function isGreeting(value) {
  12112. * return /^h(?:i|ello)$/.test(value);
  12113. * }
  12114. *
  12115. * function customizer(objValue, othValue) {
  12116. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12117. * return true;
  12118. * }
  12119. * }
  12120. *
  12121. * var array = ['hello', 'goodbye'];
  12122. * var other = ['hi', 'goodbye'];
  12123. *
  12124. * _.isEqualWith(array, other, customizer);
  12125. * // => true
  12126. */
  12127. function isEqualWith(value, other, customizer) {
  12128. customizer = typeof customizer == 'function' ? customizer : undefined;
  12129. var result = customizer ? customizer(value, other) : undefined;
  12130. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12131. }
  12132. /**
  12133. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12134. * `SyntaxError`, `TypeError`, or `URIError` object.
  12135. *
  12136. * @static
  12137. * @memberOf _
  12138. * @since 3.0.0
  12139. * @category Lang
  12140. * @param {*} value The value to check.
  12141. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12142. * @example
  12143. *
  12144. * _.isError(new Error);
  12145. * // => true
  12146. *
  12147. * _.isError(Error);
  12148. * // => false
  12149. */
  12150. function isError(value) {
  12151. if (!isObjectLike(value)) {
  12152. return false;
  12153. }
  12154. var tag = baseGetTag(value);
  12155. return tag == errorTag || tag == domExcTag ||
  12156. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12157. }
  12158. /**
  12159. * Checks if `value` is a finite primitive number.
  12160. *
  12161. * **Note:** This method is based on
  12162. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12163. *
  12164. * @static
  12165. * @memberOf _
  12166. * @since 0.1.0
  12167. * @category Lang
  12168. * @param {*} value The value to check.
  12169. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12170. * @example
  12171. *
  12172. * _.isFinite(3);
  12173. * // => true
  12174. *
  12175. * _.isFinite(Number.MIN_VALUE);
  12176. * // => true
  12177. *
  12178. * _.isFinite(Infinity);
  12179. * // => false
  12180. *
  12181. * _.isFinite('3');
  12182. * // => false
  12183. */
  12184. function isFinite(value) {
  12185. return typeof value == 'number' && nativeIsFinite(value);
  12186. }
  12187. /**
  12188. * Checks if `value` is classified as a `Function` object.
  12189. *
  12190. * @static
  12191. * @memberOf _
  12192. * @since 0.1.0
  12193. * @category Lang
  12194. * @param {*} value The value to check.
  12195. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12196. * @example
  12197. *
  12198. * _.isFunction(_);
  12199. * // => true
  12200. *
  12201. * _.isFunction(/abc/);
  12202. * // => false
  12203. */
  12204. function isFunction(value) {
  12205. if (!isObject(value)) {
  12206. return false;
  12207. }
  12208. // The use of `Object#toString` avoids issues with the `typeof` operator
  12209. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12210. var tag = baseGetTag(value);
  12211. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12212. }
  12213. /**
  12214. * Checks if `value` is an integer.
  12215. *
  12216. * **Note:** This method is based on
  12217. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12218. *
  12219. * @static
  12220. * @memberOf _
  12221. * @since 4.0.0
  12222. * @category Lang
  12223. * @param {*} value The value to check.
  12224. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12225. * @example
  12226. *
  12227. * _.isInteger(3);
  12228. * // => true
  12229. *
  12230. * _.isInteger(Number.MIN_VALUE);
  12231. * // => false
  12232. *
  12233. * _.isInteger(Infinity);
  12234. * // => false
  12235. *
  12236. * _.isInteger('3');
  12237. * // => false
  12238. */
  12239. function isInteger(value) {
  12240. return typeof value == 'number' && value == toInteger(value);
  12241. }
  12242. /**
  12243. * Checks if `value` is a valid array-like length.
  12244. *
  12245. * **Note:** This method is loosely based on
  12246. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12247. *
  12248. * @static
  12249. * @memberOf _
  12250. * @since 4.0.0
  12251. * @category Lang
  12252. * @param {*} value The value to check.
  12253. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12254. * @example
  12255. *
  12256. * _.isLength(3);
  12257. * // => true
  12258. *
  12259. * _.isLength(Number.MIN_VALUE);
  12260. * // => false
  12261. *
  12262. * _.isLength(Infinity);
  12263. * // => false
  12264. *
  12265. * _.isLength('3');
  12266. * // => false
  12267. */
  12268. function isLength(value) {
  12269. return typeof value == 'number' &&
  12270. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12271. }
  12272. /**
  12273. * Checks if `value` is the
  12274. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12275. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12276. *
  12277. * @static
  12278. * @memberOf _
  12279. * @since 0.1.0
  12280. * @category Lang
  12281. * @param {*} value The value to check.
  12282. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12283. * @example
  12284. *
  12285. * _.isObject({});
  12286. * // => true
  12287. *
  12288. * _.isObject([1, 2, 3]);
  12289. * // => true
  12290. *
  12291. * _.isObject(_.noop);
  12292. * // => true
  12293. *
  12294. * _.isObject(null);
  12295. * // => false
  12296. */
  12297. function isObject(value) {
  12298. var type = typeof value;
  12299. return value != null && (type == 'object' || type == 'function');
  12300. }
  12301. /**
  12302. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12303. * and has a `typeof` result of "object".
  12304. *
  12305. * @static
  12306. * @memberOf _
  12307. * @since 4.0.0
  12308. * @category Lang
  12309. * @param {*} value The value to check.
  12310. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12311. * @example
  12312. *
  12313. * _.isObjectLike({});
  12314. * // => true
  12315. *
  12316. * _.isObjectLike([1, 2, 3]);
  12317. * // => true
  12318. *
  12319. * _.isObjectLike(_.noop);
  12320. * // => false
  12321. *
  12322. * _.isObjectLike(null);
  12323. * // => false
  12324. */
  12325. function isObjectLike(value) {
  12326. return value != null && typeof value == 'object';
  12327. }
  12328. /**
  12329. * Checks if `value` is classified as a `Map` object.
  12330. *
  12331. * @static
  12332. * @memberOf _
  12333. * @since 4.3.0
  12334. * @category Lang
  12335. * @param {*} value The value to check.
  12336. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12337. * @example
  12338. *
  12339. * _.isMap(new Map);
  12340. * // => true
  12341. *
  12342. * _.isMap(new WeakMap);
  12343. * // => false
  12344. */
  12345. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12346. /**
  12347. * Performs a partial deep comparison between `object` and `source` to
  12348. * determine if `object` contains equivalent property values.
  12349. *
  12350. * **Note:** This method is equivalent to `_.matches` when `source` is
  12351. * partially applied.
  12352. *
  12353. * Partial comparisons will match empty array and empty object `source`
  12354. * values against any array or object value, respectively. See `_.isEqual`
  12355. * for a list of supported value comparisons.
  12356. *
  12357. * @static
  12358. * @memberOf _
  12359. * @since 3.0.0
  12360. * @category Lang
  12361. * @param {Object} object The object to inspect.
  12362. * @param {Object} source The object of property values to match.
  12363. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12364. * @example
  12365. *
  12366. * var object = { 'a': 1, 'b': 2 };
  12367. *
  12368. * _.isMatch(object, { 'b': 2 });
  12369. * // => true
  12370. *
  12371. * _.isMatch(object, { 'b': 1 });
  12372. * // => false
  12373. */
  12374. function isMatch(object, source) {
  12375. return object === source || baseIsMatch(object, source, getMatchData(source));
  12376. }
  12377. /**
  12378. * This method is like `_.isMatch` except that it accepts `customizer` which
  12379. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12380. * are handled by the method instead. The `customizer` is invoked with five
  12381. * arguments: (objValue, srcValue, index|key, object, source).
  12382. *
  12383. * @static
  12384. * @memberOf _
  12385. * @since 4.0.0
  12386. * @category Lang
  12387. * @param {Object} object The object to inspect.
  12388. * @param {Object} source The object of property values to match.
  12389. * @param {Function} [customizer] The function to customize comparisons.
  12390. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12391. * @example
  12392. *
  12393. * function isGreeting(value) {
  12394. * return /^h(?:i|ello)$/.test(value);
  12395. * }
  12396. *
  12397. * function customizer(objValue, srcValue) {
  12398. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12399. * return true;
  12400. * }
  12401. * }
  12402. *
  12403. * var object = { 'greeting': 'hello' };
  12404. * var source = { 'greeting': 'hi' };
  12405. *
  12406. * _.isMatchWith(object, source, customizer);
  12407. * // => true
  12408. */
  12409. function isMatchWith(object, source, customizer) {
  12410. customizer = typeof customizer == 'function' ? customizer : undefined;
  12411. return baseIsMatch(object, source, getMatchData(source), customizer);
  12412. }
  12413. /**
  12414. * Checks if `value` is `NaN`.
  12415. *
  12416. * **Note:** This method is based on
  12417. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12418. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12419. * `undefined` and other non-number values.
  12420. *
  12421. * @static
  12422. * @memberOf _
  12423. * @since 0.1.0
  12424. * @category Lang
  12425. * @param {*} value The value to check.
  12426. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12427. * @example
  12428. *
  12429. * _.isNaN(NaN);
  12430. * // => true
  12431. *
  12432. * _.isNaN(new Number(NaN));
  12433. * // => true
  12434. *
  12435. * isNaN(undefined);
  12436. * // => true
  12437. *
  12438. * _.isNaN(undefined);
  12439. * // => false
  12440. */
  12441. function isNaN(value) {
  12442. // An `NaN` primitive is the only value that is not equal to itself.
  12443. // Perform the `toStringTag` check first to avoid errors with some
  12444. // ActiveX objects in IE.
  12445. return isNumber(value) && value != +value;
  12446. }
  12447. /**
  12448. * Checks if `value` is a pristine native function.
  12449. *
  12450. * **Note:** This method can't reliably detect native functions in the presence
  12451. * of the core-js package because core-js circumvents this kind of detection.
  12452. * Despite multiple requests, the core-js maintainer has made it clear: any
  12453. * attempt to fix the detection will be obstructed. As a result, we're left
  12454. * with little choice but to throw an error. Unfortunately, this also affects
  12455. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12456. * which rely on core-js.
  12457. *
  12458. * @static
  12459. * @memberOf _
  12460. * @since 3.0.0
  12461. * @category Lang
  12462. * @param {*} value The value to check.
  12463. * @returns {boolean} Returns `true` if `value` is a native function,
  12464. * else `false`.
  12465. * @example
  12466. *
  12467. * _.isNative(Array.prototype.push);
  12468. * // => true
  12469. *
  12470. * _.isNative(_);
  12471. * // => false
  12472. */
  12473. function isNative(value) {
  12474. if (isMaskable(value)) {
  12475. throw new Error(CORE_ERROR_TEXT);
  12476. }
  12477. return baseIsNative(value);
  12478. }
  12479. /**
  12480. * Checks if `value` is `null`.
  12481. *
  12482. * @static
  12483. * @memberOf _
  12484. * @since 0.1.0
  12485. * @category Lang
  12486. * @param {*} value The value to check.
  12487. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12488. * @example
  12489. *
  12490. * _.isNull(null);
  12491. * // => true
  12492. *
  12493. * _.isNull(void 0);
  12494. * // => false
  12495. */
  12496. function isNull(value) {
  12497. return value === null;
  12498. }
  12499. /**
  12500. * Checks if `value` is `null` or `undefined`.
  12501. *
  12502. * @static
  12503. * @memberOf _
  12504. * @since 4.0.0
  12505. * @category Lang
  12506. * @param {*} value The value to check.
  12507. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12508. * @example
  12509. *
  12510. * _.isNil(null);
  12511. * // => true
  12512. *
  12513. * _.isNil(void 0);
  12514. * // => true
  12515. *
  12516. * _.isNil(NaN);
  12517. * // => false
  12518. */
  12519. function isNil(value) {
  12520. return value == null;
  12521. }
  12522. /**
  12523. * Checks if `value` is classified as a `Number` primitive or object.
  12524. *
  12525. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12526. * classified as numbers, use the `_.isFinite` method.
  12527. *
  12528. * @static
  12529. * @memberOf _
  12530. * @since 0.1.0
  12531. * @category Lang
  12532. * @param {*} value The value to check.
  12533. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12534. * @example
  12535. *
  12536. * _.isNumber(3);
  12537. * // => true
  12538. *
  12539. * _.isNumber(Number.MIN_VALUE);
  12540. * // => true
  12541. *
  12542. * _.isNumber(Infinity);
  12543. * // => true
  12544. *
  12545. * _.isNumber('3');
  12546. * // => false
  12547. */
  12548. function isNumber(value) {
  12549. return typeof value == 'number' ||
  12550. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12551. }
  12552. /**
  12553. * Checks if `value` is a plain object, that is, an object created by the
  12554. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12555. *
  12556. * @static
  12557. * @memberOf _
  12558. * @since 0.8.0
  12559. * @category Lang
  12560. * @param {*} value The value to check.
  12561. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12562. * @example
  12563. *
  12564. * function Foo() {
  12565. * this.a = 1;
  12566. * }
  12567. *
  12568. * _.isPlainObject(new Foo);
  12569. * // => false
  12570. *
  12571. * _.isPlainObject([1, 2, 3]);
  12572. * // => false
  12573. *
  12574. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12575. * // => true
  12576. *
  12577. * _.isPlainObject(Object.create(null));
  12578. * // => true
  12579. */
  12580. function isPlainObject(value) {
  12581. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12582. return false;
  12583. }
  12584. var proto = getPrototype(value);
  12585. if (proto === null) {
  12586. return true;
  12587. }
  12588. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12589. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12590. funcToString.call(Ctor) == objectCtorString;
  12591. }
  12592. /**
  12593. * Checks if `value` is classified as a `RegExp` object.
  12594. *
  12595. * @static
  12596. * @memberOf _
  12597. * @since 0.1.0
  12598. * @category Lang
  12599. * @param {*} value The value to check.
  12600. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12601. * @example
  12602. *
  12603. * _.isRegExp(/abc/);
  12604. * // => true
  12605. *
  12606. * _.isRegExp('/abc/');
  12607. * // => false
  12608. */
  12609. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12610. /**
  12611. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12612. * double precision number which isn't the result of a rounded unsafe integer.
  12613. *
  12614. * **Note:** This method is based on
  12615. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12616. *
  12617. * @static
  12618. * @memberOf _
  12619. * @since 4.0.0
  12620. * @category Lang
  12621. * @param {*} value The value to check.
  12622. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12623. * @example
  12624. *
  12625. * _.isSafeInteger(3);
  12626. * // => true
  12627. *
  12628. * _.isSafeInteger(Number.MIN_VALUE);
  12629. * // => false
  12630. *
  12631. * _.isSafeInteger(Infinity);
  12632. * // => false
  12633. *
  12634. * _.isSafeInteger('3');
  12635. * // => false
  12636. */
  12637. function isSafeInteger(value) {
  12638. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12639. }
  12640. /**
  12641. * Checks if `value` is classified as a `Set` object.
  12642. *
  12643. * @static
  12644. * @memberOf _
  12645. * @since 4.3.0
  12646. * @category Lang
  12647. * @param {*} value The value to check.
  12648. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12649. * @example
  12650. *
  12651. * _.isSet(new Set);
  12652. * // => true
  12653. *
  12654. * _.isSet(new WeakSet);
  12655. * // => false
  12656. */
  12657. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12658. /**
  12659. * Checks if `value` is classified as a `String` primitive or object.
  12660. *
  12661. * @static
  12662. * @since 0.1.0
  12663. * @memberOf _
  12664. * @category Lang
  12665. * @param {*} value The value to check.
  12666. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12667. * @example
  12668. *
  12669. * _.isString('abc');
  12670. * // => true
  12671. *
  12672. * _.isString(1);
  12673. * // => false
  12674. */
  12675. function isString(value) {
  12676. return typeof value == 'string' ||
  12677. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12678. }
  12679. /**
  12680. * Checks if `value` is classified as a `Symbol` primitive or object.
  12681. *
  12682. * @static
  12683. * @memberOf _
  12684. * @since 4.0.0
  12685. * @category Lang
  12686. * @param {*} value The value to check.
  12687. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12688. * @example
  12689. *
  12690. * _.isSymbol(Symbol.iterator);
  12691. * // => true
  12692. *
  12693. * _.isSymbol('abc');
  12694. * // => false
  12695. */
  12696. function isSymbol(value) {
  12697. return typeof value == 'symbol' ||
  12698. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12699. }
  12700. /**
  12701. * Checks if `value` is classified as a typed array.
  12702. *
  12703. * @static
  12704. * @memberOf _
  12705. * @since 3.0.0
  12706. * @category Lang
  12707. * @param {*} value The value to check.
  12708. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12709. * @example
  12710. *
  12711. * _.isTypedArray(new Uint8Array);
  12712. * // => true
  12713. *
  12714. * _.isTypedArray([]);
  12715. * // => false
  12716. */
  12717. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12718. /**
  12719. * Checks if `value` is `undefined`.
  12720. *
  12721. * @static
  12722. * @since 0.1.0
  12723. * @memberOf _
  12724. * @category Lang
  12725. * @param {*} value The value to check.
  12726. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12727. * @example
  12728. *
  12729. * _.isUndefined(void 0);
  12730. * // => true
  12731. *
  12732. * _.isUndefined(null);
  12733. * // => false
  12734. */
  12735. function isUndefined(value) {
  12736. return value === undefined;
  12737. }
  12738. /**
  12739. * Checks if `value` is classified as a `WeakMap` object.
  12740. *
  12741. * @static
  12742. * @memberOf _
  12743. * @since 4.3.0
  12744. * @category Lang
  12745. * @param {*} value The value to check.
  12746. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12747. * @example
  12748. *
  12749. * _.isWeakMap(new WeakMap);
  12750. * // => true
  12751. *
  12752. * _.isWeakMap(new Map);
  12753. * // => false
  12754. */
  12755. function isWeakMap(value) {
  12756. return isObjectLike(value) && getTag(value) == weakMapTag;
  12757. }
  12758. /**
  12759. * Checks if `value` is classified as a `WeakSet` object.
  12760. *
  12761. * @static
  12762. * @memberOf _
  12763. * @since 4.3.0
  12764. * @category Lang
  12765. * @param {*} value The value to check.
  12766. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12767. * @example
  12768. *
  12769. * _.isWeakSet(new WeakSet);
  12770. * // => true
  12771. *
  12772. * _.isWeakSet(new Set);
  12773. * // => false
  12774. */
  12775. function isWeakSet(value) {
  12776. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12777. }
  12778. /**
  12779. * Checks if `value` is less than `other`.
  12780. *
  12781. * @static
  12782. * @memberOf _
  12783. * @since 3.9.0
  12784. * @category Lang
  12785. * @param {*} value The value to compare.
  12786. * @param {*} other The other value to compare.
  12787. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12788. * else `false`.
  12789. * @see _.gt
  12790. * @example
  12791. *
  12792. * _.lt(1, 3);
  12793. * // => true
  12794. *
  12795. * _.lt(3, 3);
  12796. * // => false
  12797. *
  12798. * _.lt(3, 1);
  12799. * // => false
  12800. */
  12801. var lt = createRelationalOperation(baseLt);
  12802. /**
  12803. * Checks if `value` is less than or equal to `other`.
  12804. *
  12805. * @static
  12806. * @memberOf _
  12807. * @since 3.9.0
  12808. * @category Lang
  12809. * @param {*} value The value to compare.
  12810. * @param {*} other The other value to compare.
  12811. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12812. * `other`, else `false`.
  12813. * @see _.gte
  12814. * @example
  12815. *
  12816. * _.lte(1, 3);
  12817. * // => true
  12818. *
  12819. * _.lte(3, 3);
  12820. * // => true
  12821. *
  12822. * _.lte(3, 1);
  12823. * // => false
  12824. */
  12825. var lte = createRelationalOperation(function(value, other) {
  12826. return value <= other;
  12827. });
  12828. /**
  12829. * Converts `value` to an array.
  12830. *
  12831. * @static
  12832. * @since 0.1.0
  12833. * @memberOf _
  12834. * @category Lang
  12835. * @param {*} value The value to convert.
  12836. * @returns {Array} Returns the converted array.
  12837. * @example
  12838. *
  12839. * _.toArray({ 'a': 1, 'b': 2 });
  12840. * // => [1, 2]
  12841. *
  12842. * _.toArray('abc');
  12843. * // => ['a', 'b', 'c']
  12844. *
  12845. * _.toArray(1);
  12846. * // => []
  12847. *
  12848. * _.toArray(null);
  12849. * // => []
  12850. */
  12851. function toArray(value) {
  12852. if (!value) {
  12853. return [];
  12854. }
  12855. if (isArrayLike(value)) {
  12856. return isString(value) ? stringToArray(value) : copyArray(value);
  12857. }
  12858. if (symIterator && value[symIterator]) {
  12859. return iteratorToArray(value[symIterator]());
  12860. }
  12861. var tag = getTag(value),
  12862. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12863. return func(value);
  12864. }
  12865. /**
  12866. * Converts `value` to a finite number.
  12867. *
  12868. * @static
  12869. * @memberOf _
  12870. * @since 4.12.0
  12871. * @category Lang
  12872. * @param {*} value The value to convert.
  12873. * @returns {number} Returns the converted number.
  12874. * @example
  12875. *
  12876. * _.toFinite(3.2);
  12877. * // => 3.2
  12878. *
  12879. * _.toFinite(Number.MIN_VALUE);
  12880. * // => 5e-324
  12881. *
  12882. * _.toFinite(Infinity);
  12883. * // => 1.7976931348623157e+308
  12884. *
  12885. * _.toFinite('3.2');
  12886. * // => 3.2
  12887. */
  12888. function toFinite(value) {
  12889. if (!value) {
  12890. return value === 0 ? value : 0;
  12891. }
  12892. value = toNumber(value);
  12893. if (value === INFINITY || value === -INFINITY) {
  12894. var sign = (value < 0 ? -1 : 1);
  12895. return sign * MAX_INTEGER;
  12896. }
  12897. return value === value ? value : 0;
  12898. }
  12899. /**
  12900. * Converts `value` to an integer.
  12901. *
  12902. * **Note:** This method is loosely based on
  12903. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12904. *
  12905. * @static
  12906. * @memberOf _
  12907. * @since 4.0.0
  12908. * @category Lang
  12909. * @param {*} value The value to convert.
  12910. * @returns {number} Returns the converted integer.
  12911. * @example
  12912. *
  12913. * _.toInteger(3.2);
  12914. * // => 3
  12915. *
  12916. * _.toInteger(Number.MIN_VALUE);
  12917. * // => 0
  12918. *
  12919. * _.toInteger(Infinity);
  12920. * // => 1.7976931348623157e+308
  12921. *
  12922. * _.toInteger('3.2');
  12923. * // => 3
  12924. */
  12925. function toInteger(value) {
  12926. var result = toFinite(value),
  12927. remainder = result % 1;
  12928. return result === result ? (remainder ? result - remainder : result) : 0;
  12929. }
  12930. /**
  12931. * Converts `value` to an integer suitable for use as the length of an
  12932. * array-like object.
  12933. *
  12934. * **Note:** This method is based on
  12935. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12936. *
  12937. * @static
  12938. * @memberOf _
  12939. * @since 4.0.0
  12940. * @category Lang
  12941. * @param {*} value The value to convert.
  12942. * @returns {number} Returns the converted integer.
  12943. * @example
  12944. *
  12945. * _.toLength(3.2);
  12946. * // => 3
  12947. *
  12948. * _.toLength(Number.MIN_VALUE);
  12949. * // => 0
  12950. *
  12951. * _.toLength(Infinity);
  12952. * // => 4294967295
  12953. *
  12954. * _.toLength('3.2');
  12955. * // => 3
  12956. */
  12957. function toLength(value) {
  12958. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12959. }
  12960. /**
  12961. * Converts `value` to a number.
  12962. *
  12963. * @static
  12964. * @memberOf _
  12965. * @since 4.0.0
  12966. * @category Lang
  12967. * @param {*} value The value to process.
  12968. * @returns {number} Returns the number.
  12969. * @example
  12970. *
  12971. * _.toNumber(3.2);
  12972. * // => 3.2
  12973. *
  12974. * _.toNumber(Number.MIN_VALUE);
  12975. * // => 5e-324
  12976. *
  12977. * _.toNumber(Infinity);
  12978. * // => Infinity
  12979. *
  12980. * _.toNumber('3.2');
  12981. * // => 3.2
  12982. */
  12983. function toNumber(value) {
  12984. if (typeof value == 'number') {
  12985. return value;
  12986. }
  12987. if (isSymbol(value)) {
  12988. return NAN;
  12989. }
  12990. if (isObject(value)) {
  12991. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12992. value = isObject(other) ? (other + '') : other;
  12993. }
  12994. if (typeof value != 'string') {
  12995. return value === 0 ? value : +value;
  12996. }
  12997. value = baseTrim(value);
  12998. var isBinary = reIsBinary.test(value);
  12999. return (isBinary || reIsOctal.test(value))
  13000. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13001. : (reIsBadHex.test(value) ? NAN : +value);
  13002. }
  13003. /**
  13004. * Converts `value` to a plain object flattening inherited enumerable string
  13005. * keyed properties of `value` to own properties of the plain object.
  13006. *
  13007. * @static
  13008. * @memberOf _
  13009. * @since 3.0.0
  13010. * @category Lang
  13011. * @param {*} value The value to convert.
  13012. * @returns {Object} Returns the converted plain object.
  13013. * @example
  13014. *
  13015. * function Foo() {
  13016. * this.b = 2;
  13017. * }
  13018. *
  13019. * Foo.prototype.c = 3;
  13020. *
  13021. * _.assign({ 'a': 1 }, new Foo);
  13022. * // => { 'a': 1, 'b': 2 }
  13023. *
  13024. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13025. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13026. */
  13027. function toPlainObject(value) {
  13028. return copyObject(value, keysIn(value));
  13029. }
  13030. /**
  13031. * Converts `value` to a safe integer. A safe integer can be compared and
  13032. * represented correctly.
  13033. *
  13034. * @static
  13035. * @memberOf _
  13036. * @since 4.0.0
  13037. * @category Lang
  13038. * @param {*} value The value to convert.
  13039. * @returns {number} Returns the converted integer.
  13040. * @example
  13041. *
  13042. * _.toSafeInteger(3.2);
  13043. * // => 3
  13044. *
  13045. * _.toSafeInteger(Number.MIN_VALUE);
  13046. * // => 0
  13047. *
  13048. * _.toSafeInteger(Infinity);
  13049. * // => 9007199254740991
  13050. *
  13051. * _.toSafeInteger('3.2');
  13052. * // => 3
  13053. */
  13054. function toSafeInteger(value) {
  13055. return value
  13056. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13057. : (value === 0 ? value : 0);
  13058. }
  13059. /**
  13060. * Converts `value` to a string. An empty string is returned for `null`
  13061. * and `undefined` values. The sign of `-0` is preserved.
  13062. *
  13063. * @static
  13064. * @memberOf _
  13065. * @since 4.0.0
  13066. * @category Lang
  13067. * @param {*} value The value to convert.
  13068. * @returns {string} Returns the converted string.
  13069. * @example
  13070. *
  13071. * _.toString(null);
  13072. * // => ''
  13073. *
  13074. * _.toString(-0);
  13075. * // => '-0'
  13076. *
  13077. * _.toString([1, 2, 3]);
  13078. * // => '1,2,3'
  13079. */
  13080. function toString(value) {
  13081. return value == null ? '' : baseToString(value);
  13082. }
  13083. /*------------------------------------------------------------------------*/
  13084. /**
  13085. * Assigns own enumerable string keyed properties of source objects to the
  13086. * destination object. Source objects are applied from left to right.
  13087. * Subsequent sources overwrite property assignments of previous sources.
  13088. *
  13089. * **Note:** This method mutates `object` and is loosely based on
  13090. * [`Object.assign`](https://mdn.io/Object/assign).
  13091. *
  13092. * @static
  13093. * @memberOf _
  13094. * @since 0.10.0
  13095. * @category Object
  13096. * @param {Object} object The destination object.
  13097. * @param {...Object} [sources] The source objects.
  13098. * @returns {Object} Returns `object`.
  13099. * @see _.assignIn
  13100. * @example
  13101. *
  13102. * function Foo() {
  13103. * this.a = 1;
  13104. * }
  13105. *
  13106. * function Bar() {
  13107. * this.c = 3;
  13108. * }
  13109. *
  13110. * Foo.prototype.b = 2;
  13111. * Bar.prototype.d = 4;
  13112. *
  13113. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13114. * // => { 'a': 1, 'c': 3 }
  13115. */
  13116. var assign = createAssigner(function(object, source) {
  13117. if (isPrototype(source) || isArrayLike(source)) {
  13118. copyObject(source, keys(source), object);
  13119. return;
  13120. }
  13121. for (var key in source) {
  13122. if (hasOwnProperty.call(source, key)) {
  13123. assignValue(object, key, source[key]);
  13124. }
  13125. }
  13126. });
  13127. /**
  13128. * This method is like `_.assign` except that it iterates over own and
  13129. * inherited source properties.
  13130. *
  13131. * **Note:** This method mutates `object`.
  13132. *
  13133. * @static
  13134. * @memberOf _
  13135. * @since 4.0.0
  13136. * @alias extend
  13137. * @category Object
  13138. * @param {Object} object The destination object.
  13139. * @param {...Object} [sources] The source objects.
  13140. * @returns {Object} Returns `object`.
  13141. * @see _.assign
  13142. * @example
  13143. *
  13144. * function Foo() {
  13145. * this.a = 1;
  13146. * }
  13147. *
  13148. * function Bar() {
  13149. * this.c = 3;
  13150. * }
  13151. *
  13152. * Foo.prototype.b = 2;
  13153. * Bar.prototype.d = 4;
  13154. *
  13155. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13156. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13157. */
  13158. var assignIn = createAssigner(function(object, source) {
  13159. copyObject(source, keysIn(source), object);
  13160. });
  13161. /**
  13162. * This method is like `_.assignIn` except that it accepts `customizer`
  13163. * which is invoked to produce the assigned values. If `customizer` returns
  13164. * `undefined`, assignment is handled by the method instead. The `customizer`
  13165. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13166. *
  13167. * **Note:** This method mutates `object`.
  13168. *
  13169. * @static
  13170. * @memberOf _
  13171. * @since 4.0.0
  13172. * @alias extendWith
  13173. * @category Object
  13174. * @param {Object} object The destination object.
  13175. * @param {...Object} sources The source objects.
  13176. * @param {Function} [customizer] The function to customize assigned values.
  13177. * @returns {Object} Returns `object`.
  13178. * @see _.assignWith
  13179. * @example
  13180. *
  13181. * function customizer(objValue, srcValue) {
  13182. * return _.isUndefined(objValue) ? srcValue : objValue;
  13183. * }
  13184. *
  13185. * var defaults = _.partialRight(_.assignInWith, customizer);
  13186. *
  13187. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13188. * // => { 'a': 1, 'b': 2 }
  13189. */
  13190. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13191. copyObject(source, keysIn(source), object, customizer);
  13192. });
  13193. /**
  13194. * This method is like `_.assign` except that it accepts `customizer`
  13195. * which is invoked to produce the assigned values. If `customizer` returns
  13196. * `undefined`, assignment is handled by the method instead. The `customizer`
  13197. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13198. *
  13199. * **Note:** This method mutates `object`.
  13200. *
  13201. * @static
  13202. * @memberOf _
  13203. * @since 4.0.0
  13204. * @category Object
  13205. * @param {Object} object The destination object.
  13206. * @param {...Object} sources The source objects.
  13207. * @param {Function} [customizer] The function to customize assigned values.
  13208. * @returns {Object} Returns `object`.
  13209. * @see _.assignInWith
  13210. * @example
  13211. *
  13212. * function customizer(objValue, srcValue) {
  13213. * return _.isUndefined(objValue) ? srcValue : objValue;
  13214. * }
  13215. *
  13216. * var defaults = _.partialRight(_.assignWith, customizer);
  13217. *
  13218. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13219. * // => { 'a': 1, 'b': 2 }
  13220. */
  13221. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13222. copyObject(source, keys(source), object, customizer);
  13223. });
  13224. /**
  13225. * Creates an array of values corresponding to `paths` of `object`.
  13226. *
  13227. * @static
  13228. * @memberOf _
  13229. * @since 1.0.0
  13230. * @category Object
  13231. * @param {Object} object The object to iterate over.
  13232. * @param {...(string|string[])} [paths] The property paths to pick.
  13233. * @returns {Array} Returns the picked values.
  13234. * @example
  13235. *
  13236. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13237. *
  13238. * _.at(object, ['a[0].b.c', 'a[1]']);
  13239. * // => [3, 4]
  13240. */
  13241. var at = flatRest(baseAt);
  13242. /**
  13243. * Creates an object that inherits from the `prototype` object. If a
  13244. * `properties` object is given, its own enumerable string keyed properties
  13245. * are assigned to the created object.
  13246. *
  13247. * @static
  13248. * @memberOf _
  13249. * @since 2.3.0
  13250. * @category Object
  13251. * @param {Object} prototype The object to inherit from.
  13252. * @param {Object} [properties] The properties to assign to the object.
  13253. * @returns {Object} Returns the new object.
  13254. * @example
  13255. *
  13256. * function Shape() {
  13257. * this.x = 0;
  13258. * this.y = 0;
  13259. * }
  13260. *
  13261. * function Circle() {
  13262. * Shape.call(this);
  13263. * }
  13264. *
  13265. * Circle.prototype = _.create(Shape.prototype, {
  13266. * 'constructor': Circle
  13267. * });
  13268. *
  13269. * var circle = new Circle;
  13270. * circle instanceof Circle;
  13271. * // => true
  13272. *
  13273. * circle instanceof Shape;
  13274. * // => true
  13275. */
  13276. function create(prototype, properties) {
  13277. var result = baseCreate(prototype);
  13278. return properties == null ? result : baseAssign(result, properties);
  13279. }
  13280. /**
  13281. * Assigns own and inherited enumerable string keyed properties of source
  13282. * objects to the destination object for all destination properties that
  13283. * resolve to `undefined`. Source objects are applied from left to right.
  13284. * Once a property is set, additional values of the same property are ignored.
  13285. *
  13286. * **Note:** This method mutates `object`.
  13287. *
  13288. * @static
  13289. * @since 0.1.0
  13290. * @memberOf _
  13291. * @category Object
  13292. * @param {Object} object The destination object.
  13293. * @param {...Object} [sources] The source objects.
  13294. * @returns {Object} Returns `object`.
  13295. * @see _.defaultsDeep
  13296. * @example
  13297. *
  13298. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13299. * // => { 'a': 1, 'b': 2 }
  13300. */
  13301. var defaults = baseRest(function(object, sources) {
  13302. object = Object(object);
  13303. var index = -1;
  13304. var length = sources.length;
  13305. var guard = length > 2 ? sources[2] : undefined;
  13306. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13307. length = 1;
  13308. }
  13309. while (++index < length) {
  13310. var source = sources[index];
  13311. var props = keysIn(source);
  13312. var propsIndex = -1;
  13313. var propsLength = props.length;
  13314. while (++propsIndex < propsLength) {
  13315. var key = props[propsIndex];
  13316. var value = object[key];
  13317. if (value === undefined ||
  13318. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13319. object[key] = source[key];
  13320. }
  13321. }
  13322. }
  13323. return object;
  13324. });
  13325. /**
  13326. * This method is like `_.defaults` except that it recursively assigns
  13327. * default properties.
  13328. *
  13329. * **Note:** This method mutates `object`.
  13330. *
  13331. * @static
  13332. * @memberOf _
  13333. * @since 3.10.0
  13334. * @category Object
  13335. * @param {Object} object The destination object.
  13336. * @param {...Object} [sources] The source objects.
  13337. * @returns {Object} Returns `object`.
  13338. * @see _.defaults
  13339. * @example
  13340. *
  13341. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13342. * // => { 'a': { 'b': 2, 'c': 3 } }
  13343. */
  13344. var defaultsDeep = baseRest(function(args) {
  13345. args.push(undefined, customDefaultsMerge);
  13346. return apply(mergeWith, undefined, args);
  13347. });
  13348. /**
  13349. * This method is like `_.find` except that it returns the key of the first
  13350. * element `predicate` returns truthy for instead of the element itself.
  13351. *
  13352. * @static
  13353. * @memberOf _
  13354. * @since 1.1.0
  13355. * @category Object
  13356. * @param {Object} object The object to inspect.
  13357. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13358. * @returns {string|undefined} Returns the key of the matched element,
  13359. * else `undefined`.
  13360. * @example
  13361. *
  13362. * var users = {
  13363. * 'barney': { 'age': 36, 'active': true },
  13364. * 'fred': { 'age': 40, 'active': false },
  13365. * 'pebbles': { 'age': 1, 'active': true }
  13366. * };
  13367. *
  13368. * _.findKey(users, function(o) { return o.age < 40; });
  13369. * // => 'barney' (iteration order is not guaranteed)
  13370. *
  13371. * // The `_.matches` iteratee shorthand.
  13372. * _.findKey(users, { 'age': 1, 'active': true });
  13373. * // => 'pebbles'
  13374. *
  13375. * // The `_.matchesProperty` iteratee shorthand.
  13376. * _.findKey(users, ['active', false]);
  13377. * // => 'fred'
  13378. *
  13379. * // The `_.property` iteratee shorthand.
  13380. * _.findKey(users, 'active');
  13381. * // => 'barney'
  13382. */
  13383. function findKey(object, predicate) {
  13384. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13385. }
  13386. /**
  13387. * This method is like `_.findKey` except that it iterates over elements of
  13388. * a collection in the opposite order.
  13389. *
  13390. * @static
  13391. * @memberOf _
  13392. * @since 2.0.0
  13393. * @category Object
  13394. * @param {Object} object The object to inspect.
  13395. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13396. * @returns {string|undefined} Returns the key of the matched element,
  13397. * else `undefined`.
  13398. * @example
  13399. *
  13400. * var users = {
  13401. * 'barney': { 'age': 36, 'active': true },
  13402. * 'fred': { 'age': 40, 'active': false },
  13403. * 'pebbles': { 'age': 1, 'active': true }
  13404. * };
  13405. *
  13406. * _.findLastKey(users, function(o) { return o.age < 40; });
  13407. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13408. *
  13409. * // The `_.matches` iteratee shorthand.
  13410. * _.findLastKey(users, { 'age': 36, 'active': true });
  13411. * // => 'barney'
  13412. *
  13413. * // The `_.matchesProperty` iteratee shorthand.
  13414. * _.findLastKey(users, ['active', false]);
  13415. * // => 'fred'
  13416. *
  13417. * // The `_.property` iteratee shorthand.
  13418. * _.findLastKey(users, 'active');
  13419. * // => 'pebbles'
  13420. */
  13421. function findLastKey(object, predicate) {
  13422. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13423. }
  13424. /**
  13425. * Iterates over own and inherited enumerable string keyed properties of an
  13426. * object and invokes `iteratee` for each property. The iteratee is invoked
  13427. * with three arguments: (value, key, object). Iteratee functions may exit
  13428. * iteration early by explicitly returning `false`.
  13429. *
  13430. * @static
  13431. * @memberOf _
  13432. * @since 0.3.0
  13433. * @category Object
  13434. * @param {Object} object The object to iterate over.
  13435. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13436. * @returns {Object} Returns `object`.
  13437. * @see _.forInRight
  13438. * @example
  13439. *
  13440. * function Foo() {
  13441. * this.a = 1;
  13442. * this.b = 2;
  13443. * }
  13444. *
  13445. * Foo.prototype.c = 3;
  13446. *
  13447. * _.forIn(new Foo, function(value, key) {
  13448. * console.log(key);
  13449. * });
  13450. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13451. */
  13452. function forIn(object, iteratee) {
  13453. return object == null
  13454. ? object
  13455. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13456. }
  13457. /**
  13458. * This method is like `_.forIn` except that it iterates over properties of
  13459. * `object` in the opposite order.
  13460. *
  13461. * @static
  13462. * @memberOf _
  13463. * @since 2.0.0
  13464. * @category Object
  13465. * @param {Object} object The object to iterate over.
  13466. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13467. * @returns {Object} Returns `object`.
  13468. * @see _.forIn
  13469. * @example
  13470. *
  13471. * function Foo() {
  13472. * this.a = 1;
  13473. * this.b = 2;
  13474. * }
  13475. *
  13476. * Foo.prototype.c = 3;
  13477. *
  13478. * _.forInRight(new Foo, function(value, key) {
  13479. * console.log(key);
  13480. * });
  13481. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13482. */
  13483. function forInRight(object, iteratee) {
  13484. return object == null
  13485. ? object
  13486. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13487. }
  13488. /**
  13489. * Iterates over own enumerable string keyed properties of an object and
  13490. * invokes `iteratee` for each property. The iteratee is invoked with three
  13491. * arguments: (value, key, object). Iteratee functions may exit iteration
  13492. * early by explicitly returning `false`.
  13493. *
  13494. * @static
  13495. * @memberOf _
  13496. * @since 0.3.0
  13497. * @category Object
  13498. * @param {Object} object The object to iterate over.
  13499. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13500. * @returns {Object} Returns `object`.
  13501. * @see _.forOwnRight
  13502. * @example
  13503. *
  13504. * function Foo() {
  13505. * this.a = 1;
  13506. * this.b = 2;
  13507. * }
  13508. *
  13509. * Foo.prototype.c = 3;
  13510. *
  13511. * _.forOwn(new Foo, function(value, key) {
  13512. * console.log(key);
  13513. * });
  13514. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13515. */
  13516. function forOwn(object, iteratee) {
  13517. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13518. }
  13519. /**
  13520. * This method is like `_.forOwn` except that it iterates over properties of
  13521. * `object` in the opposite order.
  13522. *
  13523. * @static
  13524. * @memberOf _
  13525. * @since 2.0.0
  13526. * @category Object
  13527. * @param {Object} object The object to iterate over.
  13528. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13529. * @returns {Object} Returns `object`.
  13530. * @see _.forOwn
  13531. * @example
  13532. *
  13533. * function Foo() {
  13534. * this.a = 1;
  13535. * this.b = 2;
  13536. * }
  13537. *
  13538. * Foo.prototype.c = 3;
  13539. *
  13540. * _.forOwnRight(new Foo, function(value, key) {
  13541. * console.log(key);
  13542. * });
  13543. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13544. */
  13545. function forOwnRight(object, iteratee) {
  13546. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13547. }
  13548. /**
  13549. * Creates an array of function property names from own enumerable properties
  13550. * of `object`.
  13551. *
  13552. * @static
  13553. * @since 0.1.0
  13554. * @memberOf _
  13555. * @category Object
  13556. * @param {Object} object The object to inspect.
  13557. * @returns {Array} Returns the function names.
  13558. * @see _.functionsIn
  13559. * @example
  13560. *
  13561. * function Foo() {
  13562. * this.a = _.constant('a');
  13563. * this.b = _.constant('b');
  13564. * }
  13565. *
  13566. * Foo.prototype.c = _.constant('c');
  13567. *
  13568. * _.functions(new Foo);
  13569. * // => ['a', 'b']
  13570. */
  13571. function functions(object) {
  13572. return object == null ? [] : baseFunctions(object, keys(object));
  13573. }
  13574. /**
  13575. * Creates an array of function property names from own and inherited
  13576. * enumerable properties of `object`.
  13577. *
  13578. * @static
  13579. * @memberOf _
  13580. * @since 4.0.0
  13581. * @category Object
  13582. * @param {Object} object The object to inspect.
  13583. * @returns {Array} Returns the function names.
  13584. * @see _.functions
  13585. * @example
  13586. *
  13587. * function Foo() {
  13588. * this.a = _.constant('a');
  13589. * this.b = _.constant('b');
  13590. * }
  13591. *
  13592. * Foo.prototype.c = _.constant('c');
  13593. *
  13594. * _.functionsIn(new Foo);
  13595. * // => ['a', 'b', 'c']
  13596. */
  13597. function functionsIn(object) {
  13598. return object == null ? [] : baseFunctions(object, keysIn(object));
  13599. }
  13600. /**
  13601. * Gets the value at `path` of `object`. If the resolved value is
  13602. * `undefined`, the `defaultValue` is returned in its place.
  13603. *
  13604. * @static
  13605. * @memberOf _
  13606. * @since 3.7.0
  13607. * @category Object
  13608. * @param {Object} object The object to query.
  13609. * @param {Array|string} path The path of the property to get.
  13610. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13611. * @returns {*} Returns the resolved value.
  13612. * @example
  13613. *
  13614. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13615. *
  13616. * _.get(object, 'a[0].b.c');
  13617. * // => 3
  13618. *
  13619. * _.get(object, ['a', '0', 'b', 'c']);
  13620. * // => 3
  13621. *
  13622. * _.get(object, 'a.b.c', 'default');
  13623. * // => 'default'
  13624. */
  13625. function get(object, path, defaultValue) {
  13626. var result = object == null ? undefined : baseGet(object, path);
  13627. return result === undefined ? defaultValue : result;
  13628. }
  13629. /**
  13630. * Checks if `path` is a direct property of `object`.
  13631. *
  13632. * @static
  13633. * @since 0.1.0
  13634. * @memberOf _
  13635. * @category Object
  13636. * @param {Object} object The object to query.
  13637. * @param {Array|string} path The path to check.
  13638. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13639. * @example
  13640. *
  13641. * var object = { 'a': { 'b': 2 } };
  13642. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13643. *
  13644. * _.has(object, 'a');
  13645. * // => true
  13646. *
  13647. * _.has(object, 'a.b');
  13648. * // => true
  13649. *
  13650. * _.has(object, ['a', 'b']);
  13651. * // => true
  13652. *
  13653. * _.has(other, 'a');
  13654. * // => false
  13655. */
  13656. function has(object, path) {
  13657. return object != null && hasPath(object, path, baseHas);
  13658. }
  13659. /**
  13660. * Checks if `path` is a direct or inherited property of `object`.
  13661. *
  13662. * @static
  13663. * @memberOf _
  13664. * @since 4.0.0
  13665. * @category Object
  13666. * @param {Object} object The object to query.
  13667. * @param {Array|string} path The path to check.
  13668. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13669. * @example
  13670. *
  13671. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13672. *
  13673. * _.hasIn(object, 'a');
  13674. * // => true
  13675. *
  13676. * _.hasIn(object, 'a.b');
  13677. * // => true
  13678. *
  13679. * _.hasIn(object, ['a', 'b']);
  13680. * // => true
  13681. *
  13682. * _.hasIn(object, 'b');
  13683. * // => false
  13684. */
  13685. function hasIn(object, path) {
  13686. return object != null && hasPath(object, path, baseHasIn);
  13687. }
  13688. /**
  13689. * Creates an object composed of the inverted keys and values of `object`.
  13690. * If `object` contains duplicate values, subsequent values overwrite
  13691. * property assignments of previous values.
  13692. *
  13693. * @static
  13694. * @memberOf _
  13695. * @since 0.7.0
  13696. * @category Object
  13697. * @param {Object} object The object to invert.
  13698. * @returns {Object} Returns the new inverted object.
  13699. * @example
  13700. *
  13701. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13702. *
  13703. * _.invert(object);
  13704. * // => { '1': 'c', '2': 'b' }
  13705. */
  13706. var invert = createInverter(function(result, value, key) {
  13707. if (value != null &&
  13708. typeof value.toString != 'function') {
  13709. value = nativeObjectToString.call(value);
  13710. }
  13711. result[value] = key;
  13712. }, constant(identity));
  13713. /**
  13714. * This method is like `_.invert` except that the inverted object is generated
  13715. * from the results of running each element of `object` thru `iteratee`. The
  13716. * corresponding inverted value of each inverted key is an array of keys
  13717. * responsible for generating the inverted value. The iteratee is invoked
  13718. * with one argument: (value).
  13719. *
  13720. * @static
  13721. * @memberOf _
  13722. * @since 4.1.0
  13723. * @category Object
  13724. * @param {Object} object The object to invert.
  13725. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13726. * @returns {Object} Returns the new inverted object.
  13727. * @example
  13728. *
  13729. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13730. *
  13731. * _.invertBy(object);
  13732. * // => { '1': ['a', 'c'], '2': ['b'] }
  13733. *
  13734. * _.invertBy(object, function(value) {
  13735. * return 'group' + value;
  13736. * });
  13737. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13738. */
  13739. var invertBy = createInverter(function(result, value, key) {
  13740. if (value != null &&
  13741. typeof value.toString != 'function') {
  13742. value = nativeObjectToString.call(value);
  13743. }
  13744. if (hasOwnProperty.call(result, value)) {
  13745. result[value].push(key);
  13746. } else {
  13747. result[value] = [key];
  13748. }
  13749. }, getIteratee);
  13750. /**
  13751. * Invokes the method at `path` of `object`.
  13752. *
  13753. * @static
  13754. * @memberOf _
  13755. * @since 4.0.0
  13756. * @category Object
  13757. * @param {Object} object The object to query.
  13758. * @param {Array|string} path The path of the method to invoke.
  13759. * @param {...*} [args] The arguments to invoke the method with.
  13760. * @returns {*} Returns the result of the invoked method.
  13761. * @example
  13762. *
  13763. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13764. *
  13765. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13766. * // => [2, 3]
  13767. */
  13768. var invoke = baseRest(baseInvoke);
  13769. /**
  13770. * Creates an array of the own enumerable property names of `object`.
  13771. *
  13772. * **Note:** Non-object values are coerced to objects. See the
  13773. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13774. * for more details.
  13775. *
  13776. * @static
  13777. * @since 0.1.0
  13778. * @memberOf _
  13779. * @category Object
  13780. * @param {Object} object The object to query.
  13781. * @returns {Array} Returns the array of property names.
  13782. * @example
  13783. *
  13784. * function Foo() {
  13785. * this.a = 1;
  13786. * this.b = 2;
  13787. * }
  13788. *
  13789. * Foo.prototype.c = 3;
  13790. *
  13791. * _.keys(new Foo);
  13792. * // => ['a', 'b'] (iteration order is not guaranteed)
  13793. *
  13794. * _.keys('hi');
  13795. * // => ['0', '1']
  13796. */
  13797. function keys(object) {
  13798. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13799. }
  13800. /**
  13801. * Creates an array of the own and inherited enumerable property names of `object`.
  13802. *
  13803. * **Note:** Non-object values are coerced to objects.
  13804. *
  13805. * @static
  13806. * @memberOf _
  13807. * @since 3.0.0
  13808. * @category Object
  13809. * @param {Object} object The object to query.
  13810. * @returns {Array} Returns the array of property names.
  13811. * @example
  13812. *
  13813. * function Foo() {
  13814. * this.a = 1;
  13815. * this.b = 2;
  13816. * }
  13817. *
  13818. * Foo.prototype.c = 3;
  13819. *
  13820. * _.keysIn(new Foo);
  13821. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13822. */
  13823. function keysIn(object) {
  13824. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13825. }
  13826. /**
  13827. * The opposite of `_.mapValues`; this method creates an object with the
  13828. * same values as `object` and keys generated by running each own enumerable
  13829. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13830. * with three arguments: (value, key, object).
  13831. *
  13832. * @static
  13833. * @memberOf _
  13834. * @since 3.8.0
  13835. * @category Object
  13836. * @param {Object} object The object to iterate over.
  13837. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13838. * @returns {Object} Returns the new mapped object.
  13839. * @see _.mapValues
  13840. * @example
  13841. *
  13842. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13843. * return key + value;
  13844. * });
  13845. * // => { 'a1': 1, 'b2': 2 }
  13846. */
  13847. function mapKeys(object, iteratee) {
  13848. var result = {};
  13849. iteratee = getIteratee(iteratee, 3);
  13850. baseForOwn(object, function(value, key, object) {
  13851. baseAssignValue(result, iteratee(value, key, object), value);
  13852. });
  13853. return result;
  13854. }
  13855. /**
  13856. * Creates an object with the same keys as `object` and values generated
  13857. * by running each own enumerable string keyed property of `object` thru
  13858. * `iteratee`. The iteratee is invoked with three arguments:
  13859. * (value, key, object).
  13860. *
  13861. * @static
  13862. * @memberOf _
  13863. * @since 2.4.0
  13864. * @category Object
  13865. * @param {Object} object The object to iterate over.
  13866. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13867. * @returns {Object} Returns the new mapped object.
  13868. * @see _.mapKeys
  13869. * @example
  13870. *
  13871. * var users = {
  13872. * 'fred': { 'user': 'fred', 'age': 40 },
  13873. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13874. * };
  13875. *
  13876. * _.mapValues(users, function(o) { return o.age; });
  13877. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13878. *
  13879. * // The `_.property` iteratee shorthand.
  13880. * _.mapValues(users, 'age');
  13881. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13882. */
  13883. function mapValues(object, iteratee) {
  13884. var result = {};
  13885. iteratee = getIteratee(iteratee, 3);
  13886. baseForOwn(object, function(value, key, object) {
  13887. baseAssignValue(result, key, iteratee(value, key, object));
  13888. });
  13889. return result;
  13890. }
  13891. /**
  13892. * This method is like `_.assign` except that it recursively merges own and
  13893. * inherited enumerable string keyed properties of source objects into the
  13894. * destination object. Source properties that resolve to `undefined` are
  13895. * skipped if a destination value exists. Array and plain object properties
  13896. * are merged recursively. Other objects and value types are overridden by
  13897. * assignment. Source objects are applied from left to right. Subsequent
  13898. * sources overwrite property assignments of previous sources.
  13899. *
  13900. * **Note:** This method mutates `object`.
  13901. *
  13902. * @static
  13903. * @memberOf _
  13904. * @since 0.5.0
  13905. * @category Object
  13906. * @param {Object} object The destination object.
  13907. * @param {...Object} [sources] The source objects.
  13908. * @returns {Object} Returns `object`.
  13909. * @example
  13910. *
  13911. * var object = {
  13912. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13913. * };
  13914. *
  13915. * var other = {
  13916. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13917. * };
  13918. *
  13919. * _.merge(object, other);
  13920. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13921. */
  13922. var merge = createAssigner(function(object, source, srcIndex) {
  13923. baseMerge(object, source, srcIndex);
  13924. });
  13925. /**
  13926. * This method is like `_.merge` except that it accepts `customizer` which
  13927. * is invoked to produce the merged values of the destination and source
  13928. * properties. If `customizer` returns `undefined`, merging is handled by the
  13929. * method instead. The `customizer` is invoked with six arguments:
  13930. * (objValue, srcValue, key, object, source, stack).
  13931. *
  13932. * **Note:** This method mutates `object`.
  13933. *
  13934. * @static
  13935. * @memberOf _
  13936. * @since 4.0.0
  13937. * @category Object
  13938. * @param {Object} object The destination object.
  13939. * @param {...Object} sources The source objects.
  13940. * @param {Function} customizer The function to customize assigned values.
  13941. * @returns {Object} Returns `object`.
  13942. * @example
  13943. *
  13944. * function customizer(objValue, srcValue) {
  13945. * if (_.isArray(objValue)) {
  13946. * return objValue.concat(srcValue);
  13947. * }
  13948. * }
  13949. *
  13950. * var object = { 'a': [1], 'b': [2] };
  13951. * var other = { 'a': [3], 'b': [4] };
  13952. *
  13953. * _.mergeWith(object, other, customizer);
  13954. * // => { 'a': [1, 3], 'b': [2, 4] }
  13955. */
  13956. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13957. baseMerge(object, source, srcIndex, customizer);
  13958. });
  13959. /**
  13960. * The opposite of `_.pick`; this method creates an object composed of the
  13961. * own and inherited enumerable property paths of `object` that are not omitted.
  13962. *
  13963. * **Note:** This method is considerably slower than `_.pick`.
  13964. *
  13965. * @static
  13966. * @since 0.1.0
  13967. * @memberOf _
  13968. * @category Object
  13969. * @param {Object} object The source object.
  13970. * @param {...(string|string[])} [paths] The property paths to omit.
  13971. * @returns {Object} Returns the new object.
  13972. * @example
  13973. *
  13974. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13975. *
  13976. * _.omit(object, ['a', 'c']);
  13977. * // => { 'b': '2' }
  13978. */
  13979. var omit = flatRest(function(object, paths) {
  13980. var result = {};
  13981. if (object == null) {
  13982. return result;
  13983. }
  13984. var isDeep = false;
  13985. paths = arrayMap(paths, function(path) {
  13986. path = castPath(path, object);
  13987. isDeep || (isDeep = path.length > 1);
  13988. return path;
  13989. });
  13990. copyObject(object, getAllKeysIn(object), result);
  13991. if (isDeep) {
  13992. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13993. }
  13994. var length = paths.length;
  13995. while (length--) {
  13996. baseUnset(result, paths[length]);
  13997. }
  13998. return result;
  13999. });
  14000. /**
  14001. * The opposite of `_.pickBy`; this method creates an object composed of
  14002. * the own and inherited enumerable string keyed properties of `object` that
  14003. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14004. * arguments: (value, key).
  14005. *
  14006. * @static
  14007. * @memberOf _
  14008. * @since 4.0.0
  14009. * @category Object
  14010. * @param {Object} object The source object.
  14011. * @param {Function} [predicate=_.identity] The function invoked per property.
  14012. * @returns {Object} Returns the new object.
  14013. * @example
  14014. *
  14015. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14016. *
  14017. * _.omitBy(object, _.isNumber);
  14018. * // => { 'b': '2' }
  14019. */
  14020. function omitBy(object, predicate) {
  14021. return pickBy(object, negate(getIteratee(predicate)));
  14022. }
  14023. /**
  14024. * Creates an object composed of the picked `object` properties.
  14025. *
  14026. * @static
  14027. * @since 0.1.0
  14028. * @memberOf _
  14029. * @category Object
  14030. * @param {Object} object The source object.
  14031. * @param {...(string|string[])} [paths] The property paths to pick.
  14032. * @returns {Object} Returns the new object.
  14033. * @example
  14034. *
  14035. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14036. *
  14037. * _.pick(object, ['a', 'c']);
  14038. * // => { 'a': 1, 'c': 3 }
  14039. */
  14040. var pick = flatRest(function(object, paths) {
  14041. return object == null ? {} : basePick(object, paths);
  14042. });
  14043. /**
  14044. * Creates an object composed of the `object` properties `predicate` returns
  14045. * truthy for. The predicate is invoked with two arguments: (value, key).
  14046. *
  14047. * @static
  14048. * @memberOf _
  14049. * @since 4.0.0
  14050. * @category Object
  14051. * @param {Object} object The source object.
  14052. * @param {Function} [predicate=_.identity] The function invoked per property.
  14053. * @returns {Object} Returns the new object.
  14054. * @example
  14055. *
  14056. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14057. *
  14058. * _.pickBy(object, _.isNumber);
  14059. * // => { 'a': 1, 'c': 3 }
  14060. */
  14061. function pickBy(object, predicate) {
  14062. if (object == null) {
  14063. return {};
  14064. }
  14065. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14066. return [prop];
  14067. });
  14068. predicate = getIteratee(predicate);
  14069. return basePickBy(object, props, function(value, path) {
  14070. return predicate(value, path[0]);
  14071. });
  14072. }
  14073. /**
  14074. * This method is like `_.get` except that if the resolved value is a
  14075. * function it's invoked with the `this` binding of its parent object and
  14076. * its result is returned.
  14077. *
  14078. * @static
  14079. * @since 0.1.0
  14080. * @memberOf _
  14081. * @category Object
  14082. * @param {Object} object The object to query.
  14083. * @param {Array|string} path The path of the property to resolve.
  14084. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14085. * @returns {*} Returns the resolved value.
  14086. * @example
  14087. *
  14088. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14089. *
  14090. * _.result(object, 'a[0].b.c1');
  14091. * // => 3
  14092. *
  14093. * _.result(object, 'a[0].b.c2');
  14094. * // => 4
  14095. *
  14096. * _.result(object, 'a[0].b.c3', 'default');
  14097. * // => 'default'
  14098. *
  14099. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14100. * // => 'default'
  14101. */
  14102. function result(object, path, defaultValue) {
  14103. path = castPath(path, object);
  14104. var index = -1,
  14105. length = path.length;
  14106. // Ensure the loop is entered when path is empty.
  14107. if (!length) {
  14108. length = 1;
  14109. object = undefined;
  14110. }
  14111. while (++index < length) {
  14112. var value = object == null ? undefined : object[toKey(path[index])];
  14113. if (value === undefined) {
  14114. index = length;
  14115. value = defaultValue;
  14116. }
  14117. object = isFunction(value) ? value.call(object) : value;
  14118. }
  14119. return object;
  14120. }
  14121. /**
  14122. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14123. * it's created. Arrays are created for missing index properties while objects
  14124. * are created for all other missing properties. Use `_.setWith` to customize
  14125. * `path` creation.
  14126. *
  14127. * **Note:** This method mutates `object`.
  14128. *
  14129. * @static
  14130. * @memberOf _
  14131. * @since 3.7.0
  14132. * @category Object
  14133. * @param {Object} object The object to modify.
  14134. * @param {Array|string} path The path of the property to set.
  14135. * @param {*} value The value to set.
  14136. * @returns {Object} Returns `object`.
  14137. * @example
  14138. *
  14139. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14140. *
  14141. * _.set(object, 'a[0].b.c', 4);
  14142. * console.log(object.a[0].b.c);
  14143. * // => 4
  14144. *
  14145. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14146. * console.log(object.x[0].y.z);
  14147. * // => 5
  14148. */
  14149. function set(object, path, value) {
  14150. return object == null ? object : baseSet(object, path, value);
  14151. }
  14152. /**
  14153. * This method is like `_.set` except that it accepts `customizer` which is
  14154. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14155. * path creation is handled by the method instead. The `customizer` is invoked
  14156. * with three arguments: (nsValue, key, nsObject).
  14157. *
  14158. * **Note:** This method mutates `object`.
  14159. *
  14160. * @static
  14161. * @memberOf _
  14162. * @since 4.0.0
  14163. * @category Object
  14164. * @param {Object} object The object to modify.
  14165. * @param {Array|string} path The path of the property to set.
  14166. * @param {*} value The value to set.
  14167. * @param {Function} [customizer] The function to customize assigned values.
  14168. * @returns {Object} Returns `object`.
  14169. * @example
  14170. *
  14171. * var object = {};
  14172. *
  14173. * _.setWith(object, '[0][1]', 'a', Object);
  14174. * // => { '0': { '1': 'a' } }
  14175. */
  14176. function setWith(object, path, value, customizer) {
  14177. customizer = typeof customizer == 'function' ? customizer : undefined;
  14178. return object == null ? object : baseSet(object, path, value, customizer);
  14179. }
  14180. /**
  14181. * Creates an array of own enumerable string keyed-value pairs for `object`
  14182. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14183. * entries are returned.
  14184. *
  14185. * @static
  14186. * @memberOf _
  14187. * @since 4.0.0
  14188. * @alias entries
  14189. * @category Object
  14190. * @param {Object} object The object to query.
  14191. * @returns {Array} Returns the key-value pairs.
  14192. * @example
  14193. *
  14194. * function Foo() {
  14195. * this.a = 1;
  14196. * this.b = 2;
  14197. * }
  14198. *
  14199. * Foo.prototype.c = 3;
  14200. *
  14201. * _.toPairs(new Foo);
  14202. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14203. */
  14204. var toPairs = createToPairs(keys);
  14205. /**
  14206. * Creates an array of own and inherited enumerable string keyed-value pairs
  14207. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14208. * or set, its entries are returned.
  14209. *
  14210. * @static
  14211. * @memberOf _
  14212. * @since 4.0.0
  14213. * @alias entriesIn
  14214. * @category Object
  14215. * @param {Object} object The object to query.
  14216. * @returns {Array} Returns the key-value pairs.
  14217. * @example
  14218. *
  14219. * function Foo() {
  14220. * this.a = 1;
  14221. * this.b = 2;
  14222. * }
  14223. *
  14224. * Foo.prototype.c = 3;
  14225. *
  14226. * _.toPairsIn(new Foo);
  14227. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14228. */
  14229. var toPairsIn = createToPairs(keysIn);
  14230. /**
  14231. * An alternative to `_.reduce`; this method transforms `object` to a new
  14232. * `accumulator` object which is the result of running each of its own
  14233. * enumerable string keyed properties thru `iteratee`, with each invocation
  14234. * potentially mutating the `accumulator` object. If `accumulator` is not
  14235. * provided, a new object with the same `[[Prototype]]` will be used. The
  14236. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14237. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14238. *
  14239. * @static
  14240. * @memberOf _
  14241. * @since 1.3.0
  14242. * @category Object
  14243. * @param {Object} object The object to iterate over.
  14244. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14245. * @param {*} [accumulator] The custom accumulator value.
  14246. * @returns {*} Returns the accumulated value.
  14247. * @example
  14248. *
  14249. * _.transform([2, 3, 4], function(result, n) {
  14250. * result.push(n *= n);
  14251. * return n % 2 == 0;
  14252. * }, []);
  14253. * // => [4, 9]
  14254. *
  14255. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14256. * (result[value] || (result[value] = [])).push(key);
  14257. * }, {});
  14258. * // => { '1': ['a', 'c'], '2': ['b'] }
  14259. */
  14260. function transform(object, iteratee, accumulator) {
  14261. var isArr = isArray(object),
  14262. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14263. iteratee = getIteratee(iteratee, 4);
  14264. if (accumulator == null) {
  14265. var Ctor = object && object.constructor;
  14266. if (isArrLike) {
  14267. accumulator = isArr ? new Ctor : [];
  14268. }
  14269. else if (isObject(object)) {
  14270. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14271. }
  14272. else {
  14273. accumulator = {};
  14274. }
  14275. }
  14276. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14277. return iteratee(accumulator, value, index, object);
  14278. });
  14279. return accumulator;
  14280. }
  14281. /**
  14282. * Removes the property at `path` of `object`.
  14283. *
  14284. * **Note:** This method mutates `object`.
  14285. *
  14286. * @static
  14287. * @memberOf _
  14288. * @since 4.0.0
  14289. * @category Object
  14290. * @param {Object} object The object to modify.
  14291. * @param {Array|string} path The path of the property to unset.
  14292. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14293. * @example
  14294. *
  14295. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14296. * _.unset(object, 'a[0].b.c');
  14297. * // => true
  14298. *
  14299. * console.log(object);
  14300. * // => { 'a': [{ 'b': {} }] };
  14301. *
  14302. * _.unset(object, ['a', '0', 'b', 'c']);
  14303. * // => true
  14304. *
  14305. * console.log(object);
  14306. * // => { 'a': [{ 'b': {} }] };
  14307. */
  14308. function unset(object, path) {
  14309. return object == null ? true : baseUnset(object, path);
  14310. }
  14311. /**
  14312. * This method is like `_.set` except that accepts `updater` to produce the
  14313. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14314. * is invoked with one argument: (value).
  14315. *
  14316. * **Note:** This method mutates `object`.
  14317. *
  14318. * @static
  14319. * @memberOf _
  14320. * @since 4.6.0
  14321. * @category Object
  14322. * @param {Object} object The object to modify.
  14323. * @param {Array|string} path The path of the property to set.
  14324. * @param {Function} updater The function to produce the updated value.
  14325. * @returns {Object} Returns `object`.
  14326. * @example
  14327. *
  14328. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14329. *
  14330. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14331. * console.log(object.a[0].b.c);
  14332. * // => 9
  14333. *
  14334. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14335. * console.log(object.x[0].y.z);
  14336. * // => 0
  14337. */
  14338. function update(object, path, updater) {
  14339. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14340. }
  14341. /**
  14342. * This method is like `_.update` except that it accepts `customizer` which is
  14343. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14344. * path creation is handled by the method instead. The `customizer` is invoked
  14345. * with three arguments: (nsValue, key, nsObject).
  14346. *
  14347. * **Note:** This method mutates `object`.
  14348. *
  14349. * @static
  14350. * @memberOf _
  14351. * @since 4.6.0
  14352. * @category Object
  14353. * @param {Object} object The object to modify.
  14354. * @param {Array|string} path The path of the property to set.
  14355. * @param {Function} updater The function to produce the updated value.
  14356. * @param {Function} [customizer] The function to customize assigned values.
  14357. * @returns {Object} Returns `object`.
  14358. * @example
  14359. *
  14360. * var object = {};
  14361. *
  14362. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14363. * // => { '0': { '1': 'a' } }
  14364. */
  14365. function updateWith(object, path, updater, customizer) {
  14366. customizer = typeof customizer == 'function' ? customizer : undefined;
  14367. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14368. }
  14369. /**
  14370. * Creates an array of the own enumerable string keyed property values of `object`.
  14371. *
  14372. * **Note:** Non-object values are coerced to objects.
  14373. *
  14374. * @static
  14375. * @since 0.1.0
  14376. * @memberOf _
  14377. * @category Object
  14378. * @param {Object} object The object to query.
  14379. * @returns {Array} Returns the array of property values.
  14380. * @example
  14381. *
  14382. * function Foo() {
  14383. * this.a = 1;
  14384. * this.b = 2;
  14385. * }
  14386. *
  14387. * Foo.prototype.c = 3;
  14388. *
  14389. * _.values(new Foo);
  14390. * // => [1, 2] (iteration order is not guaranteed)
  14391. *
  14392. * _.values('hi');
  14393. * // => ['h', 'i']
  14394. */
  14395. function values(object) {
  14396. return object == null ? [] : baseValues(object, keys(object));
  14397. }
  14398. /**
  14399. * Creates an array of the own and inherited enumerable string keyed property
  14400. * values of `object`.
  14401. *
  14402. * **Note:** Non-object values are coerced to objects.
  14403. *
  14404. * @static
  14405. * @memberOf _
  14406. * @since 3.0.0
  14407. * @category Object
  14408. * @param {Object} object The object to query.
  14409. * @returns {Array} Returns the array of property values.
  14410. * @example
  14411. *
  14412. * function Foo() {
  14413. * this.a = 1;
  14414. * this.b = 2;
  14415. * }
  14416. *
  14417. * Foo.prototype.c = 3;
  14418. *
  14419. * _.valuesIn(new Foo);
  14420. * // => [1, 2, 3] (iteration order is not guaranteed)
  14421. */
  14422. function valuesIn(object) {
  14423. return object == null ? [] : baseValues(object, keysIn(object));
  14424. }
  14425. /*------------------------------------------------------------------------*/
  14426. /**
  14427. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14428. *
  14429. * @static
  14430. * @memberOf _
  14431. * @since 4.0.0
  14432. * @category Number
  14433. * @param {number} number The number to clamp.
  14434. * @param {number} [lower] The lower bound.
  14435. * @param {number} upper The upper bound.
  14436. * @returns {number} Returns the clamped number.
  14437. * @example
  14438. *
  14439. * _.clamp(-10, -5, 5);
  14440. * // => -5
  14441. *
  14442. * _.clamp(10, -5, 5);
  14443. * // => 5
  14444. */
  14445. function clamp(number, lower, upper) {
  14446. if (upper === undefined) {
  14447. upper = lower;
  14448. lower = undefined;
  14449. }
  14450. if (upper !== undefined) {
  14451. upper = toNumber(upper);
  14452. upper = upper === upper ? upper : 0;
  14453. }
  14454. if (lower !== undefined) {
  14455. lower = toNumber(lower);
  14456. lower = lower === lower ? lower : 0;
  14457. }
  14458. return baseClamp(toNumber(number), lower, upper);
  14459. }
  14460. /**
  14461. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14462. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14463. * If `start` is greater than `end` the params are swapped to support
  14464. * negative ranges.
  14465. *
  14466. * @static
  14467. * @memberOf _
  14468. * @since 3.3.0
  14469. * @category Number
  14470. * @param {number} number The number to check.
  14471. * @param {number} [start=0] The start of the range.
  14472. * @param {number} end The end of the range.
  14473. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14474. * @see _.range, _.rangeRight
  14475. * @example
  14476. *
  14477. * _.inRange(3, 2, 4);
  14478. * // => true
  14479. *
  14480. * _.inRange(4, 8);
  14481. * // => true
  14482. *
  14483. * _.inRange(4, 2);
  14484. * // => false
  14485. *
  14486. * _.inRange(2, 2);
  14487. * // => false
  14488. *
  14489. * _.inRange(1.2, 2);
  14490. * // => true
  14491. *
  14492. * _.inRange(5.2, 4);
  14493. * // => false
  14494. *
  14495. * _.inRange(-3, -2, -6);
  14496. * // => true
  14497. */
  14498. function inRange(number, start, end) {
  14499. start = toFinite(start);
  14500. if (end === undefined) {
  14501. end = start;
  14502. start = 0;
  14503. } else {
  14504. end = toFinite(end);
  14505. }
  14506. number = toNumber(number);
  14507. return baseInRange(number, start, end);
  14508. }
  14509. /**
  14510. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14511. * If only one argument is provided a number between `0` and the given number
  14512. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14513. * floats, a floating-point number is returned instead of an integer.
  14514. *
  14515. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14516. * floating-point values which can produce unexpected results.
  14517. *
  14518. * @static
  14519. * @memberOf _
  14520. * @since 0.7.0
  14521. * @category Number
  14522. * @param {number} [lower=0] The lower bound.
  14523. * @param {number} [upper=1] The upper bound.
  14524. * @param {boolean} [floating] Specify returning a floating-point number.
  14525. * @returns {number} Returns the random number.
  14526. * @example
  14527. *
  14528. * _.random(0, 5);
  14529. * // => an integer between 0 and 5
  14530. *
  14531. * _.random(5);
  14532. * // => also an integer between 0 and 5
  14533. *
  14534. * _.random(5, true);
  14535. * // => a floating-point number between 0 and 5
  14536. *
  14537. * _.random(1.2, 5.2);
  14538. * // => a floating-point number between 1.2 and 5.2
  14539. */
  14540. function random(lower, upper, floating) {
  14541. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14542. upper = floating = undefined;
  14543. }
  14544. if (floating === undefined) {
  14545. if (typeof upper == 'boolean') {
  14546. floating = upper;
  14547. upper = undefined;
  14548. }
  14549. else if (typeof lower == 'boolean') {
  14550. floating = lower;
  14551. lower = undefined;
  14552. }
  14553. }
  14554. if (lower === undefined && upper === undefined) {
  14555. lower = 0;
  14556. upper = 1;
  14557. }
  14558. else {
  14559. lower = toFinite(lower);
  14560. if (upper === undefined) {
  14561. upper = lower;
  14562. lower = 0;
  14563. } else {
  14564. upper = toFinite(upper);
  14565. }
  14566. }
  14567. if (lower > upper) {
  14568. var temp = lower;
  14569. lower = upper;
  14570. upper = temp;
  14571. }
  14572. if (floating || lower % 1 || upper % 1) {
  14573. var rand = nativeRandom();
  14574. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14575. }
  14576. return baseRandom(lower, upper);
  14577. }
  14578. /*------------------------------------------------------------------------*/
  14579. /**
  14580. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14581. *
  14582. * @static
  14583. * @memberOf _
  14584. * @since 3.0.0
  14585. * @category String
  14586. * @param {string} [string=''] The string to convert.
  14587. * @returns {string} Returns the camel cased string.
  14588. * @example
  14589. *
  14590. * _.camelCase('Foo Bar');
  14591. * // => 'fooBar'
  14592. *
  14593. * _.camelCase('--foo-bar--');
  14594. * // => 'fooBar'
  14595. *
  14596. * _.camelCase('__FOO_BAR__');
  14597. * // => 'fooBar'
  14598. */
  14599. var camelCase = createCompounder(function(result, word, index) {
  14600. word = word.toLowerCase();
  14601. return result + (index ? capitalize(word) : word);
  14602. });
  14603. /**
  14604. * Converts the first character of `string` to upper case and the remaining
  14605. * to lower case.
  14606. *
  14607. * @static
  14608. * @memberOf _
  14609. * @since 3.0.0
  14610. * @category String
  14611. * @param {string} [string=''] The string to capitalize.
  14612. * @returns {string} Returns the capitalized string.
  14613. * @example
  14614. *
  14615. * _.capitalize('FRED');
  14616. * // => 'Fred'
  14617. */
  14618. function capitalize(string) {
  14619. return upperFirst(toString(string).toLowerCase());
  14620. }
  14621. /**
  14622. * Deburrs `string` by converting
  14623. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14624. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14625. * letters to basic Latin letters and removing
  14626. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14627. *
  14628. * @static
  14629. * @memberOf _
  14630. * @since 3.0.0
  14631. * @category String
  14632. * @param {string} [string=''] The string to deburr.
  14633. * @returns {string} Returns the deburred string.
  14634. * @example
  14635. *
  14636. * _.deburr('déjà vu');
  14637. * // => 'deja vu'
  14638. */
  14639. function deburr(string) {
  14640. string = toString(string);
  14641. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14642. }
  14643. /**
  14644. * Checks if `string` ends with the given target string.
  14645. *
  14646. * @static
  14647. * @memberOf _
  14648. * @since 3.0.0
  14649. * @category String
  14650. * @param {string} [string=''] The string to inspect.
  14651. * @param {string} [target] The string to search for.
  14652. * @param {number} [position=string.length] The position to search up to.
  14653. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14654. * else `false`.
  14655. * @example
  14656. *
  14657. * _.endsWith('abc', 'c');
  14658. * // => true
  14659. *
  14660. * _.endsWith('abc', 'b');
  14661. * // => false
  14662. *
  14663. * _.endsWith('abc', 'b', 2);
  14664. * // => true
  14665. */
  14666. function endsWith(string, target, position) {
  14667. string = toString(string);
  14668. target = baseToString(target);
  14669. var length = string.length;
  14670. position = position === undefined
  14671. ? length
  14672. : baseClamp(toInteger(position), 0, length);
  14673. var end = position;
  14674. position -= target.length;
  14675. return position >= 0 && string.slice(position, end) == target;
  14676. }
  14677. /**
  14678. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14679. * corresponding HTML entities.
  14680. *
  14681. * **Note:** No other characters are escaped. To escape additional
  14682. * characters use a third-party library like [_he_](https://mths.be/he).
  14683. *
  14684. * Though the ">" character is escaped for symmetry, characters like
  14685. * ">" and "/" don't need escaping in HTML and have no special meaning
  14686. * unless they're part of a tag or unquoted attribute value. See
  14687. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14688. * (under "semi-related fun fact") for more details.
  14689. *
  14690. * When working with HTML you should always
  14691. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14692. * XSS vectors.
  14693. *
  14694. * @static
  14695. * @since 0.1.0
  14696. * @memberOf _
  14697. * @category String
  14698. * @param {string} [string=''] The string to escape.
  14699. * @returns {string} Returns the escaped string.
  14700. * @example
  14701. *
  14702. * _.escape('fred, barney, & pebbles');
  14703. * // => 'fred, barney, &amp; pebbles'
  14704. */
  14705. function escape(string) {
  14706. string = toString(string);
  14707. return (string && reHasUnescapedHtml.test(string))
  14708. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14709. : string;
  14710. }
  14711. /**
  14712. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14713. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14714. *
  14715. * @static
  14716. * @memberOf _
  14717. * @since 3.0.0
  14718. * @category String
  14719. * @param {string} [string=''] The string to escape.
  14720. * @returns {string} Returns the escaped string.
  14721. * @example
  14722. *
  14723. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14724. * // => '\[lodash\]\(https://lodash\.com/\)'
  14725. */
  14726. function escapeRegExp(string) {
  14727. string = toString(string);
  14728. return (string && reHasRegExpChar.test(string))
  14729. ? string.replace(reRegExpChar, '\\$&')
  14730. : string;
  14731. }
  14732. /**
  14733. * Converts `string` to
  14734. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14735. *
  14736. * @static
  14737. * @memberOf _
  14738. * @since 3.0.0
  14739. * @category String
  14740. * @param {string} [string=''] The string to convert.
  14741. * @returns {string} Returns the kebab cased string.
  14742. * @example
  14743. *
  14744. * _.kebabCase('Foo Bar');
  14745. * // => 'foo-bar'
  14746. *
  14747. * _.kebabCase('fooBar');
  14748. * // => 'foo-bar'
  14749. *
  14750. * _.kebabCase('__FOO_BAR__');
  14751. * // => 'foo-bar'
  14752. */
  14753. var kebabCase = createCompounder(function(result, word, index) {
  14754. return result + (index ? '-' : '') + word.toLowerCase();
  14755. });
  14756. /**
  14757. * Converts `string`, as space separated words, to lower case.
  14758. *
  14759. * @static
  14760. * @memberOf _
  14761. * @since 4.0.0
  14762. * @category String
  14763. * @param {string} [string=''] The string to convert.
  14764. * @returns {string} Returns the lower cased string.
  14765. * @example
  14766. *
  14767. * _.lowerCase('--Foo-Bar--');
  14768. * // => 'foo bar'
  14769. *
  14770. * _.lowerCase('fooBar');
  14771. * // => 'foo bar'
  14772. *
  14773. * _.lowerCase('__FOO_BAR__');
  14774. * // => 'foo bar'
  14775. */
  14776. var lowerCase = createCompounder(function(result, word, index) {
  14777. return result + (index ? ' ' : '') + word.toLowerCase();
  14778. });
  14779. /**
  14780. * Converts the first character of `string` to lower case.
  14781. *
  14782. * @static
  14783. * @memberOf _
  14784. * @since 4.0.0
  14785. * @category String
  14786. * @param {string} [string=''] The string to convert.
  14787. * @returns {string} Returns the converted string.
  14788. * @example
  14789. *
  14790. * _.lowerFirst('Fred');
  14791. * // => 'fred'
  14792. *
  14793. * _.lowerFirst('FRED');
  14794. * // => 'fRED'
  14795. */
  14796. var lowerFirst = createCaseFirst('toLowerCase');
  14797. /**
  14798. * Pads `string` on the left and right sides if it's shorter than `length`.
  14799. * Padding characters are truncated if they can't be evenly divided by `length`.
  14800. *
  14801. * @static
  14802. * @memberOf _
  14803. * @since 3.0.0
  14804. * @category String
  14805. * @param {string} [string=''] The string to pad.
  14806. * @param {number} [length=0] The padding length.
  14807. * @param {string} [chars=' '] The string used as padding.
  14808. * @returns {string} Returns the padded string.
  14809. * @example
  14810. *
  14811. * _.pad('abc', 8);
  14812. * // => ' abc '
  14813. *
  14814. * _.pad('abc', 8, '_-');
  14815. * // => '_-abc_-_'
  14816. *
  14817. * _.pad('abc', 3);
  14818. * // => 'abc'
  14819. */
  14820. function pad(string, length, chars) {
  14821. string = toString(string);
  14822. length = toInteger(length);
  14823. var strLength = length ? stringSize(string) : 0;
  14824. if (!length || strLength >= length) {
  14825. return string;
  14826. }
  14827. var mid = (length - strLength) / 2;
  14828. return (
  14829. createPadding(nativeFloor(mid), chars) +
  14830. string +
  14831. createPadding(nativeCeil(mid), chars)
  14832. );
  14833. }
  14834. /**
  14835. * Pads `string` on the right side if it's shorter than `length`. Padding
  14836. * characters are truncated if they exceed `length`.
  14837. *
  14838. * @static
  14839. * @memberOf _
  14840. * @since 4.0.0
  14841. * @category String
  14842. * @param {string} [string=''] The string to pad.
  14843. * @param {number} [length=0] The padding length.
  14844. * @param {string} [chars=' '] The string used as padding.
  14845. * @returns {string} Returns the padded string.
  14846. * @example
  14847. *
  14848. * _.padEnd('abc', 6);
  14849. * // => 'abc '
  14850. *
  14851. * _.padEnd('abc', 6, '_-');
  14852. * // => 'abc_-_'
  14853. *
  14854. * _.padEnd('abc', 3);
  14855. * // => 'abc'
  14856. */
  14857. function padEnd(string, length, chars) {
  14858. string = toString(string);
  14859. length = toInteger(length);
  14860. var strLength = length ? stringSize(string) : 0;
  14861. return (length && strLength < length)
  14862. ? (string + createPadding(length - strLength, chars))
  14863. : string;
  14864. }
  14865. /**
  14866. * Pads `string` on the left side if it's shorter than `length`. Padding
  14867. * characters are truncated if they exceed `length`.
  14868. *
  14869. * @static
  14870. * @memberOf _
  14871. * @since 4.0.0
  14872. * @category String
  14873. * @param {string} [string=''] The string to pad.
  14874. * @param {number} [length=0] The padding length.
  14875. * @param {string} [chars=' '] The string used as padding.
  14876. * @returns {string} Returns the padded string.
  14877. * @example
  14878. *
  14879. * _.padStart('abc', 6);
  14880. * // => ' abc'
  14881. *
  14882. * _.padStart('abc', 6, '_-');
  14883. * // => '_-_abc'
  14884. *
  14885. * _.padStart('abc', 3);
  14886. * // => 'abc'
  14887. */
  14888. function padStart(string, length, chars) {
  14889. string = toString(string);
  14890. length = toInteger(length);
  14891. var strLength = length ? stringSize(string) : 0;
  14892. return (length && strLength < length)
  14893. ? (createPadding(length - strLength, chars) + string)
  14894. : string;
  14895. }
  14896. /**
  14897. * Converts `string` to an integer of the specified radix. If `radix` is
  14898. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14899. * hexadecimal, in which case a `radix` of `16` is used.
  14900. *
  14901. * **Note:** This method aligns with the
  14902. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14903. *
  14904. * @static
  14905. * @memberOf _
  14906. * @since 1.1.0
  14907. * @category String
  14908. * @param {string} string The string to convert.
  14909. * @param {number} [radix=10] The radix to interpret `value` by.
  14910. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14911. * @returns {number} Returns the converted integer.
  14912. * @example
  14913. *
  14914. * _.parseInt('08');
  14915. * // => 8
  14916. *
  14917. * _.map(['6', '08', '10'], _.parseInt);
  14918. * // => [6, 8, 10]
  14919. */
  14920. function parseInt(string, radix, guard) {
  14921. if (guard || radix == null) {
  14922. radix = 0;
  14923. } else if (radix) {
  14924. radix = +radix;
  14925. }
  14926. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14927. }
  14928. /**
  14929. * Repeats the given string `n` times.
  14930. *
  14931. * @static
  14932. * @memberOf _
  14933. * @since 3.0.0
  14934. * @category String
  14935. * @param {string} [string=''] The string to repeat.
  14936. * @param {number} [n=1] The number of times to repeat the string.
  14937. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14938. * @returns {string} Returns the repeated string.
  14939. * @example
  14940. *
  14941. * _.repeat('*', 3);
  14942. * // => '***'
  14943. *
  14944. * _.repeat('abc', 2);
  14945. * // => 'abcabc'
  14946. *
  14947. * _.repeat('abc', 0);
  14948. * // => ''
  14949. */
  14950. function repeat(string, n, guard) {
  14951. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14952. n = 1;
  14953. } else {
  14954. n = toInteger(n);
  14955. }
  14956. return baseRepeat(toString(string), n);
  14957. }
  14958. /**
  14959. * Replaces matches for `pattern` in `string` with `replacement`.
  14960. *
  14961. * **Note:** This method is based on
  14962. * [`String#replace`](https://mdn.io/String/replace).
  14963. *
  14964. * @static
  14965. * @memberOf _
  14966. * @since 4.0.0
  14967. * @category String
  14968. * @param {string} [string=''] The string to modify.
  14969. * @param {RegExp|string} pattern The pattern to replace.
  14970. * @param {Function|string} replacement The match replacement.
  14971. * @returns {string} Returns the modified string.
  14972. * @example
  14973. *
  14974. * _.replace('Hi Fred', 'Fred', 'Barney');
  14975. * // => 'Hi Barney'
  14976. */
  14977. function replace() {
  14978. var args = arguments,
  14979. string = toString(args[0]);
  14980. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14981. }
  14982. /**
  14983. * Converts `string` to
  14984. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14985. *
  14986. * @static
  14987. * @memberOf _
  14988. * @since 3.0.0
  14989. * @category String
  14990. * @param {string} [string=''] The string to convert.
  14991. * @returns {string} Returns the snake cased string.
  14992. * @example
  14993. *
  14994. * _.snakeCase('Foo Bar');
  14995. * // => 'foo_bar'
  14996. *
  14997. * _.snakeCase('fooBar');
  14998. * // => 'foo_bar'
  14999. *
  15000. * _.snakeCase('--FOO-BAR--');
  15001. * // => 'foo_bar'
  15002. */
  15003. var snakeCase = createCompounder(function(result, word, index) {
  15004. return result + (index ? '_' : '') + word.toLowerCase();
  15005. });
  15006. /**
  15007. * Splits `string` by `separator`.
  15008. *
  15009. * **Note:** This method is based on
  15010. * [`String#split`](https://mdn.io/String/split).
  15011. *
  15012. * @static
  15013. * @memberOf _
  15014. * @since 4.0.0
  15015. * @category String
  15016. * @param {string} [string=''] The string to split.
  15017. * @param {RegExp|string} separator The separator pattern to split by.
  15018. * @param {number} [limit] The length to truncate results to.
  15019. * @returns {Array} Returns the string segments.
  15020. * @example
  15021. *
  15022. * _.split('a-b-c', '-', 2);
  15023. * // => ['a', 'b']
  15024. */
  15025. function split(string, separator, limit) {
  15026. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15027. separator = limit = undefined;
  15028. }
  15029. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15030. if (!limit) {
  15031. return [];
  15032. }
  15033. string = toString(string);
  15034. if (string && (
  15035. typeof separator == 'string' ||
  15036. (separator != null && !isRegExp(separator))
  15037. )) {
  15038. separator = baseToString(separator);
  15039. if (!separator && hasUnicode(string)) {
  15040. return castSlice(stringToArray(string), 0, limit);
  15041. }
  15042. }
  15043. return string.split(separator, limit);
  15044. }
  15045. /**
  15046. * Converts `string` to
  15047. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15048. *
  15049. * @static
  15050. * @memberOf _
  15051. * @since 3.1.0
  15052. * @category String
  15053. * @param {string} [string=''] The string to convert.
  15054. * @returns {string} Returns the start cased string.
  15055. * @example
  15056. *
  15057. * _.startCase('--foo-bar--');
  15058. * // => 'Foo Bar'
  15059. *
  15060. * _.startCase('fooBar');
  15061. * // => 'Foo Bar'
  15062. *
  15063. * _.startCase('__FOO_BAR__');
  15064. * // => 'FOO BAR'
  15065. */
  15066. var startCase = createCompounder(function(result, word, index) {
  15067. return result + (index ? ' ' : '') + upperFirst(word);
  15068. });
  15069. /**
  15070. * Checks if `string` starts with the given target string.
  15071. *
  15072. * @static
  15073. * @memberOf _
  15074. * @since 3.0.0
  15075. * @category String
  15076. * @param {string} [string=''] The string to inspect.
  15077. * @param {string} [target] The string to search for.
  15078. * @param {number} [position=0] The position to search from.
  15079. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15080. * else `false`.
  15081. * @example
  15082. *
  15083. * _.startsWith('abc', 'a');
  15084. * // => true
  15085. *
  15086. * _.startsWith('abc', 'b');
  15087. * // => false
  15088. *
  15089. * _.startsWith('abc', 'b', 1);
  15090. * // => true
  15091. */
  15092. function startsWith(string, target, position) {
  15093. string = toString(string);
  15094. position = position == null
  15095. ? 0
  15096. : baseClamp(toInteger(position), 0, string.length);
  15097. target = baseToString(target);
  15098. return string.slice(position, position + target.length) == target;
  15099. }
  15100. /**
  15101. * Creates a compiled template function that can interpolate data properties
  15102. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15103. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15104. * properties may be accessed as free variables in the template. If a setting
  15105. * object is given, it takes precedence over `_.templateSettings` values.
  15106. *
  15107. * **Note:** In the development build `_.template` utilizes
  15108. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15109. * for easier debugging.
  15110. *
  15111. * For more information on precompiling templates see
  15112. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15113. *
  15114. * For more information on Chrome extension sandboxes see
  15115. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15116. *
  15117. * @static
  15118. * @since 0.1.0
  15119. * @memberOf _
  15120. * @category String
  15121. * @param {string} [string=''] The template string.
  15122. * @param {Object} [options={}] The options object.
  15123. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15124. * The HTML "escape" delimiter.
  15125. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15126. * The "evaluate" delimiter.
  15127. * @param {Object} [options.imports=_.templateSettings.imports]
  15128. * An object to import into the template as free variables.
  15129. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15130. * The "interpolate" delimiter.
  15131. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15132. * The sourceURL of the compiled template.
  15133. * @param {string} [options.variable='obj']
  15134. * The data object variable name.
  15135. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15136. * @returns {Function} Returns the compiled template function.
  15137. * @example
  15138. *
  15139. * // Use the "interpolate" delimiter to create a compiled template.
  15140. * var compiled = _.template('hello <%= user %>!');
  15141. * compiled({ 'user': 'fred' });
  15142. * // => 'hello fred!'
  15143. *
  15144. * // Use the HTML "escape" delimiter to escape data property values.
  15145. * var compiled = _.template('<b><%- value %></b>');
  15146. * compiled({ 'value': '<script>' });
  15147. * // => '<b>&lt;script&gt;</b>'
  15148. *
  15149. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15150. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15151. * compiled({ 'users': ['fred', 'barney'] });
  15152. * // => '<li>fred</li><li>barney</li>'
  15153. *
  15154. * // Use the internal `print` function in "evaluate" delimiters.
  15155. * var compiled = _.template('<% print("hello " + user); %>!');
  15156. * compiled({ 'user': 'barney' });
  15157. * // => 'hello barney!'
  15158. *
  15159. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15160. * // Disable support by replacing the "interpolate" delimiter.
  15161. * var compiled = _.template('hello ${ user }!');
  15162. * compiled({ 'user': 'pebbles' });
  15163. * // => 'hello pebbles!'
  15164. *
  15165. * // Use backslashes to treat delimiters as plain text.
  15166. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15167. * compiled({ 'value': 'ignored' });
  15168. * // => '<%- value %>'
  15169. *
  15170. * // Use the `imports` option to import `jQuery` as `jq`.
  15171. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15172. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15173. * compiled({ 'users': ['fred', 'barney'] });
  15174. * // => '<li>fred</li><li>barney</li>'
  15175. *
  15176. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15177. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15178. * compiled(data);
  15179. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15180. *
  15181. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15182. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15183. * compiled.source;
  15184. * // => function(data) {
  15185. * // var __t, __p = '';
  15186. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15187. * // return __p;
  15188. * // }
  15189. *
  15190. * // Use custom template delimiters.
  15191. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15192. * var compiled = _.template('hello {{ user }}!');
  15193. * compiled({ 'user': 'mustache' });
  15194. * // => 'hello mustache!'
  15195. *
  15196. * // Use the `source` property to inline compiled templates for meaningful
  15197. * // line numbers in error messages and stack traces.
  15198. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15199. * var JST = {\
  15200. * "main": ' + _.template(mainText).source + '\
  15201. * };\
  15202. * ');
  15203. */
  15204. function template(string, options, guard) {
  15205. // Based on John Resig's `tmpl` implementation
  15206. // (http://ejohn.org/blog/javascript-micro-templating/)
  15207. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15208. var settings = lodash.templateSettings;
  15209. if (guard && isIterateeCall(string, options, guard)) {
  15210. options = undefined;
  15211. }
  15212. string = toString(string);
  15213. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15214. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15215. importsKeys = keys(imports),
  15216. importsValues = baseValues(imports, importsKeys);
  15217. var isEscaping,
  15218. isEvaluating,
  15219. index = 0,
  15220. interpolate = options.interpolate || reNoMatch,
  15221. source = "__p += '";
  15222. // Compile the regexp to match each delimiter.
  15223. var reDelimiters = RegExp(
  15224. (options.escape || reNoMatch).source + '|' +
  15225. interpolate.source + '|' +
  15226. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15227. (options.evaluate || reNoMatch).source + '|$'
  15228. , 'g');
  15229. // Use a sourceURL for easier debugging.
  15230. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15231. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15232. // and escape the comment, thus injecting code that gets evaled.
  15233. var sourceURL = '//# sourceURL=' +
  15234. (hasOwnProperty.call(options, 'sourceURL')
  15235. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15236. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15237. ) + '\n';
  15238. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15239. interpolateValue || (interpolateValue = esTemplateValue);
  15240. // Escape characters that can't be included in string literals.
  15241. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15242. // Replace delimiters with snippets.
  15243. if (escapeValue) {
  15244. isEscaping = true;
  15245. source += "' +\n__e(" + escapeValue + ") +\n'";
  15246. }
  15247. if (evaluateValue) {
  15248. isEvaluating = true;
  15249. source += "';\n" + evaluateValue + ";\n__p += '";
  15250. }
  15251. if (interpolateValue) {
  15252. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15253. }
  15254. index = offset + match.length;
  15255. // The JS engine embedded in Adobe products needs `match` returned in
  15256. // order to produce the correct `offset` value.
  15257. return match;
  15258. });
  15259. source += "';\n";
  15260. // If `variable` is not specified wrap a with-statement around the generated
  15261. // code to add the data object to the top of the scope chain.
  15262. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15263. if (!variable) {
  15264. source = 'with (obj) {\n' + source + '\n}\n';
  15265. }
  15266. // Throw an error if a forbidden character was found in `variable`, to prevent
  15267. // potential command injection attacks.
  15268. else if (reForbiddenIdentifierChars.test(variable)) {
  15269. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15270. }
  15271. // Cleanup code by stripping empty strings.
  15272. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15273. .replace(reEmptyStringMiddle, '$1')
  15274. .replace(reEmptyStringTrailing, '$1;');
  15275. // Frame code as the function body.
  15276. source = 'function(' + (variable || 'obj') + ') {\n' +
  15277. (variable
  15278. ? ''
  15279. : 'obj || (obj = {});\n'
  15280. ) +
  15281. "var __t, __p = ''" +
  15282. (isEscaping
  15283. ? ', __e = _.escape'
  15284. : ''
  15285. ) +
  15286. (isEvaluating
  15287. ? ', __j = Array.prototype.join;\n' +
  15288. "function print() { __p += __j.call(arguments, '') }\n"
  15289. : ';\n'
  15290. ) +
  15291. source +
  15292. 'return __p\n}';
  15293. var result = attempt(function() {
  15294. return Function(importsKeys, sourceURL + 'return ' + source)
  15295. .apply(undefined, importsValues);
  15296. });
  15297. // Provide the compiled function's source by its `toString` method or
  15298. // the `source` property as a convenience for inlining compiled templates.
  15299. result.source = source;
  15300. if (isError(result)) {
  15301. throw result;
  15302. }
  15303. return result;
  15304. }
  15305. /**
  15306. * Converts `string`, as a whole, to lower case just like
  15307. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15308. *
  15309. * @static
  15310. * @memberOf _
  15311. * @since 4.0.0
  15312. * @category String
  15313. * @param {string} [string=''] The string to convert.
  15314. * @returns {string} Returns the lower cased string.
  15315. * @example
  15316. *
  15317. * _.toLower('--Foo-Bar--');
  15318. * // => '--foo-bar--'
  15319. *
  15320. * _.toLower('fooBar');
  15321. * // => 'foobar'
  15322. *
  15323. * _.toLower('__FOO_BAR__');
  15324. * // => '__foo_bar__'
  15325. */
  15326. function toLower(value) {
  15327. return toString(value).toLowerCase();
  15328. }
  15329. /**
  15330. * Converts `string`, as a whole, to upper case just like
  15331. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15332. *
  15333. * @static
  15334. * @memberOf _
  15335. * @since 4.0.0
  15336. * @category String
  15337. * @param {string} [string=''] The string to convert.
  15338. * @returns {string} Returns the upper cased string.
  15339. * @example
  15340. *
  15341. * _.toUpper('--foo-bar--');
  15342. * // => '--FOO-BAR--'
  15343. *
  15344. * _.toUpper('fooBar');
  15345. * // => 'FOOBAR'
  15346. *
  15347. * _.toUpper('__foo_bar__');
  15348. * // => '__FOO_BAR__'
  15349. */
  15350. function toUpper(value) {
  15351. return toString(value).toUpperCase();
  15352. }
  15353. /**
  15354. * Removes leading and trailing whitespace or specified characters from `string`.
  15355. *
  15356. * @static
  15357. * @memberOf _
  15358. * @since 3.0.0
  15359. * @category String
  15360. * @param {string} [string=''] The string to trim.
  15361. * @param {string} [chars=whitespace] The characters to trim.
  15362. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15363. * @returns {string} Returns the trimmed string.
  15364. * @example
  15365. *
  15366. * _.trim(' abc ');
  15367. * // => 'abc'
  15368. *
  15369. * _.trim('-_-abc-_-', '_-');
  15370. * // => 'abc'
  15371. *
  15372. * _.map([' foo ', ' bar '], _.trim);
  15373. * // => ['foo', 'bar']
  15374. */
  15375. function trim(string, chars, guard) {
  15376. string = toString(string);
  15377. if (string && (guard || chars === undefined)) {
  15378. return baseTrim(string);
  15379. }
  15380. if (!string || !(chars = baseToString(chars))) {
  15381. return string;
  15382. }
  15383. var strSymbols = stringToArray(string),
  15384. chrSymbols = stringToArray(chars),
  15385. start = charsStartIndex(strSymbols, chrSymbols),
  15386. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15387. return castSlice(strSymbols, start, end).join('');
  15388. }
  15389. /**
  15390. * Removes trailing whitespace or specified characters from `string`.
  15391. *
  15392. * @static
  15393. * @memberOf _
  15394. * @since 4.0.0
  15395. * @category String
  15396. * @param {string} [string=''] The string to trim.
  15397. * @param {string} [chars=whitespace] The characters to trim.
  15398. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15399. * @returns {string} Returns the trimmed string.
  15400. * @example
  15401. *
  15402. * _.trimEnd(' abc ');
  15403. * // => ' abc'
  15404. *
  15405. * _.trimEnd('-_-abc-_-', '_-');
  15406. * // => '-_-abc'
  15407. */
  15408. function trimEnd(string, chars, guard) {
  15409. string = toString(string);
  15410. if (string && (guard || chars === undefined)) {
  15411. return string.slice(0, trimmedEndIndex(string) + 1);
  15412. }
  15413. if (!string || !(chars = baseToString(chars))) {
  15414. return string;
  15415. }
  15416. var strSymbols = stringToArray(string),
  15417. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15418. return castSlice(strSymbols, 0, end).join('');
  15419. }
  15420. /**
  15421. * Removes leading whitespace or specified characters from `string`.
  15422. *
  15423. * @static
  15424. * @memberOf _
  15425. * @since 4.0.0
  15426. * @category String
  15427. * @param {string} [string=''] The string to trim.
  15428. * @param {string} [chars=whitespace] The characters to trim.
  15429. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15430. * @returns {string} Returns the trimmed string.
  15431. * @example
  15432. *
  15433. * _.trimStart(' abc ');
  15434. * // => 'abc '
  15435. *
  15436. * _.trimStart('-_-abc-_-', '_-');
  15437. * // => 'abc-_-'
  15438. */
  15439. function trimStart(string, chars, guard) {
  15440. string = toString(string);
  15441. if (string && (guard || chars === undefined)) {
  15442. return string.replace(reTrimStart, '');
  15443. }
  15444. if (!string || !(chars = baseToString(chars))) {
  15445. return string;
  15446. }
  15447. var strSymbols = stringToArray(string),
  15448. start = charsStartIndex(strSymbols, stringToArray(chars));
  15449. return castSlice(strSymbols, start).join('');
  15450. }
  15451. /**
  15452. * Truncates `string` if it's longer than the given maximum string length.
  15453. * The last characters of the truncated string are replaced with the omission
  15454. * string which defaults to "...".
  15455. *
  15456. * @static
  15457. * @memberOf _
  15458. * @since 4.0.0
  15459. * @category String
  15460. * @param {string} [string=''] The string to truncate.
  15461. * @param {Object} [options={}] The options object.
  15462. * @param {number} [options.length=30] The maximum string length.
  15463. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15464. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15465. * @returns {string} Returns the truncated string.
  15466. * @example
  15467. *
  15468. * _.truncate('hi-diddly-ho there, neighborino');
  15469. * // => 'hi-diddly-ho there, neighbo...'
  15470. *
  15471. * _.truncate('hi-diddly-ho there, neighborino', {
  15472. * 'length': 24,
  15473. * 'separator': ' '
  15474. * });
  15475. * // => 'hi-diddly-ho there,...'
  15476. *
  15477. * _.truncate('hi-diddly-ho there, neighborino', {
  15478. * 'length': 24,
  15479. * 'separator': /,? +/
  15480. * });
  15481. * // => 'hi-diddly-ho there...'
  15482. *
  15483. * _.truncate('hi-diddly-ho there, neighborino', {
  15484. * 'omission': ' [...]'
  15485. * });
  15486. * // => 'hi-diddly-ho there, neig [...]'
  15487. */
  15488. function truncate(string, options) {
  15489. var length = DEFAULT_TRUNC_LENGTH,
  15490. omission = DEFAULT_TRUNC_OMISSION;
  15491. if (isObject(options)) {
  15492. var separator = 'separator' in options ? options.separator : separator;
  15493. length = 'length' in options ? toInteger(options.length) : length;
  15494. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15495. }
  15496. string = toString(string);
  15497. var strLength = string.length;
  15498. if (hasUnicode(string)) {
  15499. var strSymbols = stringToArray(string);
  15500. strLength = strSymbols.length;
  15501. }
  15502. if (length >= strLength) {
  15503. return string;
  15504. }
  15505. var end = length - stringSize(omission);
  15506. if (end < 1) {
  15507. return omission;
  15508. }
  15509. var result = strSymbols
  15510. ? castSlice(strSymbols, 0, end).join('')
  15511. : string.slice(0, end);
  15512. if (separator === undefined) {
  15513. return result + omission;
  15514. }
  15515. if (strSymbols) {
  15516. end += (result.length - end);
  15517. }
  15518. if (isRegExp(separator)) {
  15519. if (string.slice(end).search(separator)) {
  15520. var match,
  15521. substring = result;
  15522. if (!separator.global) {
  15523. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15524. }
  15525. separator.lastIndex = 0;
  15526. while ((match = separator.exec(substring))) {
  15527. var newEnd = match.index;
  15528. }
  15529. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15530. }
  15531. } else if (string.indexOf(baseToString(separator), end) != end) {
  15532. var index = result.lastIndexOf(separator);
  15533. if (index > -1) {
  15534. result = result.slice(0, index);
  15535. }
  15536. }
  15537. return result + omission;
  15538. }
  15539. /**
  15540. * The inverse of `_.escape`; this method converts the HTML entities
  15541. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15542. * their corresponding characters.
  15543. *
  15544. * **Note:** No other HTML entities are unescaped. To unescape additional
  15545. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15546. *
  15547. * @static
  15548. * @memberOf _
  15549. * @since 0.6.0
  15550. * @category String
  15551. * @param {string} [string=''] The string to unescape.
  15552. * @returns {string} Returns the unescaped string.
  15553. * @example
  15554. *
  15555. * _.unescape('fred, barney, &amp; pebbles');
  15556. * // => 'fred, barney, & pebbles'
  15557. */
  15558. function unescape(string) {
  15559. string = toString(string);
  15560. return (string && reHasEscapedHtml.test(string))
  15561. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15562. : string;
  15563. }
  15564. /**
  15565. * Converts `string`, as space separated words, to upper case.
  15566. *
  15567. * @static
  15568. * @memberOf _
  15569. * @since 4.0.0
  15570. * @category String
  15571. * @param {string} [string=''] The string to convert.
  15572. * @returns {string} Returns the upper cased string.
  15573. * @example
  15574. *
  15575. * _.upperCase('--foo-bar');
  15576. * // => 'FOO BAR'
  15577. *
  15578. * _.upperCase('fooBar');
  15579. * // => 'FOO BAR'
  15580. *
  15581. * _.upperCase('__foo_bar__');
  15582. * // => 'FOO BAR'
  15583. */
  15584. var upperCase = createCompounder(function(result, word, index) {
  15585. return result + (index ? ' ' : '') + word.toUpperCase();
  15586. });
  15587. /**
  15588. * Converts the first character of `string` to upper case.
  15589. *
  15590. * @static
  15591. * @memberOf _
  15592. * @since 4.0.0
  15593. * @category String
  15594. * @param {string} [string=''] The string to convert.
  15595. * @returns {string} Returns the converted string.
  15596. * @example
  15597. *
  15598. * _.upperFirst('fred');
  15599. * // => 'Fred'
  15600. *
  15601. * _.upperFirst('FRED');
  15602. * // => 'FRED'
  15603. */
  15604. var upperFirst = createCaseFirst('toUpperCase');
  15605. /**
  15606. * Splits `string` into an array of its words.
  15607. *
  15608. * @static
  15609. * @memberOf _
  15610. * @since 3.0.0
  15611. * @category String
  15612. * @param {string} [string=''] The string to inspect.
  15613. * @param {RegExp|string} [pattern] The pattern to match words.
  15614. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15615. * @returns {Array} Returns the words of `string`.
  15616. * @example
  15617. *
  15618. * _.words('fred, barney, & pebbles');
  15619. * // => ['fred', 'barney', 'pebbles']
  15620. *
  15621. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15622. * // => ['fred', 'barney', '&', 'pebbles']
  15623. */
  15624. function words(string, pattern, guard) {
  15625. string = toString(string);
  15626. pattern = guard ? undefined : pattern;
  15627. if (pattern === undefined) {
  15628. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15629. }
  15630. return string.match(pattern) || [];
  15631. }
  15632. /*------------------------------------------------------------------------*/
  15633. /**
  15634. * Attempts to invoke `func`, returning either the result or the caught error
  15635. * object. Any additional arguments are provided to `func` when it's invoked.
  15636. *
  15637. * @static
  15638. * @memberOf _
  15639. * @since 3.0.0
  15640. * @category Util
  15641. * @param {Function} func The function to attempt.
  15642. * @param {...*} [args] The arguments to invoke `func` with.
  15643. * @returns {*} Returns the `func` result or error object.
  15644. * @example
  15645. *
  15646. * // Avoid throwing errors for invalid selectors.
  15647. * var elements = _.attempt(function(selector) {
  15648. * return document.querySelectorAll(selector);
  15649. * }, '>_>');
  15650. *
  15651. * if (_.isError(elements)) {
  15652. * elements = [];
  15653. * }
  15654. */
  15655. var attempt = baseRest(function(func, args) {
  15656. try {
  15657. return apply(func, undefined, args);
  15658. } catch (e) {
  15659. return isError(e) ? e : new Error(e);
  15660. }
  15661. });
  15662. /**
  15663. * Binds methods of an object to the object itself, overwriting the existing
  15664. * method.
  15665. *
  15666. * **Note:** This method doesn't set the "length" property of bound functions.
  15667. *
  15668. * @static
  15669. * @since 0.1.0
  15670. * @memberOf _
  15671. * @category Util
  15672. * @param {Object} object The object to bind and assign the bound methods to.
  15673. * @param {...(string|string[])} methodNames The object method names to bind.
  15674. * @returns {Object} Returns `object`.
  15675. * @example
  15676. *
  15677. * var view = {
  15678. * 'label': 'docs',
  15679. * 'click': function() {
  15680. * console.log('clicked ' + this.label);
  15681. * }
  15682. * };
  15683. *
  15684. * _.bindAll(view, ['click']);
  15685. * jQuery(element).on('click', view.click);
  15686. * // => Logs 'clicked docs' when clicked.
  15687. */
  15688. var bindAll = flatRest(function(object, methodNames) {
  15689. arrayEach(methodNames, function(key) {
  15690. key = toKey(key);
  15691. baseAssignValue(object, key, bind(object[key], object));
  15692. });
  15693. return object;
  15694. });
  15695. /**
  15696. * Creates a function that iterates over `pairs` and invokes the corresponding
  15697. * function of the first predicate to return truthy. The predicate-function
  15698. * pairs are invoked with the `this` binding and arguments of the created
  15699. * function.
  15700. *
  15701. * @static
  15702. * @memberOf _
  15703. * @since 4.0.0
  15704. * @category Util
  15705. * @param {Array} pairs The predicate-function pairs.
  15706. * @returns {Function} Returns the new composite function.
  15707. * @example
  15708. *
  15709. * var func = _.cond([
  15710. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15711. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15712. * [_.stubTrue, _.constant('no match')]
  15713. * ]);
  15714. *
  15715. * func({ 'a': 1, 'b': 2 });
  15716. * // => 'matches A'
  15717. *
  15718. * func({ 'a': 0, 'b': 1 });
  15719. * // => 'matches B'
  15720. *
  15721. * func({ 'a': '1', 'b': '2' });
  15722. * // => 'no match'
  15723. */
  15724. function cond(pairs) {
  15725. var length = pairs == null ? 0 : pairs.length,
  15726. toIteratee = getIteratee();
  15727. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15728. if (typeof pair[1] != 'function') {
  15729. throw new TypeError(FUNC_ERROR_TEXT);
  15730. }
  15731. return [toIteratee(pair[0]), pair[1]];
  15732. });
  15733. return baseRest(function(args) {
  15734. var index = -1;
  15735. while (++index < length) {
  15736. var pair = pairs[index];
  15737. if (apply(pair[0], this, args)) {
  15738. return apply(pair[1], this, args);
  15739. }
  15740. }
  15741. });
  15742. }
  15743. /**
  15744. * Creates a function that invokes the predicate properties of `source` with
  15745. * the corresponding property values of a given object, returning `true` if
  15746. * all predicates return truthy, else `false`.
  15747. *
  15748. * **Note:** The created function is equivalent to `_.conformsTo` with
  15749. * `source` partially applied.
  15750. *
  15751. * @static
  15752. * @memberOf _
  15753. * @since 4.0.0
  15754. * @category Util
  15755. * @param {Object} source The object of property predicates to conform to.
  15756. * @returns {Function} Returns the new spec function.
  15757. * @example
  15758. *
  15759. * var objects = [
  15760. * { 'a': 2, 'b': 1 },
  15761. * { 'a': 1, 'b': 2 }
  15762. * ];
  15763. *
  15764. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15765. * // => [{ 'a': 1, 'b': 2 }]
  15766. */
  15767. function conforms(source) {
  15768. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15769. }
  15770. /**
  15771. * Creates a function that returns `value`.
  15772. *
  15773. * @static
  15774. * @memberOf _
  15775. * @since 2.4.0
  15776. * @category Util
  15777. * @param {*} value The value to return from the new function.
  15778. * @returns {Function} Returns the new constant function.
  15779. * @example
  15780. *
  15781. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15782. *
  15783. * console.log(objects);
  15784. * // => [{ 'a': 1 }, { 'a': 1 }]
  15785. *
  15786. * console.log(objects[0] === objects[1]);
  15787. * // => true
  15788. */
  15789. function constant(value) {
  15790. return function() {
  15791. return value;
  15792. };
  15793. }
  15794. /**
  15795. * Checks `value` to determine whether a default value should be returned in
  15796. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15797. * or `undefined`.
  15798. *
  15799. * @static
  15800. * @memberOf _
  15801. * @since 4.14.0
  15802. * @category Util
  15803. * @param {*} value The value to check.
  15804. * @param {*} defaultValue The default value.
  15805. * @returns {*} Returns the resolved value.
  15806. * @example
  15807. *
  15808. * _.defaultTo(1, 10);
  15809. * // => 1
  15810. *
  15811. * _.defaultTo(undefined, 10);
  15812. * // => 10
  15813. */
  15814. function defaultTo(value, defaultValue) {
  15815. return (value == null || value !== value) ? defaultValue : value;
  15816. }
  15817. /**
  15818. * Creates a function that returns the result of invoking the given functions
  15819. * with the `this` binding of the created function, where each successive
  15820. * invocation is supplied the return value of the previous.
  15821. *
  15822. * @static
  15823. * @memberOf _
  15824. * @since 3.0.0
  15825. * @category Util
  15826. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15827. * @returns {Function} Returns the new composite function.
  15828. * @see _.flowRight
  15829. * @example
  15830. *
  15831. * function square(n) {
  15832. * return n * n;
  15833. * }
  15834. *
  15835. * var addSquare = _.flow([_.add, square]);
  15836. * addSquare(1, 2);
  15837. * // => 9
  15838. */
  15839. var flow = createFlow();
  15840. /**
  15841. * This method is like `_.flow` except that it creates a function that
  15842. * invokes the given functions from right to left.
  15843. *
  15844. * @static
  15845. * @since 3.0.0
  15846. * @memberOf _
  15847. * @category Util
  15848. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15849. * @returns {Function} Returns the new composite function.
  15850. * @see _.flow
  15851. * @example
  15852. *
  15853. * function square(n) {
  15854. * return n * n;
  15855. * }
  15856. *
  15857. * var addSquare = _.flowRight([square, _.add]);
  15858. * addSquare(1, 2);
  15859. * // => 9
  15860. */
  15861. var flowRight = createFlow(true);
  15862. /**
  15863. * This method returns the first argument it receives.
  15864. *
  15865. * @static
  15866. * @since 0.1.0
  15867. * @memberOf _
  15868. * @category Util
  15869. * @param {*} value Any value.
  15870. * @returns {*} Returns `value`.
  15871. * @example
  15872. *
  15873. * var object = { 'a': 1 };
  15874. *
  15875. * console.log(_.identity(object) === object);
  15876. * // => true
  15877. */
  15878. function identity(value) {
  15879. return value;
  15880. }
  15881. /**
  15882. * Creates a function that invokes `func` with the arguments of the created
  15883. * function. If `func` is a property name, the created function returns the
  15884. * property value for a given element. If `func` is an array or object, the
  15885. * created function returns `true` for elements that contain the equivalent
  15886. * source properties, otherwise it returns `false`.
  15887. *
  15888. * @static
  15889. * @since 4.0.0
  15890. * @memberOf _
  15891. * @category Util
  15892. * @param {*} [func=_.identity] The value to convert to a callback.
  15893. * @returns {Function} Returns the callback.
  15894. * @example
  15895. *
  15896. * var users = [
  15897. * { 'user': 'barney', 'age': 36, 'active': true },
  15898. * { 'user': 'fred', 'age': 40, 'active': false }
  15899. * ];
  15900. *
  15901. * // The `_.matches` iteratee shorthand.
  15902. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15903. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15904. *
  15905. * // The `_.matchesProperty` iteratee shorthand.
  15906. * _.filter(users, _.iteratee(['user', 'fred']));
  15907. * // => [{ 'user': 'fred', 'age': 40 }]
  15908. *
  15909. * // The `_.property` iteratee shorthand.
  15910. * _.map(users, _.iteratee('user'));
  15911. * // => ['barney', 'fred']
  15912. *
  15913. * // Create custom iteratee shorthands.
  15914. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15915. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15916. * return func.test(string);
  15917. * };
  15918. * });
  15919. *
  15920. * _.filter(['abc', 'def'], /ef/);
  15921. * // => ['def']
  15922. */
  15923. function iteratee(func) {
  15924. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15925. }
  15926. /**
  15927. * Creates a function that performs a partial deep comparison between a given
  15928. * object and `source`, returning `true` if the given object has equivalent
  15929. * property values, else `false`.
  15930. *
  15931. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15932. * partially applied.
  15933. *
  15934. * Partial comparisons will match empty array and empty object `source`
  15935. * values against any array or object value, respectively. See `_.isEqual`
  15936. * for a list of supported value comparisons.
  15937. *
  15938. * **Note:** Multiple values can be checked by combining several matchers
  15939. * using `_.overSome`
  15940. *
  15941. * @static
  15942. * @memberOf _
  15943. * @since 3.0.0
  15944. * @category Util
  15945. * @param {Object} source The object of property values to match.
  15946. * @returns {Function} Returns the new spec function.
  15947. * @example
  15948. *
  15949. * var objects = [
  15950. * { 'a': 1, 'b': 2, 'c': 3 },
  15951. * { 'a': 4, 'b': 5, 'c': 6 }
  15952. * ];
  15953. *
  15954. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15955. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15956. *
  15957. * // Checking for several possible values
  15958. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15959. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15960. */
  15961. function matches(source) {
  15962. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15963. }
  15964. /**
  15965. * Creates a function that performs a partial deep comparison between the
  15966. * value at `path` of a given object to `srcValue`, returning `true` if the
  15967. * object value is equivalent, else `false`.
  15968. *
  15969. * **Note:** Partial comparisons will match empty array and empty object
  15970. * `srcValue` values against any array or object value, respectively. See
  15971. * `_.isEqual` for a list of supported value comparisons.
  15972. *
  15973. * **Note:** Multiple values can be checked by combining several matchers
  15974. * using `_.overSome`
  15975. *
  15976. * @static
  15977. * @memberOf _
  15978. * @since 3.2.0
  15979. * @category Util
  15980. * @param {Array|string} path The path of the property to get.
  15981. * @param {*} srcValue The value to match.
  15982. * @returns {Function} Returns the new spec function.
  15983. * @example
  15984. *
  15985. * var objects = [
  15986. * { 'a': 1, 'b': 2, 'c': 3 },
  15987. * { 'a': 4, 'b': 5, 'c': 6 }
  15988. * ];
  15989. *
  15990. * _.find(objects, _.matchesProperty('a', 4));
  15991. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15992. *
  15993. * // Checking for several possible values
  15994. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15995. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15996. */
  15997. function matchesProperty(path, srcValue) {
  15998. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15999. }
  16000. /**
  16001. * Creates a function that invokes the method at `path` of a given object.
  16002. * Any additional arguments are provided to the invoked method.
  16003. *
  16004. * @static
  16005. * @memberOf _
  16006. * @since 3.7.0
  16007. * @category Util
  16008. * @param {Array|string} path The path of the method to invoke.
  16009. * @param {...*} [args] The arguments to invoke the method with.
  16010. * @returns {Function} Returns the new invoker function.
  16011. * @example
  16012. *
  16013. * var objects = [
  16014. * { 'a': { 'b': _.constant(2) } },
  16015. * { 'a': { 'b': _.constant(1) } }
  16016. * ];
  16017. *
  16018. * _.map(objects, _.method('a.b'));
  16019. * // => [2, 1]
  16020. *
  16021. * _.map(objects, _.method(['a', 'b']));
  16022. * // => [2, 1]
  16023. */
  16024. var method = baseRest(function(path, args) {
  16025. return function(object) {
  16026. return baseInvoke(object, path, args);
  16027. };
  16028. });
  16029. /**
  16030. * The opposite of `_.method`; this method creates a function that invokes
  16031. * the method at a given path of `object`. Any additional arguments are
  16032. * provided to the invoked method.
  16033. *
  16034. * @static
  16035. * @memberOf _
  16036. * @since 3.7.0
  16037. * @category Util
  16038. * @param {Object} object The object to query.
  16039. * @param {...*} [args] The arguments to invoke the method with.
  16040. * @returns {Function} Returns the new invoker function.
  16041. * @example
  16042. *
  16043. * var array = _.times(3, _.constant),
  16044. * object = { 'a': array, 'b': array, 'c': array };
  16045. *
  16046. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16047. * // => [2, 0]
  16048. *
  16049. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16050. * // => [2, 0]
  16051. */
  16052. var methodOf = baseRest(function(object, args) {
  16053. return function(path) {
  16054. return baseInvoke(object, path, args);
  16055. };
  16056. });
  16057. /**
  16058. * Adds all own enumerable string keyed function properties of a source
  16059. * object to the destination object. If `object` is a function, then methods
  16060. * are added to its prototype as well.
  16061. *
  16062. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16063. * avoid conflicts caused by modifying the original.
  16064. *
  16065. * @static
  16066. * @since 0.1.0
  16067. * @memberOf _
  16068. * @category Util
  16069. * @param {Function|Object} [object=lodash] The destination object.
  16070. * @param {Object} source The object of functions to add.
  16071. * @param {Object} [options={}] The options object.
  16072. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16073. * @returns {Function|Object} Returns `object`.
  16074. * @example
  16075. *
  16076. * function vowels(string) {
  16077. * return _.filter(string, function(v) {
  16078. * return /[aeiou]/i.test(v);
  16079. * });
  16080. * }
  16081. *
  16082. * _.mixin({ 'vowels': vowels });
  16083. * _.vowels('fred');
  16084. * // => ['e']
  16085. *
  16086. * _('fred').vowels().value();
  16087. * // => ['e']
  16088. *
  16089. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16090. * _('fred').vowels();
  16091. * // => ['e']
  16092. */
  16093. function mixin(object, source, options) {
  16094. var props = keys(source),
  16095. methodNames = baseFunctions(source, props);
  16096. if (options == null &&
  16097. !(isObject(source) && (methodNames.length || !props.length))) {
  16098. options = source;
  16099. source = object;
  16100. object = this;
  16101. methodNames = baseFunctions(source, keys(source));
  16102. }
  16103. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16104. isFunc = isFunction(object);
  16105. arrayEach(methodNames, function(methodName) {
  16106. var func = source[methodName];
  16107. object[methodName] = func;
  16108. if (isFunc) {
  16109. object.prototype[methodName] = function() {
  16110. var chainAll = this.__chain__;
  16111. if (chain || chainAll) {
  16112. var result = object(this.__wrapped__),
  16113. actions = result.__actions__ = copyArray(this.__actions__);
  16114. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16115. result.__chain__ = chainAll;
  16116. return result;
  16117. }
  16118. return func.apply(object, arrayPush([this.value()], arguments));
  16119. };
  16120. }
  16121. });
  16122. return object;
  16123. }
  16124. /**
  16125. * Reverts the `_` variable to its previous value and returns a reference to
  16126. * the `lodash` function.
  16127. *
  16128. * @static
  16129. * @since 0.1.0
  16130. * @memberOf _
  16131. * @category Util
  16132. * @returns {Function} Returns the `lodash` function.
  16133. * @example
  16134. *
  16135. * var lodash = _.noConflict();
  16136. */
  16137. function noConflict() {
  16138. if (root._ === this) {
  16139. root._ = oldDash;
  16140. }
  16141. return this;
  16142. }
  16143. /**
  16144. * This method returns `undefined`.
  16145. *
  16146. * @static
  16147. * @memberOf _
  16148. * @since 2.3.0
  16149. * @category Util
  16150. * @example
  16151. *
  16152. * _.times(2, _.noop);
  16153. * // => [undefined, undefined]
  16154. */
  16155. function noop() {
  16156. // No operation performed.
  16157. }
  16158. /**
  16159. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16160. * the nth argument from the end is returned.
  16161. *
  16162. * @static
  16163. * @memberOf _
  16164. * @since 4.0.0
  16165. * @category Util
  16166. * @param {number} [n=0] The index of the argument to return.
  16167. * @returns {Function} Returns the new pass-thru function.
  16168. * @example
  16169. *
  16170. * var func = _.nthArg(1);
  16171. * func('a', 'b', 'c', 'd');
  16172. * // => 'b'
  16173. *
  16174. * var func = _.nthArg(-2);
  16175. * func('a', 'b', 'c', 'd');
  16176. * // => 'c'
  16177. */
  16178. function nthArg(n) {
  16179. n = toInteger(n);
  16180. return baseRest(function(args) {
  16181. return baseNth(args, n);
  16182. });
  16183. }
  16184. /**
  16185. * Creates a function that invokes `iteratees` with the arguments it receives
  16186. * and returns their results.
  16187. *
  16188. * @static
  16189. * @memberOf _
  16190. * @since 4.0.0
  16191. * @category Util
  16192. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16193. * The iteratees to invoke.
  16194. * @returns {Function} Returns the new function.
  16195. * @example
  16196. *
  16197. * var func = _.over([Math.max, Math.min]);
  16198. *
  16199. * func(1, 2, 3, 4);
  16200. * // => [4, 1]
  16201. */
  16202. var over = createOver(arrayMap);
  16203. /**
  16204. * Creates a function that checks if **all** of the `predicates` return
  16205. * truthy when invoked with the arguments it receives.
  16206. *
  16207. * Following shorthands are possible for providing predicates.
  16208. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16209. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16210. *
  16211. * @static
  16212. * @memberOf _
  16213. * @since 4.0.0
  16214. * @category Util
  16215. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16216. * The predicates to check.
  16217. * @returns {Function} Returns the new function.
  16218. * @example
  16219. *
  16220. * var func = _.overEvery([Boolean, isFinite]);
  16221. *
  16222. * func('1');
  16223. * // => true
  16224. *
  16225. * func(null);
  16226. * // => false
  16227. *
  16228. * func(NaN);
  16229. * // => false
  16230. */
  16231. var overEvery = createOver(arrayEvery);
  16232. /**
  16233. * Creates a function that checks if **any** of the `predicates` return
  16234. * truthy when invoked with the arguments it receives.
  16235. *
  16236. * Following shorthands are possible for providing predicates.
  16237. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16238. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16239. *
  16240. * @static
  16241. * @memberOf _
  16242. * @since 4.0.0
  16243. * @category Util
  16244. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16245. * The predicates to check.
  16246. * @returns {Function} Returns the new function.
  16247. * @example
  16248. *
  16249. * var func = _.overSome([Boolean, isFinite]);
  16250. *
  16251. * func('1');
  16252. * // => true
  16253. *
  16254. * func(null);
  16255. * // => true
  16256. *
  16257. * func(NaN);
  16258. * // => false
  16259. *
  16260. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16261. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16262. */
  16263. var overSome = createOver(arraySome);
  16264. /**
  16265. * Creates a function that returns the value at `path` of a given object.
  16266. *
  16267. * @static
  16268. * @memberOf _
  16269. * @since 2.4.0
  16270. * @category Util
  16271. * @param {Array|string} path The path of the property to get.
  16272. * @returns {Function} Returns the new accessor function.
  16273. * @example
  16274. *
  16275. * var objects = [
  16276. * { 'a': { 'b': 2 } },
  16277. * { 'a': { 'b': 1 } }
  16278. * ];
  16279. *
  16280. * _.map(objects, _.property('a.b'));
  16281. * // => [2, 1]
  16282. *
  16283. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16284. * // => [1, 2]
  16285. */
  16286. function property(path) {
  16287. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16288. }
  16289. /**
  16290. * The opposite of `_.property`; this method creates a function that returns
  16291. * the value at a given path of `object`.
  16292. *
  16293. * @static
  16294. * @memberOf _
  16295. * @since 3.0.0
  16296. * @category Util
  16297. * @param {Object} object The object to query.
  16298. * @returns {Function} Returns the new accessor function.
  16299. * @example
  16300. *
  16301. * var array = [0, 1, 2],
  16302. * object = { 'a': array, 'b': array, 'c': array };
  16303. *
  16304. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16305. * // => [2, 0]
  16306. *
  16307. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16308. * // => [2, 0]
  16309. */
  16310. function propertyOf(object) {
  16311. return function(path) {
  16312. return object == null ? undefined : baseGet(object, path);
  16313. };
  16314. }
  16315. /**
  16316. * Creates an array of numbers (positive and/or negative) progressing from
  16317. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16318. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16319. * it's set to `start` with `start` then set to `0`.
  16320. *
  16321. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16322. * floating-point values which can produce unexpected results.
  16323. *
  16324. * @static
  16325. * @since 0.1.0
  16326. * @memberOf _
  16327. * @category Util
  16328. * @param {number} [start=0] The start of the range.
  16329. * @param {number} end The end of the range.
  16330. * @param {number} [step=1] The value to increment or decrement by.
  16331. * @returns {Array} Returns the range of numbers.
  16332. * @see _.inRange, _.rangeRight
  16333. * @example
  16334. *
  16335. * _.range(4);
  16336. * // => [0, 1, 2, 3]
  16337. *
  16338. * _.range(-4);
  16339. * // => [0, -1, -2, -3]
  16340. *
  16341. * _.range(1, 5);
  16342. * // => [1, 2, 3, 4]
  16343. *
  16344. * _.range(0, 20, 5);
  16345. * // => [0, 5, 10, 15]
  16346. *
  16347. * _.range(0, -4, -1);
  16348. * // => [0, -1, -2, -3]
  16349. *
  16350. * _.range(1, 4, 0);
  16351. * // => [1, 1, 1]
  16352. *
  16353. * _.range(0);
  16354. * // => []
  16355. */
  16356. var range = createRange();
  16357. /**
  16358. * This method is like `_.range` except that it populates values in
  16359. * descending order.
  16360. *
  16361. * @static
  16362. * @memberOf _
  16363. * @since 4.0.0
  16364. * @category Util
  16365. * @param {number} [start=0] The start of the range.
  16366. * @param {number} end The end of the range.
  16367. * @param {number} [step=1] The value to increment or decrement by.
  16368. * @returns {Array} Returns the range of numbers.
  16369. * @see _.inRange, _.range
  16370. * @example
  16371. *
  16372. * _.rangeRight(4);
  16373. * // => [3, 2, 1, 0]
  16374. *
  16375. * _.rangeRight(-4);
  16376. * // => [-3, -2, -1, 0]
  16377. *
  16378. * _.rangeRight(1, 5);
  16379. * // => [4, 3, 2, 1]
  16380. *
  16381. * _.rangeRight(0, 20, 5);
  16382. * // => [15, 10, 5, 0]
  16383. *
  16384. * _.rangeRight(0, -4, -1);
  16385. * // => [-3, -2, -1, 0]
  16386. *
  16387. * _.rangeRight(1, 4, 0);
  16388. * // => [1, 1, 1]
  16389. *
  16390. * _.rangeRight(0);
  16391. * // => []
  16392. */
  16393. var rangeRight = createRange(true);
  16394. /**
  16395. * This method returns a new empty array.
  16396. *
  16397. * @static
  16398. * @memberOf _
  16399. * @since 4.13.0
  16400. * @category Util
  16401. * @returns {Array} Returns the new empty array.
  16402. * @example
  16403. *
  16404. * var arrays = _.times(2, _.stubArray);
  16405. *
  16406. * console.log(arrays);
  16407. * // => [[], []]
  16408. *
  16409. * console.log(arrays[0] === arrays[1]);
  16410. * // => false
  16411. */
  16412. function stubArray() {
  16413. return [];
  16414. }
  16415. /**
  16416. * This method returns `false`.
  16417. *
  16418. * @static
  16419. * @memberOf _
  16420. * @since 4.13.0
  16421. * @category Util
  16422. * @returns {boolean} Returns `false`.
  16423. * @example
  16424. *
  16425. * _.times(2, _.stubFalse);
  16426. * // => [false, false]
  16427. */
  16428. function stubFalse() {
  16429. return false;
  16430. }
  16431. /**
  16432. * This method returns a new empty object.
  16433. *
  16434. * @static
  16435. * @memberOf _
  16436. * @since 4.13.0
  16437. * @category Util
  16438. * @returns {Object} Returns the new empty object.
  16439. * @example
  16440. *
  16441. * var objects = _.times(2, _.stubObject);
  16442. *
  16443. * console.log(objects);
  16444. * // => [{}, {}]
  16445. *
  16446. * console.log(objects[0] === objects[1]);
  16447. * // => false
  16448. */
  16449. function stubObject() {
  16450. return {};
  16451. }
  16452. /**
  16453. * This method returns an empty string.
  16454. *
  16455. * @static
  16456. * @memberOf _
  16457. * @since 4.13.0
  16458. * @category Util
  16459. * @returns {string} Returns the empty string.
  16460. * @example
  16461. *
  16462. * _.times(2, _.stubString);
  16463. * // => ['', '']
  16464. */
  16465. function stubString() {
  16466. return '';
  16467. }
  16468. /**
  16469. * This method returns `true`.
  16470. *
  16471. * @static
  16472. * @memberOf _
  16473. * @since 4.13.0
  16474. * @category Util
  16475. * @returns {boolean} Returns `true`.
  16476. * @example
  16477. *
  16478. * _.times(2, _.stubTrue);
  16479. * // => [true, true]
  16480. */
  16481. function stubTrue() {
  16482. return true;
  16483. }
  16484. /**
  16485. * Invokes the iteratee `n` times, returning an array of the results of
  16486. * each invocation. The iteratee is invoked with one argument; (index).
  16487. *
  16488. * @static
  16489. * @since 0.1.0
  16490. * @memberOf _
  16491. * @category Util
  16492. * @param {number} n The number of times to invoke `iteratee`.
  16493. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16494. * @returns {Array} Returns the array of results.
  16495. * @example
  16496. *
  16497. * _.times(3, String);
  16498. * // => ['0', '1', '2']
  16499. *
  16500. * _.times(4, _.constant(0));
  16501. * // => [0, 0, 0, 0]
  16502. */
  16503. function times(n, iteratee) {
  16504. n = toInteger(n);
  16505. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16506. return [];
  16507. }
  16508. var index = MAX_ARRAY_LENGTH,
  16509. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16510. iteratee = getIteratee(iteratee);
  16511. n -= MAX_ARRAY_LENGTH;
  16512. var result = baseTimes(length, iteratee);
  16513. while (++index < n) {
  16514. iteratee(index);
  16515. }
  16516. return result;
  16517. }
  16518. /**
  16519. * Converts `value` to a property path array.
  16520. *
  16521. * @static
  16522. * @memberOf _
  16523. * @since 4.0.0
  16524. * @category Util
  16525. * @param {*} value The value to convert.
  16526. * @returns {Array} Returns the new property path array.
  16527. * @example
  16528. *
  16529. * _.toPath('a.b.c');
  16530. * // => ['a', 'b', 'c']
  16531. *
  16532. * _.toPath('a[0].b.c');
  16533. * // => ['a', '0', 'b', 'c']
  16534. */
  16535. function toPath(value) {
  16536. if (isArray(value)) {
  16537. return arrayMap(value, toKey);
  16538. }
  16539. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16540. }
  16541. /**
  16542. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16543. *
  16544. * @static
  16545. * @since 0.1.0
  16546. * @memberOf _
  16547. * @category Util
  16548. * @param {string} [prefix=''] The value to prefix the ID with.
  16549. * @returns {string} Returns the unique ID.
  16550. * @example
  16551. *
  16552. * _.uniqueId('contact_');
  16553. * // => 'contact_104'
  16554. *
  16555. * _.uniqueId();
  16556. * // => '105'
  16557. */
  16558. function uniqueId(prefix) {
  16559. var id = ++idCounter;
  16560. return toString(prefix) + id;
  16561. }
  16562. /*------------------------------------------------------------------------*/
  16563. /**
  16564. * Adds two numbers.
  16565. *
  16566. * @static
  16567. * @memberOf _
  16568. * @since 3.4.0
  16569. * @category Math
  16570. * @param {number} augend The first number in an addition.
  16571. * @param {number} addend The second number in an addition.
  16572. * @returns {number} Returns the total.
  16573. * @example
  16574. *
  16575. * _.add(6, 4);
  16576. * // => 10
  16577. */
  16578. var add = createMathOperation(function(augend, addend) {
  16579. return augend + addend;
  16580. }, 0);
  16581. /**
  16582. * Computes `number` rounded up to `precision`.
  16583. *
  16584. * @static
  16585. * @memberOf _
  16586. * @since 3.10.0
  16587. * @category Math
  16588. * @param {number} number The number to round up.
  16589. * @param {number} [precision=0] The precision to round up to.
  16590. * @returns {number} Returns the rounded up number.
  16591. * @example
  16592. *
  16593. * _.ceil(4.006);
  16594. * // => 5
  16595. *
  16596. * _.ceil(6.004, 2);
  16597. * // => 6.01
  16598. *
  16599. * _.ceil(6040, -2);
  16600. * // => 6100
  16601. */
  16602. var ceil = createRound('ceil');
  16603. /**
  16604. * Divide two numbers.
  16605. *
  16606. * @static
  16607. * @memberOf _
  16608. * @since 4.7.0
  16609. * @category Math
  16610. * @param {number} dividend The first number in a division.
  16611. * @param {number} divisor The second number in a division.
  16612. * @returns {number} Returns the quotient.
  16613. * @example
  16614. *
  16615. * _.divide(6, 4);
  16616. * // => 1.5
  16617. */
  16618. var divide = createMathOperation(function(dividend, divisor) {
  16619. return dividend / divisor;
  16620. }, 1);
  16621. /**
  16622. * Computes `number` rounded down to `precision`.
  16623. *
  16624. * @static
  16625. * @memberOf _
  16626. * @since 3.10.0
  16627. * @category Math
  16628. * @param {number} number The number to round down.
  16629. * @param {number} [precision=0] The precision to round down to.
  16630. * @returns {number} Returns the rounded down number.
  16631. * @example
  16632. *
  16633. * _.floor(4.006);
  16634. * // => 4
  16635. *
  16636. * _.floor(0.046, 2);
  16637. * // => 0.04
  16638. *
  16639. * _.floor(4060, -2);
  16640. * // => 4000
  16641. */
  16642. var floor = createRound('floor');
  16643. /**
  16644. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16645. * `undefined` is returned.
  16646. *
  16647. * @static
  16648. * @since 0.1.0
  16649. * @memberOf _
  16650. * @category Math
  16651. * @param {Array} array The array to iterate over.
  16652. * @returns {*} Returns the maximum value.
  16653. * @example
  16654. *
  16655. * _.max([4, 2, 8, 6]);
  16656. * // => 8
  16657. *
  16658. * _.max([]);
  16659. * // => undefined
  16660. */
  16661. function max(array) {
  16662. return (array && array.length)
  16663. ? baseExtremum(array, identity, baseGt)
  16664. : undefined;
  16665. }
  16666. /**
  16667. * This method is like `_.max` except that it accepts `iteratee` which is
  16668. * invoked for each element in `array` to generate the criterion by which
  16669. * the value is ranked. The iteratee is invoked with one argument: (value).
  16670. *
  16671. * @static
  16672. * @memberOf _
  16673. * @since 4.0.0
  16674. * @category Math
  16675. * @param {Array} array The array to iterate over.
  16676. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16677. * @returns {*} Returns the maximum value.
  16678. * @example
  16679. *
  16680. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16681. *
  16682. * _.maxBy(objects, function(o) { return o.n; });
  16683. * // => { 'n': 2 }
  16684. *
  16685. * // The `_.property` iteratee shorthand.
  16686. * _.maxBy(objects, 'n');
  16687. * // => { 'n': 2 }
  16688. */
  16689. function maxBy(array, iteratee) {
  16690. return (array && array.length)
  16691. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16692. : undefined;
  16693. }
  16694. /**
  16695. * Computes the mean of the values in `array`.
  16696. *
  16697. * @static
  16698. * @memberOf _
  16699. * @since 4.0.0
  16700. * @category Math
  16701. * @param {Array} array The array to iterate over.
  16702. * @returns {number} Returns the mean.
  16703. * @example
  16704. *
  16705. * _.mean([4, 2, 8, 6]);
  16706. * // => 5
  16707. */
  16708. function mean(array) {
  16709. return baseMean(array, identity);
  16710. }
  16711. /**
  16712. * This method is like `_.mean` except that it accepts `iteratee` which is
  16713. * invoked for each element in `array` to generate the value to be averaged.
  16714. * The iteratee is invoked with one argument: (value).
  16715. *
  16716. * @static
  16717. * @memberOf _
  16718. * @since 4.7.0
  16719. * @category Math
  16720. * @param {Array} array The array to iterate over.
  16721. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16722. * @returns {number} Returns the mean.
  16723. * @example
  16724. *
  16725. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16726. *
  16727. * _.meanBy(objects, function(o) { return o.n; });
  16728. * // => 5
  16729. *
  16730. * // The `_.property` iteratee shorthand.
  16731. * _.meanBy(objects, 'n');
  16732. * // => 5
  16733. */
  16734. function meanBy(array, iteratee) {
  16735. return baseMean(array, getIteratee(iteratee, 2));
  16736. }
  16737. /**
  16738. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16739. * `undefined` is returned.
  16740. *
  16741. * @static
  16742. * @since 0.1.0
  16743. * @memberOf _
  16744. * @category Math
  16745. * @param {Array} array The array to iterate over.
  16746. * @returns {*} Returns the minimum value.
  16747. * @example
  16748. *
  16749. * _.min([4, 2, 8, 6]);
  16750. * // => 2
  16751. *
  16752. * _.min([]);
  16753. * // => undefined
  16754. */
  16755. function min(array) {
  16756. return (array && array.length)
  16757. ? baseExtremum(array, identity, baseLt)
  16758. : undefined;
  16759. }
  16760. /**
  16761. * This method is like `_.min` except that it accepts `iteratee` which is
  16762. * invoked for each element in `array` to generate the criterion by which
  16763. * the value is ranked. The iteratee is invoked with one argument: (value).
  16764. *
  16765. * @static
  16766. * @memberOf _
  16767. * @since 4.0.0
  16768. * @category Math
  16769. * @param {Array} array The array to iterate over.
  16770. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16771. * @returns {*} Returns the minimum value.
  16772. * @example
  16773. *
  16774. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16775. *
  16776. * _.minBy(objects, function(o) { return o.n; });
  16777. * // => { 'n': 1 }
  16778. *
  16779. * // The `_.property` iteratee shorthand.
  16780. * _.minBy(objects, 'n');
  16781. * // => { 'n': 1 }
  16782. */
  16783. function minBy(array, iteratee) {
  16784. return (array && array.length)
  16785. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16786. : undefined;
  16787. }
  16788. /**
  16789. * Multiply two numbers.
  16790. *
  16791. * @static
  16792. * @memberOf _
  16793. * @since 4.7.0
  16794. * @category Math
  16795. * @param {number} multiplier The first number in a multiplication.
  16796. * @param {number} multiplicand The second number in a multiplication.
  16797. * @returns {number} Returns the product.
  16798. * @example
  16799. *
  16800. * _.multiply(6, 4);
  16801. * // => 24
  16802. */
  16803. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16804. return multiplier * multiplicand;
  16805. }, 1);
  16806. /**
  16807. * Computes `number` rounded to `precision`.
  16808. *
  16809. * @static
  16810. * @memberOf _
  16811. * @since 3.10.0
  16812. * @category Math
  16813. * @param {number} number The number to round.
  16814. * @param {number} [precision=0] The precision to round to.
  16815. * @returns {number} Returns the rounded number.
  16816. * @example
  16817. *
  16818. * _.round(4.006);
  16819. * // => 4
  16820. *
  16821. * _.round(4.006, 2);
  16822. * // => 4.01
  16823. *
  16824. * _.round(4060, -2);
  16825. * // => 4100
  16826. */
  16827. var round = createRound('round');
  16828. /**
  16829. * Subtract two numbers.
  16830. *
  16831. * @static
  16832. * @memberOf _
  16833. * @since 4.0.0
  16834. * @category Math
  16835. * @param {number} minuend The first number in a subtraction.
  16836. * @param {number} subtrahend The second number in a subtraction.
  16837. * @returns {number} Returns the difference.
  16838. * @example
  16839. *
  16840. * _.subtract(6, 4);
  16841. * // => 2
  16842. */
  16843. var subtract = createMathOperation(function(minuend, subtrahend) {
  16844. return minuend - subtrahend;
  16845. }, 0);
  16846. /**
  16847. * Computes the sum of the values in `array`.
  16848. *
  16849. * @static
  16850. * @memberOf _
  16851. * @since 3.4.0
  16852. * @category Math
  16853. * @param {Array} array The array to iterate over.
  16854. * @returns {number} Returns the sum.
  16855. * @example
  16856. *
  16857. * _.sum([4, 2, 8, 6]);
  16858. * // => 20
  16859. */
  16860. function sum(array) {
  16861. return (array && array.length)
  16862. ? baseSum(array, identity)
  16863. : 0;
  16864. }
  16865. /**
  16866. * This method is like `_.sum` except that it accepts `iteratee` which is
  16867. * invoked for each element in `array` to generate the value to be summed.
  16868. * The iteratee is invoked with one argument: (value).
  16869. *
  16870. * @static
  16871. * @memberOf _
  16872. * @since 4.0.0
  16873. * @category Math
  16874. * @param {Array} array The array to iterate over.
  16875. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16876. * @returns {number} Returns the sum.
  16877. * @example
  16878. *
  16879. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16880. *
  16881. * _.sumBy(objects, function(o) { return o.n; });
  16882. * // => 20
  16883. *
  16884. * // The `_.property` iteratee shorthand.
  16885. * _.sumBy(objects, 'n');
  16886. * // => 20
  16887. */
  16888. function sumBy(array, iteratee) {
  16889. return (array && array.length)
  16890. ? baseSum(array, getIteratee(iteratee, 2))
  16891. : 0;
  16892. }
  16893. /*------------------------------------------------------------------------*/
  16894. // Add methods that return wrapped values in chain sequences.
  16895. lodash.after = after;
  16896. lodash.ary = ary;
  16897. lodash.assign = assign;
  16898. lodash.assignIn = assignIn;
  16899. lodash.assignInWith = assignInWith;
  16900. lodash.assignWith = assignWith;
  16901. lodash.at = at;
  16902. lodash.before = before;
  16903. lodash.bind = bind;
  16904. lodash.bindAll = bindAll;
  16905. lodash.bindKey = bindKey;
  16906. lodash.castArray = castArray;
  16907. lodash.chain = chain;
  16908. lodash.chunk = chunk;
  16909. lodash.compact = compact;
  16910. lodash.concat = concat;
  16911. lodash.cond = cond;
  16912. lodash.conforms = conforms;
  16913. lodash.constant = constant;
  16914. lodash.countBy = countBy;
  16915. lodash.create = create;
  16916. lodash.curry = curry;
  16917. lodash.curryRight = curryRight;
  16918. lodash.debounce = debounce;
  16919. lodash.defaults = defaults;
  16920. lodash.defaultsDeep = defaultsDeep;
  16921. lodash.defer = defer;
  16922. lodash.delay = delay;
  16923. lodash.difference = difference;
  16924. lodash.differenceBy = differenceBy;
  16925. lodash.differenceWith = differenceWith;
  16926. lodash.drop = drop;
  16927. lodash.dropRight = dropRight;
  16928. lodash.dropRightWhile = dropRightWhile;
  16929. lodash.dropWhile = dropWhile;
  16930. lodash.fill = fill;
  16931. lodash.filter = filter;
  16932. lodash.flatMap = flatMap;
  16933. lodash.flatMapDeep = flatMapDeep;
  16934. lodash.flatMapDepth = flatMapDepth;
  16935. lodash.flatten = flatten;
  16936. lodash.flattenDeep = flattenDeep;
  16937. lodash.flattenDepth = flattenDepth;
  16938. lodash.flip = flip;
  16939. lodash.flow = flow;
  16940. lodash.flowRight = flowRight;
  16941. lodash.fromPairs = fromPairs;
  16942. lodash.functions = functions;
  16943. lodash.functionsIn = functionsIn;
  16944. lodash.groupBy = groupBy;
  16945. lodash.initial = initial;
  16946. lodash.intersection = intersection;
  16947. lodash.intersectionBy = intersectionBy;
  16948. lodash.intersectionWith = intersectionWith;
  16949. lodash.invert = invert;
  16950. lodash.invertBy = invertBy;
  16951. lodash.invokeMap = invokeMap;
  16952. lodash.iteratee = iteratee;
  16953. lodash.keyBy = keyBy;
  16954. lodash.keys = keys;
  16955. lodash.keysIn = keysIn;
  16956. lodash.map = map;
  16957. lodash.mapKeys = mapKeys;
  16958. lodash.mapValues = mapValues;
  16959. lodash.matches = matches;
  16960. lodash.matchesProperty = matchesProperty;
  16961. lodash.memoize = memoize;
  16962. lodash.merge = merge;
  16963. lodash.mergeWith = mergeWith;
  16964. lodash.method = method;
  16965. lodash.methodOf = methodOf;
  16966. lodash.mixin = mixin;
  16967. lodash.negate = negate;
  16968. lodash.nthArg = nthArg;
  16969. lodash.omit = omit;
  16970. lodash.omitBy = omitBy;
  16971. lodash.once = once;
  16972. lodash.orderBy = orderBy;
  16973. lodash.over = over;
  16974. lodash.overArgs = overArgs;
  16975. lodash.overEvery = overEvery;
  16976. lodash.overSome = overSome;
  16977. lodash.partial = partial;
  16978. lodash.partialRight = partialRight;
  16979. lodash.partition = partition;
  16980. lodash.pick = pick;
  16981. lodash.pickBy = pickBy;
  16982. lodash.property = property;
  16983. lodash.propertyOf = propertyOf;
  16984. lodash.pull = pull;
  16985. lodash.pullAll = pullAll;
  16986. lodash.pullAllBy = pullAllBy;
  16987. lodash.pullAllWith = pullAllWith;
  16988. lodash.pullAt = pullAt;
  16989. lodash.range = range;
  16990. lodash.rangeRight = rangeRight;
  16991. lodash.rearg = rearg;
  16992. lodash.reject = reject;
  16993. lodash.remove = remove;
  16994. lodash.rest = rest;
  16995. lodash.reverse = reverse;
  16996. lodash.sampleSize = sampleSize;
  16997. lodash.set = set;
  16998. lodash.setWith = setWith;
  16999. lodash.shuffle = shuffle;
  17000. lodash.slice = slice;
  17001. lodash.sortBy = sortBy;
  17002. lodash.sortedUniq = sortedUniq;
  17003. lodash.sortedUniqBy = sortedUniqBy;
  17004. lodash.split = split;
  17005. lodash.spread = spread;
  17006. lodash.tail = tail;
  17007. lodash.take = take;
  17008. lodash.takeRight = takeRight;
  17009. lodash.takeRightWhile = takeRightWhile;
  17010. lodash.takeWhile = takeWhile;
  17011. lodash.tap = tap;
  17012. lodash.throttle = throttle;
  17013. lodash.thru = thru;
  17014. lodash.toArray = toArray;
  17015. lodash.toPairs = toPairs;
  17016. lodash.toPairsIn = toPairsIn;
  17017. lodash.toPath = toPath;
  17018. lodash.toPlainObject = toPlainObject;
  17019. lodash.transform = transform;
  17020. lodash.unary = unary;
  17021. lodash.union = union;
  17022. lodash.unionBy = unionBy;
  17023. lodash.unionWith = unionWith;
  17024. lodash.uniq = uniq;
  17025. lodash.uniqBy = uniqBy;
  17026. lodash.uniqWith = uniqWith;
  17027. lodash.unset = unset;
  17028. lodash.unzip = unzip;
  17029. lodash.unzipWith = unzipWith;
  17030. lodash.update = update;
  17031. lodash.updateWith = updateWith;
  17032. lodash.values = values;
  17033. lodash.valuesIn = valuesIn;
  17034. lodash.without = without;
  17035. lodash.words = words;
  17036. lodash.wrap = wrap;
  17037. lodash.xor = xor;
  17038. lodash.xorBy = xorBy;
  17039. lodash.xorWith = xorWith;
  17040. lodash.zip = zip;
  17041. lodash.zipObject = zipObject;
  17042. lodash.zipObjectDeep = zipObjectDeep;
  17043. lodash.zipWith = zipWith;
  17044. // Add aliases.
  17045. lodash.entries = toPairs;
  17046. lodash.entriesIn = toPairsIn;
  17047. lodash.extend = assignIn;
  17048. lodash.extendWith = assignInWith;
  17049. // Add methods to `lodash.prototype`.
  17050. mixin(lodash, lodash);
  17051. /*------------------------------------------------------------------------*/
  17052. // Add methods that return unwrapped values in chain sequences.
  17053. lodash.add = add;
  17054. lodash.attempt = attempt;
  17055. lodash.camelCase = camelCase;
  17056. lodash.capitalize = capitalize;
  17057. lodash.ceil = ceil;
  17058. lodash.clamp = clamp;
  17059. lodash.clone = clone;
  17060. lodash.cloneDeep = cloneDeep;
  17061. lodash.cloneDeepWith = cloneDeepWith;
  17062. lodash.cloneWith = cloneWith;
  17063. lodash.conformsTo = conformsTo;
  17064. lodash.deburr = deburr;
  17065. lodash.defaultTo = defaultTo;
  17066. lodash.divide = divide;
  17067. lodash.endsWith = endsWith;
  17068. lodash.eq = eq;
  17069. lodash.escape = escape;
  17070. lodash.escapeRegExp = escapeRegExp;
  17071. lodash.every = every;
  17072. lodash.find = find;
  17073. lodash.findIndex = findIndex;
  17074. lodash.findKey = findKey;
  17075. lodash.findLast = findLast;
  17076. lodash.findLastIndex = findLastIndex;
  17077. lodash.findLastKey = findLastKey;
  17078. lodash.floor = floor;
  17079. lodash.forEach = forEach;
  17080. lodash.forEachRight = forEachRight;
  17081. lodash.forIn = forIn;
  17082. lodash.forInRight = forInRight;
  17083. lodash.forOwn = forOwn;
  17084. lodash.forOwnRight = forOwnRight;
  17085. lodash.get = get;
  17086. lodash.gt = gt;
  17087. lodash.gte = gte;
  17088. lodash.has = has;
  17089. lodash.hasIn = hasIn;
  17090. lodash.head = head;
  17091. lodash.identity = identity;
  17092. lodash.includes = includes;
  17093. lodash.indexOf = indexOf;
  17094. lodash.inRange = inRange;
  17095. lodash.invoke = invoke;
  17096. lodash.isArguments = isArguments;
  17097. lodash.isArray = isArray;
  17098. lodash.isArrayBuffer = isArrayBuffer;
  17099. lodash.isArrayLike = isArrayLike;
  17100. lodash.isArrayLikeObject = isArrayLikeObject;
  17101. lodash.isBoolean = isBoolean;
  17102. lodash.isBuffer = isBuffer;
  17103. lodash.isDate = isDate;
  17104. lodash.isElement = isElement;
  17105. lodash.isEmpty = isEmpty;
  17106. lodash.isEqual = isEqual;
  17107. lodash.isEqualWith = isEqualWith;
  17108. lodash.isError = isError;
  17109. lodash.isFinite = isFinite;
  17110. lodash.isFunction = isFunction;
  17111. lodash.isInteger = isInteger;
  17112. lodash.isLength = isLength;
  17113. lodash.isMap = isMap;
  17114. lodash.isMatch = isMatch;
  17115. lodash.isMatchWith = isMatchWith;
  17116. lodash.isNaN = isNaN;
  17117. lodash.isNative = isNative;
  17118. lodash.isNil = isNil;
  17119. lodash.isNull = isNull;
  17120. lodash.isNumber = isNumber;
  17121. lodash.isObject = isObject;
  17122. lodash.isObjectLike = isObjectLike;
  17123. lodash.isPlainObject = isPlainObject;
  17124. lodash.isRegExp = isRegExp;
  17125. lodash.isSafeInteger = isSafeInteger;
  17126. lodash.isSet = isSet;
  17127. lodash.isString = isString;
  17128. lodash.isSymbol = isSymbol;
  17129. lodash.isTypedArray = isTypedArray;
  17130. lodash.isUndefined = isUndefined;
  17131. lodash.isWeakMap = isWeakMap;
  17132. lodash.isWeakSet = isWeakSet;
  17133. lodash.join = join;
  17134. lodash.kebabCase = kebabCase;
  17135. lodash.last = last;
  17136. lodash.lastIndexOf = lastIndexOf;
  17137. lodash.lowerCase = lowerCase;
  17138. lodash.lowerFirst = lowerFirst;
  17139. lodash.lt = lt;
  17140. lodash.lte = lte;
  17141. lodash.max = max;
  17142. lodash.maxBy = maxBy;
  17143. lodash.mean = mean;
  17144. lodash.meanBy = meanBy;
  17145. lodash.min = min;
  17146. lodash.minBy = minBy;
  17147. lodash.stubArray = stubArray;
  17148. lodash.stubFalse = stubFalse;
  17149. lodash.stubObject = stubObject;
  17150. lodash.stubString = stubString;
  17151. lodash.stubTrue = stubTrue;
  17152. lodash.multiply = multiply;
  17153. lodash.nth = nth;
  17154. lodash.noConflict = noConflict;
  17155. lodash.noop = noop;
  17156. lodash.now = now;
  17157. lodash.pad = pad;
  17158. lodash.padEnd = padEnd;
  17159. lodash.padStart = padStart;
  17160. lodash.parseInt = parseInt;
  17161. lodash.random = random;
  17162. lodash.reduce = reduce;
  17163. lodash.reduceRight = reduceRight;
  17164. lodash.repeat = repeat;
  17165. lodash.replace = replace;
  17166. lodash.result = result;
  17167. lodash.round = round;
  17168. lodash.runInContext = runInContext;
  17169. lodash.sample = sample;
  17170. lodash.size = size;
  17171. lodash.snakeCase = snakeCase;
  17172. lodash.some = some;
  17173. lodash.sortedIndex = sortedIndex;
  17174. lodash.sortedIndexBy = sortedIndexBy;
  17175. lodash.sortedIndexOf = sortedIndexOf;
  17176. lodash.sortedLastIndex = sortedLastIndex;
  17177. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17178. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17179. lodash.startCase = startCase;
  17180. lodash.startsWith = startsWith;
  17181. lodash.subtract = subtract;
  17182. lodash.sum = sum;
  17183. lodash.sumBy = sumBy;
  17184. lodash.template = template;
  17185. lodash.times = times;
  17186. lodash.toFinite = toFinite;
  17187. lodash.toInteger = toInteger;
  17188. lodash.toLength = toLength;
  17189. lodash.toLower = toLower;
  17190. lodash.toNumber = toNumber;
  17191. lodash.toSafeInteger = toSafeInteger;
  17192. lodash.toString = toString;
  17193. lodash.toUpper = toUpper;
  17194. lodash.trim = trim;
  17195. lodash.trimEnd = trimEnd;
  17196. lodash.trimStart = trimStart;
  17197. lodash.truncate = truncate;
  17198. lodash.unescape = unescape;
  17199. lodash.uniqueId = uniqueId;
  17200. lodash.upperCase = upperCase;
  17201. lodash.upperFirst = upperFirst;
  17202. // Add aliases.
  17203. lodash.each = forEach;
  17204. lodash.eachRight = forEachRight;
  17205. lodash.first = head;
  17206. mixin(lodash, (function() {
  17207. var source = {};
  17208. baseForOwn(lodash, function(func, methodName) {
  17209. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17210. source[methodName] = func;
  17211. }
  17212. });
  17213. return source;
  17214. }()), { 'chain': false });
  17215. /*------------------------------------------------------------------------*/
  17216. /**
  17217. * The semantic version number.
  17218. *
  17219. * @static
  17220. * @memberOf _
  17221. * @type {string}
  17222. */
  17223. lodash.VERSION = VERSION;
  17224. // Assign default placeholders.
  17225. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17226. lodash[methodName].placeholder = lodash;
  17227. });
  17228. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17229. arrayEach(['drop', 'take'], function(methodName, index) {
  17230. LazyWrapper.prototype[methodName] = function(n) {
  17231. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17232. var result = (this.__filtered__ && !index)
  17233. ? new LazyWrapper(this)
  17234. : this.clone();
  17235. if (result.__filtered__) {
  17236. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17237. } else {
  17238. result.__views__.push({
  17239. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17240. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17241. });
  17242. }
  17243. return result;
  17244. };
  17245. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17246. return this.reverse()[methodName](n).reverse();
  17247. };
  17248. });
  17249. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17250. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17251. var type = index + 1,
  17252. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17253. LazyWrapper.prototype[methodName] = function(iteratee) {
  17254. var result = this.clone();
  17255. result.__iteratees__.push({
  17256. 'iteratee': getIteratee(iteratee, 3),
  17257. 'type': type
  17258. });
  17259. result.__filtered__ = result.__filtered__ || isFilter;
  17260. return result;
  17261. };
  17262. });
  17263. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17264. arrayEach(['head', 'last'], function(methodName, index) {
  17265. var takeName = 'take' + (index ? 'Right' : '');
  17266. LazyWrapper.prototype[methodName] = function() {
  17267. return this[takeName](1).value()[0];
  17268. };
  17269. });
  17270. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17271. arrayEach(['initial', 'tail'], function(methodName, index) {
  17272. var dropName = 'drop' + (index ? '' : 'Right');
  17273. LazyWrapper.prototype[methodName] = function() {
  17274. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17275. };
  17276. });
  17277. LazyWrapper.prototype.compact = function() {
  17278. return this.filter(identity);
  17279. };
  17280. LazyWrapper.prototype.find = function(predicate) {
  17281. return this.filter(predicate).head();
  17282. };
  17283. LazyWrapper.prototype.findLast = function(predicate) {
  17284. return this.reverse().find(predicate);
  17285. };
  17286. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17287. if (typeof path == 'function') {
  17288. return new LazyWrapper(this);
  17289. }
  17290. return this.map(function(value) {
  17291. return baseInvoke(value, path, args);
  17292. });
  17293. });
  17294. LazyWrapper.prototype.reject = function(predicate) {
  17295. return this.filter(negate(getIteratee(predicate)));
  17296. };
  17297. LazyWrapper.prototype.slice = function(start, end) {
  17298. start = toInteger(start);
  17299. var result = this;
  17300. if (result.__filtered__ && (start > 0 || end < 0)) {
  17301. return new LazyWrapper(result);
  17302. }
  17303. if (start < 0) {
  17304. result = result.takeRight(-start);
  17305. } else if (start) {
  17306. result = result.drop(start);
  17307. }
  17308. if (end !== undefined) {
  17309. end = toInteger(end);
  17310. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17311. }
  17312. return result;
  17313. };
  17314. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17315. return this.reverse().takeWhile(predicate).reverse();
  17316. };
  17317. LazyWrapper.prototype.toArray = function() {
  17318. return this.take(MAX_ARRAY_LENGTH);
  17319. };
  17320. // Add `LazyWrapper` methods to `lodash.prototype`.
  17321. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17322. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17323. isTaker = /^(?:head|last)$/.test(methodName),
  17324. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17325. retUnwrapped = isTaker || /^find/.test(methodName);
  17326. if (!lodashFunc) {
  17327. return;
  17328. }
  17329. lodash.prototype[methodName] = function() {
  17330. var value = this.__wrapped__,
  17331. args = isTaker ? [1] : arguments,
  17332. isLazy = value instanceof LazyWrapper,
  17333. iteratee = args[0],
  17334. useLazy = isLazy || isArray(value);
  17335. var interceptor = function(value) {
  17336. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17337. return (isTaker && chainAll) ? result[0] : result;
  17338. };
  17339. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17340. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17341. isLazy = useLazy = false;
  17342. }
  17343. var chainAll = this.__chain__,
  17344. isHybrid = !!this.__actions__.length,
  17345. isUnwrapped = retUnwrapped && !chainAll,
  17346. onlyLazy = isLazy && !isHybrid;
  17347. if (!retUnwrapped && useLazy) {
  17348. value = onlyLazy ? value : new LazyWrapper(this);
  17349. var result = func.apply(value, args);
  17350. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17351. return new LodashWrapper(result, chainAll);
  17352. }
  17353. if (isUnwrapped && onlyLazy) {
  17354. return func.apply(this, args);
  17355. }
  17356. result = this.thru(interceptor);
  17357. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17358. };
  17359. });
  17360. // Add `Array` methods to `lodash.prototype`.
  17361. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17362. var func = arrayProto[methodName],
  17363. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17364. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17365. lodash.prototype[methodName] = function() {
  17366. var args = arguments;
  17367. if (retUnwrapped && !this.__chain__) {
  17368. var value = this.value();
  17369. return func.apply(isArray(value) ? value : [], args);
  17370. }
  17371. return this[chainName](function(value) {
  17372. return func.apply(isArray(value) ? value : [], args);
  17373. });
  17374. };
  17375. });
  17376. // Map minified method names to their real names.
  17377. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17378. var lodashFunc = lodash[methodName];
  17379. if (lodashFunc) {
  17380. var key = lodashFunc.name + '';
  17381. if (!hasOwnProperty.call(realNames, key)) {
  17382. realNames[key] = [];
  17383. }
  17384. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17385. }
  17386. });
  17387. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17388. 'name': 'wrapper',
  17389. 'func': undefined
  17390. }];
  17391. // Add methods to `LazyWrapper`.
  17392. LazyWrapper.prototype.clone = lazyClone;
  17393. LazyWrapper.prototype.reverse = lazyReverse;
  17394. LazyWrapper.prototype.value = lazyValue;
  17395. // Add chain sequence methods to the `lodash` wrapper.
  17396. lodash.prototype.at = wrapperAt;
  17397. lodash.prototype.chain = wrapperChain;
  17398. lodash.prototype.commit = wrapperCommit;
  17399. lodash.prototype.next = wrapperNext;
  17400. lodash.prototype.plant = wrapperPlant;
  17401. lodash.prototype.reverse = wrapperReverse;
  17402. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17403. // Add lazy aliases.
  17404. lodash.prototype.first = lodash.prototype.head;
  17405. if (symIterator) {
  17406. lodash.prototype[symIterator] = wrapperToIterator;
  17407. }
  17408. return lodash;
  17409. });
  17410. /*--------------------------------------------------------------------------*/
  17411. // Export lodash.
  17412. var _ = runInContext();
  17413. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17414. if (true) {
  17415. // Expose Lodash on the global object to prevent errors when Lodash is
  17416. // loaded by a script tag in the presence of an AMD loader.
  17417. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17418. // Use `_.noConflict` to remove Lodash from the global object.
  17419. root._ = _;
  17420. // Define as an anonymous module so, through path mapping, it can be
  17421. // referenced as the "underscore" module.
  17422. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17423. return _;
  17424. }).call(exports, __webpack_require__, exports, module),
  17425. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17426. }
  17427. // Check for `exports` after `define` in case a build optimizer adds it.
  17428. else {}
  17429. }.call(this));
  17430. /***/ }),
  17431. /***/ "./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":
  17432. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17433. !*** ./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 ***!
  17434. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17435. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17436. "use strict";
  17437. __webpack_require__.r(__webpack_exports__);
  17438. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17439. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17440. /* harmony export */ });
  17441. /* 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");
  17442. /* 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__);
  17443. /* 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");
  17444. var options = {};
  17445. options.insert = "head";
  17446. options.singleton = false;
  17447. 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);
  17448. /* 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 || {});
  17449. /***/ }),
  17450. /***/ "./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":
  17451. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17452. !*** ./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 ***!
  17453. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17454. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17455. "use strict";
  17456. __webpack_require__.r(__webpack_exports__);
  17457. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17458. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17459. /* harmony export */ });
  17460. /* 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");
  17461. /* 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__);
  17462. /* 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");
  17463. var options = {};
  17464. options.insert = "head";
  17465. options.singleton = false;
  17466. 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);
  17467. /* 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 || {});
  17468. /***/ }),
  17469. /***/ "./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":
  17470. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17471. !*** ./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 ***!
  17472. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17473. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17474. "use strict";
  17475. __webpack_require__.r(__webpack_exports__);
  17476. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17477. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17478. /* harmony export */ });
  17479. /* 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");
  17480. /* 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__);
  17481. /* 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");
  17482. var options = {};
  17483. options.insert = "head";
  17484. options.singleton = false;
  17485. 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);
  17486. /* 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 || {});
  17487. /***/ }),
  17488. /***/ "./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":
  17489. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17490. !*** ./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 ***!
  17491. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17492. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17493. "use strict";
  17494. __webpack_require__.r(__webpack_exports__);
  17495. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17496. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17497. /* harmony export */ });
  17498. /* 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");
  17499. /* 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__);
  17500. /* 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");
  17501. var options = {};
  17502. options.insert = "head";
  17503. options.singleton = false;
  17504. 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);
  17505. /* 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 || {});
  17506. /***/ }),
  17507. /***/ "./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":
  17508. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17509. !*** ./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 ***!
  17510. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17511. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17512. "use strict";
  17513. __webpack_require__.r(__webpack_exports__);
  17514. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17515. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17516. /* harmony export */ });
  17517. /* 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");
  17518. /* 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__);
  17519. /* 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");
  17520. var options = {};
  17521. options.insert = "head";
  17522. options.singleton = false;
  17523. 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);
  17524. /* 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 || {});
  17525. /***/ }),
  17526. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17527. /*!******************************************************!*\
  17528. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17529. \******************************************************/
  17530. /***/ ((__unused_webpack_module, exports) => {
  17531. "use strict";
  17532. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17533. // runtime helper for setting properties on components
  17534. // in a tree-shakable way
  17535. exports["default"] = (sfc, props) => {
  17536. const target = sfc.__vccOpts || sfc;
  17537. for (const [key, val] of props) {
  17538. target[key] = val;
  17539. }
  17540. return target;
  17541. };
  17542. /***/ }),
  17543. /***/ "./resources/js/components/AppButtonLink.vue":
  17544. /*!***************************************************!*\
  17545. !*** ./resources/js/components/AppButtonLink.vue ***!
  17546. \***************************************************/
  17547. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17548. "use strict";
  17549. __webpack_require__.r(__webpack_exports__);
  17550. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17551. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17552. /* harmony export */ });
  17553. /* 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");
  17554. /* 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");
  17555. /* 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");
  17556. ;
  17557. 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"]])
  17558. /* hot reload */
  17559. if (false) {}
  17560. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17561. /***/ }),
  17562. /***/ "./resources/js/components/AppFooter.vue":
  17563. /*!***********************************************!*\
  17564. !*** ./resources/js/components/AppFooter.vue ***!
  17565. \***********************************************/
  17566. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17567. "use strict";
  17568. __webpack_require__.r(__webpack_exports__);
  17569. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17570. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17571. /* harmony export */ });
  17572. /* 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");
  17573. /* 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");
  17574. /* 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");
  17575. const script = {}
  17576. ;
  17577. 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"]])
  17578. /* hot reload */
  17579. if (false) {}
  17580. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17581. /***/ }),
  17582. /***/ "./resources/js/components/AppMessage.vue":
  17583. /*!************************************************!*\
  17584. !*** ./resources/js/components/AppMessage.vue ***!
  17585. \************************************************/
  17586. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17587. "use strict";
  17588. __webpack_require__.r(__webpack_exports__);
  17589. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17590. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17591. /* harmony export */ });
  17592. /* 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");
  17593. /* 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");
  17594. /* 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");
  17595. ;
  17596. 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"]])
  17597. /* hot reload */
  17598. if (false) {}
  17599. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17600. /***/ }),
  17601. /***/ "./resources/js/components/AppPagination.vue":
  17602. /*!***************************************************!*\
  17603. !*** ./resources/js/components/AppPagination.vue ***!
  17604. \***************************************************/
  17605. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17606. "use strict";
  17607. __webpack_require__.r(__webpack_exports__);
  17608. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17609. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17610. /* harmony export */ });
  17611. /* 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");
  17612. /* 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");
  17613. /* 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");
  17614. ;
  17615. 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"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/components/AppSidebar.vue":
  17621. /*!************************************************!*\
  17622. !*** ./resources/js/components/AppSidebar.vue ***!
  17623. \************************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17629. /* harmony export */ });
  17630. /* harmony import */ var _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");
  17631. /* 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");
  17632. /* 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");
  17633. /* 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");
  17634. ;
  17635. 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"]])
  17636. /* hot reload */
  17637. if (false) {}
  17638. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17639. /***/ }),
  17640. /***/ "./resources/js/components/AppSubSidebar.vue":
  17641. /*!***************************************************!*\
  17642. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17643. \***************************************************/
  17644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17645. "use strict";
  17646. __webpack_require__.r(__webpack_exports__);
  17647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17648. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17649. /* harmony export */ });
  17650. /* 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");
  17651. /* 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");
  17652. /* 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");
  17653. /* 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");
  17654. ;
  17655. 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"]])
  17656. /* hot reload */
  17657. if (false) {}
  17658. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17659. /***/ }),
  17660. /***/ "./resources/js/components/AppTopBar.vue":
  17661. /*!***********************************************!*\
  17662. !*** ./resources/js/components/AppTopBar.vue ***!
  17663. \***********************************************/
  17664. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17665. "use strict";
  17666. __webpack_require__.r(__webpack_exports__);
  17667. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17668. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17669. /* harmony export */ });
  17670. /* 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");
  17671. /* 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");
  17672. /* 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");
  17673. /* 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");
  17674. ;
  17675. 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"]])
  17676. /* hot reload */
  17677. if (false) {}
  17678. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17679. /***/ }),
  17680. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17681. /*!**************************************************!*\
  17682. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17683. \**************************************************/
  17684. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17685. "use strict";
  17686. __webpack_require__.r(__webpack_exports__);
  17687. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17688. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17689. /* harmony export */ });
  17690. /* 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");
  17691. /* 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");
  17692. /* 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");
  17693. /* 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");
  17694. ;
  17695. 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"]])
  17696. /* hot reload */
  17697. if (false) {}
  17698. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17699. /***/ }),
  17700. /***/ "./resources/js/pages/topup/Index.vue":
  17701. /*!********************************************!*\
  17702. !*** ./resources/js/pages/topup/Index.vue ***!
  17703. \********************************************/
  17704. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17705. "use strict";
  17706. __webpack_require__.r(__webpack_exports__);
  17707. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17708. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17709. /* harmony export */ });
  17710. /* 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");
  17711. /* 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");
  17712. /* 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");
  17713. ;
  17714. 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"]])
  17715. /* hot reload */
  17716. if (false) {}
  17717. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17718. /***/ }),
  17719. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17720. /*!**************************************************************************************!*\
  17721. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17722. \**************************************************************************************/
  17723. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17724. "use strict";
  17725. __webpack_require__.r(__webpack_exports__);
  17726. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17727. /* 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"])
  17728. /* harmony export */ });
  17729. /* 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");
  17730. /***/ }),
  17731. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17732. /*!***********************************************************************************!*\
  17733. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17734. \***********************************************************************************/
  17735. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17736. "use strict";
  17737. __webpack_require__.r(__webpack_exports__);
  17738. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17739. /* 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"])
  17740. /* harmony export */ });
  17741. /* 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");
  17742. /***/ }),
  17743. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17744. /*!**************************************************************************************!*\
  17745. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17746. \**************************************************************************************/
  17747. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17748. "use strict";
  17749. __webpack_require__.r(__webpack_exports__);
  17750. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17751. /* 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"])
  17752. /* harmony export */ });
  17753. /* 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");
  17754. /***/ }),
  17755. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17756. /*!***********************************************************************************!*\
  17757. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17758. \***********************************************************************************/
  17759. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17760. "use strict";
  17761. __webpack_require__.r(__webpack_exports__);
  17762. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17763. /* 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"])
  17764. /* harmony export */ });
  17765. /* 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");
  17766. /***/ }),
  17767. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17768. /*!**************************************************************************************!*\
  17769. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17770. \**************************************************************************************/
  17771. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17772. "use strict";
  17773. __webpack_require__.r(__webpack_exports__);
  17774. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17775. /* 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"])
  17776. /* harmony export */ });
  17777. /* 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");
  17778. /***/ }),
  17779. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17780. /*!**********************************************************************************!*\
  17781. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17782. \**********************************************************************************/
  17783. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17784. "use strict";
  17785. __webpack_require__.r(__webpack_exports__);
  17786. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17787. /* 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"])
  17788. /* harmony export */ });
  17789. /* 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");
  17790. /***/ }),
  17791. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17792. /*!*************************************************************************************!*\
  17793. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17794. \*************************************************************************************/
  17795. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17796. "use strict";
  17797. __webpack_require__.r(__webpack_exports__);
  17798. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17799. /* 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"])
  17800. /* harmony export */ });
  17801. /* 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");
  17802. /***/ }),
  17803. /***/ "./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  17804. /*!*******************************************************************************!*\
  17805. !*** ./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  17806. \*******************************************************************************/
  17807. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17808. "use strict";
  17809. __webpack_require__.r(__webpack_exports__);
  17810. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17811. /* 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"])
  17812. /* harmony export */ });
  17813. /* 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");
  17814. /***/ }),
  17815. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17816. /*!*********************************************************************************!*\
  17817. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17818. \*********************************************************************************/
  17819. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17820. "use strict";
  17821. __webpack_require__.r(__webpack_exports__);
  17822. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17823. /* 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)
  17824. /* harmony export */ });
  17825. /* 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");
  17826. /***/ }),
  17827. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17828. /*!*****************************************************************************************!*\
  17829. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17830. \*****************************************************************************************/
  17831. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17832. "use strict";
  17833. __webpack_require__.r(__webpack_exports__);
  17834. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17835. /* 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)
  17836. /* harmony export */ });
  17837. /* 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");
  17838. /***/ }),
  17839. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17840. /*!******************************************************************************!*\
  17841. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17842. \******************************************************************************/
  17843. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17844. "use strict";
  17845. __webpack_require__.r(__webpack_exports__);
  17846. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17847. /* 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)
  17848. /* harmony export */ });
  17849. /* 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");
  17850. /***/ }),
  17851. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17852. /*!*********************************************************************************!*\
  17853. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17854. \*********************************************************************************/
  17855. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17856. "use strict";
  17857. __webpack_require__.r(__webpack_exports__);
  17858. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17859. /* 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)
  17860. /* harmony export */ });
  17861. /* 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");
  17862. /***/ }),
  17863. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17864. /*!******************************************************************************************!*\
  17865. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17866. \******************************************************************************************/
  17867. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17868. "use strict";
  17869. __webpack_require__.r(__webpack_exports__);
  17870. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17871. /* 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)
  17872. /* harmony export */ });
  17873. /* 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");
  17874. /***/ }),
  17875. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17876. /*!*********************************************************************************************!*\
  17877. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17878. \*********************************************************************************************/
  17879. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17880. "use strict";
  17881. __webpack_require__.r(__webpack_exports__);
  17882. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17883. /* 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)
  17884. /* harmony export */ });
  17885. /* 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");
  17886. /***/ }),
  17887. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17888. /*!*****************************************************************************************!*\
  17889. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17890. \*****************************************************************************************/
  17891. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17892. "use strict";
  17893. __webpack_require__.r(__webpack_exports__);
  17894. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17895. /* 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)
  17896. /* harmony export */ });
  17897. /* 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");
  17898. /***/ }),
  17899. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17900. /*!********************************************************************************************!*\
  17901. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17902. \********************************************************************************************/
  17903. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17904. "use strict";
  17905. __webpack_require__.r(__webpack_exports__);
  17906. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17907. /* 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)
  17908. /* harmony export */ });
  17909. /* 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");
  17910. /***/ }),
  17911. /***/ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c":
  17912. /*!**************************************************************************!*\
  17913. !*** ./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  17914. \**************************************************************************/
  17915. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17916. "use strict";
  17917. __webpack_require__.r(__webpack_exports__);
  17918. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17919. /* 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)
  17920. /* harmony export */ });
  17921. /* 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");
  17922. /***/ }),
  17923. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17924. /*!********************************************************************************************************!*\
  17925. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17926. \********************************************************************************************************/
  17927. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17928. "use strict";
  17929. __webpack_require__.r(__webpack_exports__);
  17930. /* 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");
  17931. /***/ }),
  17932. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17933. /*!*********************************************************************************************************!*\
  17934. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17935. \*********************************************************************************************************/
  17936. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17937. "use strict";
  17938. __webpack_require__.r(__webpack_exports__);
  17939. /* 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");
  17940. /***/ }),
  17941. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17942. /*!************************************************************************************************************!*\
  17943. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17944. \************************************************************************************************************/
  17945. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17946. "use strict";
  17947. __webpack_require__.r(__webpack_exports__);
  17948. /* 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");
  17949. /***/ }),
  17950. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17951. /*!********************************************************************************************************!*\
  17952. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17953. \********************************************************************************************************/
  17954. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17955. "use strict";
  17956. __webpack_require__.r(__webpack_exports__);
  17957. /* 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");
  17958. /***/ }),
  17959. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17960. /*!***********************************************************************************************************!*\
  17961. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17962. \***********************************************************************************************************/
  17963. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17964. "use strict";
  17965. __webpack_require__.r(__webpack_exports__);
  17966. /* 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");
  17967. /***/ })
  17968. }]);