resources_js_pages_member_Edit_vue.js 719KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_member_Edit_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/AppDropdown.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/AppDropdown.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 vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. label: {
  16. type: String,
  17. required: true
  18. },
  19. disabled: {
  20. type: Boolean,
  21. "default": false
  22. },
  23. placeholder: {
  24. type: String,
  25. required: true
  26. },
  27. error: {
  28. type: String,
  29. "default": null
  30. },
  31. optionLabel: {
  32. type: String,
  33. "default": 'label'
  34. },
  35. optionValue: {
  36. type: String,
  37. "default": 'value'
  38. },
  39. optionDisabled: {
  40. type: String,
  41. "default": 'disabled'
  42. },
  43. optionGroupChildren: {
  44. type: String,
  45. "default": null
  46. },
  47. optionGroupLabel: {
  48. type: String,
  49. "default": null
  50. },
  51. options: {
  52. type: Array,
  53. required: true
  54. },
  55. modelValue: null
  56. },
  57. emits: ['update:modelValue'],
  58. setup: function setup(__props, _ref) {
  59. var expose = _ref.expose;
  60. expose();
  61. var props = __props;
  62. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  63. return props.error ? true : false;
  64. });
  65. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  66. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') : null;
  67. });
  68. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  69. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') + '-help' : null;
  70. });
  71. var selectedDropdownLabel = function selectedDropdownLabel(value) {
  72. var result = props.options.find(function (option) {
  73. return option[props.optionValue] == value;
  74. });
  75. if (result) {
  76. return result[props.optionLabel];
  77. }
  78. };
  79. var __returned__ = {
  80. props: props,
  81. isError: isError,
  82. forLabel: forLabel,
  83. ariaDescribedbyLabel: ariaDescribedbyLabel,
  84. selectedDropdownLabel: selectedDropdownLabel,
  85. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  86. };
  87. Object.defineProperty(__returned__, '__isScriptSetup', {
  88. enumerable: false,
  89. value: true
  90. });
  91. return __returned__;
  92. }
  93. });
  94. /***/ }),
  95. /***/ "./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/AppInputText.vue?vue&type=script&setup=true&lang=js":
  96. /*!*****************************************************************************************************************************************************************************************************************!*\
  97. !*** ./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/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  98. \*****************************************************************************************************************************************************************************************************************/
  99. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  100. "use strict";
  101. __webpack_require__.r(__webpack_exports__);
  102. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  103. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  104. /* harmony export */ });
  105. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  107. props: {
  108. label: {
  109. type: String,
  110. required: true
  111. },
  112. disabled: {
  113. type: Boolean,
  114. "default": false
  115. },
  116. placeholder: {
  117. type: String,
  118. required: true
  119. },
  120. error: {
  121. type: String,
  122. "default": null
  123. },
  124. modelValue: null
  125. },
  126. emits: ['update:modelValue'],
  127. setup: function setup(__props, _ref) {
  128. var expose = _ref.expose;
  129. expose();
  130. var props = __props;
  131. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  132. return props.error ? true : false;
  133. });
  134. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  135. return props.label.toLowerCase().replace(/\s+/g, '-');
  136. });
  137. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  138. return props.label.toLowerCase().replace(/\s+/g, '-') + '-help';
  139. });
  140. var __returned__ = {
  141. props: props,
  142. isError: isError,
  143. forLabel: forLabel,
  144. ariaDescribedbyLabel: ariaDescribedbyLabel,
  145. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  146. };
  147. Object.defineProperty(__returned__, '__isScriptSetup', {
  148. enumerable: false,
  149. value: true
  150. });
  151. return __returned__;
  152. }
  153. });
  154. /***/ }),
  155. /***/ "./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":
  156. /*!***************************************************************************************************************************************************************************************************************!*\
  157. !*** ./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 ***!
  158. \***************************************************************************************************************************************************************************************************************/
  159. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  160. "use strict";
  161. __webpack_require__.r(__webpack_exports__);
  162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  163. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  164. /* harmony export */ });
  165. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  166. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  167. setup: function setup(__props, _ref) {
  168. var expose = _ref.expose;
  169. expose();
  170. var onClose = function onClose() {
  171. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  172. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  173. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  174. };
  175. var __returned__ = {
  176. onClose: onClose,
  177. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  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/components/AppSidebar.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/components/AppSidebar.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 _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  198. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  199. props: {
  200. menu: Array
  201. },
  202. setup: function setup(__props, _ref) {
  203. var expose = _ref.expose;
  204. expose();
  205. var __returned__ = {
  206. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  207. };
  208. Object.defineProperty(__returned__, '__isScriptSetup', {
  209. enumerable: false,
  210. value: true
  211. });
  212. return __returned__;
  213. }
  214. });
  215. /***/ }),
  216. /***/ "./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":
  217. /*!******************************************************************************************************************************************************************************************************************!*\
  218. !*** ./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 ***!
  219. \******************************************************************************************************************************************************************************************************************/
  220. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  221. "use strict";
  222. __webpack_require__.r(__webpack_exports__);
  223. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  224. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  225. /* harmony export */ });
  226. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  227. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  228. props: {
  229. items: Array,
  230. root: {
  231. type: Boolean,
  232. "default": false
  233. }
  234. },
  235. setup: function setup(__props, _ref) {
  236. var expose = _ref.expose;
  237. expose();
  238. var __returned__ = {
  239. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  240. };
  241. Object.defineProperty(__returned__, '__isScriptSetup', {
  242. enumerable: false,
  243. value: true
  244. });
  245. return __returned__;
  246. }
  247. });
  248. /***/ }),
  249. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  250. /*!**************************************************************************************************************************************************************************************************************!*\
  251. !*** ./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 ***!
  252. \**************************************************************************************************************************************************************************************************************/
  253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  254. "use strict";
  255. __webpack_require__.r(__webpack_exports__);
  256. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  257. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  258. /* harmony export */ });
  259. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  260. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  261. emits: ['menu-toggle'],
  262. setup: function setup(__props, _ref) {
  263. var expose = _ref.expose;
  264. expose();
  265. var __returned__ = {
  266. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  267. };
  268. Object.defineProperty(__returned__, '__isScriptSetup', {
  269. enumerable: false,
  270. value: true
  271. });
  272. return __returned__;
  273. }
  274. });
  275. /***/ }),
  276. /***/ "./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":
  277. /*!*****************************************************************************************************************************************************************************************************************!*\
  278. !*** ./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 ***!
  279. \*****************************************************************************************************************************************************************************************************************/
  280. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  281. "use strict";
  282. __webpack_require__.r(__webpack_exports__);
  283. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  284. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  285. /* harmony export */ });
  286. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  287. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  288. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  289. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  290. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  291. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  292. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  293. setup: function setup(__props, _ref) {
  294. var expose = _ref.expose;
  295. expose();
  296. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  297. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  298. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  299. var isDesktop = function isDesktop() {
  300. return window.innerWidth >= 992;
  301. };
  302. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  303. return ['layout-wrapper', {
  304. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  305. 'layout-mobile-sidebar-active': mobileMenuActive.value
  306. }];
  307. });
  308. var onWrapperClick = function onWrapperClick() {
  309. if (!menuClick.value) {
  310. mobileMenuActive.value = false;
  311. }
  312. menuClick.value = false;
  313. };
  314. var onMenuToggle = function onMenuToggle(event) {
  315. menuClick.value = true;
  316. if (isDesktop()) {
  317. staticMenuInactive.value = !staticMenuInactive.value;
  318. } else {
  319. mobileMenuActive.value = !mobileMenuActive.value;
  320. }
  321. event.preventDefault();
  322. };
  323. var __returned__ = {
  324. mobileMenuActive: mobileMenuActive,
  325. staticMenuInactive: staticMenuInactive,
  326. menuClick: menuClick,
  327. isDesktop: isDesktop,
  328. containerClass: containerClass,
  329. onWrapperClick: onWrapperClick,
  330. onMenuToggle: onMenuToggle,
  331. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  332. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  333. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  334. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  335. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  336. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  337. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  338. };
  339. Object.defineProperty(__returned__, '__isScriptSetup', {
  340. enumerable: false,
  341. value: true
  342. });
  343. return __returned__;
  344. }
  345. });
  346. /***/ }),
  347. /***/ "./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/member/Edit.vue?vue&type=script&setup=true&lang=js":
  348. /*!***********************************************************************************************************************************************************************************************************!*\
  349. !*** ./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/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  350. \***********************************************************************************************************************************************************************************************************/
  351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  352. "use strict";
  353. __webpack_require__.r(__webpack_exports__);
  354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  355. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  356. /* harmony export */ });
  357. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  358. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  359. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  360. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  361. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  362. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/member/tableHeader.js");
  363. /* harmony import */ var _useVehicle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./useVehicle */ "./resources/js/pages/member/useVehicle.js");
  364. /* harmony import */ var _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useFormErrorReset */ "./resources/js/components/useFormErrorReset.js");
  365. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  366. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  367. /* harmony import */ var _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppDropdown.vue */ "./resources/js/components/AppDropdown.vue");
  368. /* harmony import */ var _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/components/AppInputText.vue */ "./resources/js/components/AppInputText.vue");
  369. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  370. props: {
  371. member: Object,
  372. typeMembers: Array,
  373. typeMember: Object,
  374. initialVehicles: Object
  375. },
  376. setup: function setup(__props, _ref) {
  377. var expose = _ref.expose;
  378. expose();
  379. var props = __props;
  380. var form = (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm)({
  381. name: props.member.name,
  382. phone: null,
  383. plat_number: null,
  384. max_vehicle_id: null,
  385. type_member_id: props.member.typeMemberId
  386. });
  387. (0,_components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset)(form);
  388. var _useVehicle = (0,_useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle)(props, form),
  389. listVehicle = _useVehicle.listVehicle,
  390. vehicleOnDelete = _useVehicle.vehicleOnDelete,
  391. vehicleOnAdd = _useVehicle.vehicleOnAdd;
  392. var confirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm)();
  393. var errorSubmitVisible = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  394. var errorSubmitText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)();
  395. var submitValidation = function submitValidation() {
  396. var listPlatNumberGroup = (0,lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy)(listVehicle, 'typeVehicleId');
  397. var listVehicles = [];
  398. for (var key in listPlatNumberGroup) {
  399. listVehicles.push({
  400. typeVehicleId: listPlatNumberGroup[key][0]['typeVehicleId'],
  401. maxVehicle: listPlatNumberGroup[key][0]['maxVehicle'],
  402. count: listPlatNumberGroup[key].length
  403. });
  404. }
  405. listVehicles.forEach(function (val) {
  406. if (val.count > val.maxVehicle) {
  407. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"]('Ada perubahan pada batas maksimal kendaraan');
  408. }
  409. });
  410. };
  411. var formSent = function formSent() {
  412. form.transform(function (data) {
  413. return {
  414. name: data.name,
  415. phone: data.phone,
  416. vehicles: listVehicle,
  417. type_member_id: data.type_member_id
  418. };
  419. }).put(route('members.update', props.member.id));
  420. };
  421. var onSubmit = function onSubmit() {
  422. try {
  423. submitValidation();
  424. if (props.member.typeMemberId != form.type_member_id) {
  425. confirm.require({
  426. message: "Dikenakan tagihan perubahan member sebesar ".concat(props.typeMember.price),
  427. header: 'Tagihan Perubahan Jenis Member',
  428. acceptLabel: 'Bayar dan simpan',
  429. rejectLabel: 'Batalkan',
  430. accept: function accept() {
  431. formSent();
  432. },
  433. reject: function reject() {
  434. confirm.close();
  435. }
  436. });
  437. } else {
  438. formSent();
  439. }
  440. } catch (err) {
  441. errorSubmitVisible.value = true;
  442. errorSubmitText.value = err.message;
  443. }
  444. };
  445. var __returned__ = {
  446. props: props,
  447. form: form,
  448. listVehicle: listVehicle,
  449. vehicleOnDelete: vehicleOnDelete,
  450. vehicleOnAdd: vehicleOnAdd,
  451. confirm: confirm,
  452. errorSubmitVisible: errorSubmitVisible,
  453. errorSubmitText: errorSubmitText,
  454. submitValidation: submitValidation,
  455. formSent: formSent,
  456. onSubmit: onSubmit,
  457. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  458. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  459. useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm,
  460. groupBy: lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy,
  461. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm,
  462. platNumberTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.platNumberTable,
  463. useVehicle: _useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle,
  464. useFormErrorReset: _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset,
  465. FormValidationError: _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"],
  466. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  467. AppDropdown: _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__["default"],
  468. AppInputText: _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__["default"]
  469. };
  470. Object.defineProperty(__returned__, '__isScriptSetup', {
  471. enumerable: false,
  472. value: true
  473. });
  474. return __returned__;
  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/AppDropdown.vue?vue&type=template&id=ce0d1992":
  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/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  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. "class": "field"
  491. };
  492. var _hoisted_2 = ["for"];
  493. var _hoisted_3 = {
  494. key: 0
  495. };
  496. var _hoisted_4 = {
  497. key: 1
  498. };
  499. var _hoisted_5 = ["id"];
  500. function render(_ctx, _cache, $props, $setup, $data, $options) {
  501. var _component_Dropdown = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dropdown");
  502. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [$props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("label", {
  503. key: 0,
  504. "for": $setup.forLabel
  505. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  506. /* TEXT, PROPS */
  507. , _hoisted_2)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dropdown, {
  508. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  509. 'p-invalid': $setup.isError
  510. }]),
  511. id: $setup.forLabel,
  512. "aria-describedby": $setup.ariaDescribedbyLabel,
  513. "option-disabled": $props.optionDisabled,
  514. "option-group-children": $props.optionGroupChildren,
  515. "option-group-label": $props.optionGroupLabel,
  516. "option-label": $props.optionLabel,
  517. "option-value": $props.optionValue,
  518. placeholder: $props.placeholder,
  519. options: $props.options,
  520. "model-value": $props.modelValue,
  521. disabled: $props.disabled,
  522. onChange: _cache[0] || (_cache[0] = function ($event) {
  523. return _ctx.$emit('update:modelValue', $event.value);
  524. })
  525. }, {
  526. value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (slotProps) {
  527. return [slotProps.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.selectedDropdownLabel(slotProps.value)), 1
  528. /* TEXT */
  529. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(slotProps.placeholder), 1
  530. /* TEXT */
  531. ))];
  532. }),
  533. option: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  534. var option = _ref.option,
  535. index = _ref.index;
  536. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "option", {
  537. option: option,
  538. index: index
  539. })];
  540. }),
  541. _: 3
  542. /* FORWARDED */
  543. }, 8
  544. /* PROPS */
  545. , ["class", "id", "aria-describedby", "option-disabled", "option-group-children", "option-group-label", "option-label", "option-value", "placeholder", "options", "model-value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  546. key: 1,
  547. id: $setup.ariaDescribedbyLabel,
  548. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  549. 'p-error': $setup.isError
  550. })
  551. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  552. /* TEXT, CLASS, PROPS */
  553. , _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  554. }
  555. /***/ }),
  556. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  557. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  558. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  559. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  560. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  561. "use strict";
  562. __webpack_require__.r(__webpack_exports__);
  563. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  564. /* harmony export */ "render": () => (/* binding */ render)
  565. /* harmony export */ });
  566. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  567. var _withScopeId = function _withScopeId(n) {
  568. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  569. };
  570. var _hoisted_1 = {
  571. "class": "layout-footer"
  572. };
  573. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  574. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  575. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  576. href: "https://dijitalcode.com",
  577. target: "_blank",
  578. "class": "font-medium ml-2"
  579. }, "DijitalCODE", -1
  580. /* HOISTED */
  581. );
  582. });
  583. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  584. function render(_ctx, _cache) {
  585. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  586. }
  587. /***/ }),
  588. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1":
  589. /*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
  590. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  591. \**********************************************************************************************************************************************************************************************************************************************************************************/
  592. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  593. "use strict";
  594. __webpack_require__.r(__webpack_exports__);
  595. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  596. /* harmony export */ "render": () => (/* binding */ render)
  597. /* harmony export */ });
  598. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  599. var _hoisted_1 = {
  600. "class": "field"
  601. };
  602. var _hoisted_2 = ["for"];
  603. var _hoisted_3 = ["id"];
  604. function render(_ctx, _cache, $props, $setup, $data, $options) {
  605. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  606. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {
  607. "for": $setup.forLabel
  608. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  609. /* TEXT, PROPS */
  610. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  611. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  612. 'p-invalid': $setup.isError
  613. }]),
  614. type: "text",
  615. id: $setup.forLabel,
  616. "aria-describedby": $setup.ariaDescribedbyLabel,
  617. "model-value": $props.modelValue,
  618. placeholder: $props.placeholder,
  619. value: $props.modelValue,
  620. disabled: $props.disabled,
  621. onInput: _cache[0] || (_cache[0] = function ($event) {
  622. return _ctx.$emit('update:modelValue', $event.target.value);
  623. })
  624. }, null, 8
  625. /* PROPS */
  626. , ["class", "id", "aria-describedby", "model-value", "placeholder", "value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  627. key: 0,
  628. id: $setup.ariaDescribedbyLabel,
  629. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  630. 'p-error': $setup.isError
  631. })
  632. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  633. /* TEXT, CLASS, PROPS */
  634. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  635. }
  636. /***/ }),
  637. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  638. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  639. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  640. \********************************************************************************************************************************************************************************************************************************************************************************/
  641. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  642. "use strict";
  643. __webpack_require__.r(__webpack_exports__);
  644. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  645. /* harmony export */ "render": () => (/* binding */ render)
  646. /* harmony export */ });
  647. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  648. var _hoisted_1 = {
  649. key: 0
  650. };
  651. var _hoisted_2 = {
  652. key: 1
  653. };
  654. function render(_ctx, _cache, $props, $setup, $data, $options) {
  655. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  656. 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, {
  657. key: 0,
  658. severity: "success",
  659. onClose: $setup.onClose
  660. }, {
  661. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  662. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  663. /* TEXT */
  664. )];
  665. }),
  666. _: 1
  667. /* STABLE */
  668. })) : (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, {
  669. key: 1,
  670. severity: "error",
  671. onClose: $setup.onClose
  672. }, {
  673. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  674. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  675. /* TEXT */
  676. )];
  677. }),
  678. _: 1
  679. /* STABLE */
  680. })) : (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, {
  681. key: 2,
  682. severity: "error",
  683. onClose: $setup.onClose
  684. }, {
  685. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  686. 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
  687. /* TEXT */
  688. ))];
  689. }),
  690. _: 1
  691. /* STABLE */
  692. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  693. /* STABLE_FRAGMENT */
  694. );
  695. }
  696. /***/ }),
  697. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  698. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  699. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  700. \********************************************************************************************************************************************************************************************************************************************************************************************/
  701. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  702. "use strict";
  703. __webpack_require__.r(__webpack_exports__);
  704. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  705. /* harmony export */ "render": () => (/* binding */ render)
  706. /* harmony export */ });
  707. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  708. function render(_ctx, _cache, $props, $setup, $data, $options) {
  709. 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"], {
  710. "class": "layout-menu",
  711. items: $props.menu,
  712. root: true
  713. }, null, 8
  714. /* PROPS */
  715. , ["items"])]);
  716. }
  717. /***/ }),
  718. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  719. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  720. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  721. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  722. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  723. "use strict";
  724. __webpack_require__.r(__webpack_exports__);
  725. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  726. /* harmony export */ "render": () => (/* binding */ render)
  727. /* harmony export */ });
  728. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  729. var _withScopeId = function _withScopeId(n) {
  730. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  731. };
  732. var _hoisted_1 = {
  733. key: 0
  734. };
  735. var _hoisted_2 = ["aria-label"];
  736. var _hoisted_3 = ["aria-label"];
  737. function render(_ctx, _cache, $props, $setup, $data, $options) {
  738. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  739. 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) {
  740. 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", {
  741. key: i,
  742. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  743. 'layout-menuitem-category': $props.root
  744. }]),
  745. role: "none"
  746. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  747. key: 0
  748. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  749. "class": "layout-menuitem-root-text",
  750. "aria-label": item.label
  751. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  752. /* TEXT, PROPS */
  753. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  754. items: item.items
  755. }, null, 8
  756. /* PROPS */
  757. , ["items"])], 64
  758. /* STABLE_FRAGMENT */
  759. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  760. key: 1
  761. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  762. key: 0,
  763. role: "menuitem",
  764. href: item.to,
  765. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  766. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  767. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  768. }]),
  769. "aria-label": item.label
  770. }, {
  771. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  772. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  773. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  774. }, null, 2
  775. /* CLASS */
  776. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  777. /* TEXT */
  778. )];
  779. }),
  780. _: 2
  781. /* DYNAMIC */
  782. }, 1032
  783. /* PROPS, DYNAMIC_SLOTS */
  784. , ["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", {
  785. key: 1,
  786. href: "#",
  787. role: "menuitem",
  788. "aria-label": item.label
  789. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  790. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  791. }, null, 2
  792. /* CLASS */
  793. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  794. /* TEXT */
  795. )], 8
  796. /* PROPS */
  797. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  798. items: item.items
  799. }, null, 8
  800. /* PROPS */
  801. , ["items"])], 64
  802. /* STABLE_FRAGMENT */
  803. ))], 2
  804. /* CLASS */
  805. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  806. /* STABLE_FRAGMENT */
  807. );
  808. }), 256
  809. /* UNKEYED_FRAGMENT */
  810. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  811. }
  812. /***/ }),
  813. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  814. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  815. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  816. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  817. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  818. "use strict";
  819. __webpack_require__.r(__webpack_exports__);
  820. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  821. /* harmony export */ "render": () => (/* binding */ render)
  822. /* harmony export */ });
  823. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  824. var _withScopeId = function _withScopeId(n) {
  825. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  826. };
  827. var _hoisted_1 = {
  828. "class": "layout-topbar"
  829. };
  830. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  831. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  832. alt: "Logo",
  833. src: "/images/logo.svg",
  834. "class": "md:mr-3"
  835. }, null, -1
  836. /* HOISTED */
  837. );
  838. });
  839. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  840. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  841. /* HOISTED */
  842. );
  843. });
  844. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  845. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  846. "class": "pi pi-bars"
  847. }, null, -1
  848. /* HOISTED */
  849. );
  850. });
  851. var _hoisted_5 = [_hoisted_4];
  852. var _hoisted_6 = {
  853. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  854. };
  855. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  856. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  857. "class": "pi pi-ellipsis-v"
  858. }, null, -1
  859. /* HOISTED */
  860. );
  861. });
  862. var _hoisted_8 = [_hoisted_7];
  863. var _hoisted_9 = {
  864. "class": "layout-topbar-menu hidden lg:flex origin-top"
  865. };
  866. var _hoisted_10 = {
  867. "class": "align-self-center"
  868. };
  869. var _hoisted_11 = {
  870. "class": "hidden lg:inline"
  871. };
  872. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  873. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  874. "class": "pi pi-user"
  875. }, null, -1
  876. /* HOISTED */
  877. );
  878. });
  879. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  880. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  881. /* HOISTED */
  882. );
  883. });
  884. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  885. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  886. "class": "pi pi-sign-out"
  887. }, null, -1
  888. /* HOISTED */
  889. );
  890. });
  891. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  892. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  893. /* HOISTED */
  894. );
  895. });
  896. function render(_ctx, _cache, $props, $setup, $data, $options) {
  897. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  898. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  899. 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"], {
  900. href: "/",
  901. "class": "layout-topbar-logo"
  902. }, {
  903. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  904. return [_hoisted_2, _hoisted_3];
  905. }),
  906. _: 1
  907. /* STABLE */
  908. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  909. "class": "p-link layout-menu-button layout-topbar-button",
  910. onClick: _cache[0] || (_cache[0] = function ($event) {
  911. return _ctx.$emit('menu-toggle', $event);
  912. })
  913. }, _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, {
  914. selector: '@next',
  915. enterClass: 'hidden',
  916. enterActiveClass: 'scalein',
  917. leaveToClass: 'hidden',
  918. leaveActiveClass: 'fadeout',
  919. hideOnOutsideClick: true
  920. }]]), (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
  921. /* TEXT */
  922. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  923. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  924. "class": "p-link layout-topbar-button"
  925. }, {
  926. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  927. return [_hoisted_12, _hoisted_13];
  928. }),
  929. _: 1
  930. /* STABLE */
  931. }, 8
  932. /* PROPS */
  933. , ["href"])), [[_directive_tooltip, {
  934. value: 'Ubah Profil',
  935. "class": 'layout-topbar-menu-tooltip'
  936. }, void 0, {
  937. bottom: true
  938. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  939. href: _ctx.route('logout'),
  940. as: "button",
  941. method: "post",
  942. "class": "p-link layout-topbar-button"
  943. }, {
  944. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  945. return [_hoisted_14, _hoisted_15];
  946. }),
  947. _: 1
  948. /* STABLE */
  949. }, 8
  950. /* PROPS */
  951. , ["href"])), [[_directive_tooltip, {
  952. value: 'Keluar',
  953. "class": 'layout-topbar-menu-tooltip'
  954. }, void 0, {
  955. bottom: true
  956. }]])])])]);
  957. }
  958. /***/ }),
  959. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  960. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  961. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  962. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  963. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  964. "use strict";
  965. __webpack_require__.r(__webpack_exports__);
  966. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  967. /* harmony export */ "render": () => (/* binding */ render)
  968. /* harmony export */ });
  969. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  970. var _withScopeId = function _withScopeId(n) {
  971. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  972. };
  973. var _hoisted_1 = {
  974. "class": "layout-sidebar"
  975. };
  976. var _hoisted_2 = {
  977. "class": "layout-main-container"
  978. };
  979. var _hoisted_3 = {
  980. "class": "layout-main"
  981. };
  982. var _hoisted_4 = {
  983. key: 0,
  984. "class": "layout-mask p-component-overlay"
  985. };
  986. function render(_ctx, _cache, $props, $setup, $data, $options) {
  987. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  988. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  989. onClick: $setup.onWrapperClick
  990. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  991. onMenuToggle: $setup.onMenuToggle
  992. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  993. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  994. }, null, 8
  995. /* PROPS */
  996. , ["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, {
  997. name: "layout-mask"
  998. }, {
  999. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1000. 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)];
  1001. }),
  1002. _: 1
  1003. /* STABLE */
  1004. })], 2
  1005. /* CLASS */
  1006. );
  1007. }
  1008. /***/ }),
  1009. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226":
  1010. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  1011. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  1012. \****************************************************************************************************************************************************************************************************************************************************************************/
  1013. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1014. "use strict";
  1015. __webpack_require__.r(__webpack_exports__);
  1016. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1017. /* harmony export */ "render": () => (/* binding */ render)
  1018. /* harmony export */ });
  1019. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1020. var _hoisted_1 = {
  1021. "class": "grid"
  1022. };
  1023. var _hoisted_2 = {
  1024. "class": "col-12 md:col-8"
  1025. };
  1026. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Ubah Member ");
  1027. var _hoisted_4 = {
  1028. "class": "grid"
  1029. };
  1030. var _hoisted_5 = {
  1031. "class": "col-12 md:col-6"
  1032. };
  1033. var _hoisted_6 = {
  1034. "class": "col-12 md:col-6"
  1035. };
  1036. var _hoisted_7 = {
  1037. "class": "col-12 md:col-6"
  1038. };
  1039. var _hoisted_8 = {
  1040. "class": "grid"
  1041. };
  1042. var _hoisted_9 = {
  1043. "class": "col-12 md:col-8"
  1044. };
  1045. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Detail Harga");
  1046. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1047. "class": "text-base font-bold mb-0"
  1048. }, "Jenis Member", -1
  1049. /* HOISTED */
  1050. );
  1051. var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1052. "class": "text-base font-bold mb-0"
  1053. }, "Batas Maksimal Kendaraan", -1
  1054. /* HOISTED */
  1055. );
  1056. var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1057. "class": "text-base font-bold mb-0"
  1058. }, "Keterangan", -1
  1059. /* HOISTED */
  1060. );
  1061. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1062. "class": "text-base font-bold mb-0"
  1063. }, "Tarif Member", -1
  1064. /* HOISTED */
  1065. );
  1066. var _hoisted_15 = {
  1067. key: 0,
  1068. "class": "grid"
  1069. };
  1070. var _hoisted_16 = {
  1071. "class": "col-12 md:col-8"
  1072. };
  1073. var _hoisted_17 = {
  1074. "class": "grid"
  1075. };
  1076. var _hoisted_18 = {
  1077. "class": "col-12 md:col-6"
  1078. };
  1079. var _hoisted_19 = {
  1080. "class": "col-12 md:col-6"
  1081. };
  1082. var _hoisted_20 = {
  1083. "class": "col-12 mb-3 md:mb-0"
  1084. };
  1085. var _hoisted_21 = {
  1086. "class": "flex flex-column md:flex-row md:align-items-center justify-content-end"
  1087. };
  1088. var _hoisted_22 = {
  1089. "class": "col-12"
  1090. };
  1091. var _hoisted_23 = {
  1092. style: {
  1093. "color": "#b71c1c"
  1094. }
  1095. };
  1096. var _hoisted_24 = {
  1097. "class": "flex justify-content-end"
  1098. };
  1099. var _hoisted_25 = {
  1100. "class": "grid"
  1101. };
  1102. var _hoisted_26 = {
  1103. "class": "col-12 flex flex-column md:flex-row justify-content-center md:justify-content-end"
  1104. };
  1105. function render(_ctx, _cache, $props, $setup, $data, $options) {
  1106. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  1107. var _component_Dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dialog");
  1108. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  1109. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  1110. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  1111. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  1112. 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"], {
  1113. title: "Ubah Member"
  1114. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  1115. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1116. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dialog, {
  1117. modal: "",
  1118. header: "Error",
  1119. visible: $setup.errorSubmitVisible,
  1120. "onUpdate:visible": _cache[0] || (_cache[0] = function ($event) {
  1121. return $setup.errorSubmitVisible = $event;
  1122. }),
  1123. contentStyle: "color: #b71c1c",
  1124. closable: false,
  1125. style: {
  1126. width: '40vw'
  1127. }
  1128. }, {
  1129. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1130. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.errorSubmitText), 1
  1131. /* TEXT */
  1132. )];
  1133. }),
  1134. _: 1
  1135. /* STABLE */
  1136. }, 8
  1137. /* PROPS */
  1138. , ["visible"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1139. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1140. return [_hoisted_3];
  1141. }),
  1142. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1143. return [(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)($setup["AppInputText"], {
  1144. modelValue: $setup.form.name,
  1145. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  1146. return $setup.form.name = $event;
  1147. }),
  1148. label: "Nama",
  1149. placeholder: "nama",
  1150. error: $setup.form.errors.name
  1151. }, null, 8
  1152. /* PROPS */
  1153. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1154. modelValue: $setup.form.phone,
  1155. "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
  1156. return $setup.form.phone = $event;
  1157. }),
  1158. label: "Nomor HP",
  1159. placeholder: "nomor hp",
  1160. error: $setup.form.errors.phone
  1161. }, null, 8
  1162. /* PROPS */
  1163. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1164. label: "Jenis member",
  1165. placeholder: "pilih satu",
  1166. modelValue: $setup.form.type_member_id,
  1167. "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
  1168. return $setup.form.type_member_id = $event;
  1169. }),
  1170. options: $props.typeMembers,
  1171. error: $setup.form.errors.type_member_id
  1172. }, null, 8
  1173. /* PROPS */
  1174. , ["modelValue", "options", "error"])])])];
  1175. }),
  1176. _: 1
  1177. /* STABLE */
  1178. })])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, {
  1179. "class": "bg-primary"
  1180. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  1181. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1182. return [_hoisted_10];
  1183. }),
  1184. _: 2
  1185. /* DYNAMIC */
  1186. }, [$props.typeMember ? {
  1187. name: "content",
  1188. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1189. return [_hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.type), 1
  1190. /* TEXT */
  1191. ), _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.max), 1
  1192. /* TEXT */
  1193. ), _hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.description), 1
  1194. /* TEXT */
  1195. ), _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.price), 1
  1196. /* TEXT */
  1197. )];
  1198. })
  1199. } : undefined]), 1024
  1200. /* DYNAMIC_SLOTS */
  1201. )])]), $props.typeMember ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_15, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_16, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1202. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1203. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1204. modelValue: $setup.form.plat_number,
  1205. "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
  1206. return $setup.form.plat_number = $event;
  1207. }),
  1208. label: "Plat Kendaraan",
  1209. placeholder: "plat kendaraan",
  1210. disabled: !$setup.form.type_member_id,
  1211. error: $setup.form.errors.plat_number
  1212. }, null, 8
  1213. /* PROPS */
  1214. , ["modelValue", "disabled", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_19, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1215. modelValue: $setup.form.max_vehicle_id,
  1216. "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
  1217. return $setup.form.max_vehicle_id = $event;
  1218. }),
  1219. label: "Jenis Kendaraan",
  1220. placeholder: "jenis kendaraan",
  1221. disabled: !$setup.form.type_member_id,
  1222. options: $props.typeMember.maxVehicles,
  1223. error: $setup.form.errors.max_vehicle_id
  1224. }, null, 8
  1225. /* PROPS */
  1226. , ["modelValue", "disabled", "options", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_20, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_21, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1227. label: "Tambah",
  1228. "class": "p-button-outlined",
  1229. icon: "pi pi-car",
  1230. disabled: !$setup.form.type_member_id,
  1231. onClick: $setup.vehicleOnAdd
  1232. }, null, 8
  1233. /* PROPS */
  1234. , ["disabled", "onClick"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_22, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  1235. "striped-rows": "",
  1236. "row-hover": "",
  1237. "responsive-layout": "scroll",
  1238. "column-resize-mode": "expand",
  1239. "edit-mode": "cell",
  1240. value: $setup.listVehicle
  1241. }, {
  1242. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1243. 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.platNumberTable, function (value) {
  1244. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  1245. field: value.field,
  1246. header: value.header,
  1247. key: value.field
  1248. }, null, 8
  1249. /* PROPS */
  1250. , ["field", "header"]);
  1251. }), 128
  1252. /* KEYED_FRAGMENT */
  1253. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1254. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1255. var index = _ref.index;
  1256. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_23, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]), 1
  1257. /* TEXT */
  1258. )];
  1259. }),
  1260. _: 1
  1261. /* STABLE */
  1262. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1263. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  1264. var index = _ref2.index;
  1265. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_24, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1266. icon: "pi pi-trash",
  1267. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-rounded p-button-text", {
  1268. 'p-button-danger': _ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]
  1269. }]),
  1270. onClick: function onClick($event) {
  1271. return $setup.vehicleOnDelete(index);
  1272. }
  1273. }, null, 8
  1274. /* PROPS */
  1275. , ["class", "onClick"])])];
  1276. }),
  1277. _: 1
  1278. /* STABLE */
  1279. })];
  1280. }),
  1281. _: 1
  1282. /* STABLE */
  1283. }, 8
  1284. /* PROPS */
  1285. , ["value"])])])];
  1286. }),
  1287. footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1288. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_25, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_26, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1289. label: "Simpan",
  1290. icon: "pi pi-check",
  1291. "class": "p-button-outlined",
  1292. disabled: $setup.form.processing || $setup.listVehicle.length === 0,
  1293. onClick: $setup.onSubmit
  1294. }, null, 8
  1295. /* PROPS */
  1296. , ["disabled"])])])];
  1297. }),
  1298. _: 1
  1299. /* STABLE */
  1300. })])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1301. }),
  1302. _: 1
  1303. /* STABLE */
  1304. })], 64
  1305. /* STABLE_FRAGMENT */
  1306. );
  1307. }
  1308. /***/ }),
  1309. /***/ "./resources/js/components/useFormErrorReset.js":
  1310. /*!******************************************************!*\
  1311. !*** ./resources/js/components/useFormErrorReset.js ***!
  1312. \******************************************************/
  1313. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1314. "use strict";
  1315. __webpack_require__.r(__webpack_exports__);
  1316. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1317. /* harmony export */ "useFormErrorReset": () => (/* binding */ useFormErrorReset)
  1318. /* harmony export */ });
  1319. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1320. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1321. function useFormErrorReset(form) {
  1322. var errors = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  1323. return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.errors;
  1324. });
  1325. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(errors, function () {
  1326. form.clearErrors();
  1327. });
  1328. }
  1329. /***/ }),
  1330. /***/ "./resources/js/pages/member/tableHeader.js":
  1331. /*!**************************************************!*\
  1332. !*** ./resources/js/pages/member/tableHeader.js ***!
  1333. \**************************************************/
  1334. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1335. "use strict";
  1336. __webpack_require__.r(__webpack_exports__);
  1337. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1338. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1339. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  1340. /* harmony export */ });
  1341. var indexTable = [{
  1342. field: 'updatedAt',
  1343. header: 'Diperbaharui'
  1344. }, {
  1345. field: 'name',
  1346. header: 'Nama'
  1347. }, {
  1348. field: 'platNumber',
  1349. header: 'Plat Kendaraan'
  1350. }, {
  1351. field: 'type',
  1352. header: 'Jenis Member'
  1353. }, {
  1354. field: 'price',
  1355. header: 'Tarif Member'
  1356. }, {
  1357. field: 'expDate',
  1358. header: 'Berakhir'
  1359. }];
  1360. var platNumberTable = [{
  1361. field: 'platNumber',
  1362. header: 'Plat Kendaraan'
  1363. }, {
  1364. field: 'typeVehicle',
  1365. header: 'Jenis Kendaraan'
  1366. }];
  1367. /***/ }),
  1368. /***/ "./resources/js/pages/member/useVehicle.js":
  1369. /*!*************************************************!*\
  1370. !*** ./resources/js/pages/member/useVehicle.js ***!
  1371. \*************************************************/
  1372. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1373. "use strict";
  1374. __webpack_require__.r(__webpack_exports__);
  1375. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1376. /* harmony export */ "useVehicle": () => (/* binding */ useVehicle)
  1377. /* harmony export */ });
  1378. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1379. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  1380. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1381. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  1382. function useVehicle(props, form) {
  1383. var listVehicle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)([]);
  1384. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1385. if (props.initialVehicles) {
  1386. props.initialVehicles.forEach(function (val) {
  1387. return listVehicle.push(val);
  1388. });
  1389. }
  1390. });
  1391. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
  1392. return form.type_member_id;
  1393. }, function () {
  1394. vehicleClear();
  1395. form.reset('plat_number', 'max_vehicle_id');
  1396. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  1397. only: ['typeMember'],
  1398. data: {
  1399. id: form.type_member_id
  1400. }
  1401. });
  1402. });
  1403. var vehicleClear = function vehicleClear() {
  1404. listVehicle.splice(0);
  1405. };
  1406. var vehicleOnDelete = function vehicleOnDelete(index) {
  1407. listVehicle.splice(index, 1);
  1408. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage)().props.value.errors = {};
  1409. };
  1410. var vehicleAddValidation = function vehicleAddValidation() {
  1411. if (!form.plat_number) {
  1412. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Plat kendaraan tidak boleh kosong', 'plat_number');
  1413. }
  1414. if (!form.max_vehicle_id) {
  1415. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Tidak boleh kosong', 'max_vehicle_id');
  1416. }
  1417. var platNumberExist = listVehicle.filter(function (vehicle) {
  1418. return vehicle.platNumber === form.plat_number.toUpperCase();
  1419. });
  1420. if (platNumberExist.length) {
  1421. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Nomor plat kendaraan tidak boleh sama', 'plat_number');
  1422. }
  1423. var maxVehicles = listVehicle.filter(function (vehicle) {
  1424. return vehicle.maxVehicleId === form.max_vehicle_id;
  1425. });
  1426. if (maxVehicles.length) {
  1427. if (maxVehicles.length + 1 > maxVehicles[0].maxVehicle) {
  1428. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Melibihi batas maksimal kendaraan', 'plat_number');
  1429. }
  1430. }
  1431. };
  1432. var vehicleOnAdd = function vehicleOnAdd() {
  1433. try {
  1434. form.clearErrors('plat_number', 'max_vehicle_id');
  1435. vehicleAddValidation();
  1436. var typeVehicle = props.typeMember.maxVehicles.filter(function (maxVehicle) {
  1437. return maxVehicle.value === form.max_vehicle_id;
  1438. })[0];
  1439. listVehicle.push({
  1440. platNumber: form.plat_number.toUpperCase(),
  1441. typeVehicle: typeVehicle.label,
  1442. typeVehicleId: typeVehicle.typeVehicleId,
  1443. maxVehicleId: typeVehicle.value,
  1444. maxVehicle: typeVehicle.maxVehicle
  1445. });
  1446. form.reset('plat_number', 'max_vehicle_id');
  1447. } catch (err) {
  1448. form.setError(err.field, err.message);
  1449. }
  1450. };
  1451. return {
  1452. listVehicle: listVehicle,
  1453. vehicleClear: vehicleClear,
  1454. vehicleOnDelete: vehicleOnDelete,
  1455. vehicleOnAdd: vehicleOnAdd
  1456. };
  1457. }
  1458. /***/ }),
  1459. /***/ "./resources/js/utils/formValidationError.js":
  1460. /*!***************************************************!*\
  1461. !*** ./resources/js/utils/formValidationError.js ***!
  1462. \***************************************************/
  1463. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1464. "use strict";
  1465. __webpack_require__.r(__webpack_exports__);
  1466. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1467. /* harmony export */ "default": () => (/* binding */ FormValidationError)
  1468. /* harmony export */ });
  1469. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  1470. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1471. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  1472. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1473. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1474. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1475. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
  1476. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1477. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  1478. function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  1479. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1480. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  1481. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1482. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1483. var FormValidationError = /*#__PURE__*/function (_Error) {
  1484. _inherits(FormValidationError, _Error);
  1485. var _super = _createSuper(FormValidationError);
  1486. function FormValidationError(message, field) {
  1487. var _this;
  1488. _classCallCheck(this, FormValidationError);
  1489. _this = _super.call(this, message);
  1490. _this.field = field;
  1491. return _this;
  1492. }
  1493. return _createClass(FormValidationError);
  1494. }( /*#__PURE__*/_wrapNativeSuper(Error));
  1495. /***/ }),
  1496. /***/ "./resources/js/utils/menu.js":
  1497. /*!************************************!*\
  1498. !*** ./resources/js/utils/menu.js ***!
  1499. \************************************/
  1500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1501. "use strict";
  1502. __webpack_require__.r(__webpack_exports__);
  1503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1504. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1505. /* harmony export */ });
  1506. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1507. // Admin
  1508. 1: [{
  1509. label: 'Home',
  1510. items: [{
  1511. label: 'Dashboard',
  1512. icon: 'pi pi-home',
  1513. to: '/dashboards',
  1514. component: 'home/Index'
  1515. }]
  1516. }, {
  1517. label: 'Master',
  1518. items: [{
  1519. label: 'User',
  1520. icon: 'pi pi-user',
  1521. to: '/users',
  1522. component: 'user/Index'
  1523. }]
  1524. }],
  1525. // Supervisor
  1526. 2: [{
  1527. label: 'Home',
  1528. items: [{
  1529. label: 'Dashboard',
  1530. icon: 'pi pi-home',
  1531. to: '/dashboards',
  1532. component: 'home/Index'
  1533. }]
  1534. }, {
  1535. label: 'Menu',
  1536. items: [{
  1537. label: 'Pengeluaran',
  1538. icon: 'pi pi-wallet',
  1539. to: '/expenses',
  1540. component: 'expense/Index'
  1541. }, {
  1542. label: 'Laporan',
  1543. icon: 'pi pi-book',
  1544. items: [{
  1545. label: 'Mutasi',
  1546. icon: 'pi pi-circle',
  1547. to: '/reports/mutations',
  1548. component: 'mutation/Report'
  1549. }]
  1550. }]
  1551. }, {
  1552. label: 'Master',
  1553. items: [{
  1554. label: 'Jenis Kendaraan',
  1555. icon: 'pi pi-car',
  1556. to: '/type-vehicles',
  1557. component: 'typevehicle/Index'
  1558. }, {
  1559. label: 'Jenis Member',
  1560. icon: 'pi pi-id-card',
  1561. to: '/type-members',
  1562. component: 'typemember/Index'
  1563. }]
  1564. }, {
  1565. label: 'Pengaturan',
  1566. items: [{
  1567. label: 'Tarif Parkir',
  1568. icon: 'pi pi-car',
  1569. to: '/parking-fees/create',
  1570. component: 'parkingfee/Create'
  1571. }]
  1572. }],
  1573. // Operator
  1574. 3: [{
  1575. label: 'Home',
  1576. items: [{
  1577. label: 'Dashboard',
  1578. icon: 'pi pi-home',
  1579. to: '/dashboards',
  1580. component: 'home/Index'
  1581. }]
  1582. }, {
  1583. label: 'Transaksi',
  1584. items: [{
  1585. label: 'Transaksi masuk dan keluar',
  1586. icon: 'pi pi-car',
  1587. to: '/transactions/create',
  1588. component: 'transaction/Create'
  1589. }]
  1590. }, {
  1591. label: 'Menu',
  1592. items: [{
  1593. label: 'Pengeluaran',
  1594. icon: 'pi pi-wallet',
  1595. to: '/expenses',
  1596. component: 'expense/Index'
  1597. }, {
  1598. label: 'Member',
  1599. icon: 'pi pi-id-card',
  1600. to: '/members',
  1601. component: 'member/Index'
  1602. }, {
  1603. label: 'Top Up',
  1604. icon: 'pi pi-car',
  1605. to: '/top-ups',
  1606. component: 'topup/Index'
  1607. }]
  1608. }, {
  1609. label: 'Not Production',
  1610. items: [{
  1611. label: 'Test Transactions',
  1612. icon: 'pi pi-car',
  1613. to: '/test-transactions/create',
  1614. component: 'test-transaction/Create'
  1615. }]
  1616. }]
  1617. });
  1618. /***/ }),
  1619. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1620. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1621. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1622. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1623. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1624. "use strict";
  1625. __webpack_require__.r(__webpack_exports__);
  1626. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1627. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1628. /* harmony export */ });
  1629. /* 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");
  1630. /* 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__);
  1631. // Imports
  1632. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1633. // Module
  1634. ___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}", ""]);
  1635. // Exports
  1636. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1637. /***/ }),
  1638. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1639. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1640. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1641. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1642. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1643. "use strict";
  1644. __webpack_require__.r(__webpack_exports__);
  1645. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1646. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1647. /* harmony export */ });
  1648. /* 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");
  1649. /* 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__);
  1650. // Imports
  1651. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1652. // Module
  1653. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1654. // Exports
  1655. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1656. /***/ }),
  1657. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1658. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1659. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1660. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1661. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1662. "use strict";
  1663. __webpack_require__.r(__webpack_exports__);
  1664. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1665. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1666. /* harmony export */ });
  1667. /* 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");
  1668. /* 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__);
  1669. // Imports
  1670. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1671. // Module
  1672. ___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}", ""]);
  1673. // Exports
  1674. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1675. /***/ }),
  1676. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1677. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1678. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1679. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1680. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1681. "use strict";
  1682. __webpack_require__.r(__webpack_exports__);
  1683. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1684. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1685. /* harmony export */ });
  1686. /* 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");
  1687. /* 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__);
  1688. // Imports
  1689. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1690. // Module
  1691. ___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: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1692. // Exports
  1693. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1694. /***/ }),
  1695. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1696. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1697. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1698. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1699. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1700. "use strict";
  1701. __webpack_require__.r(__webpack_exports__);
  1702. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1703. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1704. /* harmony export */ });
  1705. /* 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");
  1706. /* 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__);
  1707. // Imports
  1708. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1709. // Module
  1710. ___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}", ""]);
  1711. // Exports
  1712. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1713. /***/ }),
  1714. /***/ "./node_modules/lodash/lodash.js":
  1715. /*!***************************************!*\
  1716. !*** ./node_modules/lodash/lodash.js ***!
  1717. \***************************************/
  1718. /***/ (function(module, exports, __webpack_require__) {
  1719. /* module decorator */ module = __webpack_require__.nmd(module);
  1720. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1721. * @license
  1722. * Lodash <https://lodash.com/>
  1723. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1724. * Released under MIT license <https://lodash.com/license>
  1725. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1726. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1727. */
  1728. ;(function() {
  1729. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1730. var undefined;
  1731. /** Used as the semantic version number. */
  1732. var VERSION = '4.17.21';
  1733. /** Used as the size to enable large array optimizations. */
  1734. var LARGE_ARRAY_SIZE = 200;
  1735. /** Error message constants. */
  1736. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1737. FUNC_ERROR_TEXT = 'Expected a function',
  1738. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1739. /** Used to stand-in for `undefined` hash values. */
  1740. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1741. /** Used as the maximum memoize cache size. */
  1742. var MAX_MEMOIZE_SIZE = 500;
  1743. /** Used as the internal argument placeholder. */
  1744. var PLACEHOLDER = '__lodash_placeholder__';
  1745. /** Used to compose bitmasks for cloning. */
  1746. var CLONE_DEEP_FLAG = 1,
  1747. CLONE_FLAT_FLAG = 2,
  1748. CLONE_SYMBOLS_FLAG = 4;
  1749. /** Used to compose bitmasks for value comparisons. */
  1750. var COMPARE_PARTIAL_FLAG = 1,
  1751. COMPARE_UNORDERED_FLAG = 2;
  1752. /** Used to compose bitmasks for function metadata. */
  1753. var WRAP_BIND_FLAG = 1,
  1754. WRAP_BIND_KEY_FLAG = 2,
  1755. WRAP_CURRY_BOUND_FLAG = 4,
  1756. WRAP_CURRY_FLAG = 8,
  1757. WRAP_CURRY_RIGHT_FLAG = 16,
  1758. WRAP_PARTIAL_FLAG = 32,
  1759. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1760. WRAP_ARY_FLAG = 128,
  1761. WRAP_REARG_FLAG = 256,
  1762. WRAP_FLIP_FLAG = 512;
  1763. /** Used as default options for `_.truncate`. */
  1764. var DEFAULT_TRUNC_LENGTH = 30,
  1765. DEFAULT_TRUNC_OMISSION = '...';
  1766. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1767. var HOT_COUNT = 800,
  1768. HOT_SPAN = 16;
  1769. /** Used to indicate the type of lazy iteratees. */
  1770. var LAZY_FILTER_FLAG = 1,
  1771. LAZY_MAP_FLAG = 2,
  1772. LAZY_WHILE_FLAG = 3;
  1773. /** Used as references for various `Number` constants. */
  1774. var INFINITY = 1 / 0,
  1775. MAX_SAFE_INTEGER = 9007199254740991,
  1776. MAX_INTEGER = 1.7976931348623157e+308,
  1777. NAN = 0 / 0;
  1778. /** Used as references for the maximum length and index of an array. */
  1779. var MAX_ARRAY_LENGTH = 4294967295,
  1780. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1781. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1782. /** Used to associate wrap methods with their bit flags. */
  1783. var wrapFlags = [
  1784. ['ary', WRAP_ARY_FLAG],
  1785. ['bind', WRAP_BIND_FLAG],
  1786. ['bindKey', WRAP_BIND_KEY_FLAG],
  1787. ['curry', WRAP_CURRY_FLAG],
  1788. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1789. ['flip', WRAP_FLIP_FLAG],
  1790. ['partial', WRAP_PARTIAL_FLAG],
  1791. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1792. ['rearg', WRAP_REARG_FLAG]
  1793. ];
  1794. /** `Object#toString` result references. */
  1795. var argsTag = '[object Arguments]',
  1796. arrayTag = '[object Array]',
  1797. asyncTag = '[object AsyncFunction]',
  1798. boolTag = '[object Boolean]',
  1799. dateTag = '[object Date]',
  1800. domExcTag = '[object DOMException]',
  1801. errorTag = '[object Error]',
  1802. funcTag = '[object Function]',
  1803. genTag = '[object GeneratorFunction]',
  1804. mapTag = '[object Map]',
  1805. numberTag = '[object Number]',
  1806. nullTag = '[object Null]',
  1807. objectTag = '[object Object]',
  1808. promiseTag = '[object Promise]',
  1809. proxyTag = '[object Proxy]',
  1810. regexpTag = '[object RegExp]',
  1811. setTag = '[object Set]',
  1812. stringTag = '[object String]',
  1813. symbolTag = '[object Symbol]',
  1814. undefinedTag = '[object Undefined]',
  1815. weakMapTag = '[object WeakMap]',
  1816. weakSetTag = '[object WeakSet]';
  1817. var arrayBufferTag = '[object ArrayBuffer]',
  1818. dataViewTag = '[object DataView]',
  1819. float32Tag = '[object Float32Array]',
  1820. float64Tag = '[object Float64Array]',
  1821. int8Tag = '[object Int8Array]',
  1822. int16Tag = '[object Int16Array]',
  1823. int32Tag = '[object Int32Array]',
  1824. uint8Tag = '[object Uint8Array]',
  1825. uint8ClampedTag = '[object Uint8ClampedArray]',
  1826. uint16Tag = '[object Uint16Array]',
  1827. uint32Tag = '[object Uint32Array]';
  1828. /** Used to match empty string literals in compiled template source. */
  1829. var reEmptyStringLeading = /\b__p \+= '';/g,
  1830. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1831. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1832. /** Used to match HTML entities and HTML characters. */
  1833. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1834. reUnescapedHtml = /[&<>"']/g,
  1835. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1836. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1837. /** Used to match template delimiters. */
  1838. var reEscape = /<%-([\s\S]+?)%>/g,
  1839. reEvaluate = /<%([\s\S]+?)%>/g,
  1840. reInterpolate = /<%=([\s\S]+?)%>/g;
  1841. /** Used to match property names within property paths. */
  1842. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1843. reIsPlainProp = /^\w*$/,
  1844. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1845. /**
  1846. * Used to match `RegExp`
  1847. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1848. */
  1849. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1850. reHasRegExpChar = RegExp(reRegExpChar.source);
  1851. /** Used to match leading whitespace. */
  1852. var reTrimStart = /^\s+/;
  1853. /** Used to match a single whitespace character. */
  1854. var reWhitespace = /\s/;
  1855. /** Used to match wrap detail comments. */
  1856. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1857. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1858. reSplitDetails = /,? & /;
  1859. /** Used to match words composed of alphanumeric characters. */
  1860. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1861. /**
  1862. * Used to validate the `validate` option in `_.template` variable.
  1863. *
  1864. * Forbids characters which could potentially change the meaning of the function argument definition:
  1865. * - "()," (modification of function parameters)
  1866. * - "=" (default value)
  1867. * - "[]{}" (destructuring of function parameters)
  1868. * - "/" (beginning of a comment)
  1869. * - whitespace
  1870. */
  1871. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1872. /** Used to match backslashes in property paths. */
  1873. var reEscapeChar = /\\(\\)?/g;
  1874. /**
  1875. * Used to match
  1876. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1877. */
  1878. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1879. /** Used to match `RegExp` flags from their coerced string values. */
  1880. var reFlags = /\w*$/;
  1881. /** Used to detect bad signed hexadecimal string values. */
  1882. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1883. /** Used to detect binary string values. */
  1884. var reIsBinary = /^0b[01]+$/i;
  1885. /** Used to detect host constructors (Safari). */
  1886. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1887. /** Used to detect octal string values. */
  1888. var reIsOctal = /^0o[0-7]+$/i;
  1889. /** Used to detect unsigned integer values. */
  1890. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1891. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1892. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1893. /** Used to ensure capturing order of template delimiters. */
  1894. var reNoMatch = /($^)/;
  1895. /** Used to match unescaped characters in compiled string literals. */
  1896. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1897. /** Used to compose unicode character classes. */
  1898. var rsAstralRange = '\\ud800-\\udfff',
  1899. rsComboMarksRange = '\\u0300-\\u036f',
  1900. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1901. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1902. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1903. rsDingbatRange = '\\u2700-\\u27bf',
  1904. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1905. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1906. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1907. rsPunctuationRange = '\\u2000-\\u206f',
  1908. 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',
  1909. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1910. rsVarRange = '\\ufe0e\\ufe0f',
  1911. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1912. /** Used to compose unicode capture groups. */
  1913. var rsApos = "['\u2019]",
  1914. rsAstral = '[' + rsAstralRange + ']',
  1915. rsBreak = '[' + rsBreakRange + ']',
  1916. rsCombo = '[' + rsComboRange + ']',
  1917. rsDigits = '\\d+',
  1918. rsDingbat = '[' + rsDingbatRange + ']',
  1919. rsLower = '[' + rsLowerRange + ']',
  1920. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1921. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1922. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1923. rsNonAstral = '[^' + rsAstralRange + ']',
  1924. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1925. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1926. rsUpper = '[' + rsUpperRange + ']',
  1927. rsZWJ = '\\u200d';
  1928. /** Used to compose unicode regexes. */
  1929. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1930. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1931. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1932. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1933. reOptMod = rsModifier + '?',
  1934. rsOptVar = '[' + rsVarRange + ']?',
  1935. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1936. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1937. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1938. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1939. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1940. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1941. /** Used to match apostrophes. */
  1942. var reApos = RegExp(rsApos, 'g');
  1943. /**
  1944. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1945. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1946. */
  1947. var reComboMark = RegExp(rsCombo, 'g');
  1948. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1949. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1950. /** Used to match complex or compound words. */
  1951. var reUnicodeWord = RegExp([
  1952. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1953. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1954. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1955. rsUpper + '+' + rsOptContrUpper,
  1956. rsOrdUpper,
  1957. rsOrdLower,
  1958. rsDigits,
  1959. rsEmoji
  1960. ].join('|'), 'g');
  1961. /** 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/). */
  1962. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1963. /** Used to detect strings that need a more robust regexp to match words. */
  1964. 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 ]/;
  1965. /** Used to assign default `context` object properties. */
  1966. var contextProps = [
  1967. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1968. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1969. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1970. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1971. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1972. ];
  1973. /** Used to make template sourceURLs easier to identify. */
  1974. var templateCounter = -1;
  1975. /** Used to identify `toStringTag` values of typed arrays. */
  1976. var typedArrayTags = {};
  1977. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1978. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1979. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1980. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1981. typedArrayTags[uint32Tag] = true;
  1982. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1983. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1984. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1985. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1986. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1987. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1988. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1989. typedArrayTags[weakMapTag] = false;
  1990. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1991. var cloneableTags = {};
  1992. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1993. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1994. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1995. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1996. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1997. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1998. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1999. cloneableTags[regexpTag] = cloneableTags[setTag] =
  2000. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  2001. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  2002. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  2003. cloneableTags[errorTag] = cloneableTags[funcTag] =
  2004. cloneableTags[weakMapTag] = false;
  2005. /** Used to map Latin Unicode letters to basic Latin letters. */
  2006. var deburredLetters = {
  2007. // Latin-1 Supplement block.
  2008. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  2009. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  2010. '\xc7': 'C', '\xe7': 'c',
  2011. '\xd0': 'D', '\xf0': 'd',
  2012. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  2013. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  2014. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  2015. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  2016. '\xd1': 'N', '\xf1': 'n',
  2017. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  2018. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  2019. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  2020. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  2021. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  2022. '\xc6': 'Ae', '\xe6': 'ae',
  2023. '\xde': 'Th', '\xfe': 'th',
  2024. '\xdf': 'ss',
  2025. // Latin Extended-A block.
  2026. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  2027. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  2028. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  2029. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  2030. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  2031. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  2032. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  2033. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  2034. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  2035. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  2036. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  2037. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  2038. '\u0134': 'J', '\u0135': 'j',
  2039. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  2040. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  2041. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  2042. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  2043. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  2044. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  2045. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  2046. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  2047. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  2048. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  2049. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  2050. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  2051. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  2052. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  2053. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  2054. '\u0174': 'W', '\u0175': 'w',
  2055. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  2056. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  2057. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  2058. '\u0132': 'IJ', '\u0133': 'ij',
  2059. '\u0152': 'Oe', '\u0153': 'oe',
  2060. '\u0149': "'n", '\u017f': 's'
  2061. };
  2062. /** Used to map characters to HTML entities. */
  2063. var htmlEscapes = {
  2064. '&': '&amp;',
  2065. '<': '&lt;',
  2066. '>': '&gt;',
  2067. '"': '&quot;',
  2068. "'": '&#39;'
  2069. };
  2070. /** Used to map HTML entities to characters. */
  2071. var htmlUnescapes = {
  2072. '&amp;': '&',
  2073. '&lt;': '<',
  2074. '&gt;': '>',
  2075. '&quot;': '"',
  2076. '&#39;': "'"
  2077. };
  2078. /** Used to escape characters for inclusion in compiled string literals. */
  2079. var stringEscapes = {
  2080. '\\': '\\',
  2081. "'": "'",
  2082. '\n': 'n',
  2083. '\r': 'r',
  2084. '\u2028': 'u2028',
  2085. '\u2029': 'u2029'
  2086. };
  2087. /** Built-in method references without a dependency on `root`. */
  2088. var freeParseFloat = parseFloat,
  2089. freeParseInt = parseInt;
  2090. /** Detect free variable `global` from Node.js. */
  2091. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2092. /** Detect free variable `self`. */
  2093. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  2094. /** Used as a reference to the global object. */
  2095. var root = freeGlobal || freeSelf || Function('return this')();
  2096. /** Detect free variable `exports`. */
  2097. var freeExports = true && exports && !exports.nodeType && exports;
  2098. /** Detect free variable `module`. */
  2099. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  2100. /** Detect the popular CommonJS extension `module.exports`. */
  2101. var moduleExports = freeModule && freeModule.exports === freeExports;
  2102. /** Detect free variable `process` from Node.js. */
  2103. var freeProcess = moduleExports && freeGlobal.process;
  2104. /** Used to access faster Node.js helpers. */
  2105. var nodeUtil = (function() {
  2106. try {
  2107. // Use `util.types` for Node.js 10+.
  2108. var types = freeModule && freeModule.require && freeModule.require('util').types;
  2109. if (types) {
  2110. return types;
  2111. }
  2112. // Legacy `process.binding('util')` for Node.js < 10.
  2113. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  2114. } catch (e) {}
  2115. }());
  2116. /* Node.js helper references. */
  2117. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  2118. nodeIsDate = nodeUtil && nodeUtil.isDate,
  2119. nodeIsMap = nodeUtil && nodeUtil.isMap,
  2120. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  2121. nodeIsSet = nodeUtil && nodeUtil.isSet,
  2122. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2123. /*--------------------------------------------------------------------------*/
  2124. /**
  2125. * A faster alternative to `Function#apply`, this function invokes `func`
  2126. * with the `this` binding of `thisArg` and the arguments of `args`.
  2127. *
  2128. * @private
  2129. * @param {Function} func The function to invoke.
  2130. * @param {*} thisArg The `this` binding of `func`.
  2131. * @param {Array} args The arguments to invoke `func` with.
  2132. * @returns {*} Returns the result of `func`.
  2133. */
  2134. function apply(func, thisArg, args) {
  2135. switch (args.length) {
  2136. case 0: return func.call(thisArg);
  2137. case 1: return func.call(thisArg, args[0]);
  2138. case 2: return func.call(thisArg, args[0], args[1]);
  2139. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  2140. }
  2141. return func.apply(thisArg, args);
  2142. }
  2143. /**
  2144. * A specialized version of `baseAggregator` for arrays.
  2145. *
  2146. * @private
  2147. * @param {Array} [array] The array to iterate over.
  2148. * @param {Function} setter The function to set `accumulator` values.
  2149. * @param {Function} iteratee The iteratee to transform keys.
  2150. * @param {Object} accumulator The initial aggregated object.
  2151. * @returns {Function} Returns `accumulator`.
  2152. */
  2153. function arrayAggregator(array, setter, iteratee, accumulator) {
  2154. var index = -1,
  2155. length = array == null ? 0 : array.length;
  2156. while (++index < length) {
  2157. var value = array[index];
  2158. setter(accumulator, value, iteratee(value), array);
  2159. }
  2160. return accumulator;
  2161. }
  2162. /**
  2163. * A specialized version of `_.forEach` for arrays without support for
  2164. * iteratee shorthands.
  2165. *
  2166. * @private
  2167. * @param {Array} [array] The array to iterate over.
  2168. * @param {Function} iteratee The function invoked per iteration.
  2169. * @returns {Array} Returns `array`.
  2170. */
  2171. function arrayEach(array, iteratee) {
  2172. var index = -1,
  2173. length = array == null ? 0 : array.length;
  2174. while (++index < length) {
  2175. if (iteratee(array[index], index, array) === false) {
  2176. break;
  2177. }
  2178. }
  2179. return array;
  2180. }
  2181. /**
  2182. * A specialized version of `_.forEachRight` for arrays without support for
  2183. * iteratee shorthands.
  2184. *
  2185. * @private
  2186. * @param {Array} [array] The array to iterate over.
  2187. * @param {Function} iteratee The function invoked per iteration.
  2188. * @returns {Array} Returns `array`.
  2189. */
  2190. function arrayEachRight(array, iteratee) {
  2191. var length = array == null ? 0 : array.length;
  2192. while (length--) {
  2193. if (iteratee(array[length], length, array) === false) {
  2194. break;
  2195. }
  2196. }
  2197. return array;
  2198. }
  2199. /**
  2200. * A specialized version of `_.every` for arrays without support for
  2201. * iteratee shorthands.
  2202. *
  2203. * @private
  2204. * @param {Array} [array] The array to iterate over.
  2205. * @param {Function} predicate The function invoked per iteration.
  2206. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  2207. * else `false`.
  2208. */
  2209. function arrayEvery(array, predicate) {
  2210. var index = -1,
  2211. length = array == null ? 0 : array.length;
  2212. while (++index < length) {
  2213. if (!predicate(array[index], index, array)) {
  2214. return false;
  2215. }
  2216. }
  2217. return true;
  2218. }
  2219. /**
  2220. * A specialized version of `_.filter` for arrays without support for
  2221. * iteratee shorthands.
  2222. *
  2223. * @private
  2224. * @param {Array} [array] The array to iterate over.
  2225. * @param {Function} predicate The function invoked per iteration.
  2226. * @returns {Array} Returns the new filtered array.
  2227. */
  2228. function arrayFilter(array, predicate) {
  2229. var index = -1,
  2230. length = array == null ? 0 : array.length,
  2231. resIndex = 0,
  2232. result = [];
  2233. while (++index < length) {
  2234. var value = array[index];
  2235. if (predicate(value, index, array)) {
  2236. result[resIndex++] = value;
  2237. }
  2238. }
  2239. return result;
  2240. }
  2241. /**
  2242. * A specialized version of `_.includes` for arrays without support for
  2243. * specifying an index to search from.
  2244. *
  2245. * @private
  2246. * @param {Array} [array] The array to inspect.
  2247. * @param {*} target The value to search for.
  2248. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2249. */
  2250. function arrayIncludes(array, value) {
  2251. var length = array == null ? 0 : array.length;
  2252. return !!length && baseIndexOf(array, value, 0) > -1;
  2253. }
  2254. /**
  2255. * This function is like `arrayIncludes` except that it accepts a comparator.
  2256. *
  2257. * @private
  2258. * @param {Array} [array] The array to inspect.
  2259. * @param {*} target The value to search for.
  2260. * @param {Function} comparator The comparator invoked per element.
  2261. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2262. */
  2263. function arrayIncludesWith(array, value, comparator) {
  2264. var index = -1,
  2265. length = array == null ? 0 : array.length;
  2266. while (++index < length) {
  2267. if (comparator(value, array[index])) {
  2268. return true;
  2269. }
  2270. }
  2271. return false;
  2272. }
  2273. /**
  2274. * A specialized version of `_.map` for arrays without support for iteratee
  2275. * shorthands.
  2276. *
  2277. * @private
  2278. * @param {Array} [array] The array to iterate over.
  2279. * @param {Function} iteratee The function invoked per iteration.
  2280. * @returns {Array} Returns the new mapped array.
  2281. */
  2282. function arrayMap(array, iteratee) {
  2283. var index = -1,
  2284. length = array == null ? 0 : array.length,
  2285. result = Array(length);
  2286. while (++index < length) {
  2287. result[index] = iteratee(array[index], index, array);
  2288. }
  2289. return result;
  2290. }
  2291. /**
  2292. * Appends the elements of `values` to `array`.
  2293. *
  2294. * @private
  2295. * @param {Array} array The array to modify.
  2296. * @param {Array} values The values to append.
  2297. * @returns {Array} Returns `array`.
  2298. */
  2299. function arrayPush(array, values) {
  2300. var index = -1,
  2301. length = values.length,
  2302. offset = array.length;
  2303. while (++index < length) {
  2304. array[offset + index] = values[index];
  2305. }
  2306. return array;
  2307. }
  2308. /**
  2309. * A specialized version of `_.reduce` for arrays without support for
  2310. * iteratee shorthands.
  2311. *
  2312. * @private
  2313. * @param {Array} [array] The array to iterate over.
  2314. * @param {Function} iteratee The function invoked per iteration.
  2315. * @param {*} [accumulator] The initial value.
  2316. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2317. * the initial value.
  2318. * @returns {*} Returns the accumulated value.
  2319. */
  2320. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2321. var index = -1,
  2322. length = array == null ? 0 : array.length;
  2323. if (initAccum && length) {
  2324. accumulator = array[++index];
  2325. }
  2326. while (++index < length) {
  2327. accumulator = iteratee(accumulator, array[index], index, array);
  2328. }
  2329. return accumulator;
  2330. }
  2331. /**
  2332. * A specialized version of `_.reduceRight` for arrays without support for
  2333. * iteratee shorthands.
  2334. *
  2335. * @private
  2336. * @param {Array} [array] The array to iterate over.
  2337. * @param {Function} iteratee The function invoked per iteration.
  2338. * @param {*} [accumulator] The initial value.
  2339. * @param {boolean} [initAccum] Specify using the last element of `array` as
  2340. * the initial value.
  2341. * @returns {*} Returns the accumulated value.
  2342. */
  2343. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  2344. var length = array == null ? 0 : array.length;
  2345. if (initAccum && length) {
  2346. accumulator = array[--length];
  2347. }
  2348. while (length--) {
  2349. accumulator = iteratee(accumulator, array[length], length, array);
  2350. }
  2351. return accumulator;
  2352. }
  2353. /**
  2354. * A specialized version of `_.some` for arrays without support for iteratee
  2355. * shorthands.
  2356. *
  2357. * @private
  2358. * @param {Array} [array] The array to iterate over.
  2359. * @param {Function} predicate The function invoked per iteration.
  2360. * @returns {boolean} Returns `true` if any element passes the predicate check,
  2361. * else `false`.
  2362. */
  2363. function arraySome(array, predicate) {
  2364. var index = -1,
  2365. length = array == null ? 0 : array.length;
  2366. while (++index < length) {
  2367. if (predicate(array[index], index, array)) {
  2368. return true;
  2369. }
  2370. }
  2371. return false;
  2372. }
  2373. /**
  2374. * Gets the size of an ASCII `string`.
  2375. *
  2376. * @private
  2377. * @param {string} string The string inspect.
  2378. * @returns {number} Returns the string size.
  2379. */
  2380. var asciiSize = baseProperty('length');
  2381. /**
  2382. * Converts an ASCII `string` to an array.
  2383. *
  2384. * @private
  2385. * @param {string} string The string to convert.
  2386. * @returns {Array} Returns the converted array.
  2387. */
  2388. function asciiToArray(string) {
  2389. return string.split('');
  2390. }
  2391. /**
  2392. * Splits an ASCII `string` into an array of its words.
  2393. *
  2394. * @private
  2395. * @param {string} The string to inspect.
  2396. * @returns {Array} Returns the words of `string`.
  2397. */
  2398. function asciiWords(string) {
  2399. return string.match(reAsciiWord) || [];
  2400. }
  2401. /**
  2402. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2403. * without support for iteratee shorthands, which iterates over `collection`
  2404. * using `eachFunc`.
  2405. *
  2406. * @private
  2407. * @param {Array|Object} collection The collection to inspect.
  2408. * @param {Function} predicate The function invoked per iteration.
  2409. * @param {Function} eachFunc The function to iterate over `collection`.
  2410. * @returns {*} Returns the found element or its key, else `undefined`.
  2411. */
  2412. function baseFindKey(collection, predicate, eachFunc) {
  2413. var result;
  2414. eachFunc(collection, function(value, key, collection) {
  2415. if (predicate(value, key, collection)) {
  2416. result = key;
  2417. return false;
  2418. }
  2419. });
  2420. return result;
  2421. }
  2422. /**
  2423. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2424. * support for iteratee shorthands.
  2425. *
  2426. * @private
  2427. * @param {Array} array The array to inspect.
  2428. * @param {Function} predicate The function invoked per iteration.
  2429. * @param {number} fromIndex The index to search from.
  2430. * @param {boolean} [fromRight] Specify iterating from right to left.
  2431. * @returns {number} Returns the index of the matched value, else `-1`.
  2432. */
  2433. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2434. var length = array.length,
  2435. index = fromIndex + (fromRight ? 1 : -1);
  2436. while ((fromRight ? index-- : ++index < length)) {
  2437. if (predicate(array[index], index, array)) {
  2438. return index;
  2439. }
  2440. }
  2441. return -1;
  2442. }
  2443. /**
  2444. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2445. *
  2446. * @private
  2447. * @param {Array} array The array to inspect.
  2448. * @param {*} value The value to search for.
  2449. * @param {number} fromIndex The index to search from.
  2450. * @returns {number} Returns the index of the matched value, else `-1`.
  2451. */
  2452. function baseIndexOf(array, value, fromIndex) {
  2453. return value === value
  2454. ? strictIndexOf(array, value, fromIndex)
  2455. : baseFindIndex(array, baseIsNaN, fromIndex);
  2456. }
  2457. /**
  2458. * This function is like `baseIndexOf` except that it accepts a comparator.
  2459. *
  2460. * @private
  2461. * @param {Array} array The array to inspect.
  2462. * @param {*} value The value to search for.
  2463. * @param {number} fromIndex The index to search from.
  2464. * @param {Function} comparator The comparator invoked per element.
  2465. * @returns {number} Returns the index of the matched value, else `-1`.
  2466. */
  2467. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2468. var index = fromIndex - 1,
  2469. length = array.length;
  2470. while (++index < length) {
  2471. if (comparator(array[index], value)) {
  2472. return index;
  2473. }
  2474. }
  2475. return -1;
  2476. }
  2477. /**
  2478. * The base implementation of `_.isNaN` without support for number objects.
  2479. *
  2480. * @private
  2481. * @param {*} value The value to check.
  2482. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2483. */
  2484. function baseIsNaN(value) {
  2485. return value !== value;
  2486. }
  2487. /**
  2488. * The base implementation of `_.mean` and `_.meanBy` without support for
  2489. * iteratee shorthands.
  2490. *
  2491. * @private
  2492. * @param {Array} array The array to iterate over.
  2493. * @param {Function} iteratee The function invoked per iteration.
  2494. * @returns {number} Returns the mean.
  2495. */
  2496. function baseMean(array, iteratee) {
  2497. var length = array == null ? 0 : array.length;
  2498. return length ? (baseSum(array, iteratee) / length) : NAN;
  2499. }
  2500. /**
  2501. * The base implementation of `_.property` without support for deep paths.
  2502. *
  2503. * @private
  2504. * @param {string} key The key of the property to get.
  2505. * @returns {Function} Returns the new accessor function.
  2506. */
  2507. function baseProperty(key) {
  2508. return function(object) {
  2509. return object == null ? undefined : object[key];
  2510. };
  2511. }
  2512. /**
  2513. * The base implementation of `_.propertyOf` without support for deep paths.
  2514. *
  2515. * @private
  2516. * @param {Object} object The object to query.
  2517. * @returns {Function} Returns the new accessor function.
  2518. */
  2519. function basePropertyOf(object) {
  2520. return function(key) {
  2521. return object == null ? undefined : object[key];
  2522. };
  2523. }
  2524. /**
  2525. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2526. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2527. *
  2528. * @private
  2529. * @param {Array|Object} collection The collection to iterate over.
  2530. * @param {Function} iteratee The function invoked per iteration.
  2531. * @param {*} accumulator The initial value.
  2532. * @param {boolean} initAccum Specify using the first or last element of
  2533. * `collection` as the initial value.
  2534. * @param {Function} eachFunc The function to iterate over `collection`.
  2535. * @returns {*} Returns the accumulated value.
  2536. */
  2537. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2538. eachFunc(collection, function(value, index, collection) {
  2539. accumulator = initAccum
  2540. ? (initAccum = false, value)
  2541. : iteratee(accumulator, value, index, collection);
  2542. });
  2543. return accumulator;
  2544. }
  2545. /**
  2546. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2547. * sort order of `array` and replaces criteria objects with their corresponding
  2548. * values.
  2549. *
  2550. * @private
  2551. * @param {Array} array The array to sort.
  2552. * @param {Function} comparer The function to define sort order.
  2553. * @returns {Array} Returns `array`.
  2554. */
  2555. function baseSortBy(array, comparer) {
  2556. var length = array.length;
  2557. array.sort(comparer);
  2558. while (length--) {
  2559. array[length] = array[length].value;
  2560. }
  2561. return array;
  2562. }
  2563. /**
  2564. * The base implementation of `_.sum` and `_.sumBy` without support for
  2565. * iteratee shorthands.
  2566. *
  2567. * @private
  2568. * @param {Array} array The array to iterate over.
  2569. * @param {Function} iteratee The function invoked per iteration.
  2570. * @returns {number} Returns the sum.
  2571. */
  2572. function baseSum(array, iteratee) {
  2573. var result,
  2574. index = -1,
  2575. length = array.length;
  2576. while (++index < length) {
  2577. var current = iteratee(array[index]);
  2578. if (current !== undefined) {
  2579. result = result === undefined ? current : (result + current);
  2580. }
  2581. }
  2582. return result;
  2583. }
  2584. /**
  2585. * The base implementation of `_.times` without support for iteratee shorthands
  2586. * or max array length checks.
  2587. *
  2588. * @private
  2589. * @param {number} n The number of times to invoke `iteratee`.
  2590. * @param {Function} iteratee The function invoked per iteration.
  2591. * @returns {Array} Returns the array of results.
  2592. */
  2593. function baseTimes(n, iteratee) {
  2594. var index = -1,
  2595. result = Array(n);
  2596. while (++index < n) {
  2597. result[index] = iteratee(index);
  2598. }
  2599. return result;
  2600. }
  2601. /**
  2602. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2603. * of key-value pairs for `object` corresponding to the property names of `props`.
  2604. *
  2605. * @private
  2606. * @param {Object} object The object to query.
  2607. * @param {Array} props The property names to get values for.
  2608. * @returns {Object} Returns the key-value pairs.
  2609. */
  2610. function baseToPairs(object, props) {
  2611. return arrayMap(props, function(key) {
  2612. return [key, object[key]];
  2613. });
  2614. }
  2615. /**
  2616. * The base implementation of `_.trim`.
  2617. *
  2618. * @private
  2619. * @param {string} string The string to trim.
  2620. * @returns {string} Returns the trimmed string.
  2621. */
  2622. function baseTrim(string) {
  2623. return string
  2624. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2625. : string;
  2626. }
  2627. /**
  2628. * The base implementation of `_.unary` without support for storing metadata.
  2629. *
  2630. * @private
  2631. * @param {Function} func The function to cap arguments for.
  2632. * @returns {Function} Returns the new capped function.
  2633. */
  2634. function baseUnary(func) {
  2635. return function(value) {
  2636. return func(value);
  2637. };
  2638. }
  2639. /**
  2640. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2641. * array of `object` property values corresponding to the property names
  2642. * of `props`.
  2643. *
  2644. * @private
  2645. * @param {Object} object The object to query.
  2646. * @param {Array} props The property names to get values for.
  2647. * @returns {Object} Returns the array of property values.
  2648. */
  2649. function baseValues(object, props) {
  2650. return arrayMap(props, function(key) {
  2651. return object[key];
  2652. });
  2653. }
  2654. /**
  2655. * Checks if a `cache` value for `key` exists.
  2656. *
  2657. * @private
  2658. * @param {Object} cache The cache to query.
  2659. * @param {string} key The key of the entry to check.
  2660. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2661. */
  2662. function cacheHas(cache, key) {
  2663. return cache.has(key);
  2664. }
  2665. /**
  2666. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2667. * that is not found in the character symbols.
  2668. *
  2669. * @private
  2670. * @param {Array} strSymbols The string symbols to inspect.
  2671. * @param {Array} chrSymbols The character symbols to find.
  2672. * @returns {number} Returns the index of the first unmatched string symbol.
  2673. */
  2674. function charsStartIndex(strSymbols, chrSymbols) {
  2675. var index = -1,
  2676. length = strSymbols.length;
  2677. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2678. return index;
  2679. }
  2680. /**
  2681. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2682. * that is not found in the character symbols.
  2683. *
  2684. * @private
  2685. * @param {Array} strSymbols The string symbols to inspect.
  2686. * @param {Array} chrSymbols The character symbols to find.
  2687. * @returns {number} Returns the index of the last unmatched string symbol.
  2688. */
  2689. function charsEndIndex(strSymbols, chrSymbols) {
  2690. var index = strSymbols.length;
  2691. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2692. return index;
  2693. }
  2694. /**
  2695. * Gets the number of `placeholder` occurrences in `array`.
  2696. *
  2697. * @private
  2698. * @param {Array} array The array to inspect.
  2699. * @param {*} placeholder The placeholder to search for.
  2700. * @returns {number} Returns the placeholder count.
  2701. */
  2702. function countHolders(array, placeholder) {
  2703. var length = array.length,
  2704. result = 0;
  2705. while (length--) {
  2706. if (array[length] === placeholder) {
  2707. ++result;
  2708. }
  2709. }
  2710. return result;
  2711. }
  2712. /**
  2713. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2714. * letters to basic Latin letters.
  2715. *
  2716. * @private
  2717. * @param {string} letter The matched letter to deburr.
  2718. * @returns {string} Returns the deburred letter.
  2719. */
  2720. var deburrLetter = basePropertyOf(deburredLetters);
  2721. /**
  2722. * Used by `_.escape` to convert characters to HTML entities.
  2723. *
  2724. * @private
  2725. * @param {string} chr The matched character to escape.
  2726. * @returns {string} Returns the escaped character.
  2727. */
  2728. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2729. /**
  2730. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2731. *
  2732. * @private
  2733. * @param {string} chr The matched character to escape.
  2734. * @returns {string} Returns the escaped character.
  2735. */
  2736. function escapeStringChar(chr) {
  2737. return '\\' + stringEscapes[chr];
  2738. }
  2739. /**
  2740. * Gets the value at `key` of `object`.
  2741. *
  2742. * @private
  2743. * @param {Object} [object] The object to query.
  2744. * @param {string} key The key of the property to get.
  2745. * @returns {*} Returns the property value.
  2746. */
  2747. function getValue(object, key) {
  2748. return object == null ? undefined : object[key];
  2749. }
  2750. /**
  2751. * Checks if `string` contains Unicode symbols.
  2752. *
  2753. * @private
  2754. * @param {string} string The string to inspect.
  2755. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2756. */
  2757. function hasUnicode(string) {
  2758. return reHasUnicode.test(string);
  2759. }
  2760. /**
  2761. * Checks if `string` contains a word composed of Unicode symbols.
  2762. *
  2763. * @private
  2764. * @param {string} string The string to inspect.
  2765. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2766. */
  2767. function hasUnicodeWord(string) {
  2768. return reHasUnicodeWord.test(string);
  2769. }
  2770. /**
  2771. * Converts `iterator` to an array.
  2772. *
  2773. * @private
  2774. * @param {Object} iterator The iterator to convert.
  2775. * @returns {Array} Returns the converted array.
  2776. */
  2777. function iteratorToArray(iterator) {
  2778. var data,
  2779. result = [];
  2780. while (!(data = iterator.next()).done) {
  2781. result.push(data.value);
  2782. }
  2783. return result;
  2784. }
  2785. /**
  2786. * Converts `map` to its key-value pairs.
  2787. *
  2788. * @private
  2789. * @param {Object} map The map to convert.
  2790. * @returns {Array} Returns the key-value pairs.
  2791. */
  2792. function mapToArray(map) {
  2793. var index = -1,
  2794. result = Array(map.size);
  2795. map.forEach(function(value, key) {
  2796. result[++index] = [key, value];
  2797. });
  2798. return result;
  2799. }
  2800. /**
  2801. * Creates a unary function that invokes `func` with its argument transformed.
  2802. *
  2803. * @private
  2804. * @param {Function} func The function to wrap.
  2805. * @param {Function} transform The argument transform.
  2806. * @returns {Function} Returns the new function.
  2807. */
  2808. function overArg(func, transform) {
  2809. return function(arg) {
  2810. return func(transform(arg));
  2811. };
  2812. }
  2813. /**
  2814. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2815. * and returns an array of their indexes.
  2816. *
  2817. * @private
  2818. * @param {Array} array The array to modify.
  2819. * @param {*} placeholder The placeholder to replace.
  2820. * @returns {Array} Returns the new array of placeholder indexes.
  2821. */
  2822. function replaceHolders(array, placeholder) {
  2823. var index = -1,
  2824. length = array.length,
  2825. resIndex = 0,
  2826. result = [];
  2827. while (++index < length) {
  2828. var value = array[index];
  2829. if (value === placeholder || value === PLACEHOLDER) {
  2830. array[index] = PLACEHOLDER;
  2831. result[resIndex++] = index;
  2832. }
  2833. }
  2834. return result;
  2835. }
  2836. /**
  2837. * Converts `set` to an array of its values.
  2838. *
  2839. * @private
  2840. * @param {Object} set The set to convert.
  2841. * @returns {Array} Returns the values.
  2842. */
  2843. function setToArray(set) {
  2844. var index = -1,
  2845. result = Array(set.size);
  2846. set.forEach(function(value) {
  2847. result[++index] = value;
  2848. });
  2849. return result;
  2850. }
  2851. /**
  2852. * Converts `set` to its value-value pairs.
  2853. *
  2854. * @private
  2855. * @param {Object} set The set to convert.
  2856. * @returns {Array} Returns the value-value pairs.
  2857. */
  2858. function setToPairs(set) {
  2859. var index = -1,
  2860. result = Array(set.size);
  2861. set.forEach(function(value) {
  2862. result[++index] = [value, value];
  2863. });
  2864. return result;
  2865. }
  2866. /**
  2867. * A specialized version of `_.indexOf` which performs strict equality
  2868. * comparisons of values, i.e. `===`.
  2869. *
  2870. * @private
  2871. * @param {Array} array The array to inspect.
  2872. * @param {*} value The value to search for.
  2873. * @param {number} fromIndex The index to search from.
  2874. * @returns {number} Returns the index of the matched value, else `-1`.
  2875. */
  2876. function strictIndexOf(array, value, fromIndex) {
  2877. var index = fromIndex - 1,
  2878. length = array.length;
  2879. while (++index < length) {
  2880. if (array[index] === value) {
  2881. return index;
  2882. }
  2883. }
  2884. return -1;
  2885. }
  2886. /**
  2887. * A specialized version of `_.lastIndexOf` which performs strict equality
  2888. * comparisons of values, i.e. `===`.
  2889. *
  2890. * @private
  2891. * @param {Array} array The array to inspect.
  2892. * @param {*} value The value to search for.
  2893. * @param {number} fromIndex The index to search from.
  2894. * @returns {number} Returns the index of the matched value, else `-1`.
  2895. */
  2896. function strictLastIndexOf(array, value, fromIndex) {
  2897. var index = fromIndex + 1;
  2898. while (index--) {
  2899. if (array[index] === value) {
  2900. return index;
  2901. }
  2902. }
  2903. return index;
  2904. }
  2905. /**
  2906. * Gets the number of symbols in `string`.
  2907. *
  2908. * @private
  2909. * @param {string} string The string to inspect.
  2910. * @returns {number} Returns the string size.
  2911. */
  2912. function stringSize(string) {
  2913. return hasUnicode(string)
  2914. ? unicodeSize(string)
  2915. : asciiSize(string);
  2916. }
  2917. /**
  2918. * Converts `string` to an array.
  2919. *
  2920. * @private
  2921. * @param {string} string The string to convert.
  2922. * @returns {Array} Returns the converted array.
  2923. */
  2924. function stringToArray(string) {
  2925. return hasUnicode(string)
  2926. ? unicodeToArray(string)
  2927. : asciiToArray(string);
  2928. }
  2929. /**
  2930. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2931. * character of `string`.
  2932. *
  2933. * @private
  2934. * @param {string} string The string to inspect.
  2935. * @returns {number} Returns the index of the last non-whitespace character.
  2936. */
  2937. function trimmedEndIndex(string) {
  2938. var index = string.length;
  2939. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2940. return index;
  2941. }
  2942. /**
  2943. * Used by `_.unescape` to convert HTML entities to characters.
  2944. *
  2945. * @private
  2946. * @param {string} chr The matched character to unescape.
  2947. * @returns {string} Returns the unescaped character.
  2948. */
  2949. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2950. /**
  2951. * Gets the size of a Unicode `string`.
  2952. *
  2953. * @private
  2954. * @param {string} string The string inspect.
  2955. * @returns {number} Returns the string size.
  2956. */
  2957. function unicodeSize(string) {
  2958. var result = reUnicode.lastIndex = 0;
  2959. while (reUnicode.test(string)) {
  2960. ++result;
  2961. }
  2962. return result;
  2963. }
  2964. /**
  2965. * Converts a Unicode `string` to an array.
  2966. *
  2967. * @private
  2968. * @param {string} string The string to convert.
  2969. * @returns {Array} Returns the converted array.
  2970. */
  2971. function unicodeToArray(string) {
  2972. return string.match(reUnicode) || [];
  2973. }
  2974. /**
  2975. * Splits a Unicode `string` into an array of its words.
  2976. *
  2977. * @private
  2978. * @param {string} The string to inspect.
  2979. * @returns {Array} Returns the words of `string`.
  2980. */
  2981. function unicodeWords(string) {
  2982. return string.match(reUnicodeWord) || [];
  2983. }
  2984. /*--------------------------------------------------------------------------*/
  2985. /**
  2986. * Create a new pristine `lodash` function using the `context` object.
  2987. *
  2988. * @static
  2989. * @memberOf _
  2990. * @since 1.1.0
  2991. * @category Util
  2992. * @param {Object} [context=root] The context object.
  2993. * @returns {Function} Returns a new `lodash` function.
  2994. * @example
  2995. *
  2996. * _.mixin({ 'foo': _.constant('foo') });
  2997. *
  2998. * var lodash = _.runInContext();
  2999. * lodash.mixin({ 'bar': lodash.constant('bar') });
  3000. *
  3001. * _.isFunction(_.foo);
  3002. * // => true
  3003. * _.isFunction(_.bar);
  3004. * // => false
  3005. *
  3006. * lodash.isFunction(lodash.foo);
  3007. * // => false
  3008. * lodash.isFunction(lodash.bar);
  3009. * // => true
  3010. *
  3011. * // Create a suped-up `defer` in Node.js.
  3012. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  3013. */
  3014. var runInContext = (function runInContext(context) {
  3015. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  3016. /** Built-in constructor references. */
  3017. var Array = context.Array,
  3018. Date = context.Date,
  3019. Error = context.Error,
  3020. Function = context.Function,
  3021. Math = context.Math,
  3022. Object = context.Object,
  3023. RegExp = context.RegExp,
  3024. String = context.String,
  3025. TypeError = context.TypeError;
  3026. /** Used for built-in method references. */
  3027. var arrayProto = Array.prototype,
  3028. funcProto = Function.prototype,
  3029. objectProto = Object.prototype;
  3030. /** Used to detect overreaching core-js shims. */
  3031. var coreJsData = context['__core-js_shared__'];
  3032. /** Used to resolve the decompiled source of functions. */
  3033. var funcToString = funcProto.toString;
  3034. /** Used to check objects for own properties. */
  3035. var hasOwnProperty = objectProto.hasOwnProperty;
  3036. /** Used to generate unique IDs. */
  3037. var idCounter = 0;
  3038. /** Used to detect methods masquerading as native. */
  3039. var maskSrcKey = (function() {
  3040. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3041. return uid ? ('Symbol(src)_1.' + uid) : '';
  3042. }());
  3043. /**
  3044. * Used to resolve the
  3045. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3046. * of values.
  3047. */
  3048. var nativeObjectToString = objectProto.toString;
  3049. /** Used to infer the `Object` constructor. */
  3050. var objectCtorString = funcToString.call(Object);
  3051. /** Used to restore the original `_` reference in `_.noConflict`. */
  3052. var oldDash = root._;
  3053. /** Used to detect if a method is native. */
  3054. var reIsNative = RegExp('^' +
  3055. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  3056. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  3057. );
  3058. /** Built-in value references. */
  3059. var Buffer = moduleExports ? context.Buffer : undefined,
  3060. Symbol = context.Symbol,
  3061. Uint8Array = context.Uint8Array,
  3062. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  3063. getPrototype = overArg(Object.getPrototypeOf, Object),
  3064. objectCreate = Object.create,
  3065. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3066. splice = arrayProto.splice,
  3067. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  3068. symIterator = Symbol ? Symbol.iterator : undefined,
  3069. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3070. var defineProperty = (function() {
  3071. try {
  3072. var func = getNative(Object, 'defineProperty');
  3073. func({}, '', {});
  3074. return func;
  3075. } catch (e) {}
  3076. }());
  3077. /** Mocked built-ins. */
  3078. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  3079. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  3080. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  3081. /* Built-in method references for those with the same name as other `lodash` methods. */
  3082. var nativeCeil = Math.ceil,
  3083. nativeFloor = Math.floor,
  3084. nativeGetSymbols = Object.getOwnPropertySymbols,
  3085. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3086. nativeIsFinite = context.isFinite,
  3087. nativeJoin = arrayProto.join,
  3088. nativeKeys = overArg(Object.keys, Object),
  3089. nativeMax = Math.max,
  3090. nativeMin = Math.min,
  3091. nativeNow = Date.now,
  3092. nativeParseInt = context.parseInt,
  3093. nativeRandom = Math.random,
  3094. nativeReverse = arrayProto.reverse;
  3095. /* Built-in method references that are verified to be native. */
  3096. var DataView = getNative(context, 'DataView'),
  3097. Map = getNative(context, 'Map'),
  3098. Promise = getNative(context, 'Promise'),
  3099. Set = getNative(context, 'Set'),
  3100. WeakMap = getNative(context, 'WeakMap'),
  3101. nativeCreate = getNative(Object, 'create');
  3102. /** Used to store function metadata. */
  3103. var metaMap = WeakMap && new WeakMap;
  3104. /** Used to lookup unminified function names. */
  3105. var realNames = {};
  3106. /** Used to detect maps, sets, and weakmaps. */
  3107. var dataViewCtorString = toSource(DataView),
  3108. mapCtorString = toSource(Map),
  3109. promiseCtorString = toSource(Promise),
  3110. setCtorString = toSource(Set),
  3111. weakMapCtorString = toSource(WeakMap);
  3112. /** Used to convert symbols to primitives and strings. */
  3113. var symbolProto = Symbol ? Symbol.prototype : undefined,
  3114. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  3115. symbolToString = symbolProto ? symbolProto.toString : undefined;
  3116. /*------------------------------------------------------------------------*/
  3117. /**
  3118. * Creates a `lodash` object which wraps `value` to enable implicit method
  3119. * chain sequences. Methods that operate on and return arrays, collections,
  3120. * and functions can be chained together. Methods that retrieve a single value
  3121. * or may return a primitive value will automatically end the chain sequence
  3122. * and return the unwrapped value. Otherwise, the value must be unwrapped
  3123. * with `_#value`.
  3124. *
  3125. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  3126. * enabled using `_.chain`.
  3127. *
  3128. * The execution of chained methods is lazy, that is, it's deferred until
  3129. * `_#value` is implicitly or explicitly called.
  3130. *
  3131. * Lazy evaluation allows several methods to support shortcut fusion.
  3132. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  3133. * the creation of intermediate arrays and can greatly reduce the number of
  3134. * iteratee executions. Sections of a chain sequence qualify for shortcut
  3135. * fusion if the section is applied to an array and iteratees accept only
  3136. * one argument. The heuristic for whether a section qualifies for shortcut
  3137. * fusion is subject to change.
  3138. *
  3139. * Chaining is supported in custom builds as long as the `_#value` method is
  3140. * directly or indirectly included in the build.
  3141. *
  3142. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  3143. *
  3144. * The wrapper `Array` methods are:
  3145. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  3146. *
  3147. * The wrapper `String` methods are:
  3148. * `replace` and `split`
  3149. *
  3150. * The wrapper methods that support shortcut fusion are:
  3151. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  3152. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  3153. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  3154. *
  3155. * The chainable wrapper methods are:
  3156. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  3157. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  3158. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  3159. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  3160. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  3161. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  3162. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  3163. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  3164. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  3165. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  3166. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  3167. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  3168. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  3169. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  3170. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  3171. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  3172. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  3173. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  3174. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  3175. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  3176. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  3177. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  3178. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  3179. * `zipObject`, `zipObjectDeep`, and `zipWith`
  3180. *
  3181. * The wrapper methods that are **not** chainable by default are:
  3182. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  3183. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  3184. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  3185. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  3186. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  3187. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  3188. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  3189. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  3190. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  3191. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  3192. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  3193. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  3194. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  3195. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  3196. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  3197. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  3198. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  3199. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  3200. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  3201. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  3202. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  3203. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  3204. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  3205. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  3206. * `upperFirst`, `value`, and `words`
  3207. *
  3208. * @name _
  3209. * @constructor
  3210. * @category Seq
  3211. * @param {*} value The value to wrap in a `lodash` instance.
  3212. * @returns {Object} Returns the new `lodash` wrapper instance.
  3213. * @example
  3214. *
  3215. * function square(n) {
  3216. * return n * n;
  3217. * }
  3218. *
  3219. * var wrapped = _([1, 2, 3]);
  3220. *
  3221. * // Returns an unwrapped value.
  3222. * wrapped.reduce(_.add);
  3223. * // => 6
  3224. *
  3225. * // Returns a wrapped value.
  3226. * var squares = wrapped.map(square);
  3227. *
  3228. * _.isArray(squares);
  3229. * // => false
  3230. *
  3231. * _.isArray(squares.value());
  3232. * // => true
  3233. */
  3234. function lodash(value) {
  3235. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  3236. if (value instanceof LodashWrapper) {
  3237. return value;
  3238. }
  3239. if (hasOwnProperty.call(value, '__wrapped__')) {
  3240. return wrapperClone(value);
  3241. }
  3242. }
  3243. return new LodashWrapper(value);
  3244. }
  3245. /**
  3246. * The base implementation of `_.create` without support for assigning
  3247. * properties to the created object.
  3248. *
  3249. * @private
  3250. * @param {Object} proto The object to inherit from.
  3251. * @returns {Object} Returns the new object.
  3252. */
  3253. var baseCreate = (function() {
  3254. function object() {}
  3255. return function(proto) {
  3256. if (!isObject(proto)) {
  3257. return {};
  3258. }
  3259. if (objectCreate) {
  3260. return objectCreate(proto);
  3261. }
  3262. object.prototype = proto;
  3263. var result = new object;
  3264. object.prototype = undefined;
  3265. return result;
  3266. };
  3267. }());
  3268. /**
  3269. * The function whose prototype chain sequence wrappers inherit from.
  3270. *
  3271. * @private
  3272. */
  3273. function baseLodash() {
  3274. // No operation performed.
  3275. }
  3276. /**
  3277. * The base constructor for creating `lodash` wrapper objects.
  3278. *
  3279. * @private
  3280. * @param {*} value The value to wrap.
  3281. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  3282. */
  3283. function LodashWrapper(value, chainAll) {
  3284. this.__wrapped__ = value;
  3285. this.__actions__ = [];
  3286. this.__chain__ = !!chainAll;
  3287. this.__index__ = 0;
  3288. this.__values__ = undefined;
  3289. }
  3290. /**
  3291. * By default, the template delimiters used by lodash are like those in
  3292. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  3293. * following template settings to use alternative delimiters.
  3294. *
  3295. * @static
  3296. * @memberOf _
  3297. * @type {Object}
  3298. */
  3299. lodash.templateSettings = {
  3300. /**
  3301. * Used to detect `data` property values to be HTML-escaped.
  3302. *
  3303. * @memberOf _.templateSettings
  3304. * @type {RegExp}
  3305. */
  3306. 'escape': reEscape,
  3307. /**
  3308. * Used to detect code to be evaluated.
  3309. *
  3310. * @memberOf _.templateSettings
  3311. * @type {RegExp}
  3312. */
  3313. 'evaluate': reEvaluate,
  3314. /**
  3315. * Used to detect `data` property values to inject.
  3316. *
  3317. * @memberOf _.templateSettings
  3318. * @type {RegExp}
  3319. */
  3320. 'interpolate': reInterpolate,
  3321. /**
  3322. * Used to reference the data object in the template text.
  3323. *
  3324. * @memberOf _.templateSettings
  3325. * @type {string}
  3326. */
  3327. 'variable': '',
  3328. /**
  3329. * Used to import variables into the compiled template.
  3330. *
  3331. * @memberOf _.templateSettings
  3332. * @type {Object}
  3333. */
  3334. 'imports': {
  3335. /**
  3336. * A reference to the `lodash` function.
  3337. *
  3338. * @memberOf _.templateSettings.imports
  3339. * @type {Function}
  3340. */
  3341. '_': lodash
  3342. }
  3343. };
  3344. // Ensure wrappers are instances of `baseLodash`.
  3345. lodash.prototype = baseLodash.prototype;
  3346. lodash.prototype.constructor = lodash;
  3347. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  3348. LodashWrapper.prototype.constructor = LodashWrapper;
  3349. /*------------------------------------------------------------------------*/
  3350. /**
  3351. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  3352. *
  3353. * @private
  3354. * @constructor
  3355. * @param {*} value The value to wrap.
  3356. */
  3357. function LazyWrapper(value) {
  3358. this.__wrapped__ = value;
  3359. this.__actions__ = [];
  3360. this.__dir__ = 1;
  3361. this.__filtered__ = false;
  3362. this.__iteratees__ = [];
  3363. this.__takeCount__ = MAX_ARRAY_LENGTH;
  3364. this.__views__ = [];
  3365. }
  3366. /**
  3367. * Creates a clone of the lazy wrapper object.
  3368. *
  3369. * @private
  3370. * @name clone
  3371. * @memberOf LazyWrapper
  3372. * @returns {Object} Returns the cloned `LazyWrapper` object.
  3373. */
  3374. function lazyClone() {
  3375. var result = new LazyWrapper(this.__wrapped__);
  3376. result.__actions__ = copyArray(this.__actions__);
  3377. result.__dir__ = this.__dir__;
  3378. result.__filtered__ = this.__filtered__;
  3379. result.__iteratees__ = copyArray(this.__iteratees__);
  3380. result.__takeCount__ = this.__takeCount__;
  3381. result.__views__ = copyArray(this.__views__);
  3382. return result;
  3383. }
  3384. /**
  3385. * Reverses the direction of lazy iteration.
  3386. *
  3387. * @private
  3388. * @name reverse
  3389. * @memberOf LazyWrapper
  3390. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  3391. */
  3392. function lazyReverse() {
  3393. if (this.__filtered__) {
  3394. var result = new LazyWrapper(this);
  3395. result.__dir__ = -1;
  3396. result.__filtered__ = true;
  3397. } else {
  3398. result = this.clone();
  3399. result.__dir__ *= -1;
  3400. }
  3401. return result;
  3402. }
  3403. /**
  3404. * Extracts the unwrapped value from its lazy wrapper.
  3405. *
  3406. * @private
  3407. * @name value
  3408. * @memberOf LazyWrapper
  3409. * @returns {*} Returns the unwrapped value.
  3410. */
  3411. function lazyValue() {
  3412. var array = this.__wrapped__.value(),
  3413. dir = this.__dir__,
  3414. isArr = isArray(array),
  3415. isRight = dir < 0,
  3416. arrLength = isArr ? array.length : 0,
  3417. view = getView(0, arrLength, this.__views__),
  3418. start = view.start,
  3419. end = view.end,
  3420. length = end - start,
  3421. index = isRight ? end : (start - 1),
  3422. iteratees = this.__iteratees__,
  3423. iterLength = iteratees.length,
  3424. resIndex = 0,
  3425. takeCount = nativeMin(length, this.__takeCount__);
  3426. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3427. return baseWrapperValue(array, this.__actions__);
  3428. }
  3429. var result = [];
  3430. outer:
  3431. while (length-- && resIndex < takeCount) {
  3432. index += dir;
  3433. var iterIndex = -1,
  3434. value = array[index];
  3435. while (++iterIndex < iterLength) {
  3436. var data = iteratees[iterIndex],
  3437. iteratee = data.iteratee,
  3438. type = data.type,
  3439. computed = iteratee(value);
  3440. if (type == LAZY_MAP_FLAG) {
  3441. value = computed;
  3442. } else if (!computed) {
  3443. if (type == LAZY_FILTER_FLAG) {
  3444. continue outer;
  3445. } else {
  3446. break outer;
  3447. }
  3448. }
  3449. }
  3450. result[resIndex++] = value;
  3451. }
  3452. return result;
  3453. }
  3454. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3455. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3456. LazyWrapper.prototype.constructor = LazyWrapper;
  3457. /*------------------------------------------------------------------------*/
  3458. /**
  3459. * Creates a hash object.
  3460. *
  3461. * @private
  3462. * @constructor
  3463. * @param {Array} [entries] The key-value pairs to cache.
  3464. */
  3465. function Hash(entries) {
  3466. var index = -1,
  3467. length = entries == null ? 0 : entries.length;
  3468. this.clear();
  3469. while (++index < length) {
  3470. var entry = entries[index];
  3471. this.set(entry[0], entry[1]);
  3472. }
  3473. }
  3474. /**
  3475. * Removes all key-value entries from the hash.
  3476. *
  3477. * @private
  3478. * @name clear
  3479. * @memberOf Hash
  3480. */
  3481. function hashClear() {
  3482. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3483. this.size = 0;
  3484. }
  3485. /**
  3486. * Removes `key` and its value from the hash.
  3487. *
  3488. * @private
  3489. * @name delete
  3490. * @memberOf Hash
  3491. * @param {Object} hash The hash to modify.
  3492. * @param {string} key The key of the value to remove.
  3493. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3494. */
  3495. function hashDelete(key) {
  3496. var result = this.has(key) && delete this.__data__[key];
  3497. this.size -= result ? 1 : 0;
  3498. return result;
  3499. }
  3500. /**
  3501. * Gets the hash value for `key`.
  3502. *
  3503. * @private
  3504. * @name get
  3505. * @memberOf Hash
  3506. * @param {string} key The key of the value to get.
  3507. * @returns {*} Returns the entry value.
  3508. */
  3509. function hashGet(key) {
  3510. var data = this.__data__;
  3511. if (nativeCreate) {
  3512. var result = data[key];
  3513. return result === HASH_UNDEFINED ? undefined : result;
  3514. }
  3515. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3516. }
  3517. /**
  3518. * Checks if a hash value for `key` exists.
  3519. *
  3520. * @private
  3521. * @name has
  3522. * @memberOf Hash
  3523. * @param {string} key The key of the entry to check.
  3524. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3525. */
  3526. function hashHas(key) {
  3527. var data = this.__data__;
  3528. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3529. }
  3530. /**
  3531. * Sets the hash `key` to `value`.
  3532. *
  3533. * @private
  3534. * @name set
  3535. * @memberOf Hash
  3536. * @param {string} key The key of the value to set.
  3537. * @param {*} value The value to set.
  3538. * @returns {Object} Returns the hash instance.
  3539. */
  3540. function hashSet(key, value) {
  3541. var data = this.__data__;
  3542. this.size += this.has(key) ? 0 : 1;
  3543. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3544. return this;
  3545. }
  3546. // Add methods to `Hash`.
  3547. Hash.prototype.clear = hashClear;
  3548. Hash.prototype['delete'] = hashDelete;
  3549. Hash.prototype.get = hashGet;
  3550. Hash.prototype.has = hashHas;
  3551. Hash.prototype.set = hashSet;
  3552. /*------------------------------------------------------------------------*/
  3553. /**
  3554. * Creates an list cache object.
  3555. *
  3556. * @private
  3557. * @constructor
  3558. * @param {Array} [entries] The key-value pairs to cache.
  3559. */
  3560. function ListCache(entries) {
  3561. var index = -1,
  3562. length = entries == null ? 0 : entries.length;
  3563. this.clear();
  3564. while (++index < length) {
  3565. var entry = entries[index];
  3566. this.set(entry[0], entry[1]);
  3567. }
  3568. }
  3569. /**
  3570. * Removes all key-value entries from the list cache.
  3571. *
  3572. * @private
  3573. * @name clear
  3574. * @memberOf ListCache
  3575. */
  3576. function listCacheClear() {
  3577. this.__data__ = [];
  3578. this.size = 0;
  3579. }
  3580. /**
  3581. * Removes `key` and its value from the list cache.
  3582. *
  3583. * @private
  3584. * @name delete
  3585. * @memberOf ListCache
  3586. * @param {string} key The key of the value to remove.
  3587. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3588. */
  3589. function listCacheDelete(key) {
  3590. var data = this.__data__,
  3591. index = assocIndexOf(data, key);
  3592. if (index < 0) {
  3593. return false;
  3594. }
  3595. var lastIndex = data.length - 1;
  3596. if (index == lastIndex) {
  3597. data.pop();
  3598. } else {
  3599. splice.call(data, index, 1);
  3600. }
  3601. --this.size;
  3602. return true;
  3603. }
  3604. /**
  3605. * Gets the list cache value for `key`.
  3606. *
  3607. * @private
  3608. * @name get
  3609. * @memberOf ListCache
  3610. * @param {string} key The key of the value to get.
  3611. * @returns {*} Returns the entry value.
  3612. */
  3613. function listCacheGet(key) {
  3614. var data = this.__data__,
  3615. index = assocIndexOf(data, key);
  3616. return index < 0 ? undefined : data[index][1];
  3617. }
  3618. /**
  3619. * Checks if a list cache value for `key` exists.
  3620. *
  3621. * @private
  3622. * @name has
  3623. * @memberOf ListCache
  3624. * @param {string} key The key of the entry to check.
  3625. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3626. */
  3627. function listCacheHas(key) {
  3628. return assocIndexOf(this.__data__, key) > -1;
  3629. }
  3630. /**
  3631. * Sets the list cache `key` to `value`.
  3632. *
  3633. * @private
  3634. * @name set
  3635. * @memberOf ListCache
  3636. * @param {string} key The key of the value to set.
  3637. * @param {*} value The value to set.
  3638. * @returns {Object} Returns the list cache instance.
  3639. */
  3640. function listCacheSet(key, value) {
  3641. var data = this.__data__,
  3642. index = assocIndexOf(data, key);
  3643. if (index < 0) {
  3644. ++this.size;
  3645. data.push([key, value]);
  3646. } else {
  3647. data[index][1] = value;
  3648. }
  3649. return this;
  3650. }
  3651. // Add methods to `ListCache`.
  3652. ListCache.prototype.clear = listCacheClear;
  3653. ListCache.prototype['delete'] = listCacheDelete;
  3654. ListCache.prototype.get = listCacheGet;
  3655. ListCache.prototype.has = listCacheHas;
  3656. ListCache.prototype.set = listCacheSet;
  3657. /*------------------------------------------------------------------------*/
  3658. /**
  3659. * Creates a map cache object to store key-value pairs.
  3660. *
  3661. * @private
  3662. * @constructor
  3663. * @param {Array} [entries] The key-value pairs to cache.
  3664. */
  3665. function MapCache(entries) {
  3666. var index = -1,
  3667. length = entries == null ? 0 : entries.length;
  3668. this.clear();
  3669. while (++index < length) {
  3670. var entry = entries[index];
  3671. this.set(entry[0], entry[1]);
  3672. }
  3673. }
  3674. /**
  3675. * Removes all key-value entries from the map.
  3676. *
  3677. * @private
  3678. * @name clear
  3679. * @memberOf MapCache
  3680. */
  3681. function mapCacheClear() {
  3682. this.size = 0;
  3683. this.__data__ = {
  3684. 'hash': new Hash,
  3685. 'map': new (Map || ListCache),
  3686. 'string': new Hash
  3687. };
  3688. }
  3689. /**
  3690. * Removes `key` and its value from the map.
  3691. *
  3692. * @private
  3693. * @name delete
  3694. * @memberOf MapCache
  3695. * @param {string} key The key of the value to remove.
  3696. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3697. */
  3698. function mapCacheDelete(key) {
  3699. var result = getMapData(this, key)['delete'](key);
  3700. this.size -= result ? 1 : 0;
  3701. return result;
  3702. }
  3703. /**
  3704. * Gets the map value for `key`.
  3705. *
  3706. * @private
  3707. * @name get
  3708. * @memberOf MapCache
  3709. * @param {string} key The key of the value to get.
  3710. * @returns {*} Returns the entry value.
  3711. */
  3712. function mapCacheGet(key) {
  3713. return getMapData(this, key).get(key);
  3714. }
  3715. /**
  3716. * Checks if a map value for `key` exists.
  3717. *
  3718. * @private
  3719. * @name has
  3720. * @memberOf MapCache
  3721. * @param {string} key The key of the entry to check.
  3722. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3723. */
  3724. function mapCacheHas(key) {
  3725. return getMapData(this, key).has(key);
  3726. }
  3727. /**
  3728. * Sets the map `key` to `value`.
  3729. *
  3730. * @private
  3731. * @name set
  3732. * @memberOf MapCache
  3733. * @param {string} key The key of the value to set.
  3734. * @param {*} value The value to set.
  3735. * @returns {Object} Returns the map cache instance.
  3736. */
  3737. function mapCacheSet(key, value) {
  3738. var data = getMapData(this, key),
  3739. size = data.size;
  3740. data.set(key, value);
  3741. this.size += data.size == size ? 0 : 1;
  3742. return this;
  3743. }
  3744. // Add methods to `MapCache`.
  3745. MapCache.prototype.clear = mapCacheClear;
  3746. MapCache.prototype['delete'] = mapCacheDelete;
  3747. MapCache.prototype.get = mapCacheGet;
  3748. MapCache.prototype.has = mapCacheHas;
  3749. MapCache.prototype.set = mapCacheSet;
  3750. /*------------------------------------------------------------------------*/
  3751. /**
  3752. *
  3753. * Creates an array cache object to store unique values.
  3754. *
  3755. * @private
  3756. * @constructor
  3757. * @param {Array} [values] The values to cache.
  3758. */
  3759. function SetCache(values) {
  3760. var index = -1,
  3761. length = values == null ? 0 : values.length;
  3762. this.__data__ = new MapCache;
  3763. while (++index < length) {
  3764. this.add(values[index]);
  3765. }
  3766. }
  3767. /**
  3768. * Adds `value` to the array cache.
  3769. *
  3770. * @private
  3771. * @name add
  3772. * @memberOf SetCache
  3773. * @alias push
  3774. * @param {*} value The value to cache.
  3775. * @returns {Object} Returns the cache instance.
  3776. */
  3777. function setCacheAdd(value) {
  3778. this.__data__.set(value, HASH_UNDEFINED);
  3779. return this;
  3780. }
  3781. /**
  3782. * Checks if `value` is in the array cache.
  3783. *
  3784. * @private
  3785. * @name has
  3786. * @memberOf SetCache
  3787. * @param {*} value The value to search for.
  3788. * @returns {number} Returns `true` if `value` is found, else `false`.
  3789. */
  3790. function setCacheHas(value) {
  3791. return this.__data__.has(value);
  3792. }
  3793. // Add methods to `SetCache`.
  3794. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3795. SetCache.prototype.has = setCacheHas;
  3796. /*------------------------------------------------------------------------*/
  3797. /**
  3798. * Creates a stack cache object to store key-value pairs.
  3799. *
  3800. * @private
  3801. * @constructor
  3802. * @param {Array} [entries] The key-value pairs to cache.
  3803. */
  3804. function Stack(entries) {
  3805. var data = this.__data__ = new ListCache(entries);
  3806. this.size = data.size;
  3807. }
  3808. /**
  3809. * Removes all key-value entries from the stack.
  3810. *
  3811. * @private
  3812. * @name clear
  3813. * @memberOf Stack
  3814. */
  3815. function stackClear() {
  3816. this.__data__ = new ListCache;
  3817. this.size = 0;
  3818. }
  3819. /**
  3820. * Removes `key` and its value from the stack.
  3821. *
  3822. * @private
  3823. * @name delete
  3824. * @memberOf Stack
  3825. * @param {string} key The key of the value to remove.
  3826. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3827. */
  3828. function stackDelete(key) {
  3829. var data = this.__data__,
  3830. result = data['delete'](key);
  3831. this.size = data.size;
  3832. return result;
  3833. }
  3834. /**
  3835. * Gets the stack value for `key`.
  3836. *
  3837. * @private
  3838. * @name get
  3839. * @memberOf Stack
  3840. * @param {string} key The key of the value to get.
  3841. * @returns {*} Returns the entry value.
  3842. */
  3843. function stackGet(key) {
  3844. return this.__data__.get(key);
  3845. }
  3846. /**
  3847. * Checks if a stack value for `key` exists.
  3848. *
  3849. * @private
  3850. * @name has
  3851. * @memberOf Stack
  3852. * @param {string} key The key of the entry to check.
  3853. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3854. */
  3855. function stackHas(key) {
  3856. return this.__data__.has(key);
  3857. }
  3858. /**
  3859. * Sets the stack `key` to `value`.
  3860. *
  3861. * @private
  3862. * @name set
  3863. * @memberOf Stack
  3864. * @param {string} key The key of the value to set.
  3865. * @param {*} value The value to set.
  3866. * @returns {Object} Returns the stack cache instance.
  3867. */
  3868. function stackSet(key, value) {
  3869. var data = this.__data__;
  3870. if (data instanceof ListCache) {
  3871. var pairs = data.__data__;
  3872. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3873. pairs.push([key, value]);
  3874. this.size = ++data.size;
  3875. return this;
  3876. }
  3877. data = this.__data__ = new MapCache(pairs);
  3878. }
  3879. data.set(key, value);
  3880. this.size = data.size;
  3881. return this;
  3882. }
  3883. // Add methods to `Stack`.
  3884. Stack.prototype.clear = stackClear;
  3885. Stack.prototype['delete'] = stackDelete;
  3886. Stack.prototype.get = stackGet;
  3887. Stack.prototype.has = stackHas;
  3888. Stack.prototype.set = stackSet;
  3889. /*------------------------------------------------------------------------*/
  3890. /**
  3891. * Creates an array of the enumerable property names of the array-like `value`.
  3892. *
  3893. * @private
  3894. * @param {*} value The value to query.
  3895. * @param {boolean} inherited Specify returning inherited property names.
  3896. * @returns {Array} Returns the array of property names.
  3897. */
  3898. function arrayLikeKeys(value, inherited) {
  3899. var isArr = isArray(value),
  3900. isArg = !isArr && isArguments(value),
  3901. isBuff = !isArr && !isArg && isBuffer(value),
  3902. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3903. skipIndexes = isArr || isArg || isBuff || isType,
  3904. result = skipIndexes ? baseTimes(value.length, String) : [],
  3905. length = result.length;
  3906. for (var key in value) {
  3907. if ((inherited || hasOwnProperty.call(value, key)) &&
  3908. !(skipIndexes && (
  3909. // Safari 9 has enumerable `arguments.length` in strict mode.
  3910. key == 'length' ||
  3911. // Node.js 0.10 has enumerable non-index properties on buffers.
  3912. (isBuff && (key == 'offset' || key == 'parent')) ||
  3913. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3914. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3915. // Skip index properties.
  3916. isIndex(key, length)
  3917. ))) {
  3918. result.push(key);
  3919. }
  3920. }
  3921. return result;
  3922. }
  3923. /**
  3924. * A specialized version of `_.sample` for arrays.
  3925. *
  3926. * @private
  3927. * @param {Array} array The array to sample.
  3928. * @returns {*} Returns the random element.
  3929. */
  3930. function arraySample(array) {
  3931. var length = array.length;
  3932. return length ? array[baseRandom(0, length - 1)] : undefined;
  3933. }
  3934. /**
  3935. * A specialized version of `_.sampleSize` for arrays.
  3936. *
  3937. * @private
  3938. * @param {Array} array The array to sample.
  3939. * @param {number} n The number of elements to sample.
  3940. * @returns {Array} Returns the random elements.
  3941. */
  3942. function arraySampleSize(array, n) {
  3943. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3944. }
  3945. /**
  3946. * A specialized version of `_.shuffle` for arrays.
  3947. *
  3948. * @private
  3949. * @param {Array} array The array to shuffle.
  3950. * @returns {Array} Returns the new shuffled array.
  3951. */
  3952. function arrayShuffle(array) {
  3953. return shuffleSelf(copyArray(array));
  3954. }
  3955. /**
  3956. * This function is like `assignValue` except that it doesn't assign
  3957. * `undefined` values.
  3958. *
  3959. * @private
  3960. * @param {Object} object The object to modify.
  3961. * @param {string} key The key of the property to assign.
  3962. * @param {*} value The value to assign.
  3963. */
  3964. function assignMergeValue(object, key, value) {
  3965. if ((value !== undefined && !eq(object[key], value)) ||
  3966. (value === undefined && !(key in object))) {
  3967. baseAssignValue(object, key, value);
  3968. }
  3969. }
  3970. /**
  3971. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3972. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3973. * for equality comparisons.
  3974. *
  3975. * @private
  3976. * @param {Object} object The object to modify.
  3977. * @param {string} key The key of the property to assign.
  3978. * @param {*} value The value to assign.
  3979. */
  3980. function assignValue(object, key, value) {
  3981. var objValue = object[key];
  3982. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3983. (value === undefined && !(key in object))) {
  3984. baseAssignValue(object, key, value);
  3985. }
  3986. }
  3987. /**
  3988. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3989. *
  3990. * @private
  3991. * @param {Array} array The array to inspect.
  3992. * @param {*} key The key to search for.
  3993. * @returns {number} Returns the index of the matched value, else `-1`.
  3994. */
  3995. function assocIndexOf(array, key) {
  3996. var length = array.length;
  3997. while (length--) {
  3998. if (eq(array[length][0], key)) {
  3999. return length;
  4000. }
  4001. }
  4002. return -1;
  4003. }
  4004. /**
  4005. * Aggregates elements of `collection` on `accumulator` with keys transformed
  4006. * by `iteratee` and values set by `setter`.
  4007. *
  4008. * @private
  4009. * @param {Array|Object} collection The collection to iterate over.
  4010. * @param {Function} setter The function to set `accumulator` values.
  4011. * @param {Function} iteratee The iteratee to transform keys.
  4012. * @param {Object} accumulator The initial aggregated object.
  4013. * @returns {Function} Returns `accumulator`.
  4014. */
  4015. function baseAggregator(collection, setter, iteratee, accumulator) {
  4016. baseEach(collection, function(value, key, collection) {
  4017. setter(accumulator, value, iteratee(value), collection);
  4018. });
  4019. return accumulator;
  4020. }
  4021. /**
  4022. * The base implementation of `_.assign` without support for multiple sources
  4023. * or `customizer` functions.
  4024. *
  4025. * @private
  4026. * @param {Object} object The destination object.
  4027. * @param {Object} source The source object.
  4028. * @returns {Object} Returns `object`.
  4029. */
  4030. function baseAssign(object, source) {
  4031. return object && copyObject(source, keys(source), object);
  4032. }
  4033. /**
  4034. * The base implementation of `_.assignIn` without support for multiple sources
  4035. * or `customizer` functions.
  4036. *
  4037. * @private
  4038. * @param {Object} object The destination object.
  4039. * @param {Object} source The source object.
  4040. * @returns {Object} Returns `object`.
  4041. */
  4042. function baseAssignIn(object, source) {
  4043. return object && copyObject(source, keysIn(source), object);
  4044. }
  4045. /**
  4046. * The base implementation of `assignValue` and `assignMergeValue` without
  4047. * value checks.
  4048. *
  4049. * @private
  4050. * @param {Object} object The object to modify.
  4051. * @param {string} key The key of the property to assign.
  4052. * @param {*} value The value to assign.
  4053. */
  4054. function baseAssignValue(object, key, value) {
  4055. if (key == '__proto__' && defineProperty) {
  4056. defineProperty(object, key, {
  4057. 'configurable': true,
  4058. 'enumerable': true,
  4059. 'value': value,
  4060. 'writable': true
  4061. });
  4062. } else {
  4063. object[key] = value;
  4064. }
  4065. }
  4066. /**
  4067. * The base implementation of `_.at` without support for individual paths.
  4068. *
  4069. * @private
  4070. * @param {Object} object The object to iterate over.
  4071. * @param {string[]} paths The property paths to pick.
  4072. * @returns {Array} Returns the picked elements.
  4073. */
  4074. function baseAt(object, paths) {
  4075. var index = -1,
  4076. length = paths.length,
  4077. result = Array(length),
  4078. skip = object == null;
  4079. while (++index < length) {
  4080. result[index] = skip ? undefined : get(object, paths[index]);
  4081. }
  4082. return result;
  4083. }
  4084. /**
  4085. * The base implementation of `_.clamp` which doesn't coerce arguments.
  4086. *
  4087. * @private
  4088. * @param {number} number The number to clamp.
  4089. * @param {number} [lower] The lower bound.
  4090. * @param {number} upper The upper bound.
  4091. * @returns {number} Returns the clamped number.
  4092. */
  4093. function baseClamp(number, lower, upper) {
  4094. if (number === number) {
  4095. if (upper !== undefined) {
  4096. number = number <= upper ? number : upper;
  4097. }
  4098. if (lower !== undefined) {
  4099. number = number >= lower ? number : lower;
  4100. }
  4101. }
  4102. return number;
  4103. }
  4104. /**
  4105. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4106. * traversed objects.
  4107. *
  4108. * @private
  4109. * @param {*} value The value to clone.
  4110. * @param {boolean} bitmask The bitmask flags.
  4111. * 1 - Deep clone
  4112. * 2 - Flatten inherited properties
  4113. * 4 - Clone symbols
  4114. * @param {Function} [customizer] The function to customize cloning.
  4115. * @param {string} [key] The key of `value`.
  4116. * @param {Object} [object] The parent object of `value`.
  4117. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4118. * @returns {*} Returns the cloned value.
  4119. */
  4120. function baseClone(value, bitmask, customizer, key, object, stack) {
  4121. var result,
  4122. isDeep = bitmask & CLONE_DEEP_FLAG,
  4123. isFlat = bitmask & CLONE_FLAT_FLAG,
  4124. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  4125. if (customizer) {
  4126. result = object ? customizer(value, key, object, stack) : customizer(value);
  4127. }
  4128. if (result !== undefined) {
  4129. return result;
  4130. }
  4131. if (!isObject(value)) {
  4132. return value;
  4133. }
  4134. var isArr = isArray(value);
  4135. if (isArr) {
  4136. result = initCloneArray(value);
  4137. if (!isDeep) {
  4138. return copyArray(value, result);
  4139. }
  4140. } else {
  4141. var tag = getTag(value),
  4142. isFunc = tag == funcTag || tag == genTag;
  4143. if (isBuffer(value)) {
  4144. return cloneBuffer(value, isDeep);
  4145. }
  4146. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  4147. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  4148. if (!isDeep) {
  4149. return isFlat
  4150. ? copySymbolsIn(value, baseAssignIn(result, value))
  4151. : copySymbols(value, baseAssign(result, value));
  4152. }
  4153. } else {
  4154. if (!cloneableTags[tag]) {
  4155. return object ? value : {};
  4156. }
  4157. result = initCloneByTag(value, tag, isDeep);
  4158. }
  4159. }
  4160. // Check for circular references and return its corresponding clone.
  4161. stack || (stack = new Stack);
  4162. var stacked = stack.get(value);
  4163. if (stacked) {
  4164. return stacked;
  4165. }
  4166. stack.set(value, result);
  4167. if (isSet(value)) {
  4168. value.forEach(function(subValue) {
  4169. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  4170. });
  4171. } else if (isMap(value)) {
  4172. value.forEach(function(subValue, key) {
  4173. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4174. });
  4175. }
  4176. var keysFunc = isFull
  4177. ? (isFlat ? getAllKeysIn : getAllKeys)
  4178. : (isFlat ? keysIn : keys);
  4179. var props = isArr ? undefined : keysFunc(value);
  4180. arrayEach(props || value, function(subValue, key) {
  4181. if (props) {
  4182. key = subValue;
  4183. subValue = value[key];
  4184. }
  4185. // Recursively populate clone (susceptible to call stack limits).
  4186. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4187. });
  4188. return result;
  4189. }
  4190. /**
  4191. * The base implementation of `_.conforms` which doesn't clone `source`.
  4192. *
  4193. * @private
  4194. * @param {Object} source The object of property predicates to conform to.
  4195. * @returns {Function} Returns the new spec function.
  4196. */
  4197. function baseConforms(source) {
  4198. var props = keys(source);
  4199. return function(object) {
  4200. return baseConformsTo(object, source, props);
  4201. };
  4202. }
  4203. /**
  4204. * The base implementation of `_.conformsTo` which accepts `props` to check.
  4205. *
  4206. * @private
  4207. * @param {Object} object The object to inspect.
  4208. * @param {Object} source The object of property predicates to conform to.
  4209. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  4210. */
  4211. function baseConformsTo(object, source, props) {
  4212. var length = props.length;
  4213. if (object == null) {
  4214. return !length;
  4215. }
  4216. object = Object(object);
  4217. while (length--) {
  4218. var key = props[length],
  4219. predicate = source[key],
  4220. value = object[key];
  4221. if ((value === undefined && !(key in object)) || !predicate(value)) {
  4222. return false;
  4223. }
  4224. }
  4225. return true;
  4226. }
  4227. /**
  4228. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  4229. * to provide to `func`.
  4230. *
  4231. * @private
  4232. * @param {Function} func The function to delay.
  4233. * @param {number} wait The number of milliseconds to delay invocation.
  4234. * @param {Array} args The arguments to provide to `func`.
  4235. * @returns {number|Object} Returns the timer id or timeout object.
  4236. */
  4237. function baseDelay(func, wait, args) {
  4238. if (typeof func != 'function') {
  4239. throw new TypeError(FUNC_ERROR_TEXT);
  4240. }
  4241. return setTimeout(function() { func.apply(undefined, args); }, wait);
  4242. }
  4243. /**
  4244. * The base implementation of methods like `_.difference` without support
  4245. * for excluding multiple arrays or iteratee shorthands.
  4246. *
  4247. * @private
  4248. * @param {Array} array The array to inspect.
  4249. * @param {Array} values The values to exclude.
  4250. * @param {Function} [iteratee] The iteratee invoked per element.
  4251. * @param {Function} [comparator] The comparator invoked per element.
  4252. * @returns {Array} Returns the new array of filtered values.
  4253. */
  4254. function baseDifference(array, values, iteratee, comparator) {
  4255. var index = -1,
  4256. includes = arrayIncludes,
  4257. isCommon = true,
  4258. length = array.length,
  4259. result = [],
  4260. valuesLength = values.length;
  4261. if (!length) {
  4262. return result;
  4263. }
  4264. if (iteratee) {
  4265. values = arrayMap(values, baseUnary(iteratee));
  4266. }
  4267. if (comparator) {
  4268. includes = arrayIncludesWith;
  4269. isCommon = false;
  4270. }
  4271. else if (values.length >= LARGE_ARRAY_SIZE) {
  4272. includes = cacheHas;
  4273. isCommon = false;
  4274. values = new SetCache(values);
  4275. }
  4276. outer:
  4277. while (++index < length) {
  4278. var value = array[index],
  4279. computed = iteratee == null ? value : iteratee(value);
  4280. value = (comparator || value !== 0) ? value : 0;
  4281. if (isCommon && computed === computed) {
  4282. var valuesIndex = valuesLength;
  4283. while (valuesIndex--) {
  4284. if (values[valuesIndex] === computed) {
  4285. continue outer;
  4286. }
  4287. }
  4288. result.push(value);
  4289. }
  4290. else if (!includes(values, computed, comparator)) {
  4291. result.push(value);
  4292. }
  4293. }
  4294. return result;
  4295. }
  4296. /**
  4297. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4298. *
  4299. * @private
  4300. * @param {Array|Object} collection The collection to iterate over.
  4301. * @param {Function} iteratee The function invoked per iteration.
  4302. * @returns {Array|Object} Returns `collection`.
  4303. */
  4304. var baseEach = createBaseEach(baseForOwn);
  4305. /**
  4306. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  4307. *
  4308. * @private
  4309. * @param {Array|Object} collection The collection to iterate over.
  4310. * @param {Function} iteratee The function invoked per iteration.
  4311. * @returns {Array|Object} Returns `collection`.
  4312. */
  4313. var baseEachRight = createBaseEach(baseForOwnRight, true);
  4314. /**
  4315. * The base implementation of `_.every` without support for iteratee shorthands.
  4316. *
  4317. * @private
  4318. * @param {Array|Object} collection The collection to iterate over.
  4319. * @param {Function} predicate The function invoked per iteration.
  4320. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  4321. * else `false`
  4322. */
  4323. function baseEvery(collection, predicate) {
  4324. var result = true;
  4325. baseEach(collection, function(value, index, collection) {
  4326. result = !!predicate(value, index, collection);
  4327. return result;
  4328. });
  4329. return result;
  4330. }
  4331. /**
  4332. * The base implementation of methods like `_.max` and `_.min` which accepts a
  4333. * `comparator` to determine the extremum value.
  4334. *
  4335. * @private
  4336. * @param {Array} array The array to iterate over.
  4337. * @param {Function} iteratee The iteratee invoked per iteration.
  4338. * @param {Function} comparator The comparator used to compare values.
  4339. * @returns {*} Returns the extremum value.
  4340. */
  4341. function baseExtremum(array, iteratee, comparator) {
  4342. var index = -1,
  4343. length = array.length;
  4344. while (++index < length) {
  4345. var value = array[index],
  4346. current = iteratee(value);
  4347. if (current != null && (computed === undefined
  4348. ? (current === current && !isSymbol(current))
  4349. : comparator(current, computed)
  4350. )) {
  4351. var computed = current,
  4352. result = value;
  4353. }
  4354. }
  4355. return result;
  4356. }
  4357. /**
  4358. * The base implementation of `_.fill` without an iteratee call guard.
  4359. *
  4360. * @private
  4361. * @param {Array} array The array to fill.
  4362. * @param {*} value The value to fill `array` with.
  4363. * @param {number} [start=0] The start position.
  4364. * @param {number} [end=array.length] The end position.
  4365. * @returns {Array} Returns `array`.
  4366. */
  4367. function baseFill(array, value, start, end) {
  4368. var length = array.length;
  4369. start = toInteger(start);
  4370. if (start < 0) {
  4371. start = -start > length ? 0 : (length + start);
  4372. }
  4373. end = (end === undefined || end > length) ? length : toInteger(end);
  4374. if (end < 0) {
  4375. end += length;
  4376. }
  4377. end = start > end ? 0 : toLength(end);
  4378. while (start < end) {
  4379. array[start++] = value;
  4380. }
  4381. return array;
  4382. }
  4383. /**
  4384. * The base implementation of `_.filter` without support for iteratee shorthands.
  4385. *
  4386. * @private
  4387. * @param {Array|Object} collection The collection to iterate over.
  4388. * @param {Function} predicate The function invoked per iteration.
  4389. * @returns {Array} Returns the new filtered array.
  4390. */
  4391. function baseFilter(collection, predicate) {
  4392. var result = [];
  4393. baseEach(collection, function(value, index, collection) {
  4394. if (predicate(value, index, collection)) {
  4395. result.push(value);
  4396. }
  4397. });
  4398. return result;
  4399. }
  4400. /**
  4401. * The base implementation of `_.flatten` with support for restricting flattening.
  4402. *
  4403. * @private
  4404. * @param {Array} array The array to flatten.
  4405. * @param {number} depth The maximum recursion depth.
  4406. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4407. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4408. * @param {Array} [result=[]] The initial result value.
  4409. * @returns {Array} Returns the new flattened array.
  4410. */
  4411. function baseFlatten(array, depth, predicate, isStrict, result) {
  4412. var index = -1,
  4413. length = array.length;
  4414. predicate || (predicate = isFlattenable);
  4415. result || (result = []);
  4416. while (++index < length) {
  4417. var value = array[index];
  4418. if (depth > 0 && predicate(value)) {
  4419. if (depth > 1) {
  4420. // Recursively flatten arrays (susceptible to call stack limits).
  4421. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4422. } else {
  4423. arrayPush(result, value);
  4424. }
  4425. } else if (!isStrict) {
  4426. result[result.length] = value;
  4427. }
  4428. }
  4429. return result;
  4430. }
  4431. /**
  4432. * The base implementation of `baseForOwn` which iterates over `object`
  4433. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4434. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4435. *
  4436. * @private
  4437. * @param {Object} object The object to iterate over.
  4438. * @param {Function} iteratee The function invoked per iteration.
  4439. * @param {Function} keysFunc The function to get the keys of `object`.
  4440. * @returns {Object} Returns `object`.
  4441. */
  4442. var baseFor = createBaseFor();
  4443. /**
  4444. * This function is like `baseFor` except that it iterates over properties
  4445. * in the opposite order.
  4446. *
  4447. * @private
  4448. * @param {Object} object The object to iterate over.
  4449. * @param {Function} iteratee The function invoked per iteration.
  4450. * @param {Function} keysFunc The function to get the keys of `object`.
  4451. * @returns {Object} Returns `object`.
  4452. */
  4453. var baseForRight = createBaseFor(true);
  4454. /**
  4455. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4456. *
  4457. * @private
  4458. * @param {Object} object The object to iterate over.
  4459. * @param {Function} iteratee The function invoked per iteration.
  4460. * @returns {Object} Returns `object`.
  4461. */
  4462. function baseForOwn(object, iteratee) {
  4463. return object && baseFor(object, iteratee, keys);
  4464. }
  4465. /**
  4466. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4467. *
  4468. * @private
  4469. * @param {Object} object The object to iterate over.
  4470. * @param {Function} iteratee The function invoked per iteration.
  4471. * @returns {Object} Returns `object`.
  4472. */
  4473. function baseForOwnRight(object, iteratee) {
  4474. return object && baseForRight(object, iteratee, keys);
  4475. }
  4476. /**
  4477. * The base implementation of `_.functions` which creates an array of
  4478. * `object` function property names filtered from `props`.
  4479. *
  4480. * @private
  4481. * @param {Object} object The object to inspect.
  4482. * @param {Array} props The property names to filter.
  4483. * @returns {Array} Returns the function names.
  4484. */
  4485. function baseFunctions(object, props) {
  4486. return arrayFilter(props, function(key) {
  4487. return isFunction(object[key]);
  4488. });
  4489. }
  4490. /**
  4491. * The base implementation of `_.get` without support for default values.
  4492. *
  4493. * @private
  4494. * @param {Object} object The object to query.
  4495. * @param {Array|string} path The path of the property to get.
  4496. * @returns {*} Returns the resolved value.
  4497. */
  4498. function baseGet(object, path) {
  4499. path = castPath(path, object);
  4500. var index = 0,
  4501. length = path.length;
  4502. while (object != null && index < length) {
  4503. object = object[toKey(path[index++])];
  4504. }
  4505. return (index && index == length) ? object : undefined;
  4506. }
  4507. /**
  4508. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4509. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4510. * symbols of `object`.
  4511. *
  4512. * @private
  4513. * @param {Object} object The object to query.
  4514. * @param {Function} keysFunc The function to get the keys of `object`.
  4515. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4516. * @returns {Array} Returns the array of property names and symbols.
  4517. */
  4518. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4519. var result = keysFunc(object);
  4520. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4521. }
  4522. /**
  4523. * The base implementation of `getTag` without fallbacks for buggy environments.
  4524. *
  4525. * @private
  4526. * @param {*} value The value to query.
  4527. * @returns {string} Returns the `toStringTag`.
  4528. */
  4529. function baseGetTag(value) {
  4530. if (value == null) {
  4531. return value === undefined ? undefinedTag : nullTag;
  4532. }
  4533. return (symToStringTag && symToStringTag in Object(value))
  4534. ? getRawTag(value)
  4535. : objectToString(value);
  4536. }
  4537. /**
  4538. * The base implementation of `_.gt` which doesn't coerce arguments.
  4539. *
  4540. * @private
  4541. * @param {*} value The value to compare.
  4542. * @param {*} other The other value to compare.
  4543. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4544. * else `false`.
  4545. */
  4546. function baseGt(value, other) {
  4547. return value > other;
  4548. }
  4549. /**
  4550. * The base implementation of `_.has` without support for deep paths.
  4551. *
  4552. * @private
  4553. * @param {Object} [object] The object to query.
  4554. * @param {Array|string} key The key to check.
  4555. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4556. */
  4557. function baseHas(object, key) {
  4558. return object != null && hasOwnProperty.call(object, key);
  4559. }
  4560. /**
  4561. * The base implementation of `_.hasIn` without support for deep paths.
  4562. *
  4563. * @private
  4564. * @param {Object} [object] The object to query.
  4565. * @param {Array|string} key The key to check.
  4566. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4567. */
  4568. function baseHasIn(object, key) {
  4569. return object != null && key in Object(object);
  4570. }
  4571. /**
  4572. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4573. *
  4574. * @private
  4575. * @param {number} number The number to check.
  4576. * @param {number} start The start of the range.
  4577. * @param {number} end The end of the range.
  4578. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4579. */
  4580. function baseInRange(number, start, end) {
  4581. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4582. }
  4583. /**
  4584. * The base implementation of methods like `_.intersection`, without support
  4585. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4586. *
  4587. * @private
  4588. * @param {Array} arrays The arrays to inspect.
  4589. * @param {Function} [iteratee] The iteratee invoked per element.
  4590. * @param {Function} [comparator] The comparator invoked per element.
  4591. * @returns {Array} Returns the new array of shared values.
  4592. */
  4593. function baseIntersection(arrays, iteratee, comparator) {
  4594. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4595. length = arrays[0].length,
  4596. othLength = arrays.length,
  4597. othIndex = othLength,
  4598. caches = Array(othLength),
  4599. maxLength = Infinity,
  4600. result = [];
  4601. while (othIndex--) {
  4602. var array = arrays[othIndex];
  4603. if (othIndex && iteratee) {
  4604. array = arrayMap(array, baseUnary(iteratee));
  4605. }
  4606. maxLength = nativeMin(array.length, maxLength);
  4607. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4608. ? new SetCache(othIndex && array)
  4609. : undefined;
  4610. }
  4611. array = arrays[0];
  4612. var index = -1,
  4613. seen = caches[0];
  4614. outer:
  4615. while (++index < length && result.length < maxLength) {
  4616. var value = array[index],
  4617. computed = iteratee ? iteratee(value) : value;
  4618. value = (comparator || value !== 0) ? value : 0;
  4619. if (!(seen
  4620. ? cacheHas(seen, computed)
  4621. : includes(result, computed, comparator)
  4622. )) {
  4623. othIndex = othLength;
  4624. while (--othIndex) {
  4625. var cache = caches[othIndex];
  4626. if (!(cache
  4627. ? cacheHas(cache, computed)
  4628. : includes(arrays[othIndex], computed, comparator))
  4629. ) {
  4630. continue outer;
  4631. }
  4632. }
  4633. if (seen) {
  4634. seen.push(computed);
  4635. }
  4636. result.push(value);
  4637. }
  4638. }
  4639. return result;
  4640. }
  4641. /**
  4642. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4643. * `object` with values transformed by `iteratee` and set by `setter`.
  4644. *
  4645. * @private
  4646. * @param {Object} object The object to iterate over.
  4647. * @param {Function} setter The function to set `accumulator` values.
  4648. * @param {Function} iteratee The iteratee to transform values.
  4649. * @param {Object} accumulator The initial inverted object.
  4650. * @returns {Function} Returns `accumulator`.
  4651. */
  4652. function baseInverter(object, setter, iteratee, accumulator) {
  4653. baseForOwn(object, function(value, key, object) {
  4654. setter(accumulator, iteratee(value), key, object);
  4655. });
  4656. return accumulator;
  4657. }
  4658. /**
  4659. * The base implementation of `_.invoke` without support for individual
  4660. * method arguments.
  4661. *
  4662. * @private
  4663. * @param {Object} object The object to query.
  4664. * @param {Array|string} path The path of the method to invoke.
  4665. * @param {Array} args The arguments to invoke the method with.
  4666. * @returns {*} Returns the result of the invoked method.
  4667. */
  4668. function baseInvoke(object, path, args) {
  4669. path = castPath(path, object);
  4670. object = parent(object, path);
  4671. var func = object == null ? object : object[toKey(last(path))];
  4672. return func == null ? undefined : apply(func, object, args);
  4673. }
  4674. /**
  4675. * The base implementation of `_.isArguments`.
  4676. *
  4677. * @private
  4678. * @param {*} value The value to check.
  4679. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4680. */
  4681. function baseIsArguments(value) {
  4682. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4683. }
  4684. /**
  4685. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4686. *
  4687. * @private
  4688. * @param {*} value The value to check.
  4689. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4690. */
  4691. function baseIsArrayBuffer(value) {
  4692. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4693. }
  4694. /**
  4695. * The base implementation of `_.isDate` without Node.js optimizations.
  4696. *
  4697. * @private
  4698. * @param {*} value The value to check.
  4699. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4700. */
  4701. function baseIsDate(value) {
  4702. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4703. }
  4704. /**
  4705. * The base implementation of `_.isEqual` which supports partial comparisons
  4706. * and tracks traversed objects.
  4707. *
  4708. * @private
  4709. * @param {*} value The value to compare.
  4710. * @param {*} other The other value to compare.
  4711. * @param {boolean} bitmask The bitmask flags.
  4712. * 1 - Unordered comparison
  4713. * 2 - Partial comparison
  4714. * @param {Function} [customizer] The function to customize comparisons.
  4715. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4716. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4717. */
  4718. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4719. if (value === other) {
  4720. return true;
  4721. }
  4722. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4723. return value !== value && other !== other;
  4724. }
  4725. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4726. }
  4727. /**
  4728. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4729. * deep comparisons and tracks traversed objects enabling objects with circular
  4730. * references to be compared.
  4731. *
  4732. * @private
  4733. * @param {Object} object The object to compare.
  4734. * @param {Object} other The other object to compare.
  4735. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4736. * @param {Function} customizer The function to customize comparisons.
  4737. * @param {Function} equalFunc The function to determine equivalents of values.
  4738. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4739. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4740. */
  4741. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4742. var objIsArr = isArray(object),
  4743. othIsArr = isArray(other),
  4744. objTag = objIsArr ? arrayTag : getTag(object),
  4745. othTag = othIsArr ? arrayTag : getTag(other);
  4746. objTag = objTag == argsTag ? objectTag : objTag;
  4747. othTag = othTag == argsTag ? objectTag : othTag;
  4748. var objIsObj = objTag == objectTag,
  4749. othIsObj = othTag == objectTag,
  4750. isSameTag = objTag == othTag;
  4751. if (isSameTag && isBuffer(object)) {
  4752. if (!isBuffer(other)) {
  4753. return false;
  4754. }
  4755. objIsArr = true;
  4756. objIsObj = false;
  4757. }
  4758. if (isSameTag && !objIsObj) {
  4759. stack || (stack = new Stack);
  4760. return (objIsArr || isTypedArray(object))
  4761. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4762. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4763. }
  4764. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4765. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4766. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4767. if (objIsWrapped || othIsWrapped) {
  4768. var objUnwrapped = objIsWrapped ? object.value() : object,
  4769. othUnwrapped = othIsWrapped ? other.value() : other;
  4770. stack || (stack = new Stack);
  4771. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4772. }
  4773. }
  4774. if (!isSameTag) {
  4775. return false;
  4776. }
  4777. stack || (stack = new Stack);
  4778. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4779. }
  4780. /**
  4781. * The base implementation of `_.isMap` without Node.js optimizations.
  4782. *
  4783. * @private
  4784. * @param {*} value The value to check.
  4785. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4786. */
  4787. function baseIsMap(value) {
  4788. return isObjectLike(value) && getTag(value) == mapTag;
  4789. }
  4790. /**
  4791. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4792. *
  4793. * @private
  4794. * @param {Object} object The object to inspect.
  4795. * @param {Object} source The object of property values to match.
  4796. * @param {Array} matchData The property names, values, and compare flags to match.
  4797. * @param {Function} [customizer] The function to customize comparisons.
  4798. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4799. */
  4800. function baseIsMatch(object, source, matchData, customizer) {
  4801. var index = matchData.length,
  4802. length = index,
  4803. noCustomizer = !customizer;
  4804. if (object == null) {
  4805. return !length;
  4806. }
  4807. object = Object(object);
  4808. while (index--) {
  4809. var data = matchData[index];
  4810. if ((noCustomizer && data[2])
  4811. ? data[1] !== object[data[0]]
  4812. : !(data[0] in object)
  4813. ) {
  4814. return false;
  4815. }
  4816. }
  4817. while (++index < length) {
  4818. data = matchData[index];
  4819. var key = data[0],
  4820. objValue = object[key],
  4821. srcValue = data[1];
  4822. if (noCustomizer && data[2]) {
  4823. if (objValue === undefined && !(key in object)) {
  4824. return false;
  4825. }
  4826. } else {
  4827. var stack = new Stack;
  4828. if (customizer) {
  4829. var result = customizer(objValue, srcValue, key, object, source, stack);
  4830. }
  4831. if (!(result === undefined
  4832. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4833. : result
  4834. )) {
  4835. return false;
  4836. }
  4837. }
  4838. }
  4839. return true;
  4840. }
  4841. /**
  4842. * The base implementation of `_.isNative` without bad shim checks.
  4843. *
  4844. * @private
  4845. * @param {*} value The value to check.
  4846. * @returns {boolean} Returns `true` if `value` is a native function,
  4847. * else `false`.
  4848. */
  4849. function baseIsNative(value) {
  4850. if (!isObject(value) || isMasked(value)) {
  4851. return false;
  4852. }
  4853. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4854. return pattern.test(toSource(value));
  4855. }
  4856. /**
  4857. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4858. *
  4859. * @private
  4860. * @param {*} value The value to check.
  4861. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4862. */
  4863. function baseIsRegExp(value) {
  4864. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4865. }
  4866. /**
  4867. * The base implementation of `_.isSet` without Node.js optimizations.
  4868. *
  4869. * @private
  4870. * @param {*} value The value to check.
  4871. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4872. */
  4873. function baseIsSet(value) {
  4874. return isObjectLike(value) && getTag(value) == setTag;
  4875. }
  4876. /**
  4877. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4878. *
  4879. * @private
  4880. * @param {*} value The value to check.
  4881. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4882. */
  4883. function baseIsTypedArray(value) {
  4884. return isObjectLike(value) &&
  4885. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4886. }
  4887. /**
  4888. * The base implementation of `_.iteratee`.
  4889. *
  4890. * @private
  4891. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4892. * @returns {Function} Returns the iteratee.
  4893. */
  4894. function baseIteratee(value) {
  4895. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4896. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4897. if (typeof value == 'function') {
  4898. return value;
  4899. }
  4900. if (value == null) {
  4901. return identity;
  4902. }
  4903. if (typeof value == 'object') {
  4904. return isArray(value)
  4905. ? baseMatchesProperty(value[0], value[1])
  4906. : baseMatches(value);
  4907. }
  4908. return property(value);
  4909. }
  4910. /**
  4911. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4912. *
  4913. * @private
  4914. * @param {Object} object The object to query.
  4915. * @returns {Array} Returns the array of property names.
  4916. */
  4917. function baseKeys(object) {
  4918. if (!isPrototype(object)) {
  4919. return nativeKeys(object);
  4920. }
  4921. var result = [];
  4922. for (var key in Object(object)) {
  4923. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4924. result.push(key);
  4925. }
  4926. }
  4927. return result;
  4928. }
  4929. /**
  4930. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4931. *
  4932. * @private
  4933. * @param {Object} object The object to query.
  4934. * @returns {Array} Returns the array of property names.
  4935. */
  4936. function baseKeysIn(object) {
  4937. if (!isObject(object)) {
  4938. return nativeKeysIn(object);
  4939. }
  4940. var isProto = isPrototype(object),
  4941. result = [];
  4942. for (var key in object) {
  4943. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4944. result.push(key);
  4945. }
  4946. }
  4947. return result;
  4948. }
  4949. /**
  4950. * The base implementation of `_.lt` which doesn't coerce arguments.
  4951. *
  4952. * @private
  4953. * @param {*} value The value to compare.
  4954. * @param {*} other The other value to compare.
  4955. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4956. * else `false`.
  4957. */
  4958. function baseLt(value, other) {
  4959. return value < other;
  4960. }
  4961. /**
  4962. * The base implementation of `_.map` without support for iteratee shorthands.
  4963. *
  4964. * @private
  4965. * @param {Array|Object} collection The collection to iterate over.
  4966. * @param {Function} iteratee The function invoked per iteration.
  4967. * @returns {Array} Returns the new mapped array.
  4968. */
  4969. function baseMap(collection, iteratee) {
  4970. var index = -1,
  4971. result = isArrayLike(collection) ? Array(collection.length) : [];
  4972. baseEach(collection, function(value, key, collection) {
  4973. result[++index] = iteratee(value, key, collection);
  4974. });
  4975. return result;
  4976. }
  4977. /**
  4978. * The base implementation of `_.matches` which doesn't clone `source`.
  4979. *
  4980. * @private
  4981. * @param {Object} source The object of property values to match.
  4982. * @returns {Function} Returns the new spec function.
  4983. */
  4984. function baseMatches(source) {
  4985. var matchData = getMatchData(source);
  4986. if (matchData.length == 1 && matchData[0][2]) {
  4987. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4988. }
  4989. return function(object) {
  4990. return object === source || baseIsMatch(object, source, matchData);
  4991. };
  4992. }
  4993. /**
  4994. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4995. *
  4996. * @private
  4997. * @param {string} path The path of the property to get.
  4998. * @param {*} srcValue The value to match.
  4999. * @returns {Function} Returns the new spec function.
  5000. */
  5001. function baseMatchesProperty(path, srcValue) {
  5002. if (isKey(path) && isStrictComparable(srcValue)) {
  5003. return matchesStrictComparable(toKey(path), srcValue);
  5004. }
  5005. return function(object) {
  5006. var objValue = get(object, path);
  5007. return (objValue === undefined && objValue === srcValue)
  5008. ? hasIn(object, path)
  5009. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  5010. };
  5011. }
  5012. /**
  5013. * The base implementation of `_.merge` without support for multiple sources.
  5014. *
  5015. * @private
  5016. * @param {Object} object The destination object.
  5017. * @param {Object} source The source object.
  5018. * @param {number} srcIndex The index of `source`.
  5019. * @param {Function} [customizer] The function to customize merged values.
  5020. * @param {Object} [stack] Tracks traversed source values and their merged
  5021. * counterparts.
  5022. */
  5023. function baseMerge(object, source, srcIndex, customizer, stack) {
  5024. if (object === source) {
  5025. return;
  5026. }
  5027. baseFor(source, function(srcValue, key) {
  5028. stack || (stack = new Stack);
  5029. if (isObject(srcValue)) {
  5030. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  5031. }
  5032. else {
  5033. var newValue = customizer
  5034. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  5035. : undefined;
  5036. if (newValue === undefined) {
  5037. newValue = srcValue;
  5038. }
  5039. assignMergeValue(object, key, newValue);
  5040. }
  5041. }, keysIn);
  5042. }
  5043. /**
  5044. * A specialized version of `baseMerge` for arrays and objects which performs
  5045. * deep merges and tracks traversed objects enabling objects with circular
  5046. * references to be merged.
  5047. *
  5048. * @private
  5049. * @param {Object} object The destination object.
  5050. * @param {Object} source The source object.
  5051. * @param {string} key The key of the value to merge.
  5052. * @param {number} srcIndex The index of `source`.
  5053. * @param {Function} mergeFunc The function to merge values.
  5054. * @param {Function} [customizer] The function to customize assigned values.
  5055. * @param {Object} [stack] Tracks traversed source values and their merged
  5056. * counterparts.
  5057. */
  5058. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  5059. var objValue = safeGet(object, key),
  5060. srcValue = safeGet(source, key),
  5061. stacked = stack.get(srcValue);
  5062. if (stacked) {
  5063. assignMergeValue(object, key, stacked);
  5064. return;
  5065. }
  5066. var newValue = customizer
  5067. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  5068. : undefined;
  5069. var isCommon = newValue === undefined;
  5070. if (isCommon) {
  5071. var isArr = isArray(srcValue),
  5072. isBuff = !isArr && isBuffer(srcValue),
  5073. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  5074. newValue = srcValue;
  5075. if (isArr || isBuff || isTyped) {
  5076. if (isArray(objValue)) {
  5077. newValue = objValue;
  5078. }
  5079. else if (isArrayLikeObject(objValue)) {
  5080. newValue = copyArray(objValue);
  5081. }
  5082. else if (isBuff) {
  5083. isCommon = false;
  5084. newValue = cloneBuffer(srcValue, true);
  5085. }
  5086. else if (isTyped) {
  5087. isCommon = false;
  5088. newValue = cloneTypedArray(srcValue, true);
  5089. }
  5090. else {
  5091. newValue = [];
  5092. }
  5093. }
  5094. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  5095. newValue = objValue;
  5096. if (isArguments(objValue)) {
  5097. newValue = toPlainObject(objValue);
  5098. }
  5099. else if (!isObject(objValue) || isFunction(objValue)) {
  5100. newValue = initCloneObject(srcValue);
  5101. }
  5102. }
  5103. else {
  5104. isCommon = false;
  5105. }
  5106. }
  5107. if (isCommon) {
  5108. // Recursively merge objects and arrays (susceptible to call stack limits).
  5109. stack.set(srcValue, newValue);
  5110. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  5111. stack['delete'](srcValue);
  5112. }
  5113. assignMergeValue(object, key, newValue);
  5114. }
  5115. /**
  5116. * The base implementation of `_.nth` which doesn't coerce arguments.
  5117. *
  5118. * @private
  5119. * @param {Array} array The array to query.
  5120. * @param {number} n The index of the element to return.
  5121. * @returns {*} Returns the nth element of `array`.
  5122. */
  5123. function baseNth(array, n) {
  5124. var length = array.length;
  5125. if (!length) {
  5126. return;
  5127. }
  5128. n += n < 0 ? length : 0;
  5129. return isIndex(n, length) ? array[n] : undefined;
  5130. }
  5131. /**
  5132. * The base implementation of `_.orderBy` without param guards.
  5133. *
  5134. * @private
  5135. * @param {Array|Object} collection The collection to iterate over.
  5136. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  5137. * @param {string[]} orders The sort orders of `iteratees`.
  5138. * @returns {Array} Returns the new sorted array.
  5139. */
  5140. function baseOrderBy(collection, iteratees, orders) {
  5141. if (iteratees.length) {
  5142. iteratees = arrayMap(iteratees, function(iteratee) {
  5143. if (isArray(iteratee)) {
  5144. return function(value) {
  5145. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  5146. }
  5147. }
  5148. return iteratee;
  5149. });
  5150. } else {
  5151. iteratees = [identity];
  5152. }
  5153. var index = -1;
  5154. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5155. var result = baseMap(collection, function(value, key, collection) {
  5156. var criteria = arrayMap(iteratees, function(iteratee) {
  5157. return iteratee(value);
  5158. });
  5159. return { 'criteria': criteria, 'index': ++index, 'value': value };
  5160. });
  5161. return baseSortBy(result, function(object, other) {
  5162. return compareMultiple(object, other, orders);
  5163. });
  5164. }
  5165. /**
  5166. * The base implementation of `_.pick` without support for individual
  5167. * property identifiers.
  5168. *
  5169. * @private
  5170. * @param {Object} object The source object.
  5171. * @param {string[]} paths The property paths to pick.
  5172. * @returns {Object} Returns the new object.
  5173. */
  5174. function basePick(object, paths) {
  5175. return basePickBy(object, paths, function(value, path) {
  5176. return hasIn(object, path);
  5177. });
  5178. }
  5179. /**
  5180. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5181. *
  5182. * @private
  5183. * @param {Object} object The source object.
  5184. * @param {string[]} paths The property paths to pick.
  5185. * @param {Function} predicate The function invoked per property.
  5186. * @returns {Object} Returns the new object.
  5187. */
  5188. function basePickBy(object, paths, predicate) {
  5189. var index = -1,
  5190. length = paths.length,
  5191. result = {};
  5192. while (++index < length) {
  5193. var path = paths[index],
  5194. value = baseGet(object, path);
  5195. if (predicate(value, path)) {
  5196. baseSet(result, castPath(path, object), value);
  5197. }
  5198. }
  5199. return result;
  5200. }
  5201. /**
  5202. * A specialized version of `baseProperty` which supports deep paths.
  5203. *
  5204. * @private
  5205. * @param {Array|string} path The path of the property to get.
  5206. * @returns {Function} Returns the new accessor function.
  5207. */
  5208. function basePropertyDeep(path) {
  5209. return function(object) {
  5210. return baseGet(object, path);
  5211. };
  5212. }
  5213. /**
  5214. * The base implementation of `_.pullAllBy` without support for iteratee
  5215. * shorthands.
  5216. *
  5217. * @private
  5218. * @param {Array} array The array to modify.
  5219. * @param {Array} values The values to remove.
  5220. * @param {Function} [iteratee] The iteratee invoked per element.
  5221. * @param {Function} [comparator] The comparator invoked per element.
  5222. * @returns {Array} Returns `array`.
  5223. */
  5224. function basePullAll(array, values, iteratee, comparator) {
  5225. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  5226. index = -1,
  5227. length = values.length,
  5228. seen = array;
  5229. if (array === values) {
  5230. values = copyArray(values);
  5231. }
  5232. if (iteratee) {
  5233. seen = arrayMap(array, baseUnary(iteratee));
  5234. }
  5235. while (++index < length) {
  5236. var fromIndex = 0,
  5237. value = values[index],
  5238. computed = iteratee ? iteratee(value) : value;
  5239. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  5240. if (seen !== array) {
  5241. splice.call(seen, fromIndex, 1);
  5242. }
  5243. splice.call(array, fromIndex, 1);
  5244. }
  5245. }
  5246. return array;
  5247. }
  5248. /**
  5249. * The base implementation of `_.pullAt` without support for individual
  5250. * indexes or capturing the removed elements.
  5251. *
  5252. * @private
  5253. * @param {Array} array The array to modify.
  5254. * @param {number[]} indexes The indexes of elements to remove.
  5255. * @returns {Array} Returns `array`.
  5256. */
  5257. function basePullAt(array, indexes) {
  5258. var length = array ? indexes.length : 0,
  5259. lastIndex = length - 1;
  5260. while (length--) {
  5261. var index = indexes[length];
  5262. if (length == lastIndex || index !== previous) {
  5263. var previous = index;
  5264. if (isIndex(index)) {
  5265. splice.call(array, index, 1);
  5266. } else {
  5267. baseUnset(array, index);
  5268. }
  5269. }
  5270. }
  5271. return array;
  5272. }
  5273. /**
  5274. * The base implementation of `_.random` without support for returning
  5275. * floating-point numbers.
  5276. *
  5277. * @private
  5278. * @param {number} lower The lower bound.
  5279. * @param {number} upper The upper bound.
  5280. * @returns {number} Returns the random number.
  5281. */
  5282. function baseRandom(lower, upper) {
  5283. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  5284. }
  5285. /**
  5286. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  5287. * coerce arguments.
  5288. *
  5289. * @private
  5290. * @param {number} start The start of the range.
  5291. * @param {number} end The end of the range.
  5292. * @param {number} step The value to increment or decrement by.
  5293. * @param {boolean} [fromRight] Specify iterating from right to left.
  5294. * @returns {Array} Returns the range of numbers.
  5295. */
  5296. function baseRange(start, end, step, fromRight) {
  5297. var index = -1,
  5298. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  5299. result = Array(length);
  5300. while (length--) {
  5301. result[fromRight ? length : ++index] = start;
  5302. start += step;
  5303. }
  5304. return result;
  5305. }
  5306. /**
  5307. * The base implementation of `_.repeat` which doesn't coerce arguments.
  5308. *
  5309. * @private
  5310. * @param {string} string The string to repeat.
  5311. * @param {number} n The number of times to repeat the string.
  5312. * @returns {string} Returns the repeated string.
  5313. */
  5314. function baseRepeat(string, n) {
  5315. var result = '';
  5316. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  5317. return result;
  5318. }
  5319. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  5320. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  5321. do {
  5322. if (n % 2) {
  5323. result += string;
  5324. }
  5325. n = nativeFloor(n / 2);
  5326. if (n) {
  5327. string += string;
  5328. }
  5329. } while (n);
  5330. return result;
  5331. }
  5332. /**
  5333. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  5334. *
  5335. * @private
  5336. * @param {Function} func The function to apply a rest parameter to.
  5337. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5338. * @returns {Function} Returns the new function.
  5339. */
  5340. function baseRest(func, start) {
  5341. return setToString(overRest(func, start, identity), func + '');
  5342. }
  5343. /**
  5344. * The base implementation of `_.sample`.
  5345. *
  5346. * @private
  5347. * @param {Array|Object} collection The collection to sample.
  5348. * @returns {*} Returns the random element.
  5349. */
  5350. function baseSample(collection) {
  5351. return arraySample(values(collection));
  5352. }
  5353. /**
  5354. * The base implementation of `_.sampleSize` without param guards.
  5355. *
  5356. * @private
  5357. * @param {Array|Object} collection The collection to sample.
  5358. * @param {number} n The number of elements to sample.
  5359. * @returns {Array} Returns the random elements.
  5360. */
  5361. function baseSampleSize(collection, n) {
  5362. var array = values(collection);
  5363. return shuffleSelf(array, baseClamp(n, 0, array.length));
  5364. }
  5365. /**
  5366. * The base implementation of `_.set`.
  5367. *
  5368. * @private
  5369. * @param {Object} object The object to modify.
  5370. * @param {Array|string} path The path of the property to set.
  5371. * @param {*} value The value to set.
  5372. * @param {Function} [customizer] The function to customize path creation.
  5373. * @returns {Object} Returns `object`.
  5374. */
  5375. function baseSet(object, path, value, customizer) {
  5376. if (!isObject(object)) {
  5377. return object;
  5378. }
  5379. path = castPath(path, object);
  5380. var index = -1,
  5381. length = path.length,
  5382. lastIndex = length - 1,
  5383. nested = object;
  5384. while (nested != null && ++index < length) {
  5385. var key = toKey(path[index]),
  5386. newValue = value;
  5387. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  5388. return object;
  5389. }
  5390. if (index != lastIndex) {
  5391. var objValue = nested[key];
  5392. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5393. if (newValue === undefined) {
  5394. newValue = isObject(objValue)
  5395. ? objValue
  5396. : (isIndex(path[index + 1]) ? [] : {});
  5397. }
  5398. }
  5399. assignValue(nested, key, newValue);
  5400. nested = nested[key];
  5401. }
  5402. return object;
  5403. }
  5404. /**
  5405. * The base implementation of `setData` without support for hot loop shorting.
  5406. *
  5407. * @private
  5408. * @param {Function} func The function to associate metadata with.
  5409. * @param {*} data The metadata.
  5410. * @returns {Function} Returns `func`.
  5411. */
  5412. var baseSetData = !metaMap ? identity : function(func, data) {
  5413. metaMap.set(func, data);
  5414. return func;
  5415. };
  5416. /**
  5417. * The base implementation of `setToString` without support for hot loop shorting.
  5418. *
  5419. * @private
  5420. * @param {Function} func The function to modify.
  5421. * @param {Function} string The `toString` result.
  5422. * @returns {Function} Returns `func`.
  5423. */
  5424. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5425. return defineProperty(func, 'toString', {
  5426. 'configurable': true,
  5427. 'enumerable': false,
  5428. 'value': constant(string),
  5429. 'writable': true
  5430. });
  5431. };
  5432. /**
  5433. * The base implementation of `_.shuffle`.
  5434. *
  5435. * @private
  5436. * @param {Array|Object} collection The collection to shuffle.
  5437. * @returns {Array} Returns the new shuffled array.
  5438. */
  5439. function baseShuffle(collection) {
  5440. return shuffleSelf(values(collection));
  5441. }
  5442. /**
  5443. * The base implementation of `_.slice` without an iteratee call guard.
  5444. *
  5445. * @private
  5446. * @param {Array} array The array to slice.
  5447. * @param {number} [start=0] The start position.
  5448. * @param {number} [end=array.length] The end position.
  5449. * @returns {Array} Returns the slice of `array`.
  5450. */
  5451. function baseSlice(array, start, end) {
  5452. var index = -1,
  5453. length = array.length;
  5454. if (start < 0) {
  5455. start = -start > length ? 0 : (length + start);
  5456. }
  5457. end = end > length ? length : end;
  5458. if (end < 0) {
  5459. end += length;
  5460. }
  5461. length = start > end ? 0 : ((end - start) >>> 0);
  5462. start >>>= 0;
  5463. var result = Array(length);
  5464. while (++index < length) {
  5465. result[index] = array[index + start];
  5466. }
  5467. return result;
  5468. }
  5469. /**
  5470. * The base implementation of `_.some` without support for iteratee shorthands.
  5471. *
  5472. * @private
  5473. * @param {Array|Object} collection The collection to iterate over.
  5474. * @param {Function} predicate The function invoked per iteration.
  5475. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5476. * else `false`.
  5477. */
  5478. function baseSome(collection, predicate) {
  5479. var result;
  5480. baseEach(collection, function(value, index, collection) {
  5481. result = predicate(value, index, collection);
  5482. return !result;
  5483. });
  5484. return !!result;
  5485. }
  5486. /**
  5487. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5488. * performs a binary search of `array` to determine the index at which `value`
  5489. * should be inserted into `array` in order to maintain its sort order.
  5490. *
  5491. * @private
  5492. * @param {Array} array The sorted array to inspect.
  5493. * @param {*} value The value to evaluate.
  5494. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5495. * @returns {number} Returns the index at which `value` should be inserted
  5496. * into `array`.
  5497. */
  5498. function baseSortedIndex(array, value, retHighest) {
  5499. var low = 0,
  5500. high = array == null ? low : array.length;
  5501. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5502. while (low < high) {
  5503. var mid = (low + high) >>> 1,
  5504. computed = array[mid];
  5505. if (computed !== null && !isSymbol(computed) &&
  5506. (retHighest ? (computed <= value) : (computed < value))) {
  5507. low = mid + 1;
  5508. } else {
  5509. high = mid;
  5510. }
  5511. }
  5512. return high;
  5513. }
  5514. return baseSortedIndexBy(array, value, identity, retHighest);
  5515. }
  5516. /**
  5517. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5518. * which invokes `iteratee` for `value` and each element of `array` to compute
  5519. * their sort ranking. The iteratee is invoked with one argument; (value).
  5520. *
  5521. * @private
  5522. * @param {Array} array The sorted array to inspect.
  5523. * @param {*} value The value to evaluate.
  5524. * @param {Function} iteratee The iteratee invoked per element.
  5525. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5526. * @returns {number} Returns the index at which `value` should be inserted
  5527. * into `array`.
  5528. */
  5529. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5530. var low = 0,
  5531. high = array == null ? 0 : array.length;
  5532. if (high === 0) {
  5533. return 0;
  5534. }
  5535. value = iteratee(value);
  5536. var valIsNaN = value !== value,
  5537. valIsNull = value === null,
  5538. valIsSymbol = isSymbol(value),
  5539. valIsUndefined = value === undefined;
  5540. while (low < high) {
  5541. var mid = nativeFloor((low + high) / 2),
  5542. computed = iteratee(array[mid]),
  5543. othIsDefined = computed !== undefined,
  5544. othIsNull = computed === null,
  5545. othIsReflexive = computed === computed,
  5546. othIsSymbol = isSymbol(computed);
  5547. if (valIsNaN) {
  5548. var setLow = retHighest || othIsReflexive;
  5549. } else if (valIsUndefined) {
  5550. setLow = othIsReflexive && (retHighest || othIsDefined);
  5551. } else if (valIsNull) {
  5552. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5553. } else if (valIsSymbol) {
  5554. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5555. } else if (othIsNull || othIsSymbol) {
  5556. setLow = false;
  5557. } else {
  5558. setLow = retHighest ? (computed <= value) : (computed < value);
  5559. }
  5560. if (setLow) {
  5561. low = mid + 1;
  5562. } else {
  5563. high = mid;
  5564. }
  5565. }
  5566. return nativeMin(high, MAX_ARRAY_INDEX);
  5567. }
  5568. /**
  5569. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5570. * support for iteratee shorthands.
  5571. *
  5572. * @private
  5573. * @param {Array} array The array to inspect.
  5574. * @param {Function} [iteratee] The iteratee invoked per element.
  5575. * @returns {Array} Returns the new duplicate free array.
  5576. */
  5577. function baseSortedUniq(array, iteratee) {
  5578. var index = -1,
  5579. length = array.length,
  5580. resIndex = 0,
  5581. result = [];
  5582. while (++index < length) {
  5583. var value = array[index],
  5584. computed = iteratee ? iteratee(value) : value;
  5585. if (!index || !eq(computed, seen)) {
  5586. var seen = computed;
  5587. result[resIndex++] = value === 0 ? 0 : value;
  5588. }
  5589. }
  5590. return result;
  5591. }
  5592. /**
  5593. * The base implementation of `_.toNumber` which doesn't ensure correct
  5594. * conversions of binary, hexadecimal, or octal string values.
  5595. *
  5596. * @private
  5597. * @param {*} value The value to process.
  5598. * @returns {number} Returns the number.
  5599. */
  5600. function baseToNumber(value) {
  5601. if (typeof value == 'number') {
  5602. return value;
  5603. }
  5604. if (isSymbol(value)) {
  5605. return NAN;
  5606. }
  5607. return +value;
  5608. }
  5609. /**
  5610. * The base implementation of `_.toString` which doesn't convert nullish
  5611. * values to empty strings.
  5612. *
  5613. * @private
  5614. * @param {*} value The value to process.
  5615. * @returns {string} Returns the string.
  5616. */
  5617. function baseToString(value) {
  5618. // Exit early for strings to avoid a performance hit in some environments.
  5619. if (typeof value == 'string') {
  5620. return value;
  5621. }
  5622. if (isArray(value)) {
  5623. // Recursively convert values (susceptible to call stack limits).
  5624. return arrayMap(value, baseToString) + '';
  5625. }
  5626. if (isSymbol(value)) {
  5627. return symbolToString ? symbolToString.call(value) : '';
  5628. }
  5629. var result = (value + '');
  5630. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5631. }
  5632. /**
  5633. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5634. *
  5635. * @private
  5636. * @param {Array} array The array to inspect.
  5637. * @param {Function} [iteratee] The iteratee invoked per element.
  5638. * @param {Function} [comparator] The comparator invoked per element.
  5639. * @returns {Array} Returns the new duplicate free array.
  5640. */
  5641. function baseUniq(array, iteratee, comparator) {
  5642. var index = -1,
  5643. includes = arrayIncludes,
  5644. length = array.length,
  5645. isCommon = true,
  5646. result = [],
  5647. seen = result;
  5648. if (comparator) {
  5649. isCommon = false;
  5650. includes = arrayIncludesWith;
  5651. }
  5652. else if (length >= LARGE_ARRAY_SIZE) {
  5653. var set = iteratee ? null : createSet(array);
  5654. if (set) {
  5655. return setToArray(set);
  5656. }
  5657. isCommon = false;
  5658. includes = cacheHas;
  5659. seen = new SetCache;
  5660. }
  5661. else {
  5662. seen = iteratee ? [] : result;
  5663. }
  5664. outer:
  5665. while (++index < length) {
  5666. var value = array[index],
  5667. computed = iteratee ? iteratee(value) : value;
  5668. value = (comparator || value !== 0) ? value : 0;
  5669. if (isCommon && computed === computed) {
  5670. var seenIndex = seen.length;
  5671. while (seenIndex--) {
  5672. if (seen[seenIndex] === computed) {
  5673. continue outer;
  5674. }
  5675. }
  5676. if (iteratee) {
  5677. seen.push(computed);
  5678. }
  5679. result.push(value);
  5680. }
  5681. else if (!includes(seen, computed, comparator)) {
  5682. if (seen !== result) {
  5683. seen.push(computed);
  5684. }
  5685. result.push(value);
  5686. }
  5687. }
  5688. return result;
  5689. }
  5690. /**
  5691. * The base implementation of `_.unset`.
  5692. *
  5693. * @private
  5694. * @param {Object} object The object to modify.
  5695. * @param {Array|string} path The property path to unset.
  5696. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5697. */
  5698. function baseUnset(object, path) {
  5699. path = castPath(path, object);
  5700. object = parent(object, path);
  5701. return object == null || delete object[toKey(last(path))];
  5702. }
  5703. /**
  5704. * The base implementation of `_.update`.
  5705. *
  5706. * @private
  5707. * @param {Object} object The object to modify.
  5708. * @param {Array|string} path The path of the property to update.
  5709. * @param {Function} updater The function to produce the updated value.
  5710. * @param {Function} [customizer] The function to customize path creation.
  5711. * @returns {Object} Returns `object`.
  5712. */
  5713. function baseUpdate(object, path, updater, customizer) {
  5714. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5715. }
  5716. /**
  5717. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5718. * without support for iteratee shorthands.
  5719. *
  5720. * @private
  5721. * @param {Array} array The array to query.
  5722. * @param {Function} predicate The function invoked per iteration.
  5723. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5724. * @param {boolean} [fromRight] Specify iterating from right to left.
  5725. * @returns {Array} Returns the slice of `array`.
  5726. */
  5727. function baseWhile(array, predicate, isDrop, fromRight) {
  5728. var length = array.length,
  5729. index = fromRight ? length : -1;
  5730. while ((fromRight ? index-- : ++index < length) &&
  5731. predicate(array[index], index, array)) {}
  5732. return isDrop
  5733. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5734. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5735. }
  5736. /**
  5737. * The base implementation of `wrapperValue` which returns the result of
  5738. * performing a sequence of actions on the unwrapped `value`, where each
  5739. * successive action is supplied the return value of the previous.
  5740. *
  5741. * @private
  5742. * @param {*} value The unwrapped value.
  5743. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5744. * @returns {*} Returns the resolved value.
  5745. */
  5746. function baseWrapperValue(value, actions) {
  5747. var result = value;
  5748. if (result instanceof LazyWrapper) {
  5749. result = result.value();
  5750. }
  5751. return arrayReduce(actions, function(result, action) {
  5752. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5753. }, result);
  5754. }
  5755. /**
  5756. * The base implementation of methods like `_.xor`, without support for
  5757. * iteratee shorthands, that accepts an array of arrays to inspect.
  5758. *
  5759. * @private
  5760. * @param {Array} arrays The arrays to inspect.
  5761. * @param {Function} [iteratee] The iteratee invoked per element.
  5762. * @param {Function} [comparator] The comparator invoked per element.
  5763. * @returns {Array} Returns the new array of values.
  5764. */
  5765. function baseXor(arrays, iteratee, comparator) {
  5766. var length = arrays.length;
  5767. if (length < 2) {
  5768. return length ? baseUniq(arrays[0]) : [];
  5769. }
  5770. var index = -1,
  5771. result = Array(length);
  5772. while (++index < length) {
  5773. var array = arrays[index],
  5774. othIndex = -1;
  5775. while (++othIndex < length) {
  5776. if (othIndex != index) {
  5777. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5778. }
  5779. }
  5780. }
  5781. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5782. }
  5783. /**
  5784. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5785. *
  5786. * @private
  5787. * @param {Array} props The property identifiers.
  5788. * @param {Array} values The property values.
  5789. * @param {Function} assignFunc The function to assign values.
  5790. * @returns {Object} Returns the new object.
  5791. */
  5792. function baseZipObject(props, values, assignFunc) {
  5793. var index = -1,
  5794. length = props.length,
  5795. valsLength = values.length,
  5796. result = {};
  5797. while (++index < length) {
  5798. var value = index < valsLength ? values[index] : undefined;
  5799. assignFunc(result, props[index], value);
  5800. }
  5801. return result;
  5802. }
  5803. /**
  5804. * Casts `value` to an empty array if it's not an array like object.
  5805. *
  5806. * @private
  5807. * @param {*} value The value to inspect.
  5808. * @returns {Array|Object} Returns the cast array-like object.
  5809. */
  5810. function castArrayLikeObject(value) {
  5811. return isArrayLikeObject(value) ? value : [];
  5812. }
  5813. /**
  5814. * Casts `value` to `identity` if it's not a function.
  5815. *
  5816. * @private
  5817. * @param {*} value The value to inspect.
  5818. * @returns {Function} Returns cast function.
  5819. */
  5820. function castFunction(value) {
  5821. return typeof value == 'function' ? value : identity;
  5822. }
  5823. /**
  5824. * Casts `value` to a path array if it's not one.
  5825. *
  5826. * @private
  5827. * @param {*} value The value to inspect.
  5828. * @param {Object} [object] The object to query keys on.
  5829. * @returns {Array} Returns the cast property path array.
  5830. */
  5831. function castPath(value, object) {
  5832. if (isArray(value)) {
  5833. return value;
  5834. }
  5835. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5836. }
  5837. /**
  5838. * A `baseRest` alias which can be replaced with `identity` by module
  5839. * replacement plugins.
  5840. *
  5841. * @private
  5842. * @type {Function}
  5843. * @param {Function} func The function to apply a rest parameter to.
  5844. * @returns {Function} Returns the new function.
  5845. */
  5846. var castRest = baseRest;
  5847. /**
  5848. * Casts `array` to a slice if it's needed.
  5849. *
  5850. * @private
  5851. * @param {Array} array The array to inspect.
  5852. * @param {number} start The start position.
  5853. * @param {number} [end=array.length] The end position.
  5854. * @returns {Array} Returns the cast slice.
  5855. */
  5856. function castSlice(array, start, end) {
  5857. var length = array.length;
  5858. end = end === undefined ? length : end;
  5859. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5860. }
  5861. /**
  5862. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5863. *
  5864. * @private
  5865. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5866. */
  5867. var clearTimeout = ctxClearTimeout || function(id) {
  5868. return root.clearTimeout(id);
  5869. };
  5870. /**
  5871. * Creates a clone of `buffer`.
  5872. *
  5873. * @private
  5874. * @param {Buffer} buffer The buffer to clone.
  5875. * @param {boolean} [isDeep] Specify a deep clone.
  5876. * @returns {Buffer} Returns the cloned buffer.
  5877. */
  5878. function cloneBuffer(buffer, isDeep) {
  5879. if (isDeep) {
  5880. return buffer.slice();
  5881. }
  5882. var length = buffer.length,
  5883. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5884. buffer.copy(result);
  5885. return result;
  5886. }
  5887. /**
  5888. * Creates a clone of `arrayBuffer`.
  5889. *
  5890. * @private
  5891. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5892. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5893. */
  5894. function cloneArrayBuffer(arrayBuffer) {
  5895. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5896. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5897. return result;
  5898. }
  5899. /**
  5900. * Creates a clone of `dataView`.
  5901. *
  5902. * @private
  5903. * @param {Object} dataView The data view to clone.
  5904. * @param {boolean} [isDeep] Specify a deep clone.
  5905. * @returns {Object} Returns the cloned data view.
  5906. */
  5907. function cloneDataView(dataView, isDeep) {
  5908. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5909. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5910. }
  5911. /**
  5912. * Creates a clone of `regexp`.
  5913. *
  5914. * @private
  5915. * @param {Object} regexp The regexp to clone.
  5916. * @returns {Object} Returns the cloned regexp.
  5917. */
  5918. function cloneRegExp(regexp) {
  5919. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5920. result.lastIndex = regexp.lastIndex;
  5921. return result;
  5922. }
  5923. /**
  5924. * Creates a clone of the `symbol` object.
  5925. *
  5926. * @private
  5927. * @param {Object} symbol The symbol object to clone.
  5928. * @returns {Object} Returns the cloned symbol object.
  5929. */
  5930. function cloneSymbol(symbol) {
  5931. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5932. }
  5933. /**
  5934. * Creates a clone of `typedArray`.
  5935. *
  5936. * @private
  5937. * @param {Object} typedArray The typed array to clone.
  5938. * @param {boolean} [isDeep] Specify a deep clone.
  5939. * @returns {Object} Returns the cloned typed array.
  5940. */
  5941. function cloneTypedArray(typedArray, isDeep) {
  5942. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5943. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5944. }
  5945. /**
  5946. * Compares values to sort them in ascending order.
  5947. *
  5948. * @private
  5949. * @param {*} value The value to compare.
  5950. * @param {*} other The other value to compare.
  5951. * @returns {number} Returns the sort order indicator for `value`.
  5952. */
  5953. function compareAscending(value, other) {
  5954. if (value !== other) {
  5955. var valIsDefined = value !== undefined,
  5956. valIsNull = value === null,
  5957. valIsReflexive = value === value,
  5958. valIsSymbol = isSymbol(value);
  5959. var othIsDefined = other !== undefined,
  5960. othIsNull = other === null,
  5961. othIsReflexive = other === other,
  5962. othIsSymbol = isSymbol(other);
  5963. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5964. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5965. (valIsNull && othIsDefined && othIsReflexive) ||
  5966. (!valIsDefined && othIsReflexive) ||
  5967. !valIsReflexive) {
  5968. return 1;
  5969. }
  5970. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5971. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5972. (othIsNull && valIsDefined && valIsReflexive) ||
  5973. (!othIsDefined && valIsReflexive) ||
  5974. !othIsReflexive) {
  5975. return -1;
  5976. }
  5977. }
  5978. return 0;
  5979. }
  5980. /**
  5981. * Used by `_.orderBy` to compare multiple properties of a value to another
  5982. * and stable sort them.
  5983. *
  5984. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5985. * specify an order of "desc" for descending or "asc" for ascending sort order
  5986. * of corresponding values.
  5987. *
  5988. * @private
  5989. * @param {Object} object The object to compare.
  5990. * @param {Object} other The other object to compare.
  5991. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5992. * @returns {number} Returns the sort order indicator for `object`.
  5993. */
  5994. function compareMultiple(object, other, orders) {
  5995. var index = -1,
  5996. objCriteria = object.criteria,
  5997. othCriteria = other.criteria,
  5998. length = objCriteria.length,
  5999. ordersLength = orders.length;
  6000. while (++index < length) {
  6001. var result = compareAscending(objCriteria[index], othCriteria[index]);
  6002. if (result) {
  6003. if (index >= ordersLength) {
  6004. return result;
  6005. }
  6006. var order = orders[index];
  6007. return result * (order == 'desc' ? -1 : 1);
  6008. }
  6009. }
  6010. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  6011. // that causes it, under certain circumstances, to provide the same value for
  6012. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  6013. // for more details.
  6014. //
  6015. // This also ensures a stable sort in V8 and other engines.
  6016. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  6017. return object.index - other.index;
  6018. }
  6019. /**
  6020. * Creates an array that is the composition of partially applied arguments,
  6021. * placeholders, and provided arguments into a single array of arguments.
  6022. *
  6023. * @private
  6024. * @param {Array} args The provided arguments.
  6025. * @param {Array} partials The arguments to prepend to those provided.
  6026. * @param {Array} holders The `partials` placeholder indexes.
  6027. * @params {boolean} [isCurried] Specify composing for a curried function.
  6028. * @returns {Array} Returns the new array of composed arguments.
  6029. */
  6030. function composeArgs(args, partials, holders, isCurried) {
  6031. var argsIndex = -1,
  6032. argsLength = args.length,
  6033. holdersLength = holders.length,
  6034. leftIndex = -1,
  6035. leftLength = partials.length,
  6036. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6037. result = Array(leftLength + rangeLength),
  6038. isUncurried = !isCurried;
  6039. while (++leftIndex < leftLength) {
  6040. result[leftIndex] = partials[leftIndex];
  6041. }
  6042. while (++argsIndex < holdersLength) {
  6043. if (isUncurried || argsIndex < argsLength) {
  6044. result[holders[argsIndex]] = args[argsIndex];
  6045. }
  6046. }
  6047. while (rangeLength--) {
  6048. result[leftIndex++] = args[argsIndex++];
  6049. }
  6050. return result;
  6051. }
  6052. /**
  6053. * This function is like `composeArgs` except that the arguments composition
  6054. * is tailored for `_.partialRight`.
  6055. *
  6056. * @private
  6057. * @param {Array} args The provided arguments.
  6058. * @param {Array} partials The arguments to append to those provided.
  6059. * @param {Array} holders The `partials` placeholder indexes.
  6060. * @params {boolean} [isCurried] Specify composing for a curried function.
  6061. * @returns {Array} Returns the new array of composed arguments.
  6062. */
  6063. function composeArgsRight(args, partials, holders, isCurried) {
  6064. var argsIndex = -1,
  6065. argsLength = args.length,
  6066. holdersIndex = -1,
  6067. holdersLength = holders.length,
  6068. rightIndex = -1,
  6069. rightLength = partials.length,
  6070. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6071. result = Array(rangeLength + rightLength),
  6072. isUncurried = !isCurried;
  6073. while (++argsIndex < rangeLength) {
  6074. result[argsIndex] = args[argsIndex];
  6075. }
  6076. var offset = argsIndex;
  6077. while (++rightIndex < rightLength) {
  6078. result[offset + rightIndex] = partials[rightIndex];
  6079. }
  6080. while (++holdersIndex < holdersLength) {
  6081. if (isUncurried || argsIndex < argsLength) {
  6082. result[offset + holders[holdersIndex]] = args[argsIndex++];
  6083. }
  6084. }
  6085. return result;
  6086. }
  6087. /**
  6088. * Copies the values of `source` to `array`.
  6089. *
  6090. * @private
  6091. * @param {Array} source The array to copy values from.
  6092. * @param {Array} [array=[]] The array to copy values to.
  6093. * @returns {Array} Returns `array`.
  6094. */
  6095. function copyArray(source, array) {
  6096. var index = -1,
  6097. length = source.length;
  6098. array || (array = Array(length));
  6099. while (++index < length) {
  6100. array[index] = source[index];
  6101. }
  6102. return array;
  6103. }
  6104. /**
  6105. * Copies properties of `source` to `object`.
  6106. *
  6107. * @private
  6108. * @param {Object} source The object to copy properties from.
  6109. * @param {Array} props The property identifiers to copy.
  6110. * @param {Object} [object={}] The object to copy properties to.
  6111. * @param {Function} [customizer] The function to customize copied values.
  6112. * @returns {Object} Returns `object`.
  6113. */
  6114. function copyObject(source, props, object, customizer) {
  6115. var isNew = !object;
  6116. object || (object = {});
  6117. var index = -1,
  6118. length = props.length;
  6119. while (++index < length) {
  6120. var key = props[index];
  6121. var newValue = customizer
  6122. ? customizer(object[key], source[key], key, object, source)
  6123. : undefined;
  6124. if (newValue === undefined) {
  6125. newValue = source[key];
  6126. }
  6127. if (isNew) {
  6128. baseAssignValue(object, key, newValue);
  6129. } else {
  6130. assignValue(object, key, newValue);
  6131. }
  6132. }
  6133. return object;
  6134. }
  6135. /**
  6136. * Copies own symbols of `source` to `object`.
  6137. *
  6138. * @private
  6139. * @param {Object} source The object to copy symbols from.
  6140. * @param {Object} [object={}] The object to copy symbols to.
  6141. * @returns {Object} Returns `object`.
  6142. */
  6143. function copySymbols(source, object) {
  6144. return copyObject(source, getSymbols(source), object);
  6145. }
  6146. /**
  6147. * Copies own and inherited symbols of `source` to `object`.
  6148. *
  6149. * @private
  6150. * @param {Object} source The object to copy symbols from.
  6151. * @param {Object} [object={}] The object to copy symbols to.
  6152. * @returns {Object} Returns `object`.
  6153. */
  6154. function copySymbolsIn(source, object) {
  6155. return copyObject(source, getSymbolsIn(source), object);
  6156. }
  6157. /**
  6158. * Creates a function like `_.groupBy`.
  6159. *
  6160. * @private
  6161. * @param {Function} setter The function to set accumulator values.
  6162. * @param {Function} [initializer] The accumulator object initializer.
  6163. * @returns {Function} Returns the new aggregator function.
  6164. */
  6165. function createAggregator(setter, initializer) {
  6166. return function(collection, iteratee) {
  6167. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  6168. accumulator = initializer ? initializer() : {};
  6169. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  6170. };
  6171. }
  6172. /**
  6173. * Creates a function like `_.assign`.
  6174. *
  6175. * @private
  6176. * @param {Function} assigner The function to assign values.
  6177. * @returns {Function} Returns the new assigner function.
  6178. */
  6179. function createAssigner(assigner) {
  6180. return baseRest(function(object, sources) {
  6181. var index = -1,
  6182. length = sources.length,
  6183. customizer = length > 1 ? sources[length - 1] : undefined,
  6184. guard = length > 2 ? sources[2] : undefined;
  6185. customizer = (assigner.length > 3 && typeof customizer == 'function')
  6186. ? (length--, customizer)
  6187. : undefined;
  6188. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  6189. customizer = length < 3 ? undefined : customizer;
  6190. length = 1;
  6191. }
  6192. object = Object(object);
  6193. while (++index < length) {
  6194. var source = sources[index];
  6195. if (source) {
  6196. assigner(object, source, index, customizer);
  6197. }
  6198. }
  6199. return object;
  6200. });
  6201. }
  6202. /**
  6203. * Creates a `baseEach` or `baseEachRight` function.
  6204. *
  6205. * @private
  6206. * @param {Function} eachFunc The function to iterate over a collection.
  6207. * @param {boolean} [fromRight] Specify iterating from right to left.
  6208. * @returns {Function} Returns the new base function.
  6209. */
  6210. function createBaseEach(eachFunc, fromRight) {
  6211. return function(collection, iteratee) {
  6212. if (collection == null) {
  6213. return collection;
  6214. }
  6215. if (!isArrayLike(collection)) {
  6216. return eachFunc(collection, iteratee);
  6217. }
  6218. var length = collection.length,
  6219. index = fromRight ? length : -1,
  6220. iterable = Object(collection);
  6221. while ((fromRight ? index-- : ++index < length)) {
  6222. if (iteratee(iterable[index], index, iterable) === false) {
  6223. break;
  6224. }
  6225. }
  6226. return collection;
  6227. };
  6228. }
  6229. /**
  6230. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  6231. *
  6232. * @private
  6233. * @param {boolean} [fromRight] Specify iterating from right to left.
  6234. * @returns {Function} Returns the new base function.
  6235. */
  6236. function createBaseFor(fromRight) {
  6237. return function(object, iteratee, keysFunc) {
  6238. var index = -1,
  6239. iterable = Object(object),
  6240. props = keysFunc(object),
  6241. length = props.length;
  6242. while (length--) {
  6243. var key = props[fromRight ? length : ++index];
  6244. if (iteratee(iterable[key], key, iterable) === false) {
  6245. break;
  6246. }
  6247. }
  6248. return object;
  6249. };
  6250. }
  6251. /**
  6252. * Creates a function that wraps `func` to invoke it with the optional `this`
  6253. * binding of `thisArg`.
  6254. *
  6255. * @private
  6256. * @param {Function} func The function to wrap.
  6257. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6258. * @param {*} [thisArg] The `this` binding of `func`.
  6259. * @returns {Function} Returns the new wrapped function.
  6260. */
  6261. function createBind(func, bitmask, thisArg) {
  6262. var isBind = bitmask & WRAP_BIND_FLAG,
  6263. Ctor = createCtor(func);
  6264. function wrapper() {
  6265. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6266. return fn.apply(isBind ? thisArg : this, arguments);
  6267. }
  6268. return wrapper;
  6269. }
  6270. /**
  6271. * Creates a function like `_.lowerFirst`.
  6272. *
  6273. * @private
  6274. * @param {string} methodName The name of the `String` case method to use.
  6275. * @returns {Function} Returns the new case function.
  6276. */
  6277. function createCaseFirst(methodName) {
  6278. return function(string) {
  6279. string = toString(string);
  6280. var strSymbols = hasUnicode(string)
  6281. ? stringToArray(string)
  6282. : undefined;
  6283. var chr = strSymbols
  6284. ? strSymbols[0]
  6285. : string.charAt(0);
  6286. var trailing = strSymbols
  6287. ? castSlice(strSymbols, 1).join('')
  6288. : string.slice(1);
  6289. return chr[methodName]() + trailing;
  6290. };
  6291. }
  6292. /**
  6293. * Creates a function like `_.camelCase`.
  6294. *
  6295. * @private
  6296. * @param {Function} callback The function to combine each word.
  6297. * @returns {Function} Returns the new compounder function.
  6298. */
  6299. function createCompounder(callback) {
  6300. return function(string) {
  6301. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  6302. };
  6303. }
  6304. /**
  6305. * Creates a function that produces an instance of `Ctor` regardless of
  6306. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  6307. *
  6308. * @private
  6309. * @param {Function} Ctor The constructor to wrap.
  6310. * @returns {Function} Returns the new wrapped function.
  6311. */
  6312. function createCtor(Ctor) {
  6313. return function() {
  6314. // Use a `switch` statement to work with class constructors. See
  6315. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  6316. // for more details.
  6317. var args = arguments;
  6318. switch (args.length) {
  6319. case 0: return new Ctor;
  6320. case 1: return new Ctor(args[0]);
  6321. case 2: return new Ctor(args[0], args[1]);
  6322. case 3: return new Ctor(args[0], args[1], args[2]);
  6323. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  6324. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  6325. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  6326. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  6327. }
  6328. var thisBinding = baseCreate(Ctor.prototype),
  6329. result = Ctor.apply(thisBinding, args);
  6330. // Mimic the constructor's `return` behavior.
  6331. // See https://es5.github.io/#x13.2.2 for more details.
  6332. return isObject(result) ? result : thisBinding;
  6333. };
  6334. }
  6335. /**
  6336. * Creates a function that wraps `func` to enable currying.
  6337. *
  6338. * @private
  6339. * @param {Function} func The function to wrap.
  6340. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6341. * @param {number} arity The arity of `func`.
  6342. * @returns {Function} Returns the new wrapped function.
  6343. */
  6344. function createCurry(func, bitmask, arity) {
  6345. var Ctor = createCtor(func);
  6346. function wrapper() {
  6347. var length = arguments.length,
  6348. args = Array(length),
  6349. index = length,
  6350. placeholder = getHolder(wrapper);
  6351. while (index--) {
  6352. args[index] = arguments[index];
  6353. }
  6354. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  6355. ? []
  6356. : replaceHolders(args, placeholder);
  6357. length -= holders.length;
  6358. if (length < arity) {
  6359. return createRecurry(
  6360. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  6361. args, holders, undefined, undefined, arity - length);
  6362. }
  6363. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6364. return apply(fn, this, args);
  6365. }
  6366. return wrapper;
  6367. }
  6368. /**
  6369. * Creates a `_.find` or `_.findLast` function.
  6370. *
  6371. * @private
  6372. * @param {Function} findIndexFunc The function to find the collection index.
  6373. * @returns {Function} Returns the new find function.
  6374. */
  6375. function createFind(findIndexFunc) {
  6376. return function(collection, predicate, fromIndex) {
  6377. var iterable = Object(collection);
  6378. if (!isArrayLike(collection)) {
  6379. var iteratee = getIteratee(predicate, 3);
  6380. collection = keys(collection);
  6381. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  6382. }
  6383. var index = findIndexFunc(collection, predicate, fromIndex);
  6384. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  6385. };
  6386. }
  6387. /**
  6388. * Creates a `_.flow` or `_.flowRight` function.
  6389. *
  6390. * @private
  6391. * @param {boolean} [fromRight] Specify iterating from right to left.
  6392. * @returns {Function} Returns the new flow function.
  6393. */
  6394. function createFlow(fromRight) {
  6395. return flatRest(function(funcs) {
  6396. var length = funcs.length,
  6397. index = length,
  6398. prereq = LodashWrapper.prototype.thru;
  6399. if (fromRight) {
  6400. funcs.reverse();
  6401. }
  6402. while (index--) {
  6403. var func = funcs[index];
  6404. if (typeof func != 'function') {
  6405. throw new TypeError(FUNC_ERROR_TEXT);
  6406. }
  6407. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6408. var wrapper = new LodashWrapper([], true);
  6409. }
  6410. }
  6411. index = wrapper ? index : length;
  6412. while (++index < length) {
  6413. func = funcs[index];
  6414. var funcName = getFuncName(func),
  6415. data = funcName == 'wrapper' ? getData(func) : undefined;
  6416. if (data && isLaziable(data[0]) &&
  6417. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6418. !data[4].length && data[9] == 1
  6419. ) {
  6420. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6421. } else {
  6422. wrapper = (func.length == 1 && isLaziable(func))
  6423. ? wrapper[funcName]()
  6424. : wrapper.thru(func);
  6425. }
  6426. }
  6427. return function() {
  6428. var args = arguments,
  6429. value = args[0];
  6430. if (wrapper && args.length == 1 && isArray(value)) {
  6431. return wrapper.plant(value).value();
  6432. }
  6433. var index = 0,
  6434. result = length ? funcs[index].apply(this, args) : value;
  6435. while (++index < length) {
  6436. result = funcs[index].call(this, result);
  6437. }
  6438. return result;
  6439. };
  6440. });
  6441. }
  6442. /**
  6443. * Creates a function that wraps `func` to invoke it with optional `this`
  6444. * binding of `thisArg`, partial application, and currying.
  6445. *
  6446. * @private
  6447. * @param {Function|string} func The function or method name to wrap.
  6448. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6449. * @param {*} [thisArg] The `this` binding of `func`.
  6450. * @param {Array} [partials] The arguments to prepend to those provided to
  6451. * the new function.
  6452. * @param {Array} [holders] The `partials` placeholder indexes.
  6453. * @param {Array} [partialsRight] The arguments to append to those provided
  6454. * to the new function.
  6455. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6456. * @param {Array} [argPos] The argument positions of the new function.
  6457. * @param {number} [ary] The arity cap of `func`.
  6458. * @param {number} [arity] The arity of `func`.
  6459. * @returns {Function} Returns the new wrapped function.
  6460. */
  6461. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6462. var isAry = bitmask & WRAP_ARY_FLAG,
  6463. isBind = bitmask & WRAP_BIND_FLAG,
  6464. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6465. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6466. isFlip = bitmask & WRAP_FLIP_FLAG,
  6467. Ctor = isBindKey ? undefined : createCtor(func);
  6468. function wrapper() {
  6469. var length = arguments.length,
  6470. args = Array(length),
  6471. index = length;
  6472. while (index--) {
  6473. args[index] = arguments[index];
  6474. }
  6475. if (isCurried) {
  6476. var placeholder = getHolder(wrapper),
  6477. holdersCount = countHolders(args, placeholder);
  6478. }
  6479. if (partials) {
  6480. args = composeArgs(args, partials, holders, isCurried);
  6481. }
  6482. if (partialsRight) {
  6483. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6484. }
  6485. length -= holdersCount;
  6486. if (isCurried && length < arity) {
  6487. var newHolders = replaceHolders(args, placeholder);
  6488. return createRecurry(
  6489. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6490. args, newHolders, argPos, ary, arity - length
  6491. );
  6492. }
  6493. var thisBinding = isBind ? thisArg : this,
  6494. fn = isBindKey ? thisBinding[func] : func;
  6495. length = args.length;
  6496. if (argPos) {
  6497. args = reorder(args, argPos);
  6498. } else if (isFlip && length > 1) {
  6499. args.reverse();
  6500. }
  6501. if (isAry && ary < length) {
  6502. args.length = ary;
  6503. }
  6504. if (this && this !== root && this instanceof wrapper) {
  6505. fn = Ctor || createCtor(fn);
  6506. }
  6507. return fn.apply(thisBinding, args);
  6508. }
  6509. return wrapper;
  6510. }
  6511. /**
  6512. * Creates a function like `_.invertBy`.
  6513. *
  6514. * @private
  6515. * @param {Function} setter The function to set accumulator values.
  6516. * @param {Function} toIteratee The function to resolve iteratees.
  6517. * @returns {Function} Returns the new inverter function.
  6518. */
  6519. function createInverter(setter, toIteratee) {
  6520. return function(object, iteratee) {
  6521. return baseInverter(object, setter, toIteratee(iteratee), {});
  6522. };
  6523. }
  6524. /**
  6525. * Creates a function that performs a mathematical operation on two values.
  6526. *
  6527. * @private
  6528. * @param {Function} operator The function to perform the operation.
  6529. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6530. * @returns {Function} Returns the new mathematical operation function.
  6531. */
  6532. function createMathOperation(operator, defaultValue) {
  6533. return function(value, other) {
  6534. var result;
  6535. if (value === undefined && other === undefined) {
  6536. return defaultValue;
  6537. }
  6538. if (value !== undefined) {
  6539. result = value;
  6540. }
  6541. if (other !== undefined) {
  6542. if (result === undefined) {
  6543. return other;
  6544. }
  6545. if (typeof value == 'string' || typeof other == 'string') {
  6546. value = baseToString(value);
  6547. other = baseToString(other);
  6548. } else {
  6549. value = baseToNumber(value);
  6550. other = baseToNumber(other);
  6551. }
  6552. result = operator(value, other);
  6553. }
  6554. return result;
  6555. };
  6556. }
  6557. /**
  6558. * Creates a function like `_.over`.
  6559. *
  6560. * @private
  6561. * @param {Function} arrayFunc The function to iterate over iteratees.
  6562. * @returns {Function} Returns the new over function.
  6563. */
  6564. function createOver(arrayFunc) {
  6565. return flatRest(function(iteratees) {
  6566. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6567. return baseRest(function(args) {
  6568. var thisArg = this;
  6569. return arrayFunc(iteratees, function(iteratee) {
  6570. return apply(iteratee, thisArg, args);
  6571. });
  6572. });
  6573. });
  6574. }
  6575. /**
  6576. * Creates the padding for `string` based on `length`. The `chars` string
  6577. * is truncated if the number of characters exceeds `length`.
  6578. *
  6579. * @private
  6580. * @param {number} length The padding length.
  6581. * @param {string} [chars=' '] The string used as padding.
  6582. * @returns {string} Returns the padding for `string`.
  6583. */
  6584. function createPadding(length, chars) {
  6585. chars = chars === undefined ? ' ' : baseToString(chars);
  6586. var charsLength = chars.length;
  6587. if (charsLength < 2) {
  6588. return charsLength ? baseRepeat(chars, length) : chars;
  6589. }
  6590. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6591. return hasUnicode(chars)
  6592. ? castSlice(stringToArray(result), 0, length).join('')
  6593. : result.slice(0, length);
  6594. }
  6595. /**
  6596. * Creates a function that wraps `func` to invoke it with the `this` binding
  6597. * of `thisArg` and `partials` prepended to the arguments it receives.
  6598. *
  6599. * @private
  6600. * @param {Function} func The function to wrap.
  6601. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6602. * @param {*} thisArg The `this` binding of `func`.
  6603. * @param {Array} partials The arguments to prepend to those provided to
  6604. * the new function.
  6605. * @returns {Function} Returns the new wrapped function.
  6606. */
  6607. function createPartial(func, bitmask, thisArg, partials) {
  6608. var isBind = bitmask & WRAP_BIND_FLAG,
  6609. Ctor = createCtor(func);
  6610. function wrapper() {
  6611. var argsIndex = -1,
  6612. argsLength = arguments.length,
  6613. leftIndex = -1,
  6614. leftLength = partials.length,
  6615. args = Array(leftLength + argsLength),
  6616. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6617. while (++leftIndex < leftLength) {
  6618. args[leftIndex] = partials[leftIndex];
  6619. }
  6620. while (argsLength--) {
  6621. args[leftIndex++] = arguments[++argsIndex];
  6622. }
  6623. return apply(fn, isBind ? thisArg : this, args);
  6624. }
  6625. return wrapper;
  6626. }
  6627. /**
  6628. * Creates a `_.range` or `_.rangeRight` function.
  6629. *
  6630. * @private
  6631. * @param {boolean} [fromRight] Specify iterating from right to left.
  6632. * @returns {Function} Returns the new range function.
  6633. */
  6634. function createRange(fromRight) {
  6635. return function(start, end, step) {
  6636. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6637. end = step = undefined;
  6638. }
  6639. // Ensure the sign of `-0` is preserved.
  6640. start = toFinite(start);
  6641. if (end === undefined) {
  6642. end = start;
  6643. start = 0;
  6644. } else {
  6645. end = toFinite(end);
  6646. }
  6647. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6648. return baseRange(start, end, step, fromRight);
  6649. };
  6650. }
  6651. /**
  6652. * Creates a function that performs a relational operation on two values.
  6653. *
  6654. * @private
  6655. * @param {Function} operator The function to perform the operation.
  6656. * @returns {Function} Returns the new relational operation function.
  6657. */
  6658. function createRelationalOperation(operator) {
  6659. return function(value, other) {
  6660. if (!(typeof value == 'string' && typeof other == 'string')) {
  6661. value = toNumber(value);
  6662. other = toNumber(other);
  6663. }
  6664. return operator(value, other);
  6665. };
  6666. }
  6667. /**
  6668. * Creates a function that wraps `func` to continue currying.
  6669. *
  6670. * @private
  6671. * @param {Function} func The function to wrap.
  6672. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6673. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6674. * @param {*} placeholder The placeholder value.
  6675. * @param {*} [thisArg] The `this` binding of `func`.
  6676. * @param {Array} [partials] The arguments to prepend to those provided to
  6677. * the new function.
  6678. * @param {Array} [holders] The `partials` placeholder indexes.
  6679. * @param {Array} [argPos] The argument positions of the new function.
  6680. * @param {number} [ary] The arity cap of `func`.
  6681. * @param {number} [arity] The arity of `func`.
  6682. * @returns {Function} Returns the new wrapped function.
  6683. */
  6684. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6685. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6686. newHolders = isCurry ? holders : undefined,
  6687. newHoldersRight = isCurry ? undefined : holders,
  6688. newPartials = isCurry ? partials : undefined,
  6689. newPartialsRight = isCurry ? undefined : partials;
  6690. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6691. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6692. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6693. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6694. }
  6695. var newData = [
  6696. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6697. newHoldersRight, argPos, ary, arity
  6698. ];
  6699. var result = wrapFunc.apply(undefined, newData);
  6700. if (isLaziable(func)) {
  6701. setData(result, newData);
  6702. }
  6703. result.placeholder = placeholder;
  6704. return setWrapToString(result, func, bitmask);
  6705. }
  6706. /**
  6707. * Creates a function like `_.round`.
  6708. *
  6709. * @private
  6710. * @param {string} methodName The name of the `Math` method to use when rounding.
  6711. * @returns {Function} Returns the new round function.
  6712. */
  6713. function createRound(methodName) {
  6714. var func = Math[methodName];
  6715. return function(number, precision) {
  6716. number = toNumber(number);
  6717. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6718. if (precision && nativeIsFinite(number)) {
  6719. // Shift with exponential notation to avoid floating-point issues.
  6720. // See [MDN](https://mdn.io/round#Examples) for more details.
  6721. var pair = (toString(number) + 'e').split('e'),
  6722. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6723. pair = (toString(value) + 'e').split('e');
  6724. return +(pair[0] + 'e' + (+pair[1] - precision));
  6725. }
  6726. return func(number);
  6727. };
  6728. }
  6729. /**
  6730. * Creates a set object of `values`.
  6731. *
  6732. * @private
  6733. * @param {Array} values The values to add to the set.
  6734. * @returns {Object} Returns the new set.
  6735. */
  6736. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6737. return new Set(values);
  6738. };
  6739. /**
  6740. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6741. *
  6742. * @private
  6743. * @param {Function} keysFunc The function to get the keys of a given object.
  6744. * @returns {Function} Returns the new pairs function.
  6745. */
  6746. function createToPairs(keysFunc) {
  6747. return function(object) {
  6748. var tag = getTag(object);
  6749. if (tag == mapTag) {
  6750. return mapToArray(object);
  6751. }
  6752. if (tag == setTag) {
  6753. return setToPairs(object);
  6754. }
  6755. return baseToPairs(object, keysFunc(object));
  6756. };
  6757. }
  6758. /**
  6759. * Creates a function that either curries or invokes `func` with optional
  6760. * `this` binding and partially applied arguments.
  6761. *
  6762. * @private
  6763. * @param {Function|string} func The function or method name to wrap.
  6764. * @param {number} bitmask The bitmask flags.
  6765. * 1 - `_.bind`
  6766. * 2 - `_.bindKey`
  6767. * 4 - `_.curry` or `_.curryRight` of a bound function
  6768. * 8 - `_.curry`
  6769. * 16 - `_.curryRight`
  6770. * 32 - `_.partial`
  6771. * 64 - `_.partialRight`
  6772. * 128 - `_.rearg`
  6773. * 256 - `_.ary`
  6774. * 512 - `_.flip`
  6775. * @param {*} [thisArg] The `this` binding of `func`.
  6776. * @param {Array} [partials] The arguments to be partially applied.
  6777. * @param {Array} [holders] The `partials` placeholder indexes.
  6778. * @param {Array} [argPos] The argument positions of the new function.
  6779. * @param {number} [ary] The arity cap of `func`.
  6780. * @param {number} [arity] The arity of `func`.
  6781. * @returns {Function} Returns the new wrapped function.
  6782. */
  6783. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6784. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6785. if (!isBindKey && typeof func != 'function') {
  6786. throw new TypeError(FUNC_ERROR_TEXT);
  6787. }
  6788. var length = partials ? partials.length : 0;
  6789. if (!length) {
  6790. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6791. partials = holders = undefined;
  6792. }
  6793. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6794. arity = arity === undefined ? arity : toInteger(arity);
  6795. length -= holders ? holders.length : 0;
  6796. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6797. var partialsRight = partials,
  6798. holdersRight = holders;
  6799. partials = holders = undefined;
  6800. }
  6801. var data = isBindKey ? undefined : getData(func);
  6802. var newData = [
  6803. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6804. argPos, ary, arity
  6805. ];
  6806. if (data) {
  6807. mergeData(newData, data);
  6808. }
  6809. func = newData[0];
  6810. bitmask = newData[1];
  6811. thisArg = newData[2];
  6812. partials = newData[3];
  6813. holders = newData[4];
  6814. arity = newData[9] = newData[9] === undefined
  6815. ? (isBindKey ? 0 : func.length)
  6816. : nativeMax(newData[9] - length, 0);
  6817. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6818. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6819. }
  6820. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6821. var result = createBind(func, bitmask, thisArg);
  6822. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6823. result = createCurry(func, bitmask, arity);
  6824. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6825. result = createPartial(func, bitmask, thisArg, partials);
  6826. } else {
  6827. result = createHybrid.apply(undefined, newData);
  6828. }
  6829. var setter = data ? baseSetData : setData;
  6830. return setWrapToString(setter(result, newData), func, bitmask);
  6831. }
  6832. /**
  6833. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6834. * of source objects to the destination object for all destination properties
  6835. * that resolve to `undefined`.
  6836. *
  6837. * @private
  6838. * @param {*} objValue The destination value.
  6839. * @param {*} srcValue The source value.
  6840. * @param {string} key The key of the property to assign.
  6841. * @param {Object} object The parent object of `objValue`.
  6842. * @returns {*} Returns the value to assign.
  6843. */
  6844. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6845. if (objValue === undefined ||
  6846. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6847. return srcValue;
  6848. }
  6849. return objValue;
  6850. }
  6851. /**
  6852. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6853. * objects into destination objects that are passed thru.
  6854. *
  6855. * @private
  6856. * @param {*} objValue The destination value.
  6857. * @param {*} srcValue The source value.
  6858. * @param {string} key The key of the property to merge.
  6859. * @param {Object} object The parent object of `objValue`.
  6860. * @param {Object} source The parent object of `srcValue`.
  6861. * @param {Object} [stack] Tracks traversed source values and their merged
  6862. * counterparts.
  6863. * @returns {*} Returns the value to assign.
  6864. */
  6865. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6866. if (isObject(objValue) && isObject(srcValue)) {
  6867. // Recursively merge objects and arrays (susceptible to call stack limits).
  6868. stack.set(srcValue, objValue);
  6869. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6870. stack['delete'](srcValue);
  6871. }
  6872. return objValue;
  6873. }
  6874. /**
  6875. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6876. * objects.
  6877. *
  6878. * @private
  6879. * @param {*} value The value to inspect.
  6880. * @param {string} key The key of the property to inspect.
  6881. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6882. */
  6883. function customOmitClone(value) {
  6884. return isPlainObject(value) ? undefined : value;
  6885. }
  6886. /**
  6887. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6888. * partial deep comparisons.
  6889. *
  6890. * @private
  6891. * @param {Array} array The array to compare.
  6892. * @param {Array} other The other array to compare.
  6893. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6894. * @param {Function} customizer The function to customize comparisons.
  6895. * @param {Function} equalFunc The function to determine equivalents of values.
  6896. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6897. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6898. */
  6899. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6900. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6901. arrLength = array.length,
  6902. othLength = other.length;
  6903. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6904. return false;
  6905. }
  6906. // Check that cyclic values are equal.
  6907. var arrStacked = stack.get(array);
  6908. var othStacked = stack.get(other);
  6909. if (arrStacked && othStacked) {
  6910. return arrStacked == other && othStacked == array;
  6911. }
  6912. var index = -1,
  6913. result = true,
  6914. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6915. stack.set(array, other);
  6916. stack.set(other, array);
  6917. // Ignore non-index properties.
  6918. while (++index < arrLength) {
  6919. var arrValue = array[index],
  6920. othValue = other[index];
  6921. if (customizer) {
  6922. var compared = isPartial
  6923. ? customizer(othValue, arrValue, index, other, array, stack)
  6924. : customizer(arrValue, othValue, index, array, other, stack);
  6925. }
  6926. if (compared !== undefined) {
  6927. if (compared) {
  6928. continue;
  6929. }
  6930. result = false;
  6931. break;
  6932. }
  6933. // Recursively compare arrays (susceptible to call stack limits).
  6934. if (seen) {
  6935. if (!arraySome(other, function(othValue, othIndex) {
  6936. if (!cacheHas(seen, othIndex) &&
  6937. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6938. return seen.push(othIndex);
  6939. }
  6940. })) {
  6941. result = false;
  6942. break;
  6943. }
  6944. } else if (!(
  6945. arrValue === othValue ||
  6946. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6947. )) {
  6948. result = false;
  6949. break;
  6950. }
  6951. }
  6952. stack['delete'](array);
  6953. stack['delete'](other);
  6954. return result;
  6955. }
  6956. /**
  6957. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6958. * the same `toStringTag`.
  6959. *
  6960. * **Note:** This function only supports comparing values with tags of
  6961. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6962. *
  6963. * @private
  6964. * @param {Object} object The object to compare.
  6965. * @param {Object} other The other object to compare.
  6966. * @param {string} tag The `toStringTag` of the objects to compare.
  6967. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6968. * @param {Function} customizer The function to customize comparisons.
  6969. * @param {Function} equalFunc The function to determine equivalents of values.
  6970. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6971. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6972. */
  6973. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6974. switch (tag) {
  6975. case dataViewTag:
  6976. if ((object.byteLength != other.byteLength) ||
  6977. (object.byteOffset != other.byteOffset)) {
  6978. return false;
  6979. }
  6980. object = object.buffer;
  6981. other = other.buffer;
  6982. case arrayBufferTag:
  6983. if ((object.byteLength != other.byteLength) ||
  6984. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6985. return false;
  6986. }
  6987. return true;
  6988. case boolTag:
  6989. case dateTag:
  6990. case numberTag:
  6991. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6992. // Invalid dates are coerced to `NaN`.
  6993. return eq(+object, +other);
  6994. case errorTag:
  6995. return object.name == other.name && object.message == other.message;
  6996. case regexpTag:
  6997. case stringTag:
  6998. // Coerce regexes to strings and treat strings, primitives and objects,
  6999. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  7000. // for more details.
  7001. return object == (other + '');
  7002. case mapTag:
  7003. var convert = mapToArray;
  7004. case setTag:
  7005. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  7006. convert || (convert = setToArray);
  7007. if (object.size != other.size && !isPartial) {
  7008. return false;
  7009. }
  7010. // Assume cyclic values are equal.
  7011. var stacked = stack.get(object);
  7012. if (stacked) {
  7013. return stacked == other;
  7014. }
  7015. bitmask |= COMPARE_UNORDERED_FLAG;
  7016. // Recursively compare objects (susceptible to call stack limits).
  7017. stack.set(object, other);
  7018. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  7019. stack['delete'](object);
  7020. return result;
  7021. case symbolTag:
  7022. if (symbolValueOf) {
  7023. return symbolValueOf.call(object) == symbolValueOf.call(other);
  7024. }
  7025. }
  7026. return false;
  7027. }
  7028. /**
  7029. * A specialized version of `baseIsEqualDeep` for objects with support for
  7030. * partial deep comparisons.
  7031. *
  7032. * @private
  7033. * @param {Object} object The object to compare.
  7034. * @param {Object} other The other object to compare.
  7035. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7036. * @param {Function} customizer The function to customize comparisons.
  7037. * @param {Function} equalFunc The function to determine equivalents of values.
  7038. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7039. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7040. */
  7041. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  7042. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7043. objProps = getAllKeys(object),
  7044. objLength = objProps.length,
  7045. othProps = getAllKeys(other),
  7046. othLength = othProps.length;
  7047. if (objLength != othLength && !isPartial) {
  7048. return false;
  7049. }
  7050. var index = objLength;
  7051. while (index--) {
  7052. var key = objProps[index];
  7053. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7054. return false;
  7055. }
  7056. }
  7057. // Check that cyclic values are equal.
  7058. var objStacked = stack.get(object);
  7059. var othStacked = stack.get(other);
  7060. if (objStacked && othStacked) {
  7061. return objStacked == other && othStacked == object;
  7062. }
  7063. var result = true;
  7064. stack.set(object, other);
  7065. stack.set(other, object);
  7066. var skipCtor = isPartial;
  7067. while (++index < objLength) {
  7068. key = objProps[index];
  7069. var objValue = object[key],
  7070. othValue = other[key];
  7071. if (customizer) {
  7072. var compared = isPartial
  7073. ? customizer(othValue, objValue, key, other, object, stack)
  7074. : customizer(objValue, othValue, key, object, other, stack);
  7075. }
  7076. // Recursively compare objects (susceptible to call stack limits).
  7077. if (!(compared === undefined
  7078. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  7079. : compared
  7080. )) {
  7081. result = false;
  7082. break;
  7083. }
  7084. skipCtor || (skipCtor = key == 'constructor');
  7085. }
  7086. if (result && !skipCtor) {
  7087. var objCtor = object.constructor,
  7088. othCtor = other.constructor;
  7089. // Non `Object` object instances with different constructors are not equal.
  7090. if (objCtor != othCtor &&
  7091. ('constructor' in object && 'constructor' in other) &&
  7092. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  7093. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7094. result = false;
  7095. }
  7096. }
  7097. stack['delete'](object);
  7098. stack['delete'](other);
  7099. return result;
  7100. }
  7101. /**
  7102. * A specialized version of `baseRest` which flattens the rest array.
  7103. *
  7104. * @private
  7105. * @param {Function} func The function to apply a rest parameter to.
  7106. * @returns {Function} Returns the new function.
  7107. */
  7108. function flatRest(func) {
  7109. return setToString(overRest(func, undefined, flatten), func + '');
  7110. }
  7111. /**
  7112. * Creates an array of own enumerable property names and symbols of `object`.
  7113. *
  7114. * @private
  7115. * @param {Object} object The object to query.
  7116. * @returns {Array} Returns the array of property names and symbols.
  7117. */
  7118. function getAllKeys(object) {
  7119. return baseGetAllKeys(object, keys, getSymbols);
  7120. }
  7121. /**
  7122. * Creates an array of own and inherited enumerable property names and
  7123. * symbols of `object`.
  7124. *
  7125. * @private
  7126. * @param {Object} object The object to query.
  7127. * @returns {Array} Returns the array of property names and symbols.
  7128. */
  7129. function getAllKeysIn(object) {
  7130. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  7131. }
  7132. /**
  7133. * Gets metadata for `func`.
  7134. *
  7135. * @private
  7136. * @param {Function} func The function to query.
  7137. * @returns {*} Returns the metadata for `func`.
  7138. */
  7139. var getData = !metaMap ? noop : function(func) {
  7140. return metaMap.get(func);
  7141. };
  7142. /**
  7143. * Gets the name of `func`.
  7144. *
  7145. * @private
  7146. * @param {Function} func The function to query.
  7147. * @returns {string} Returns the function name.
  7148. */
  7149. function getFuncName(func) {
  7150. var result = (func.name + ''),
  7151. array = realNames[result],
  7152. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  7153. while (length--) {
  7154. var data = array[length],
  7155. otherFunc = data.func;
  7156. if (otherFunc == null || otherFunc == func) {
  7157. return data.name;
  7158. }
  7159. }
  7160. return result;
  7161. }
  7162. /**
  7163. * Gets the argument placeholder value for `func`.
  7164. *
  7165. * @private
  7166. * @param {Function} func The function to inspect.
  7167. * @returns {*} Returns the placeholder value.
  7168. */
  7169. function getHolder(func) {
  7170. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  7171. return object.placeholder;
  7172. }
  7173. /**
  7174. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  7175. * this function returns the custom method, otherwise it returns `baseIteratee`.
  7176. * If arguments are provided, the chosen function is invoked with them and
  7177. * its result is returned.
  7178. *
  7179. * @private
  7180. * @param {*} [value] The value to convert to an iteratee.
  7181. * @param {number} [arity] The arity of the created iteratee.
  7182. * @returns {Function} Returns the chosen function or its result.
  7183. */
  7184. function getIteratee() {
  7185. var result = lodash.iteratee || iteratee;
  7186. result = result === iteratee ? baseIteratee : result;
  7187. return arguments.length ? result(arguments[0], arguments[1]) : result;
  7188. }
  7189. /**
  7190. * Gets the data for `map`.
  7191. *
  7192. * @private
  7193. * @param {Object} map The map to query.
  7194. * @param {string} key The reference key.
  7195. * @returns {*} Returns the map data.
  7196. */
  7197. function getMapData(map, key) {
  7198. var data = map.__data__;
  7199. return isKeyable(key)
  7200. ? data[typeof key == 'string' ? 'string' : 'hash']
  7201. : data.map;
  7202. }
  7203. /**
  7204. * Gets the property names, values, and compare flags of `object`.
  7205. *
  7206. * @private
  7207. * @param {Object} object The object to query.
  7208. * @returns {Array} Returns the match data of `object`.
  7209. */
  7210. function getMatchData(object) {
  7211. var result = keys(object),
  7212. length = result.length;
  7213. while (length--) {
  7214. var key = result[length],
  7215. value = object[key];
  7216. result[length] = [key, value, isStrictComparable(value)];
  7217. }
  7218. return result;
  7219. }
  7220. /**
  7221. * Gets the native function at `key` of `object`.
  7222. *
  7223. * @private
  7224. * @param {Object} object The object to query.
  7225. * @param {string} key The key of the method to get.
  7226. * @returns {*} Returns the function if it's native, else `undefined`.
  7227. */
  7228. function getNative(object, key) {
  7229. var value = getValue(object, key);
  7230. return baseIsNative(value) ? value : undefined;
  7231. }
  7232. /**
  7233. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7234. *
  7235. * @private
  7236. * @param {*} value The value to query.
  7237. * @returns {string} Returns the raw `toStringTag`.
  7238. */
  7239. function getRawTag(value) {
  7240. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7241. tag = value[symToStringTag];
  7242. try {
  7243. value[symToStringTag] = undefined;
  7244. var unmasked = true;
  7245. } catch (e) {}
  7246. var result = nativeObjectToString.call(value);
  7247. if (unmasked) {
  7248. if (isOwn) {
  7249. value[symToStringTag] = tag;
  7250. } else {
  7251. delete value[symToStringTag];
  7252. }
  7253. }
  7254. return result;
  7255. }
  7256. /**
  7257. * Creates an array of the own enumerable symbols of `object`.
  7258. *
  7259. * @private
  7260. * @param {Object} object The object to query.
  7261. * @returns {Array} Returns the array of symbols.
  7262. */
  7263. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  7264. if (object == null) {
  7265. return [];
  7266. }
  7267. object = Object(object);
  7268. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  7269. return propertyIsEnumerable.call(object, symbol);
  7270. });
  7271. };
  7272. /**
  7273. * Creates an array of the own and inherited enumerable symbols of `object`.
  7274. *
  7275. * @private
  7276. * @param {Object} object The object to query.
  7277. * @returns {Array} Returns the array of symbols.
  7278. */
  7279. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  7280. var result = [];
  7281. while (object) {
  7282. arrayPush(result, getSymbols(object));
  7283. object = getPrototype(object);
  7284. }
  7285. return result;
  7286. };
  7287. /**
  7288. * Gets the `toStringTag` of `value`.
  7289. *
  7290. * @private
  7291. * @param {*} value The value to query.
  7292. * @returns {string} Returns the `toStringTag`.
  7293. */
  7294. var getTag = baseGetTag;
  7295. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  7296. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  7297. (Map && getTag(new Map) != mapTag) ||
  7298. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  7299. (Set && getTag(new Set) != setTag) ||
  7300. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  7301. getTag = function(value) {
  7302. var result = baseGetTag(value),
  7303. Ctor = result == objectTag ? value.constructor : undefined,
  7304. ctorString = Ctor ? toSource(Ctor) : '';
  7305. if (ctorString) {
  7306. switch (ctorString) {
  7307. case dataViewCtorString: return dataViewTag;
  7308. case mapCtorString: return mapTag;
  7309. case promiseCtorString: return promiseTag;
  7310. case setCtorString: return setTag;
  7311. case weakMapCtorString: return weakMapTag;
  7312. }
  7313. }
  7314. return result;
  7315. };
  7316. }
  7317. /**
  7318. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  7319. *
  7320. * @private
  7321. * @param {number} start The start of the view.
  7322. * @param {number} end The end of the view.
  7323. * @param {Array} transforms The transformations to apply to the view.
  7324. * @returns {Object} Returns an object containing the `start` and `end`
  7325. * positions of the view.
  7326. */
  7327. function getView(start, end, transforms) {
  7328. var index = -1,
  7329. length = transforms.length;
  7330. while (++index < length) {
  7331. var data = transforms[index],
  7332. size = data.size;
  7333. switch (data.type) {
  7334. case 'drop': start += size; break;
  7335. case 'dropRight': end -= size; break;
  7336. case 'take': end = nativeMin(end, start + size); break;
  7337. case 'takeRight': start = nativeMax(start, end - size); break;
  7338. }
  7339. }
  7340. return { 'start': start, 'end': end };
  7341. }
  7342. /**
  7343. * Extracts wrapper details from the `source` body comment.
  7344. *
  7345. * @private
  7346. * @param {string} source The source to inspect.
  7347. * @returns {Array} Returns the wrapper details.
  7348. */
  7349. function getWrapDetails(source) {
  7350. var match = source.match(reWrapDetails);
  7351. return match ? match[1].split(reSplitDetails) : [];
  7352. }
  7353. /**
  7354. * Checks if `path` exists on `object`.
  7355. *
  7356. * @private
  7357. * @param {Object} object The object to query.
  7358. * @param {Array|string} path The path to check.
  7359. * @param {Function} hasFunc The function to check properties.
  7360. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7361. */
  7362. function hasPath(object, path, hasFunc) {
  7363. path = castPath(path, object);
  7364. var index = -1,
  7365. length = path.length,
  7366. result = false;
  7367. while (++index < length) {
  7368. var key = toKey(path[index]);
  7369. if (!(result = object != null && hasFunc(object, key))) {
  7370. break;
  7371. }
  7372. object = object[key];
  7373. }
  7374. if (result || ++index != length) {
  7375. return result;
  7376. }
  7377. length = object == null ? 0 : object.length;
  7378. return !!length && isLength(length) && isIndex(key, length) &&
  7379. (isArray(object) || isArguments(object));
  7380. }
  7381. /**
  7382. * Initializes an array clone.
  7383. *
  7384. * @private
  7385. * @param {Array} array The array to clone.
  7386. * @returns {Array} Returns the initialized clone.
  7387. */
  7388. function initCloneArray(array) {
  7389. var length = array.length,
  7390. result = new array.constructor(length);
  7391. // Add properties assigned by `RegExp#exec`.
  7392. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7393. result.index = array.index;
  7394. result.input = array.input;
  7395. }
  7396. return result;
  7397. }
  7398. /**
  7399. * Initializes an object clone.
  7400. *
  7401. * @private
  7402. * @param {Object} object The object to clone.
  7403. * @returns {Object} Returns the initialized clone.
  7404. */
  7405. function initCloneObject(object) {
  7406. return (typeof object.constructor == 'function' && !isPrototype(object))
  7407. ? baseCreate(getPrototype(object))
  7408. : {};
  7409. }
  7410. /**
  7411. * Initializes an object clone based on its `toStringTag`.
  7412. *
  7413. * **Note:** This function only supports cloning values with tags of
  7414. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7415. *
  7416. * @private
  7417. * @param {Object} object The object to clone.
  7418. * @param {string} tag The `toStringTag` of the object to clone.
  7419. * @param {boolean} [isDeep] Specify a deep clone.
  7420. * @returns {Object} Returns the initialized clone.
  7421. */
  7422. function initCloneByTag(object, tag, isDeep) {
  7423. var Ctor = object.constructor;
  7424. switch (tag) {
  7425. case arrayBufferTag:
  7426. return cloneArrayBuffer(object);
  7427. case boolTag:
  7428. case dateTag:
  7429. return new Ctor(+object);
  7430. case dataViewTag:
  7431. return cloneDataView(object, isDeep);
  7432. case float32Tag: case float64Tag:
  7433. case int8Tag: case int16Tag: case int32Tag:
  7434. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7435. return cloneTypedArray(object, isDeep);
  7436. case mapTag:
  7437. return new Ctor;
  7438. case numberTag:
  7439. case stringTag:
  7440. return new Ctor(object);
  7441. case regexpTag:
  7442. return cloneRegExp(object);
  7443. case setTag:
  7444. return new Ctor;
  7445. case symbolTag:
  7446. return cloneSymbol(object);
  7447. }
  7448. }
  7449. /**
  7450. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7451. *
  7452. * @private
  7453. * @param {string} source The source to modify.
  7454. * @returns {Array} details The details to insert.
  7455. * @returns {string} Returns the modified source.
  7456. */
  7457. function insertWrapDetails(source, details) {
  7458. var length = details.length;
  7459. if (!length) {
  7460. return source;
  7461. }
  7462. var lastIndex = length - 1;
  7463. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7464. details = details.join(length > 2 ? ', ' : ' ');
  7465. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7466. }
  7467. /**
  7468. * Checks if `value` is a flattenable `arguments` object or array.
  7469. *
  7470. * @private
  7471. * @param {*} value The value to check.
  7472. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7473. */
  7474. function isFlattenable(value) {
  7475. return isArray(value) || isArguments(value) ||
  7476. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7477. }
  7478. /**
  7479. * Checks if `value` is a valid array-like index.
  7480. *
  7481. * @private
  7482. * @param {*} value The value to check.
  7483. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7484. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7485. */
  7486. function isIndex(value, length) {
  7487. var type = typeof value;
  7488. length = length == null ? MAX_SAFE_INTEGER : length;
  7489. return !!length &&
  7490. (type == 'number' ||
  7491. (type != 'symbol' && reIsUint.test(value))) &&
  7492. (value > -1 && value % 1 == 0 && value < length);
  7493. }
  7494. /**
  7495. * Checks if the given arguments are from an iteratee call.
  7496. *
  7497. * @private
  7498. * @param {*} value The potential iteratee value argument.
  7499. * @param {*} index The potential iteratee index or key argument.
  7500. * @param {*} object The potential iteratee object argument.
  7501. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7502. * else `false`.
  7503. */
  7504. function isIterateeCall(value, index, object) {
  7505. if (!isObject(object)) {
  7506. return false;
  7507. }
  7508. var type = typeof index;
  7509. if (type == 'number'
  7510. ? (isArrayLike(object) && isIndex(index, object.length))
  7511. : (type == 'string' && index in object)
  7512. ) {
  7513. return eq(object[index], value);
  7514. }
  7515. return false;
  7516. }
  7517. /**
  7518. * Checks if `value` is a property name and not a property path.
  7519. *
  7520. * @private
  7521. * @param {*} value The value to check.
  7522. * @param {Object} [object] The object to query keys on.
  7523. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7524. */
  7525. function isKey(value, object) {
  7526. if (isArray(value)) {
  7527. return false;
  7528. }
  7529. var type = typeof value;
  7530. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7531. value == null || isSymbol(value)) {
  7532. return true;
  7533. }
  7534. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7535. (object != null && value in Object(object));
  7536. }
  7537. /**
  7538. * Checks if `value` is suitable for use as unique object key.
  7539. *
  7540. * @private
  7541. * @param {*} value The value to check.
  7542. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7543. */
  7544. function isKeyable(value) {
  7545. var type = typeof value;
  7546. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7547. ? (value !== '__proto__')
  7548. : (value === null);
  7549. }
  7550. /**
  7551. * Checks if `func` has a lazy counterpart.
  7552. *
  7553. * @private
  7554. * @param {Function} func The function to check.
  7555. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7556. * else `false`.
  7557. */
  7558. function isLaziable(func) {
  7559. var funcName = getFuncName(func),
  7560. other = lodash[funcName];
  7561. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7562. return false;
  7563. }
  7564. if (func === other) {
  7565. return true;
  7566. }
  7567. var data = getData(other);
  7568. return !!data && func === data[0];
  7569. }
  7570. /**
  7571. * Checks if `func` has its source masked.
  7572. *
  7573. * @private
  7574. * @param {Function} func The function to check.
  7575. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7576. */
  7577. function isMasked(func) {
  7578. return !!maskSrcKey && (maskSrcKey in func);
  7579. }
  7580. /**
  7581. * Checks if `func` is capable of being masked.
  7582. *
  7583. * @private
  7584. * @param {*} value The value to check.
  7585. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7586. */
  7587. var isMaskable = coreJsData ? isFunction : stubFalse;
  7588. /**
  7589. * Checks if `value` is likely a prototype object.
  7590. *
  7591. * @private
  7592. * @param {*} value The value to check.
  7593. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7594. */
  7595. function isPrototype(value) {
  7596. var Ctor = value && value.constructor,
  7597. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7598. return value === proto;
  7599. }
  7600. /**
  7601. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7602. *
  7603. * @private
  7604. * @param {*} value The value to check.
  7605. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7606. * equality comparisons, else `false`.
  7607. */
  7608. function isStrictComparable(value) {
  7609. return value === value && !isObject(value);
  7610. }
  7611. /**
  7612. * A specialized version of `matchesProperty` for source values suitable
  7613. * for strict equality comparisons, i.e. `===`.
  7614. *
  7615. * @private
  7616. * @param {string} key The key of the property to get.
  7617. * @param {*} srcValue The value to match.
  7618. * @returns {Function} Returns the new spec function.
  7619. */
  7620. function matchesStrictComparable(key, srcValue) {
  7621. return function(object) {
  7622. if (object == null) {
  7623. return false;
  7624. }
  7625. return object[key] === srcValue &&
  7626. (srcValue !== undefined || (key in Object(object)));
  7627. };
  7628. }
  7629. /**
  7630. * A specialized version of `_.memoize` which clears the memoized function's
  7631. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7632. *
  7633. * @private
  7634. * @param {Function} func The function to have its output memoized.
  7635. * @returns {Function} Returns the new memoized function.
  7636. */
  7637. function memoizeCapped(func) {
  7638. var result = memoize(func, function(key) {
  7639. if (cache.size === MAX_MEMOIZE_SIZE) {
  7640. cache.clear();
  7641. }
  7642. return key;
  7643. });
  7644. var cache = result.cache;
  7645. return result;
  7646. }
  7647. /**
  7648. * Merges the function metadata of `source` into `data`.
  7649. *
  7650. * Merging metadata reduces the number of wrappers used to invoke a function.
  7651. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7652. * may be applied regardless of execution order. Methods like `_.ary` and
  7653. * `_.rearg` modify function arguments, making the order in which they are
  7654. * executed important, preventing the merging of metadata. However, we make
  7655. * an exception for a safe combined case where curried functions have `_.ary`
  7656. * and or `_.rearg` applied.
  7657. *
  7658. * @private
  7659. * @param {Array} data The destination metadata.
  7660. * @param {Array} source The source metadata.
  7661. * @returns {Array} Returns `data`.
  7662. */
  7663. function mergeData(data, source) {
  7664. var bitmask = data[1],
  7665. srcBitmask = source[1],
  7666. newBitmask = bitmask | srcBitmask,
  7667. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7668. var isCombo =
  7669. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7670. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7671. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7672. // Exit early if metadata can't be merged.
  7673. if (!(isCommon || isCombo)) {
  7674. return data;
  7675. }
  7676. // Use source `thisArg` if available.
  7677. if (srcBitmask & WRAP_BIND_FLAG) {
  7678. data[2] = source[2];
  7679. // Set when currying a bound function.
  7680. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7681. }
  7682. // Compose partial arguments.
  7683. var value = source[3];
  7684. if (value) {
  7685. var partials = data[3];
  7686. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7687. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7688. }
  7689. // Compose partial right arguments.
  7690. value = source[5];
  7691. if (value) {
  7692. partials = data[5];
  7693. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7694. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7695. }
  7696. // Use source `argPos` if available.
  7697. value = source[7];
  7698. if (value) {
  7699. data[7] = value;
  7700. }
  7701. // Use source `ary` if it's smaller.
  7702. if (srcBitmask & WRAP_ARY_FLAG) {
  7703. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7704. }
  7705. // Use source `arity` if one is not provided.
  7706. if (data[9] == null) {
  7707. data[9] = source[9];
  7708. }
  7709. // Use source `func` and merge bitmasks.
  7710. data[0] = source[0];
  7711. data[1] = newBitmask;
  7712. return data;
  7713. }
  7714. /**
  7715. * This function is like
  7716. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7717. * except that it includes inherited enumerable properties.
  7718. *
  7719. * @private
  7720. * @param {Object} object The object to query.
  7721. * @returns {Array} Returns the array of property names.
  7722. */
  7723. function nativeKeysIn(object) {
  7724. var result = [];
  7725. if (object != null) {
  7726. for (var key in Object(object)) {
  7727. result.push(key);
  7728. }
  7729. }
  7730. return result;
  7731. }
  7732. /**
  7733. * Converts `value` to a string using `Object.prototype.toString`.
  7734. *
  7735. * @private
  7736. * @param {*} value The value to convert.
  7737. * @returns {string} Returns the converted string.
  7738. */
  7739. function objectToString(value) {
  7740. return nativeObjectToString.call(value);
  7741. }
  7742. /**
  7743. * A specialized version of `baseRest` which transforms the rest array.
  7744. *
  7745. * @private
  7746. * @param {Function} func The function to apply a rest parameter to.
  7747. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7748. * @param {Function} transform The rest array transform.
  7749. * @returns {Function} Returns the new function.
  7750. */
  7751. function overRest(func, start, transform) {
  7752. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7753. return function() {
  7754. var args = arguments,
  7755. index = -1,
  7756. length = nativeMax(args.length - start, 0),
  7757. array = Array(length);
  7758. while (++index < length) {
  7759. array[index] = args[start + index];
  7760. }
  7761. index = -1;
  7762. var otherArgs = Array(start + 1);
  7763. while (++index < start) {
  7764. otherArgs[index] = args[index];
  7765. }
  7766. otherArgs[start] = transform(array);
  7767. return apply(func, this, otherArgs);
  7768. };
  7769. }
  7770. /**
  7771. * Gets the parent value at `path` of `object`.
  7772. *
  7773. * @private
  7774. * @param {Object} object The object to query.
  7775. * @param {Array} path The path to get the parent value of.
  7776. * @returns {*} Returns the parent value.
  7777. */
  7778. function parent(object, path) {
  7779. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7780. }
  7781. /**
  7782. * Reorder `array` according to the specified indexes where the element at
  7783. * the first index is assigned as the first element, the element at
  7784. * the second index is assigned as the second element, and so on.
  7785. *
  7786. * @private
  7787. * @param {Array} array The array to reorder.
  7788. * @param {Array} indexes The arranged array indexes.
  7789. * @returns {Array} Returns `array`.
  7790. */
  7791. function reorder(array, indexes) {
  7792. var arrLength = array.length,
  7793. length = nativeMin(indexes.length, arrLength),
  7794. oldArray = copyArray(array);
  7795. while (length--) {
  7796. var index = indexes[length];
  7797. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7798. }
  7799. return array;
  7800. }
  7801. /**
  7802. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7803. *
  7804. * @private
  7805. * @param {Object} object The object to query.
  7806. * @param {string} key The key of the property to get.
  7807. * @returns {*} Returns the property value.
  7808. */
  7809. function safeGet(object, key) {
  7810. if (key === 'constructor' && typeof object[key] === 'function') {
  7811. return;
  7812. }
  7813. if (key == '__proto__') {
  7814. return;
  7815. }
  7816. return object[key];
  7817. }
  7818. /**
  7819. * Sets metadata for `func`.
  7820. *
  7821. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7822. * period of time, it will trip its breaker and transition to an identity
  7823. * function to avoid garbage collection pauses in V8. See
  7824. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7825. * for more details.
  7826. *
  7827. * @private
  7828. * @param {Function} func The function to associate metadata with.
  7829. * @param {*} data The metadata.
  7830. * @returns {Function} Returns `func`.
  7831. */
  7832. var setData = shortOut(baseSetData);
  7833. /**
  7834. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7835. *
  7836. * @private
  7837. * @param {Function} func The function to delay.
  7838. * @param {number} wait The number of milliseconds to delay invocation.
  7839. * @returns {number|Object} Returns the timer id or timeout object.
  7840. */
  7841. var setTimeout = ctxSetTimeout || function(func, wait) {
  7842. return root.setTimeout(func, wait);
  7843. };
  7844. /**
  7845. * Sets the `toString` method of `func` to return `string`.
  7846. *
  7847. * @private
  7848. * @param {Function} func The function to modify.
  7849. * @param {Function} string The `toString` result.
  7850. * @returns {Function} Returns `func`.
  7851. */
  7852. var setToString = shortOut(baseSetToString);
  7853. /**
  7854. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7855. * with wrapper details in a comment at the top of the source body.
  7856. *
  7857. * @private
  7858. * @param {Function} wrapper The function to modify.
  7859. * @param {Function} reference The reference function.
  7860. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7861. * @returns {Function} Returns `wrapper`.
  7862. */
  7863. function setWrapToString(wrapper, reference, bitmask) {
  7864. var source = (reference + '');
  7865. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7866. }
  7867. /**
  7868. * Creates a function that'll short out and invoke `identity` instead
  7869. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7870. * milliseconds.
  7871. *
  7872. * @private
  7873. * @param {Function} func The function to restrict.
  7874. * @returns {Function} Returns the new shortable function.
  7875. */
  7876. function shortOut(func) {
  7877. var count = 0,
  7878. lastCalled = 0;
  7879. return function() {
  7880. var stamp = nativeNow(),
  7881. remaining = HOT_SPAN - (stamp - lastCalled);
  7882. lastCalled = stamp;
  7883. if (remaining > 0) {
  7884. if (++count >= HOT_COUNT) {
  7885. return arguments[0];
  7886. }
  7887. } else {
  7888. count = 0;
  7889. }
  7890. return func.apply(undefined, arguments);
  7891. };
  7892. }
  7893. /**
  7894. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7895. *
  7896. * @private
  7897. * @param {Array} array The array to shuffle.
  7898. * @param {number} [size=array.length] The size of `array`.
  7899. * @returns {Array} Returns `array`.
  7900. */
  7901. function shuffleSelf(array, size) {
  7902. var index = -1,
  7903. length = array.length,
  7904. lastIndex = length - 1;
  7905. size = size === undefined ? length : size;
  7906. while (++index < size) {
  7907. var rand = baseRandom(index, lastIndex),
  7908. value = array[rand];
  7909. array[rand] = array[index];
  7910. array[index] = value;
  7911. }
  7912. array.length = size;
  7913. return array;
  7914. }
  7915. /**
  7916. * Converts `string` to a property path array.
  7917. *
  7918. * @private
  7919. * @param {string} string The string to convert.
  7920. * @returns {Array} Returns the property path array.
  7921. */
  7922. var stringToPath = memoizeCapped(function(string) {
  7923. var result = [];
  7924. if (string.charCodeAt(0) === 46 /* . */) {
  7925. result.push('');
  7926. }
  7927. string.replace(rePropName, function(match, number, quote, subString) {
  7928. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7929. });
  7930. return result;
  7931. });
  7932. /**
  7933. * Converts `value` to a string key if it's not a string or symbol.
  7934. *
  7935. * @private
  7936. * @param {*} value The value to inspect.
  7937. * @returns {string|symbol} Returns the key.
  7938. */
  7939. function toKey(value) {
  7940. if (typeof value == 'string' || isSymbol(value)) {
  7941. return value;
  7942. }
  7943. var result = (value + '');
  7944. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7945. }
  7946. /**
  7947. * Converts `func` to its source code.
  7948. *
  7949. * @private
  7950. * @param {Function} func The function to convert.
  7951. * @returns {string} Returns the source code.
  7952. */
  7953. function toSource(func) {
  7954. if (func != null) {
  7955. try {
  7956. return funcToString.call(func);
  7957. } catch (e) {}
  7958. try {
  7959. return (func + '');
  7960. } catch (e) {}
  7961. }
  7962. return '';
  7963. }
  7964. /**
  7965. * Updates wrapper `details` based on `bitmask` flags.
  7966. *
  7967. * @private
  7968. * @returns {Array} details The details to modify.
  7969. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7970. * @returns {Array} Returns `details`.
  7971. */
  7972. function updateWrapDetails(details, bitmask) {
  7973. arrayEach(wrapFlags, function(pair) {
  7974. var value = '_.' + pair[0];
  7975. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7976. details.push(value);
  7977. }
  7978. });
  7979. return details.sort();
  7980. }
  7981. /**
  7982. * Creates a clone of `wrapper`.
  7983. *
  7984. * @private
  7985. * @param {Object} wrapper The wrapper to clone.
  7986. * @returns {Object} Returns the cloned wrapper.
  7987. */
  7988. function wrapperClone(wrapper) {
  7989. if (wrapper instanceof LazyWrapper) {
  7990. return wrapper.clone();
  7991. }
  7992. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7993. result.__actions__ = copyArray(wrapper.__actions__);
  7994. result.__index__ = wrapper.__index__;
  7995. result.__values__ = wrapper.__values__;
  7996. return result;
  7997. }
  7998. /*------------------------------------------------------------------------*/
  7999. /**
  8000. * Creates an array of elements split into groups the length of `size`.
  8001. * If `array` can't be split evenly, the final chunk will be the remaining
  8002. * elements.
  8003. *
  8004. * @static
  8005. * @memberOf _
  8006. * @since 3.0.0
  8007. * @category Array
  8008. * @param {Array} array The array to process.
  8009. * @param {number} [size=1] The length of each chunk
  8010. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8011. * @returns {Array} Returns the new array of chunks.
  8012. * @example
  8013. *
  8014. * _.chunk(['a', 'b', 'c', 'd'], 2);
  8015. * // => [['a', 'b'], ['c', 'd']]
  8016. *
  8017. * _.chunk(['a', 'b', 'c', 'd'], 3);
  8018. * // => [['a', 'b', 'c'], ['d']]
  8019. */
  8020. function chunk(array, size, guard) {
  8021. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  8022. size = 1;
  8023. } else {
  8024. size = nativeMax(toInteger(size), 0);
  8025. }
  8026. var length = array == null ? 0 : array.length;
  8027. if (!length || size < 1) {
  8028. return [];
  8029. }
  8030. var index = 0,
  8031. resIndex = 0,
  8032. result = Array(nativeCeil(length / size));
  8033. while (index < length) {
  8034. result[resIndex++] = baseSlice(array, index, (index += size));
  8035. }
  8036. return result;
  8037. }
  8038. /**
  8039. * Creates an array with all falsey values removed. The values `false`, `null`,
  8040. * `0`, `""`, `undefined`, and `NaN` are falsey.
  8041. *
  8042. * @static
  8043. * @memberOf _
  8044. * @since 0.1.0
  8045. * @category Array
  8046. * @param {Array} array The array to compact.
  8047. * @returns {Array} Returns the new array of filtered values.
  8048. * @example
  8049. *
  8050. * _.compact([0, 1, false, 2, '', 3]);
  8051. * // => [1, 2, 3]
  8052. */
  8053. function compact(array) {
  8054. var index = -1,
  8055. length = array == null ? 0 : array.length,
  8056. resIndex = 0,
  8057. result = [];
  8058. while (++index < length) {
  8059. var value = array[index];
  8060. if (value) {
  8061. result[resIndex++] = value;
  8062. }
  8063. }
  8064. return result;
  8065. }
  8066. /**
  8067. * Creates a new array concatenating `array` with any additional arrays
  8068. * and/or values.
  8069. *
  8070. * @static
  8071. * @memberOf _
  8072. * @since 4.0.0
  8073. * @category Array
  8074. * @param {Array} array The array to concatenate.
  8075. * @param {...*} [values] The values to concatenate.
  8076. * @returns {Array} Returns the new concatenated array.
  8077. * @example
  8078. *
  8079. * var array = [1];
  8080. * var other = _.concat(array, 2, [3], [[4]]);
  8081. *
  8082. * console.log(other);
  8083. * // => [1, 2, 3, [4]]
  8084. *
  8085. * console.log(array);
  8086. * // => [1]
  8087. */
  8088. function concat() {
  8089. var length = arguments.length;
  8090. if (!length) {
  8091. return [];
  8092. }
  8093. var args = Array(length - 1),
  8094. array = arguments[0],
  8095. index = length;
  8096. while (index--) {
  8097. args[index - 1] = arguments[index];
  8098. }
  8099. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  8100. }
  8101. /**
  8102. * Creates an array of `array` values not included in the other given arrays
  8103. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8104. * for equality comparisons. The order and references of result values are
  8105. * determined by the first array.
  8106. *
  8107. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  8108. *
  8109. * @static
  8110. * @memberOf _
  8111. * @since 0.1.0
  8112. * @category Array
  8113. * @param {Array} array The array to inspect.
  8114. * @param {...Array} [values] The values to exclude.
  8115. * @returns {Array} Returns the new array of filtered values.
  8116. * @see _.without, _.xor
  8117. * @example
  8118. *
  8119. * _.difference([2, 1], [2, 3]);
  8120. * // => [1]
  8121. */
  8122. var difference = baseRest(function(array, values) {
  8123. return isArrayLikeObject(array)
  8124. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  8125. : [];
  8126. });
  8127. /**
  8128. * This method is like `_.difference` except that it accepts `iteratee` which
  8129. * is invoked for each element of `array` and `values` to generate the criterion
  8130. * by which they're compared. The order and references of result values are
  8131. * determined by the first array. The iteratee is invoked with one argument:
  8132. * (value).
  8133. *
  8134. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  8135. *
  8136. * @static
  8137. * @memberOf _
  8138. * @since 4.0.0
  8139. * @category Array
  8140. * @param {Array} array The array to inspect.
  8141. * @param {...Array} [values] The values to exclude.
  8142. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8143. * @returns {Array} Returns the new array of filtered values.
  8144. * @example
  8145. *
  8146. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8147. * // => [1.2]
  8148. *
  8149. * // The `_.property` iteratee shorthand.
  8150. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  8151. * // => [{ 'x': 2 }]
  8152. */
  8153. var differenceBy = baseRest(function(array, values) {
  8154. var iteratee = last(values);
  8155. if (isArrayLikeObject(iteratee)) {
  8156. iteratee = undefined;
  8157. }
  8158. return isArrayLikeObject(array)
  8159. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  8160. : [];
  8161. });
  8162. /**
  8163. * This method is like `_.difference` except that it accepts `comparator`
  8164. * which is invoked to compare elements of `array` to `values`. The order and
  8165. * references of result values are determined by the first array. The comparator
  8166. * is invoked with two arguments: (arrVal, othVal).
  8167. *
  8168. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  8169. *
  8170. * @static
  8171. * @memberOf _
  8172. * @since 4.0.0
  8173. * @category Array
  8174. * @param {Array} array The array to inspect.
  8175. * @param {...Array} [values] The values to exclude.
  8176. * @param {Function} [comparator] The comparator invoked per element.
  8177. * @returns {Array} Returns the new array of filtered values.
  8178. * @example
  8179. *
  8180. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8181. *
  8182. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  8183. * // => [{ 'x': 2, 'y': 1 }]
  8184. */
  8185. var differenceWith = baseRest(function(array, values) {
  8186. var comparator = last(values);
  8187. if (isArrayLikeObject(comparator)) {
  8188. comparator = undefined;
  8189. }
  8190. return isArrayLikeObject(array)
  8191. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  8192. : [];
  8193. });
  8194. /**
  8195. * Creates a slice of `array` with `n` elements dropped from the beginning.
  8196. *
  8197. * @static
  8198. * @memberOf _
  8199. * @since 0.5.0
  8200. * @category Array
  8201. * @param {Array} array The array to query.
  8202. * @param {number} [n=1] The number of elements to drop.
  8203. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8204. * @returns {Array} Returns the slice of `array`.
  8205. * @example
  8206. *
  8207. * _.drop([1, 2, 3]);
  8208. * // => [2, 3]
  8209. *
  8210. * _.drop([1, 2, 3], 2);
  8211. * // => [3]
  8212. *
  8213. * _.drop([1, 2, 3], 5);
  8214. * // => []
  8215. *
  8216. * _.drop([1, 2, 3], 0);
  8217. * // => [1, 2, 3]
  8218. */
  8219. function drop(array, n, guard) {
  8220. var length = array == null ? 0 : array.length;
  8221. if (!length) {
  8222. return [];
  8223. }
  8224. n = (guard || n === undefined) ? 1 : toInteger(n);
  8225. return baseSlice(array, n < 0 ? 0 : n, length);
  8226. }
  8227. /**
  8228. * Creates a slice of `array` with `n` elements dropped from the end.
  8229. *
  8230. * @static
  8231. * @memberOf _
  8232. * @since 3.0.0
  8233. * @category Array
  8234. * @param {Array} array The array to query.
  8235. * @param {number} [n=1] The number of elements to drop.
  8236. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8237. * @returns {Array} Returns the slice of `array`.
  8238. * @example
  8239. *
  8240. * _.dropRight([1, 2, 3]);
  8241. * // => [1, 2]
  8242. *
  8243. * _.dropRight([1, 2, 3], 2);
  8244. * // => [1]
  8245. *
  8246. * _.dropRight([1, 2, 3], 5);
  8247. * // => []
  8248. *
  8249. * _.dropRight([1, 2, 3], 0);
  8250. * // => [1, 2, 3]
  8251. */
  8252. function dropRight(array, n, guard) {
  8253. var length = array == null ? 0 : array.length;
  8254. if (!length) {
  8255. return [];
  8256. }
  8257. n = (guard || n === undefined) ? 1 : toInteger(n);
  8258. n = length - n;
  8259. return baseSlice(array, 0, n < 0 ? 0 : n);
  8260. }
  8261. /**
  8262. * Creates a slice of `array` excluding elements dropped from the end.
  8263. * Elements are dropped until `predicate` returns falsey. The predicate is
  8264. * invoked with three arguments: (value, index, array).
  8265. *
  8266. * @static
  8267. * @memberOf _
  8268. * @since 3.0.0
  8269. * @category Array
  8270. * @param {Array} array The array to query.
  8271. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8272. * @returns {Array} Returns the slice of `array`.
  8273. * @example
  8274. *
  8275. * var users = [
  8276. * { 'user': 'barney', 'active': true },
  8277. * { 'user': 'fred', 'active': false },
  8278. * { 'user': 'pebbles', 'active': false }
  8279. * ];
  8280. *
  8281. * _.dropRightWhile(users, function(o) { return !o.active; });
  8282. * // => objects for ['barney']
  8283. *
  8284. * // The `_.matches` iteratee shorthand.
  8285. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  8286. * // => objects for ['barney', 'fred']
  8287. *
  8288. * // The `_.matchesProperty` iteratee shorthand.
  8289. * _.dropRightWhile(users, ['active', false]);
  8290. * // => objects for ['barney']
  8291. *
  8292. * // The `_.property` iteratee shorthand.
  8293. * _.dropRightWhile(users, 'active');
  8294. * // => objects for ['barney', 'fred', 'pebbles']
  8295. */
  8296. function dropRightWhile(array, predicate) {
  8297. return (array && array.length)
  8298. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  8299. : [];
  8300. }
  8301. /**
  8302. * Creates a slice of `array` excluding elements dropped from the beginning.
  8303. * Elements are dropped until `predicate` returns falsey. The predicate is
  8304. * invoked with three arguments: (value, index, array).
  8305. *
  8306. * @static
  8307. * @memberOf _
  8308. * @since 3.0.0
  8309. * @category Array
  8310. * @param {Array} array The array to query.
  8311. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8312. * @returns {Array} Returns the slice of `array`.
  8313. * @example
  8314. *
  8315. * var users = [
  8316. * { 'user': 'barney', 'active': false },
  8317. * { 'user': 'fred', 'active': false },
  8318. * { 'user': 'pebbles', 'active': true }
  8319. * ];
  8320. *
  8321. * _.dropWhile(users, function(o) { return !o.active; });
  8322. * // => objects for ['pebbles']
  8323. *
  8324. * // The `_.matches` iteratee shorthand.
  8325. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  8326. * // => objects for ['fred', 'pebbles']
  8327. *
  8328. * // The `_.matchesProperty` iteratee shorthand.
  8329. * _.dropWhile(users, ['active', false]);
  8330. * // => objects for ['pebbles']
  8331. *
  8332. * // The `_.property` iteratee shorthand.
  8333. * _.dropWhile(users, 'active');
  8334. * // => objects for ['barney', 'fred', 'pebbles']
  8335. */
  8336. function dropWhile(array, predicate) {
  8337. return (array && array.length)
  8338. ? baseWhile(array, getIteratee(predicate, 3), true)
  8339. : [];
  8340. }
  8341. /**
  8342. * Fills elements of `array` with `value` from `start` up to, but not
  8343. * including, `end`.
  8344. *
  8345. * **Note:** This method mutates `array`.
  8346. *
  8347. * @static
  8348. * @memberOf _
  8349. * @since 3.2.0
  8350. * @category Array
  8351. * @param {Array} array The array to fill.
  8352. * @param {*} value The value to fill `array` with.
  8353. * @param {number} [start=0] The start position.
  8354. * @param {number} [end=array.length] The end position.
  8355. * @returns {Array} Returns `array`.
  8356. * @example
  8357. *
  8358. * var array = [1, 2, 3];
  8359. *
  8360. * _.fill(array, 'a');
  8361. * console.log(array);
  8362. * // => ['a', 'a', 'a']
  8363. *
  8364. * _.fill(Array(3), 2);
  8365. * // => [2, 2, 2]
  8366. *
  8367. * _.fill([4, 6, 8, 10], '*', 1, 3);
  8368. * // => [4, '*', '*', 10]
  8369. */
  8370. function fill(array, value, start, end) {
  8371. var length = array == null ? 0 : array.length;
  8372. if (!length) {
  8373. return [];
  8374. }
  8375. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  8376. start = 0;
  8377. end = length;
  8378. }
  8379. return baseFill(array, value, start, end);
  8380. }
  8381. /**
  8382. * This method is like `_.find` except that it returns the index of the first
  8383. * element `predicate` returns truthy for instead of the element itself.
  8384. *
  8385. * @static
  8386. * @memberOf _
  8387. * @since 1.1.0
  8388. * @category Array
  8389. * @param {Array} array The array to inspect.
  8390. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8391. * @param {number} [fromIndex=0] The index to search from.
  8392. * @returns {number} Returns the index of the found element, else `-1`.
  8393. * @example
  8394. *
  8395. * var users = [
  8396. * { 'user': 'barney', 'active': false },
  8397. * { 'user': 'fred', 'active': false },
  8398. * { 'user': 'pebbles', 'active': true }
  8399. * ];
  8400. *
  8401. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8402. * // => 0
  8403. *
  8404. * // The `_.matches` iteratee shorthand.
  8405. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8406. * // => 1
  8407. *
  8408. * // The `_.matchesProperty` iteratee shorthand.
  8409. * _.findIndex(users, ['active', false]);
  8410. * // => 0
  8411. *
  8412. * // The `_.property` iteratee shorthand.
  8413. * _.findIndex(users, 'active');
  8414. * // => 2
  8415. */
  8416. function findIndex(array, predicate, fromIndex) {
  8417. var length = array == null ? 0 : array.length;
  8418. if (!length) {
  8419. return -1;
  8420. }
  8421. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8422. if (index < 0) {
  8423. index = nativeMax(length + index, 0);
  8424. }
  8425. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8426. }
  8427. /**
  8428. * This method is like `_.findIndex` except that it iterates over elements
  8429. * of `collection` from right to left.
  8430. *
  8431. * @static
  8432. * @memberOf _
  8433. * @since 2.0.0
  8434. * @category Array
  8435. * @param {Array} array The array to inspect.
  8436. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8437. * @param {number} [fromIndex=array.length-1] The index to search from.
  8438. * @returns {number} Returns the index of the found element, else `-1`.
  8439. * @example
  8440. *
  8441. * var users = [
  8442. * { 'user': 'barney', 'active': true },
  8443. * { 'user': 'fred', 'active': false },
  8444. * { 'user': 'pebbles', 'active': false }
  8445. * ];
  8446. *
  8447. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8448. * // => 2
  8449. *
  8450. * // The `_.matches` iteratee shorthand.
  8451. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8452. * // => 0
  8453. *
  8454. * // The `_.matchesProperty` iteratee shorthand.
  8455. * _.findLastIndex(users, ['active', false]);
  8456. * // => 2
  8457. *
  8458. * // The `_.property` iteratee shorthand.
  8459. * _.findLastIndex(users, 'active');
  8460. * // => 0
  8461. */
  8462. function findLastIndex(array, predicate, fromIndex) {
  8463. var length = array == null ? 0 : array.length;
  8464. if (!length) {
  8465. return -1;
  8466. }
  8467. var index = length - 1;
  8468. if (fromIndex !== undefined) {
  8469. index = toInteger(fromIndex);
  8470. index = fromIndex < 0
  8471. ? nativeMax(length + index, 0)
  8472. : nativeMin(index, length - 1);
  8473. }
  8474. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8475. }
  8476. /**
  8477. * Flattens `array` a single level deep.
  8478. *
  8479. * @static
  8480. * @memberOf _
  8481. * @since 0.1.0
  8482. * @category Array
  8483. * @param {Array} array The array to flatten.
  8484. * @returns {Array} Returns the new flattened array.
  8485. * @example
  8486. *
  8487. * _.flatten([1, [2, [3, [4]], 5]]);
  8488. * // => [1, 2, [3, [4]], 5]
  8489. */
  8490. function flatten(array) {
  8491. var length = array == null ? 0 : array.length;
  8492. return length ? baseFlatten(array, 1) : [];
  8493. }
  8494. /**
  8495. * Recursively flattens `array`.
  8496. *
  8497. * @static
  8498. * @memberOf _
  8499. * @since 3.0.0
  8500. * @category Array
  8501. * @param {Array} array The array to flatten.
  8502. * @returns {Array} Returns the new flattened array.
  8503. * @example
  8504. *
  8505. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8506. * // => [1, 2, 3, 4, 5]
  8507. */
  8508. function flattenDeep(array) {
  8509. var length = array == null ? 0 : array.length;
  8510. return length ? baseFlatten(array, INFINITY) : [];
  8511. }
  8512. /**
  8513. * Recursively flatten `array` up to `depth` times.
  8514. *
  8515. * @static
  8516. * @memberOf _
  8517. * @since 4.4.0
  8518. * @category Array
  8519. * @param {Array} array The array to flatten.
  8520. * @param {number} [depth=1] The maximum recursion depth.
  8521. * @returns {Array} Returns the new flattened array.
  8522. * @example
  8523. *
  8524. * var array = [1, [2, [3, [4]], 5]];
  8525. *
  8526. * _.flattenDepth(array, 1);
  8527. * // => [1, 2, [3, [4]], 5]
  8528. *
  8529. * _.flattenDepth(array, 2);
  8530. * // => [1, 2, 3, [4], 5]
  8531. */
  8532. function flattenDepth(array, depth) {
  8533. var length = array == null ? 0 : array.length;
  8534. if (!length) {
  8535. return [];
  8536. }
  8537. depth = depth === undefined ? 1 : toInteger(depth);
  8538. return baseFlatten(array, depth);
  8539. }
  8540. /**
  8541. * The inverse of `_.toPairs`; this method returns an object composed
  8542. * from key-value `pairs`.
  8543. *
  8544. * @static
  8545. * @memberOf _
  8546. * @since 4.0.0
  8547. * @category Array
  8548. * @param {Array} pairs The key-value pairs.
  8549. * @returns {Object} Returns the new object.
  8550. * @example
  8551. *
  8552. * _.fromPairs([['a', 1], ['b', 2]]);
  8553. * // => { 'a': 1, 'b': 2 }
  8554. */
  8555. function fromPairs(pairs) {
  8556. var index = -1,
  8557. length = pairs == null ? 0 : pairs.length,
  8558. result = {};
  8559. while (++index < length) {
  8560. var pair = pairs[index];
  8561. result[pair[0]] = pair[1];
  8562. }
  8563. return result;
  8564. }
  8565. /**
  8566. * Gets the first element of `array`.
  8567. *
  8568. * @static
  8569. * @memberOf _
  8570. * @since 0.1.0
  8571. * @alias first
  8572. * @category Array
  8573. * @param {Array} array The array to query.
  8574. * @returns {*} Returns the first element of `array`.
  8575. * @example
  8576. *
  8577. * _.head([1, 2, 3]);
  8578. * // => 1
  8579. *
  8580. * _.head([]);
  8581. * // => undefined
  8582. */
  8583. function head(array) {
  8584. return (array && array.length) ? array[0] : undefined;
  8585. }
  8586. /**
  8587. * Gets the index at which the first occurrence of `value` is found in `array`
  8588. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8589. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8590. * offset from the end of `array`.
  8591. *
  8592. * @static
  8593. * @memberOf _
  8594. * @since 0.1.0
  8595. * @category Array
  8596. * @param {Array} array The array to inspect.
  8597. * @param {*} value The value to search for.
  8598. * @param {number} [fromIndex=0] The index to search from.
  8599. * @returns {number} Returns the index of the matched value, else `-1`.
  8600. * @example
  8601. *
  8602. * _.indexOf([1, 2, 1, 2], 2);
  8603. * // => 1
  8604. *
  8605. * // Search from the `fromIndex`.
  8606. * _.indexOf([1, 2, 1, 2], 2, 2);
  8607. * // => 3
  8608. */
  8609. function indexOf(array, value, fromIndex) {
  8610. var length = array == null ? 0 : array.length;
  8611. if (!length) {
  8612. return -1;
  8613. }
  8614. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8615. if (index < 0) {
  8616. index = nativeMax(length + index, 0);
  8617. }
  8618. return baseIndexOf(array, value, index);
  8619. }
  8620. /**
  8621. * Gets all but the last element of `array`.
  8622. *
  8623. * @static
  8624. * @memberOf _
  8625. * @since 0.1.0
  8626. * @category Array
  8627. * @param {Array} array The array to query.
  8628. * @returns {Array} Returns the slice of `array`.
  8629. * @example
  8630. *
  8631. * _.initial([1, 2, 3]);
  8632. * // => [1, 2]
  8633. */
  8634. function initial(array) {
  8635. var length = array == null ? 0 : array.length;
  8636. return length ? baseSlice(array, 0, -1) : [];
  8637. }
  8638. /**
  8639. * Creates an array of unique values that are included in all given arrays
  8640. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8641. * for equality comparisons. The order and references of result values are
  8642. * determined by the first array.
  8643. *
  8644. * @static
  8645. * @memberOf _
  8646. * @since 0.1.0
  8647. * @category Array
  8648. * @param {...Array} [arrays] The arrays to inspect.
  8649. * @returns {Array} Returns the new array of intersecting values.
  8650. * @example
  8651. *
  8652. * _.intersection([2, 1], [2, 3]);
  8653. * // => [2]
  8654. */
  8655. var intersection = baseRest(function(arrays) {
  8656. var mapped = arrayMap(arrays, castArrayLikeObject);
  8657. return (mapped.length && mapped[0] === arrays[0])
  8658. ? baseIntersection(mapped)
  8659. : [];
  8660. });
  8661. /**
  8662. * This method is like `_.intersection` except that it accepts `iteratee`
  8663. * which is invoked for each element of each `arrays` to generate the criterion
  8664. * by which they're compared. The order and references of result values are
  8665. * determined by the first array. The iteratee is invoked with one argument:
  8666. * (value).
  8667. *
  8668. * @static
  8669. * @memberOf _
  8670. * @since 4.0.0
  8671. * @category Array
  8672. * @param {...Array} [arrays] The arrays to inspect.
  8673. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8674. * @returns {Array} Returns the new array of intersecting values.
  8675. * @example
  8676. *
  8677. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8678. * // => [2.1]
  8679. *
  8680. * // The `_.property` iteratee shorthand.
  8681. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8682. * // => [{ 'x': 1 }]
  8683. */
  8684. var intersectionBy = baseRest(function(arrays) {
  8685. var iteratee = last(arrays),
  8686. mapped = arrayMap(arrays, castArrayLikeObject);
  8687. if (iteratee === last(mapped)) {
  8688. iteratee = undefined;
  8689. } else {
  8690. mapped.pop();
  8691. }
  8692. return (mapped.length && mapped[0] === arrays[0])
  8693. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8694. : [];
  8695. });
  8696. /**
  8697. * This method is like `_.intersection` except that it accepts `comparator`
  8698. * which is invoked to compare elements of `arrays`. The order and references
  8699. * of result values are determined by the first array. The comparator is
  8700. * invoked with two arguments: (arrVal, othVal).
  8701. *
  8702. * @static
  8703. * @memberOf _
  8704. * @since 4.0.0
  8705. * @category Array
  8706. * @param {...Array} [arrays] The arrays to inspect.
  8707. * @param {Function} [comparator] The comparator invoked per element.
  8708. * @returns {Array} Returns the new array of intersecting values.
  8709. * @example
  8710. *
  8711. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8712. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8713. *
  8714. * _.intersectionWith(objects, others, _.isEqual);
  8715. * // => [{ 'x': 1, 'y': 2 }]
  8716. */
  8717. var intersectionWith = baseRest(function(arrays) {
  8718. var comparator = last(arrays),
  8719. mapped = arrayMap(arrays, castArrayLikeObject);
  8720. comparator = typeof comparator == 'function' ? comparator : undefined;
  8721. if (comparator) {
  8722. mapped.pop();
  8723. }
  8724. return (mapped.length && mapped[0] === arrays[0])
  8725. ? baseIntersection(mapped, undefined, comparator)
  8726. : [];
  8727. });
  8728. /**
  8729. * Converts all elements in `array` into a string separated by `separator`.
  8730. *
  8731. * @static
  8732. * @memberOf _
  8733. * @since 4.0.0
  8734. * @category Array
  8735. * @param {Array} array The array to convert.
  8736. * @param {string} [separator=','] The element separator.
  8737. * @returns {string} Returns the joined string.
  8738. * @example
  8739. *
  8740. * _.join(['a', 'b', 'c'], '~');
  8741. * // => 'a~b~c'
  8742. */
  8743. function join(array, separator) {
  8744. return array == null ? '' : nativeJoin.call(array, separator);
  8745. }
  8746. /**
  8747. * Gets the last element of `array`.
  8748. *
  8749. * @static
  8750. * @memberOf _
  8751. * @since 0.1.0
  8752. * @category Array
  8753. * @param {Array} array The array to query.
  8754. * @returns {*} Returns the last element of `array`.
  8755. * @example
  8756. *
  8757. * _.last([1, 2, 3]);
  8758. * // => 3
  8759. */
  8760. function last(array) {
  8761. var length = array == null ? 0 : array.length;
  8762. return length ? array[length - 1] : undefined;
  8763. }
  8764. /**
  8765. * This method is like `_.indexOf` except that it iterates over elements of
  8766. * `array` from right to left.
  8767. *
  8768. * @static
  8769. * @memberOf _
  8770. * @since 0.1.0
  8771. * @category Array
  8772. * @param {Array} array The array to inspect.
  8773. * @param {*} value The value to search for.
  8774. * @param {number} [fromIndex=array.length-1] The index to search from.
  8775. * @returns {number} Returns the index of the matched value, else `-1`.
  8776. * @example
  8777. *
  8778. * _.lastIndexOf([1, 2, 1, 2], 2);
  8779. * // => 3
  8780. *
  8781. * // Search from the `fromIndex`.
  8782. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8783. * // => 1
  8784. */
  8785. function lastIndexOf(array, value, fromIndex) {
  8786. var length = array == null ? 0 : array.length;
  8787. if (!length) {
  8788. return -1;
  8789. }
  8790. var index = length;
  8791. if (fromIndex !== undefined) {
  8792. index = toInteger(fromIndex);
  8793. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8794. }
  8795. return value === value
  8796. ? strictLastIndexOf(array, value, index)
  8797. : baseFindIndex(array, baseIsNaN, index, true);
  8798. }
  8799. /**
  8800. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8801. * element from the end is returned.
  8802. *
  8803. * @static
  8804. * @memberOf _
  8805. * @since 4.11.0
  8806. * @category Array
  8807. * @param {Array} array The array to query.
  8808. * @param {number} [n=0] The index of the element to return.
  8809. * @returns {*} Returns the nth element of `array`.
  8810. * @example
  8811. *
  8812. * var array = ['a', 'b', 'c', 'd'];
  8813. *
  8814. * _.nth(array, 1);
  8815. * // => 'b'
  8816. *
  8817. * _.nth(array, -2);
  8818. * // => 'c';
  8819. */
  8820. function nth(array, n) {
  8821. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8822. }
  8823. /**
  8824. * Removes all given values from `array` using
  8825. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8826. * for equality comparisons.
  8827. *
  8828. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8829. * to remove elements from an array by predicate.
  8830. *
  8831. * @static
  8832. * @memberOf _
  8833. * @since 2.0.0
  8834. * @category Array
  8835. * @param {Array} array The array to modify.
  8836. * @param {...*} [values] The values to remove.
  8837. * @returns {Array} Returns `array`.
  8838. * @example
  8839. *
  8840. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8841. *
  8842. * _.pull(array, 'a', 'c');
  8843. * console.log(array);
  8844. * // => ['b', 'b']
  8845. */
  8846. var pull = baseRest(pullAll);
  8847. /**
  8848. * This method is like `_.pull` except that it accepts an array of values to remove.
  8849. *
  8850. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8851. *
  8852. * @static
  8853. * @memberOf _
  8854. * @since 4.0.0
  8855. * @category Array
  8856. * @param {Array} array The array to modify.
  8857. * @param {Array} values The values to remove.
  8858. * @returns {Array} Returns `array`.
  8859. * @example
  8860. *
  8861. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8862. *
  8863. * _.pullAll(array, ['a', 'c']);
  8864. * console.log(array);
  8865. * // => ['b', 'b']
  8866. */
  8867. function pullAll(array, values) {
  8868. return (array && array.length && values && values.length)
  8869. ? basePullAll(array, values)
  8870. : array;
  8871. }
  8872. /**
  8873. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8874. * invoked for each element of `array` and `values` to generate the criterion
  8875. * by which they're compared. The iteratee is invoked with one argument: (value).
  8876. *
  8877. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8878. *
  8879. * @static
  8880. * @memberOf _
  8881. * @since 4.0.0
  8882. * @category Array
  8883. * @param {Array} array The array to modify.
  8884. * @param {Array} values The values to remove.
  8885. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8886. * @returns {Array} Returns `array`.
  8887. * @example
  8888. *
  8889. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8890. *
  8891. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8892. * console.log(array);
  8893. * // => [{ 'x': 2 }]
  8894. */
  8895. function pullAllBy(array, values, iteratee) {
  8896. return (array && array.length && values && values.length)
  8897. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8898. : array;
  8899. }
  8900. /**
  8901. * This method is like `_.pullAll` except that it accepts `comparator` which
  8902. * is invoked to compare elements of `array` to `values`. The comparator is
  8903. * invoked with two arguments: (arrVal, othVal).
  8904. *
  8905. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8906. *
  8907. * @static
  8908. * @memberOf _
  8909. * @since 4.6.0
  8910. * @category Array
  8911. * @param {Array} array The array to modify.
  8912. * @param {Array} values The values to remove.
  8913. * @param {Function} [comparator] The comparator invoked per element.
  8914. * @returns {Array} Returns `array`.
  8915. * @example
  8916. *
  8917. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8918. *
  8919. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8920. * console.log(array);
  8921. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8922. */
  8923. function pullAllWith(array, values, comparator) {
  8924. return (array && array.length && values && values.length)
  8925. ? basePullAll(array, values, undefined, comparator)
  8926. : array;
  8927. }
  8928. /**
  8929. * Removes elements from `array` corresponding to `indexes` and returns an
  8930. * array of removed elements.
  8931. *
  8932. * **Note:** Unlike `_.at`, this method mutates `array`.
  8933. *
  8934. * @static
  8935. * @memberOf _
  8936. * @since 3.0.0
  8937. * @category Array
  8938. * @param {Array} array The array to modify.
  8939. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8940. * @returns {Array} Returns the new array of removed elements.
  8941. * @example
  8942. *
  8943. * var array = ['a', 'b', 'c', 'd'];
  8944. * var pulled = _.pullAt(array, [1, 3]);
  8945. *
  8946. * console.log(array);
  8947. * // => ['a', 'c']
  8948. *
  8949. * console.log(pulled);
  8950. * // => ['b', 'd']
  8951. */
  8952. var pullAt = flatRest(function(array, indexes) {
  8953. var length = array == null ? 0 : array.length,
  8954. result = baseAt(array, indexes);
  8955. basePullAt(array, arrayMap(indexes, function(index) {
  8956. return isIndex(index, length) ? +index : index;
  8957. }).sort(compareAscending));
  8958. return result;
  8959. });
  8960. /**
  8961. * Removes all elements from `array` that `predicate` returns truthy for
  8962. * and returns an array of the removed elements. The predicate is invoked
  8963. * with three arguments: (value, index, array).
  8964. *
  8965. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8966. * to pull elements from an array by value.
  8967. *
  8968. * @static
  8969. * @memberOf _
  8970. * @since 2.0.0
  8971. * @category Array
  8972. * @param {Array} array The array to modify.
  8973. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8974. * @returns {Array} Returns the new array of removed elements.
  8975. * @example
  8976. *
  8977. * var array = [1, 2, 3, 4];
  8978. * var evens = _.remove(array, function(n) {
  8979. * return n % 2 == 0;
  8980. * });
  8981. *
  8982. * console.log(array);
  8983. * // => [1, 3]
  8984. *
  8985. * console.log(evens);
  8986. * // => [2, 4]
  8987. */
  8988. function remove(array, predicate) {
  8989. var result = [];
  8990. if (!(array && array.length)) {
  8991. return result;
  8992. }
  8993. var index = -1,
  8994. indexes = [],
  8995. length = array.length;
  8996. predicate = getIteratee(predicate, 3);
  8997. while (++index < length) {
  8998. var value = array[index];
  8999. if (predicate(value, index, array)) {
  9000. result.push(value);
  9001. indexes.push(index);
  9002. }
  9003. }
  9004. basePullAt(array, indexes);
  9005. return result;
  9006. }
  9007. /**
  9008. * Reverses `array` so that the first element becomes the last, the second
  9009. * element becomes the second to last, and so on.
  9010. *
  9011. * **Note:** This method mutates `array` and is based on
  9012. * [`Array#reverse`](https://mdn.io/Array/reverse).
  9013. *
  9014. * @static
  9015. * @memberOf _
  9016. * @since 4.0.0
  9017. * @category Array
  9018. * @param {Array} array The array to modify.
  9019. * @returns {Array} Returns `array`.
  9020. * @example
  9021. *
  9022. * var array = [1, 2, 3];
  9023. *
  9024. * _.reverse(array);
  9025. * // => [3, 2, 1]
  9026. *
  9027. * console.log(array);
  9028. * // => [3, 2, 1]
  9029. */
  9030. function reverse(array) {
  9031. return array == null ? array : nativeReverse.call(array);
  9032. }
  9033. /**
  9034. * Creates a slice of `array` from `start` up to, but not including, `end`.
  9035. *
  9036. * **Note:** This method is used instead of
  9037. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  9038. * returned.
  9039. *
  9040. * @static
  9041. * @memberOf _
  9042. * @since 3.0.0
  9043. * @category Array
  9044. * @param {Array} array The array to slice.
  9045. * @param {number} [start=0] The start position.
  9046. * @param {number} [end=array.length] The end position.
  9047. * @returns {Array} Returns the slice of `array`.
  9048. */
  9049. function slice(array, start, end) {
  9050. var length = array == null ? 0 : array.length;
  9051. if (!length) {
  9052. return [];
  9053. }
  9054. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  9055. start = 0;
  9056. end = length;
  9057. }
  9058. else {
  9059. start = start == null ? 0 : toInteger(start);
  9060. end = end === undefined ? length : toInteger(end);
  9061. }
  9062. return baseSlice(array, start, end);
  9063. }
  9064. /**
  9065. * Uses a binary search to determine the lowest index at which `value`
  9066. * should be inserted into `array` in order to maintain its sort order.
  9067. *
  9068. * @static
  9069. * @memberOf _
  9070. * @since 0.1.0
  9071. * @category Array
  9072. * @param {Array} array The sorted array to inspect.
  9073. * @param {*} value The value to evaluate.
  9074. * @returns {number} Returns the index at which `value` should be inserted
  9075. * into `array`.
  9076. * @example
  9077. *
  9078. * _.sortedIndex([30, 50], 40);
  9079. * // => 1
  9080. */
  9081. function sortedIndex(array, value) {
  9082. return baseSortedIndex(array, value);
  9083. }
  9084. /**
  9085. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  9086. * which is invoked for `value` and each element of `array` to compute their
  9087. * sort ranking. The iteratee is invoked with one argument: (value).
  9088. *
  9089. * @static
  9090. * @memberOf _
  9091. * @since 4.0.0
  9092. * @category Array
  9093. * @param {Array} array The sorted array to inspect.
  9094. * @param {*} value The value to evaluate.
  9095. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9096. * @returns {number} Returns the index at which `value` should be inserted
  9097. * into `array`.
  9098. * @example
  9099. *
  9100. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9101. *
  9102. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9103. * // => 0
  9104. *
  9105. * // The `_.property` iteratee shorthand.
  9106. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  9107. * // => 0
  9108. */
  9109. function sortedIndexBy(array, value, iteratee) {
  9110. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  9111. }
  9112. /**
  9113. * This method is like `_.indexOf` except that it performs a binary
  9114. * search on a sorted `array`.
  9115. *
  9116. * @static
  9117. * @memberOf _
  9118. * @since 4.0.0
  9119. * @category Array
  9120. * @param {Array} array The array to inspect.
  9121. * @param {*} value The value to search for.
  9122. * @returns {number} Returns the index of the matched value, else `-1`.
  9123. * @example
  9124. *
  9125. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  9126. * // => 1
  9127. */
  9128. function sortedIndexOf(array, value) {
  9129. var length = array == null ? 0 : array.length;
  9130. if (length) {
  9131. var index = baseSortedIndex(array, value);
  9132. if (index < length && eq(array[index], value)) {
  9133. return index;
  9134. }
  9135. }
  9136. return -1;
  9137. }
  9138. /**
  9139. * This method is like `_.sortedIndex` except that it returns the highest
  9140. * index at which `value` should be inserted into `array` in order to
  9141. * maintain its sort order.
  9142. *
  9143. * @static
  9144. * @memberOf _
  9145. * @since 3.0.0
  9146. * @category Array
  9147. * @param {Array} array The sorted array to inspect.
  9148. * @param {*} value The value to evaluate.
  9149. * @returns {number} Returns the index at which `value` should be inserted
  9150. * into `array`.
  9151. * @example
  9152. *
  9153. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  9154. * // => 4
  9155. */
  9156. function sortedLastIndex(array, value) {
  9157. return baseSortedIndex(array, value, true);
  9158. }
  9159. /**
  9160. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  9161. * which is invoked for `value` and each element of `array` to compute their
  9162. * sort ranking. The iteratee is invoked with one argument: (value).
  9163. *
  9164. * @static
  9165. * @memberOf _
  9166. * @since 4.0.0
  9167. * @category Array
  9168. * @param {Array} array The sorted array to inspect.
  9169. * @param {*} value The value to evaluate.
  9170. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9171. * @returns {number} Returns the index at which `value` should be inserted
  9172. * into `array`.
  9173. * @example
  9174. *
  9175. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9176. *
  9177. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9178. * // => 1
  9179. *
  9180. * // The `_.property` iteratee shorthand.
  9181. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  9182. * // => 1
  9183. */
  9184. function sortedLastIndexBy(array, value, iteratee) {
  9185. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  9186. }
  9187. /**
  9188. * This method is like `_.lastIndexOf` except that it performs a binary
  9189. * search on a sorted `array`.
  9190. *
  9191. * @static
  9192. * @memberOf _
  9193. * @since 4.0.0
  9194. * @category Array
  9195. * @param {Array} array The array to inspect.
  9196. * @param {*} value The value to search for.
  9197. * @returns {number} Returns the index of the matched value, else `-1`.
  9198. * @example
  9199. *
  9200. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  9201. * // => 3
  9202. */
  9203. function sortedLastIndexOf(array, value) {
  9204. var length = array == null ? 0 : array.length;
  9205. if (length) {
  9206. var index = baseSortedIndex(array, value, true) - 1;
  9207. if (eq(array[index], value)) {
  9208. return index;
  9209. }
  9210. }
  9211. return -1;
  9212. }
  9213. /**
  9214. * This method is like `_.uniq` except that it's designed and optimized
  9215. * for sorted arrays.
  9216. *
  9217. * @static
  9218. * @memberOf _
  9219. * @since 4.0.0
  9220. * @category Array
  9221. * @param {Array} array The array to inspect.
  9222. * @returns {Array} Returns the new duplicate free array.
  9223. * @example
  9224. *
  9225. * _.sortedUniq([1, 1, 2]);
  9226. * // => [1, 2]
  9227. */
  9228. function sortedUniq(array) {
  9229. return (array && array.length)
  9230. ? baseSortedUniq(array)
  9231. : [];
  9232. }
  9233. /**
  9234. * This method is like `_.uniqBy` except that it's designed and optimized
  9235. * for sorted arrays.
  9236. *
  9237. * @static
  9238. * @memberOf _
  9239. * @since 4.0.0
  9240. * @category Array
  9241. * @param {Array} array The array to inspect.
  9242. * @param {Function} [iteratee] The iteratee invoked per element.
  9243. * @returns {Array} Returns the new duplicate free array.
  9244. * @example
  9245. *
  9246. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  9247. * // => [1.1, 2.3]
  9248. */
  9249. function sortedUniqBy(array, iteratee) {
  9250. return (array && array.length)
  9251. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  9252. : [];
  9253. }
  9254. /**
  9255. * Gets all but the first element of `array`.
  9256. *
  9257. * @static
  9258. * @memberOf _
  9259. * @since 4.0.0
  9260. * @category Array
  9261. * @param {Array} array The array to query.
  9262. * @returns {Array} Returns the slice of `array`.
  9263. * @example
  9264. *
  9265. * _.tail([1, 2, 3]);
  9266. * // => [2, 3]
  9267. */
  9268. function tail(array) {
  9269. var length = array == null ? 0 : array.length;
  9270. return length ? baseSlice(array, 1, length) : [];
  9271. }
  9272. /**
  9273. * Creates a slice of `array` with `n` elements taken from the beginning.
  9274. *
  9275. * @static
  9276. * @memberOf _
  9277. * @since 0.1.0
  9278. * @category Array
  9279. * @param {Array} array The array to query.
  9280. * @param {number} [n=1] The number of elements to take.
  9281. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9282. * @returns {Array} Returns the slice of `array`.
  9283. * @example
  9284. *
  9285. * _.take([1, 2, 3]);
  9286. * // => [1]
  9287. *
  9288. * _.take([1, 2, 3], 2);
  9289. * // => [1, 2]
  9290. *
  9291. * _.take([1, 2, 3], 5);
  9292. * // => [1, 2, 3]
  9293. *
  9294. * _.take([1, 2, 3], 0);
  9295. * // => []
  9296. */
  9297. function take(array, n, guard) {
  9298. if (!(array && array.length)) {
  9299. return [];
  9300. }
  9301. n = (guard || n === undefined) ? 1 : toInteger(n);
  9302. return baseSlice(array, 0, n < 0 ? 0 : n);
  9303. }
  9304. /**
  9305. * Creates a slice of `array` with `n` elements taken from the end.
  9306. *
  9307. * @static
  9308. * @memberOf _
  9309. * @since 3.0.0
  9310. * @category Array
  9311. * @param {Array} array The array to query.
  9312. * @param {number} [n=1] The number of elements to take.
  9313. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9314. * @returns {Array} Returns the slice of `array`.
  9315. * @example
  9316. *
  9317. * _.takeRight([1, 2, 3]);
  9318. * // => [3]
  9319. *
  9320. * _.takeRight([1, 2, 3], 2);
  9321. * // => [2, 3]
  9322. *
  9323. * _.takeRight([1, 2, 3], 5);
  9324. * // => [1, 2, 3]
  9325. *
  9326. * _.takeRight([1, 2, 3], 0);
  9327. * // => []
  9328. */
  9329. function takeRight(array, n, guard) {
  9330. var length = array == null ? 0 : array.length;
  9331. if (!length) {
  9332. return [];
  9333. }
  9334. n = (guard || n === undefined) ? 1 : toInteger(n);
  9335. n = length - n;
  9336. return baseSlice(array, n < 0 ? 0 : n, length);
  9337. }
  9338. /**
  9339. * Creates a slice of `array` with elements taken from the end. Elements are
  9340. * taken until `predicate` returns falsey. The predicate is invoked with
  9341. * three arguments: (value, index, array).
  9342. *
  9343. * @static
  9344. * @memberOf _
  9345. * @since 3.0.0
  9346. * @category Array
  9347. * @param {Array} array The array to query.
  9348. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9349. * @returns {Array} Returns the slice of `array`.
  9350. * @example
  9351. *
  9352. * var users = [
  9353. * { 'user': 'barney', 'active': true },
  9354. * { 'user': 'fred', 'active': false },
  9355. * { 'user': 'pebbles', 'active': false }
  9356. * ];
  9357. *
  9358. * _.takeRightWhile(users, function(o) { return !o.active; });
  9359. * // => objects for ['fred', 'pebbles']
  9360. *
  9361. * // The `_.matches` iteratee shorthand.
  9362. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  9363. * // => objects for ['pebbles']
  9364. *
  9365. * // The `_.matchesProperty` iteratee shorthand.
  9366. * _.takeRightWhile(users, ['active', false]);
  9367. * // => objects for ['fred', 'pebbles']
  9368. *
  9369. * // The `_.property` iteratee shorthand.
  9370. * _.takeRightWhile(users, 'active');
  9371. * // => []
  9372. */
  9373. function takeRightWhile(array, predicate) {
  9374. return (array && array.length)
  9375. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  9376. : [];
  9377. }
  9378. /**
  9379. * Creates a slice of `array` with elements taken from the beginning. Elements
  9380. * are taken until `predicate` returns falsey. The predicate is invoked with
  9381. * three arguments: (value, index, array).
  9382. *
  9383. * @static
  9384. * @memberOf _
  9385. * @since 3.0.0
  9386. * @category Array
  9387. * @param {Array} array The array to query.
  9388. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9389. * @returns {Array} Returns the slice of `array`.
  9390. * @example
  9391. *
  9392. * var users = [
  9393. * { 'user': 'barney', 'active': false },
  9394. * { 'user': 'fred', 'active': false },
  9395. * { 'user': 'pebbles', 'active': true }
  9396. * ];
  9397. *
  9398. * _.takeWhile(users, function(o) { return !o.active; });
  9399. * // => objects for ['barney', 'fred']
  9400. *
  9401. * // The `_.matches` iteratee shorthand.
  9402. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9403. * // => objects for ['barney']
  9404. *
  9405. * // The `_.matchesProperty` iteratee shorthand.
  9406. * _.takeWhile(users, ['active', false]);
  9407. * // => objects for ['barney', 'fred']
  9408. *
  9409. * // The `_.property` iteratee shorthand.
  9410. * _.takeWhile(users, 'active');
  9411. * // => []
  9412. */
  9413. function takeWhile(array, predicate) {
  9414. return (array && array.length)
  9415. ? baseWhile(array, getIteratee(predicate, 3))
  9416. : [];
  9417. }
  9418. /**
  9419. * Creates an array of unique values, in order, from all given arrays using
  9420. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9421. * for equality comparisons.
  9422. *
  9423. * @static
  9424. * @memberOf _
  9425. * @since 0.1.0
  9426. * @category Array
  9427. * @param {...Array} [arrays] The arrays to inspect.
  9428. * @returns {Array} Returns the new array of combined values.
  9429. * @example
  9430. *
  9431. * _.union([2], [1, 2]);
  9432. * // => [2, 1]
  9433. */
  9434. var union = baseRest(function(arrays) {
  9435. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9436. });
  9437. /**
  9438. * This method is like `_.union` except that it accepts `iteratee` which is
  9439. * invoked for each element of each `arrays` to generate the criterion by
  9440. * which uniqueness is computed. Result values are chosen from the first
  9441. * array in which the value occurs. The iteratee is invoked with one argument:
  9442. * (value).
  9443. *
  9444. * @static
  9445. * @memberOf _
  9446. * @since 4.0.0
  9447. * @category Array
  9448. * @param {...Array} [arrays] The arrays to inspect.
  9449. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9450. * @returns {Array} Returns the new array of combined values.
  9451. * @example
  9452. *
  9453. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9454. * // => [2.1, 1.2]
  9455. *
  9456. * // The `_.property` iteratee shorthand.
  9457. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9458. * // => [{ 'x': 1 }, { 'x': 2 }]
  9459. */
  9460. var unionBy = baseRest(function(arrays) {
  9461. var iteratee = last(arrays);
  9462. if (isArrayLikeObject(iteratee)) {
  9463. iteratee = undefined;
  9464. }
  9465. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9466. });
  9467. /**
  9468. * This method is like `_.union` except that it accepts `comparator` which
  9469. * is invoked to compare elements of `arrays`. Result values are chosen from
  9470. * the first array in which the value occurs. The comparator is invoked
  9471. * with two arguments: (arrVal, othVal).
  9472. *
  9473. * @static
  9474. * @memberOf _
  9475. * @since 4.0.0
  9476. * @category Array
  9477. * @param {...Array} [arrays] The arrays to inspect.
  9478. * @param {Function} [comparator] The comparator invoked per element.
  9479. * @returns {Array} Returns the new array of combined values.
  9480. * @example
  9481. *
  9482. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9483. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9484. *
  9485. * _.unionWith(objects, others, _.isEqual);
  9486. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9487. */
  9488. var unionWith = baseRest(function(arrays) {
  9489. var comparator = last(arrays);
  9490. comparator = typeof comparator == 'function' ? comparator : undefined;
  9491. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9492. });
  9493. /**
  9494. * Creates a duplicate-free version of an array, using
  9495. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9496. * for equality comparisons, in which only the first occurrence of each element
  9497. * is kept. The order of result values is determined by the order they occur
  9498. * in the array.
  9499. *
  9500. * @static
  9501. * @memberOf _
  9502. * @since 0.1.0
  9503. * @category Array
  9504. * @param {Array} array The array to inspect.
  9505. * @returns {Array} Returns the new duplicate free array.
  9506. * @example
  9507. *
  9508. * _.uniq([2, 1, 2]);
  9509. * // => [2, 1]
  9510. */
  9511. function uniq(array) {
  9512. return (array && array.length) ? baseUniq(array) : [];
  9513. }
  9514. /**
  9515. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9516. * invoked for each element in `array` to generate the criterion by which
  9517. * uniqueness is computed. The order of result values is determined by the
  9518. * order they occur in the array. The iteratee is invoked with one argument:
  9519. * (value).
  9520. *
  9521. * @static
  9522. * @memberOf _
  9523. * @since 4.0.0
  9524. * @category Array
  9525. * @param {Array} array The array to inspect.
  9526. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9527. * @returns {Array} Returns the new duplicate free array.
  9528. * @example
  9529. *
  9530. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9531. * // => [2.1, 1.2]
  9532. *
  9533. * // The `_.property` iteratee shorthand.
  9534. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9535. * // => [{ 'x': 1 }, { 'x': 2 }]
  9536. */
  9537. function uniqBy(array, iteratee) {
  9538. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9539. }
  9540. /**
  9541. * This method is like `_.uniq` except that it accepts `comparator` which
  9542. * is invoked to compare elements of `array`. The order of result values is
  9543. * determined by the order they occur in the array.The comparator is invoked
  9544. * with two arguments: (arrVal, othVal).
  9545. *
  9546. * @static
  9547. * @memberOf _
  9548. * @since 4.0.0
  9549. * @category Array
  9550. * @param {Array} array The array to inspect.
  9551. * @param {Function} [comparator] The comparator invoked per element.
  9552. * @returns {Array} Returns the new duplicate free array.
  9553. * @example
  9554. *
  9555. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9556. *
  9557. * _.uniqWith(objects, _.isEqual);
  9558. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9559. */
  9560. function uniqWith(array, comparator) {
  9561. comparator = typeof comparator == 'function' ? comparator : undefined;
  9562. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9563. }
  9564. /**
  9565. * This method is like `_.zip` except that it accepts an array of grouped
  9566. * elements and creates an array regrouping the elements to their pre-zip
  9567. * configuration.
  9568. *
  9569. * @static
  9570. * @memberOf _
  9571. * @since 1.2.0
  9572. * @category Array
  9573. * @param {Array} array The array of grouped elements to process.
  9574. * @returns {Array} Returns the new array of regrouped elements.
  9575. * @example
  9576. *
  9577. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9578. * // => [['a', 1, true], ['b', 2, false]]
  9579. *
  9580. * _.unzip(zipped);
  9581. * // => [['a', 'b'], [1, 2], [true, false]]
  9582. */
  9583. function unzip(array) {
  9584. if (!(array && array.length)) {
  9585. return [];
  9586. }
  9587. var length = 0;
  9588. array = arrayFilter(array, function(group) {
  9589. if (isArrayLikeObject(group)) {
  9590. length = nativeMax(group.length, length);
  9591. return true;
  9592. }
  9593. });
  9594. return baseTimes(length, function(index) {
  9595. return arrayMap(array, baseProperty(index));
  9596. });
  9597. }
  9598. /**
  9599. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9600. * how regrouped values should be combined. The iteratee is invoked with the
  9601. * elements of each group: (...group).
  9602. *
  9603. * @static
  9604. * @memberOf _
  9605. * @since 3.8.0
  9606. * @category Array
  9607. * @param {Array} array The array of grouped elements to process.
  9608. * @param {Function} [iteratee=_.identity] The function to combine
  9609. * regrouped values.
  9610. * @returns {Array} Returns the new array of regrouped elements.
  9611. * @example
  9612. *
  9613. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9614. * // => [[1, 10, 100], [2, 20, 200]]
  9615. *
  9616. * _.unzipWith(zipped, _.add);
  9617. * // => [3, 30, 300]
  9618. */
  9619. function unzipWith(array, iteratee) {
  9620. if (!(array && array.length)) {
  9621. return [];
  9622. }
  9623. var result = unzip(array);
  9624. if (iteratee == null) {
  9625. return result;
  9626. }
  9627. return arrayMap(result, function(group) {
  9628. return apply(iteratee, undefined, group);
  9629. });
  9630. }
  9631. /**
  9632. * Creates an array excluding all given values using
  9633. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9634. * for equality comparisons.
  9635. *
  9636. * **Note:** Unlike `_.pull`, this method returns a new array.
  9637. *
  9638. * @static
  9639. * @memberOf _
  9640. * @since 0.1.0
  9641. * @category Array
  9642. * @param {Array} array The array to inspect.
  9643. * @param {...*} [values] The values to exclude.
  9644. * @returns {Array} Returns the new array of filtered values.
  9645. * @see _.difference, _.xor
  9646. * @example
  9647. *
  9648. * _.without([2, 1, 2, 3], 1, 2);
  9649. * // => [3]
  9650. */
  9651. var without = baseRest(function(array, values) {
  9652. return isArrayLikeObject(array)
  9653. ? baseDifference(array, values)
  9654. : [];
  9655. });
  9656. /**
  9657. * Creates an array of unique values that is the
  9658. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9659. * of the given arrays. The order of result values is determined by the order
  9660. * they occur in the arrays.
  9661. *
  9662. * @static
  9663. * @memberOf _
  9664. * @since 2.4.0
  9665. * @category Array
  9666. * @param {...Array} [arrays] The arrays to inspect.
  9667. * @returns {Array} Returns the new array of filtered values.
  9668. * @see _.difference, _.without
  9669. * @example
  9670. *
  9671. * _.xor([2, 1], [2, 3]);
  9672. * // => [1, 3]
  9673. */
  9674. var xor = baseRest(function(arrays) {
  9675. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9676. });
  9677. /**
  9678. * This method is like `_.xor` except that it accepts `iteratee` which is
  9679. * invoked for each element of each `arrays` to generate the criterion by
  9680. * which by which they're compared. The order of result values is determined
  9681. * by the order they occur in the arrays. The iteratee is invoked with one
  9682. * argument: (value).
  9683. *
  9684. * @static
  9685. * @memberOf _
  9686. * @since 4.0.0
  9687. * @category Array
  9688. * @param {...Array} [arrays] The arrays to inspect.
  9689. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9690. * @returns {Array} Returns the new array of filtered values.
  9691. * @example
  9692. *
  9693. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9694. * // => [1.2, 3.4]
  9695. *
  9696. * // The `_.property` iteratee shorthand.
  9697. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9698. * // => [{ 'x': 2 }]
  9699. */
  9700. var xorBy = baseRest(function(arrays) {
  9701. var iteratee = last(arrays);
  9702. if (isArrayLikeObject(iteratee)) {
  9703. iteratee = undefined;
  9704. }
  9705. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9706. });
  9707. /**
  9708. * This method is like `_.xor` except that it accepts `comparator` which is
  9709. * invoked to compare elements of `arrays`. The order of result values is
  9710. * determined by the order they occur in the arrays. The comparator is invoked
  9711. * with two arguments: (arrVal, othVal).
  9712. *
  9713. * @static
  9714. * @memberOf _
  9715. * @since 4.0.0
  9716. * @category Array
  9717. * @param {...Array} [arrays] The arrays to inspect.
  9718. * @param {Function} [comparator] The comparator invoked per element.
  9719. * @returns {Array} Returns the new array of filtered values.
  9720. * @example
  9721. *
  9722. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9723. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9724. *
  9725. * _.xorWith(objects, others, _.isEqual);
  9726. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9727. */
  9728. var xorWith = baseRest(function(arrays) {
  9729. var comparator = last(arrays);
  9730. comparator = typeof comparator == 'function' ? comparator : undefined;
  9731. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9732. });
  9733. /**
  9734. * Creates an array of grouped elements, the first of which contains the
  9735. * first elements of the given arrays, the second of which contains the
  9736. * second elements of the given arrays, and so on.
  9737. *
  9738. * @static
  9739. * @memberOf _
  9740. * @since 0.1.0
  9741. * @category Array
  9742. * @param {...Array} [arrays] The arrays to process.
  9743. * @returns {Array} Returns the new array of grouped elements.
  9744. * @example
  9745. *
  9746. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9747. * // => [['a', 1, true], ['b', 2, false]]
  9748. */
  9749. var zip = baseRest(unzip);
  9750. /**
  9751. * This method is like `_.fromPairs` except that it accepts two arrays,
  9752. * one of property identifiers and one of corresponding values.
  9753. *
  9754. * @static
  9755. * @memberOf _
  9756. * @since 0.4.0
  9757. * @category Array
  9758. * @param {Array} [props=[]] The property identifiers.
  9759. * @param {Array} [values=[]] The property values.
  9760. * @returns {Object} Returns the new object.
  9761. * @example
  9762. *
  9763. * _.zipObject(['a', 'b'], [1, 2]);
  9764. * // => { 'a': 1, 'b': 2 }
  9765. */
  9766. function zipObject(props, values) {
  9767. return baseZipObject(props || [], values || [], assignValue);
  9768. }
  9769. /**
  9770. * This method is like `_.zipObject` except that it supports property paths.
  9771. *
  9772. * @static
  9773. * @memberOf _
  9774. * @since 4.1.0
  9775. * @category Array
  9776. * @param {Array} [props=[]] The property identifiers.
  9777. * @param {Array} [values=[]] The property values.
  9778. * @returns {Object} Returns the new object.
  9779. * @example
  9780. *
  9781. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9782. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9783. */
  9784. function zipObjectDeep(props, values) {
  9785. return baseZipObject(props || [], values || [], baseSet);
  9786. }
  9787. /**
  9788. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9789. * how grouped values should be combined. The iteratee is invoked with the
  9790. * elements of each group: (...group).
  9791. *
  9792. * @static
  9793. * @memberOf _
  9794. * @since 3.8.0
  9795. * @category Array
  9796. * @param {...Array} [arrays] The arrays to process.
  9797. * @param {Function} [iteratee=_.identity] The function to combine
  9798. * grouped values.
  9799. * @returns {Array} Returns the new array of grouped elements.
  9800. * @example
  9801. *
  9802. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9803. * return a + b + c;
  9804. * });
  9805. * // => [111, 222]
  9806. */
  9807. var zipWith = baseRest(function(arrays) {
  9808. var length = arrays.length,
  9809. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9810. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9811. return unzipWith(arrays, iteratee);
  9812. });
  9813. /*------------------------------------------------------------------------*/
  9814. /**
  9815. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9816. * chain sequences enabled. The result of such sequences must be unwrapped
  9817. * with `_#value`.
  9818. *
  9819. * @static
  9820. * @memberOf _
  9821. * @since 1.3.0
  9822. * @category Seq
  9823. * @param {*} value The value to wrap.
  9824. * @returns {Object} Returns the new `lodash` wrapper instance.
  9825. * @example
  9826. *
  9827. * var users = [
  9828. * { 'user': 'barney', 'age': 36 },
  9829. * { 'user': 'fred', 'age': 40 },
  9830. * { 'user': 'pebbles', 'age': 1 }
  9831. * ];
  9832. *
  9833. * var youngest = _
  9834. * .chain(users)
  9835. * .sortBy('age')
  9836. * .map(function(o) {
  9837. * return o.user + ' is ' + o.age;
  9838. * })
  9839. * .head()
  9840. * .value();
  9841. * // => 'pebbles is 1'
  9842. */
  9843. function chain(value) {
  9844. var result = lodash(value);
  9845. result.__chain__ = true;
  9846. return result;
  9847. }
  9848. /**
  9849. * This method invokes `interceptor` and returns `value`. The interceptor
  9850. * is invoked with one argument; (value). The purpose of this method is to
  9851. * "tap into" a method chain sequence in order to modify intermediate results.
  9852. *
  9853. * @static
  9854. * @memberOf _
  9855. * @since 0.1.0
  9856. * @category Seq
  9857. * @param {*} value The value to provide to `interceptor`.
  9858. * @param {Function} interceptor The function to invoke.
  9859. * @returns {*} Returns `value`.
  9860. * @example
  9861. *
  9862. * _([1, 2, 3])
  9863. * .tap(function(array) {
  9864. * // Mutate input array.
  9865. * array.pop();
  9866. * })
  9867. * .reverse()
  9868. * .value();
  9869. * // => [2, 1]
  9870. */
  9871. function tap(value, interceptor) {
  9872. interceptor(value);
  9873. return value;
  9874. }
  9875. /**
  9876. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9877. * The purpose of this method is to "pass thru" values replacing intermediate
  9878. * results in a method chain sequence.
  9879. *
  9880. * @static
  9881. * @memberOf _
  9882. * @since 3.0.0
  9883. * @category Seq
  9884. * @param {*} value The value to provide to `interceptor`.
  9885. * @param {Function} interceptor The function to invoke.
  9886. * @returns {*} Returns the result of `interceptor`.
  9887. * @example
  9888. *
  9889. * _(' abc ')
  9890. * .chain()
  9891. * .trim()
  9892. * .thru(function(value) {
  9893. * return [value];
  9894. * })
  9895. * .value();
  9896. * // => ['abc']
  9897. */
  9898. function thru(value, interceptor) {
  9899. return interceptor(value);
  9900. }
  9901. /**
  9902. * This method is the wrapper version of `_.at`.
  9903. *
  9904. * @name at
  9905. * @memberOf _
  9906. * @since 1.0.0
  9907. * @category Seq
  9908. * @param {...(string|string[])} [paths] The property paths to pick.
  9909. * @returns {Object} Returns the new `lodash` wrapper instance.
  9910. * @example
  9911. *
  9912. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9913. *
  9914. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9915. * // => [3, 4]
  9916. */
  9917. var wrapperAt = flatRest(function(paths) {
  9918. var length = paths.length,
  9919. start = length ? paths[0] : 0,
  9920. value = this.__wrapped__,
  9921. interceptor = function(object) { return baseAt(object, paths); };
  9922. if (length > 1 || this.__actions__.length ||
  9923. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9924. return this.thru(interceptor);
  9925. }
  9926. value = value.slice(start, +start + (length ? 1 : 0));
  9927. value.__actions__.push({
  9928. 'func': thru,
  9929. 'args': [interceptor],
  9930. 'thisArg': undefined
  9931. });
  9932. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9933. if (length && !array.length) {
  9934. array.push(undefined);
  9935. }
  9936. return array;
  9937. });
  9938. });
  9939. /**
  9940. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9941. *
  9942. * @name chain
  9943. * @memberOf _
  9944. * @since 0.1.0
  9945. * @category Seq
  9946. * @returns {Object} Returns the new `lodash` wrapper instance.
  9947. * @example
  9948. *
  9949. * var users = [
  9950. * { 'user': 'barney', 'age': 36 },
  9951. * { 'user': 'fred', 'age': 40 }
  9952. * ];
  9953. *
  9954. * // A sequence without explicit chaining.
  9955. * _(users).head();
  9956. * // => { 'user': 'barney', 'age': 36 }
  9957. *
  9958. * // A sequence with explicit chaining.
  9959. * _(users)
  9960. * .chain()
  9961. * .head()
  9962. * .pick('user')
  9963. * .value();
  9964. * // => { 'user': 'barney' }
  9965. */
  9966. function wrapperChain() {
  9967. return chain(this);
  9968. }
  9969. /**
  9970. * Executes the chain sequence and returns the wrapped result.
  9971. *
  9972. * @name commit
  9973. * @memberOf _
  9974. * @since 3.2.0
  9975. * @category Seq
  9976. * @returns {Object} Returns the new `lodash` wrapper instance.
  9977. * @example
  9978. *
  9979. * var array = [1, 2];
  9980. * var wrapped = _(array).push(3);
  9981. *
  9982. * console.log(array);
  9983. * // => [1, 2]
  9984. *
  9985. * wrapped = wrapped.commit();
  9986. * console.log(array);
  9987. * // => [1, 2, 3]
  9988. *
  9989. * wrapped.last();
  9990. * // => 3
  9991. *
  9992. * console.log(array);
  9993. * // => [1, 2, 3]
  9994. */
  9995. function wrapperCommit() {
  9996. return new LodashWrapper(this.value(), this.__chain__);
  9997. }
  9998. /**
  9999. * Gets the next value on a wrapped object following the
  10000. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  10001. *
  10002. * @name next
  10003. * @memberOf _
  10004. * @since 4.0.0
  10005. * @category Seq
  10006. * @returns {Object} Returns the next iterator value.
  10007. * @example
  10008. *
  10009. * var wrapped = _([1, 2]);
  10010. *
  10011. * wrapped.next();
  10012. * // => { 'done': false, 'value': 1 }
  10013. *
  10014. * wrapped.next();
  10015. * // => { 'done': false, 'value': 2 }
  10016. *
  10017. * wrapped.next();
  10018. * // => { 'done': true, 'value': undefined }
  10019. */
  10020. function wrapperNext() {
  10021. if (this.__values__ === undefined) {
  10022. this.__values__ = toArray(this.value());
  10023. }
  10024. var done = this.__index__ >= this.__values__.length,
  10025. value = done ? undefined : this.__values__[this.__index__++];
  10026. return { 'done': done, 'value': value };
  10027. }
  10028. /**
  10029. * Enables the wrapper to be iterable.
  10030. *
  10031. * @name Symbol.iterator
  10032. * @memberOf _
  10033. * @since 4.0.0
  10034. * @category Seq
  10035. * @returns {Object} Returns the wrapper object.
  10036. * @example
  10037. *
  10038. * var wrapped = _([1, 2]);
  10039. *
  10040. * wrapped[Symbol.iterator]() === wrapped;
  10041. * // => true
  10042. *
  10043. * Array.from(wrapped);
  10044. * // => [1, 2]
  10045. */
  10046. function wrapperToIterator() {
  10047. return this;
  10048. }
  10049. /**
  10050. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  10051. *
  10052. * @name plant
  10053. * @memberOf _
  10054. * @since 3.2.0
  10055. * @category Seq
  10056. * @param {*} value The value to plant.
  10057. * @returns {Object} Returns the new `lodash` wrapper instance.
  10058. * @example
  10059. *
  10060. * function square(n) {
  10061. * return n * n;
  10062. * }
  10063. *
  10064. * var wrapped = _([1, 2]).map(square);
  10065. * var other = wrapped.plant([3, 4]);
  10066. *
  10067. * other.value();
  10068. * // => [9, 16]
  10069. *
  10070. * wrapped.value();
  10071. * // => [1, 4]
  10072. */
  10073. function wrapperPlant(value) {
  10074. var result,
  10075. parent = this;
  10076. while (parent instanceof baseLodash) {
  10077. var clone = wrapperClone(parent);
  10078. clone.__index__ = 0;
  10079. clone.__values__ = undefined;
  10080. if (result) {
  10081. previous.__wrapped__ = clone;
  10082. } else {
  10083. result = clone;
  10084. }
  10085. var previous = clone;
  10086. parent = parent.__wrapped__;
  10087. }
  10088. previous.__wrapped__ = value;
  10089. return result;
  10090. }
  10091. /**
  10092. * This method is the wrapper version of `_.reverse`.
  10093. *
  10094. * **Note:** This method mutates the wrapped array.
  10095. *
  10096. * @name reverse
  10097. * @memberOf _
  10098. * @since 0.1.0
  10099. * @category Seq
  10100. * @returns {Object} Returns the new `lodash` wrapper instance.
  10101. * @example
  10102. *
  10103. * var array = [1, 2, 3];
  10104. *
  10105. * _(array).reverse().value()
  10106. * // => [3, 2, 1]
  10107. *
  10108. * console.log(array);
  10109. * // => [3, 2, 1]
  10110. */
  10111. function wrapperReverse() {
  10112. var value = this.__wrapped__;
  10113. if (value instanceof LazyWrapper) {
  10114. var wrapped = value;
  10115. if (this.__actions__.length) {
  10116. wrapped = new LazyWrapper(this);
  10117. }
  10118. wrapped = wrapped.reverse();
  10119. wrapped.__actions__.push({
  10120. 'func': thru,
  10121. 'args': [reverse],
  10122. 'thisArg': undefined
  10123. });
  10124. return new LodashWrapper(wrapped, this.__chain__);
  10125. }
  10126. return this.thru(reverse);
  10127. }
  10128. /**
  10129. * Executes the chain sequence to resolve the unwrapped value.
  10130. *
  10131. * @name value
  10132. * @memberOf _
  10133. * @since 0.1.0
  10134. * @alias toJSON, valueOf
  10135. * @category Seq
  10136. * @returns {*} Returns the resolved unwrapped value.
  10137. * @example
  10138. *
  10139. * _([1, 2, 3]).value();
  10140. * // => [1, 2, 3]
  10141. */
  10142. function wrapperValue() {
  10143. return baseWrapperValue(this.__wrapped__, this.__actions__);
  10144. }
  10145. /*------------------------------------------------------------------------*/
  10146. /**
  10147. * Creates an object composed of keys generated from the results of running
  10148. * each element of `collection` thru `iteratee`. The corresponding value of
  10149. * each key is the number of times the key was returned by `iteratee`. The
  10150. * iteratee is invoked with one argument: (value).
  10151. *
  10152. * @static
  10153. * @memberOf _
  10154. * @since 0.5.0
  10155. * @category Collection
  10156. * @param {Array|Object} collection The collection to iterate over.
  10157. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10158. * @returns {Object} Returns the composed aggregate object.
  10159. * @example
  10160. *
  10161. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  10162. * // => { '4': 1, '6': 2 }
  10163. *
  10164. * // The `_.property` iteratee shorthand.
  10165. * _.countBy(['one', 'two', 'three'], 'length');
  10166. * // => { '3': 2, '5': 1 }
  10167. */
  10168. var countBy = createAggregator(function(result, value, key) {
  10169. if (hasOwnProperty.call(result, key)) {
  10170. ++result[key];
  10171. } else {
  10172. baseAssignValue(result, key, 1);
  10173. }
  10174. });
  10175. /**
  10176. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  10177. * Iteration is stopped once `predicate` returns falsey. The predicate is
  10178. * invoked with three arguments: (value, index|key, collection).
  10179. *
  10180. * **Note:** This method returns `true` for
  10181. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  10182. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  10183. * elements of empty collections.
  10184. *
  10185. * @static
  10186. * @memberOf _
  10187. * @since 0.1.0
  10188. * @category Collection
  10189. * @param {Array|Object} collection The collection to iterate over.
  10190. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10191. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10192. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  10193. * else `false`.
  10194. * @example
  10195. *
  10196. * _.every([true, 1, null, 'yes'], Boolean);
  10197. * // => false
  10198. *
  10199. * var users = [
  10200. * { 'user': 'barney', 'age': 36, 'active': false },
  10201. * { 'user': 'fred', 'age': 40, 'active': false }
  10202. * ];
  10203. *
  10204. * // The `_.matches` iteratee shorthand.
  10205. * _.every(users, { 'user': 'barney', 'active': false });
  10206. * // => false
  10207. *
  10208. * // The `_.matchesProperty` iteratee shorthand.
  10209. * _.every(users, ['active', false]);
  10210. * // => true
  10211. *
  10212. * // The `_.property` iteratee shorthand.
  10213. * _.every(users, 'active');
  10214. * // => false
  10215. */
  10216. function every(collection, predicate, guard) {
  10217. var func = isArray(collection) ? arrayEvery : baseEvery;
  10218. if (guard && isIterateeCall(collection, predicate, guard)) {
  10219. predicate = undefined;
  10220. }
  10221. return func(collection, getIteratee(predicate, 3));
  10222. }
  10223. /**
  10224. * Iterates over elements of `collection`, returning an array of all elements
  10225. * `predicate` returns truthy for. The predicate is invoked with three
  10226. * arguments: (value, index|key, collection).
  10227. *
  10228. * **Note:** Unlike `_.remove`, this method returns a new array.
  10229. *
  10230. * @static
  10231. * @memberOf _
  10232. * @since 0.1.0
  10233. * @category Collection
  10234. * @param {Array|Object} collection The collection to iterate over.
  10235. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10236. * @returns {Array} Returns the new filtered array.
  10237. * @see _.reject
  10238. * @example
  10239. *
  10240. * var users = [
  10241. * { 'user': 'barney', 'age': 36, 'active': true },
  10242. * { 'user': 'fred', 'age': 40, 'active': false }
  10243. * ];
  10244. *
  10245. * _.filter(users, function(o) { return !o.active; });
  10246. * // => objects for ['fred']
  10247. *
  10248. * // The `_.matches` iteratee shorthand.
  10249. * _.filter(users, { 'age': 36, 'active': true });
  10250. * // => objects for ['barney']
  10251. *
  10252. * // The `_.matchesProperty` iteratee shorthand.
  10253. * _.filter(users, ['active', false]);
  10254. * // => objects for ['fred']
  10255. *
  10256. * // The `_.property` iteratee shorthand.
  10257. * _.filter(users, 'active');
  10258. * // => objects for ['barney']
  10259. *
  10260. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  10261. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  10262. * // => objects for ['fred', 'barney']
  10263. */
  10264. function filter(collection, predicate) {
  10265. var func = isArray(collection) ? arrayFilter : baseFilter;
  10266. return func(collection, getIteratee(predicate, 3));
  10267. }
  10268. /**
  10269. * Iterates over elements of `collection`, returning the first element
  10270. * `predicate` returns truthy for. The predicate is invoked with three
  10271. * arguments: (value, index|key, collection).
  10272. *
  10273. * @static
  10274. * @memberOf _
  10275. * @since 0.1.0
  10276. * @category Collection
  10277. * @param {Array|Object} collection The collection to inspect.
  10278. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10279. * @param {number} [fromIndex=0] The index to search from.
  10280. * @returns {*} Returns the matched element, else `undefined`.
  10281. * @example
  10282. *
  10283. * var users = [
  10284. * { 'user': 'barney', 'age': 36, 'active': true },
  10285. * { 'user': 'fred', 'age': 40, 'active': false },
  10286. * { 'user': 'pebbles', 'age': 1, 'active': true }
  10287. * ];
  10288. *
  10289. * _.find(users, function(o) { return o.age < 40; });
  10290. * // => object for 'barney'
  10291. *
  10292. * // The `_.matches` iteratee shorthand.
  10293. * _.find(users, { 'age': 1, 'active': true });
  10294. * // => object for 'pebbles'
  10295. *
  10296. * // The `_.matchesProperty` iteratee shorthand.
  10297. * _.find(users, ['active', false]);
  10298. * // => object for 'fred'
  10299. *
  10300. * // The `_.property` iteratee shorthand.
  10301. * _.find(users, 'active');
  10302. * // => object for 'barney'
  10303. */
  10304. var find = createFind(findIndex);
  10305. /**
  10306. * This method is like `_.find` except that it iterates over elements of
  10307. * `collection` from right to left.
  10308. *
  10309. * @static
  10310. * @memberOf _
  10311. * @since 2.0.0
  10312. * @category Collection
  10313. * @param {Array|Object} collection The collection to inspect.
  10314. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10315. * @param {number} [fromIndex=collection.length-1] The index to search from.
  10316. * @returns {*} Returns the matched element, else `undefined`.
  10317. * @example
  10318. *
  10319. * _.findLast([1, 2, 3, 4], function(n) {
  10320. * return n % 2 == 1;
  10321. * });
  10322. * // => 3
  10323. */
  10324. var findLast = createFind(findLastIndex);
  10325. /**
  10326. * Creates a flattened array of values by running each element in `collection`
  10327. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  10328. * with three arguments: (value, index|key, collection).
  10329. *
  10330. * @static
  10331. * @memberOf _
  10332. * @since 4.0.0
  10333. * @category Collection
  10334. * @param {Array|Object} collection The collection to iterate over.
  10335. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10336. * @returns {Array} Returns the new flattened array.
  10337. * @example
  10338. *
  10339. * function duplicate(n) {
  10340. * return [n, n];
  10341. * }
  10342. *
  10343. * _.flatMap([1, 2], duplicate);
  10344. * // => [1, 1, 2, 2]
  10345. */
  10346. function flatMap(collection, iteratee) {
  10347. return baseFlatten(map(collection, iteratee), 1);
  10348. }
  10349. /**
  10350. * This method is like `_.flatMap` except that it recursively flattens the
  10351. * mapped results.
  10352. *
  10353. * @static
  10354. * @memberOf _
  10355. * @since 4.7.0
  10356. * @category Collection
  10357. * @param {Array|Object} collection The collection to iterate over.
  10358. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10359. * @returns {Array} Returns the new flattened array.
  10360. * @example
  10361. *
  10362. * function duplicate(n) {
  10363. * return [[[n, n]]];
  10364. * }
  10365. *
  10366. * _.flatMapDeep([1, 2], duplicate);
  10367. * // => [1, 1, 2, 2]
  10368. */
  10369. function flatMapDeep(collection, iteratee) {
  10370. return baseFlatten(map(collection, iteratee), INFINITY);
  10371. }
  10372. /**
  10373. * This method is like `_.flatMap` except that it recursively flattens the
  10374. * mapped results up to `depth` times.
  10375. *
  10376. * @static
  10377. * @memberOf _
  10378. * @since 4.7.0
  10379. * @category Collection
  10380. * @param {Array|Object} collection The collection to iterate over.
  10381. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10382. * @param {number} [depth=1] The maximum recursion depth.
  10383. * @returns {Array} Returns the new flattened array.
  10384. * @example
  10385. *
  10386. * function duplicate(n) {
  10387. * return [[[n, n]]];
  10388. * }
  10389. *
  10390. * _.flatMapDepth([1, 2], duplicate, 2);
  10391. * // => [[1, 1], [2, 2]]
  10392. */
  10393. function flatMapDepth(collection, iteratee, depth) {
  10394. depth = depth === undefined ? 1 : toInteger(depth);
  10395. return baseFlatten(map(collection, iteratee), depth);
  10396. }
  10397. /**
  10398. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10399. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10400. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10401. *
  10402. * **Note:** As with other "Collections" methods, objects with a "length"
  10403. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10404. * or `_.forOwn` for object iteration.
  10405. *
  10406. * @static
  10407. * @memberOf _
  10408. * @since 0.1.0
  10409. * @alias each
  10410. * @category Collection
  10411. * @param {Array|Object} collection The collection to iterate over.
  10412. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10413. * @returns {Array|Object} Returns `collection`.
  10414. * @see _.forEachRight
  10415. * @example
  10416. *
  10417. * _.forEach([1, 2], function(value) {
  10418. * console.log(value);
  10419. * });
  10420. * // => Logs `1` then `2`.
  10421. *
  10422. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10423. * console.log(key);
  10424. * });
  10425. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10426. */
  10427. function forEach(collection, iteratee) {
  10428. var func = isArray(collection) ? arrayEach : baseEach;
  10429. return func(collection, getIteratee(iteratee, 3));
  10430. }
  10431. /**
  10432. * This method is like `_.forEach` except that it iterates over elements of
  10433. * `collection` from right to left.
  10434. *
  10435. * @static
  10436. * @memberOf _
  10437. * @since 2.0.0
  10438. * @alias eachRight
  10439. * @category Collection
  10440. * @param {Array|Object} collection The collection to iterate over.
  10441. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10442. * @returns {Array|Object} Returns `collection`.
  10443. * @see _.forEach
  10444. * @example
  10445. *
  10446. * _.forEachRight([1, 2], function(value) {
  10447. * console.log(value);
  10448. * });
  10449. * // => Logs `2` then `1`.
  10450. */
  10451. function forEachRight(collection, iteratee) {
  10452. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10453. return func(collection, getIteratee(iteratee, 3));
  10454. }
  10455. /**
  10456. * Creates an object composed of keys generated from the results of running
  10457. * each element of `collection` thru `iteratee`. The order of grouped values
  10458. * is determined by the order they occur in `collection`. The corresponding
  10459. * value of each key is an array of elements responsible for generating the
  10460. * key. The iteratee is invoked with one argument: (value).
  10461. *
  10462. * @static
  10463. * @memberOf _
  10464. * @since 0.1.0
  10465. * @category Collection
  10466. * @param {Array|Object} collection The collection to iterate over.
  10467. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10468. * @returns {Object} Returns the composed aggregate object.
  10469. * @example
  10470. *
  10471. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10472. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10473. *
  10474. * // The `_.property` iteratee shorthand.
  10475. * _.groupBy(['one', 'two', 'three'], 'length');
  10476. * // => { '3': ['one', 'two'], '5': ['three'] }
  10477. */
  10478. var groupBy = createAggregator(function(result, value, key) {
  10479. if (hasOwnProperty.call(result, key)) {
  10480. result[key].push(value);
  10481. } else {
  10482. baseAssignValue(result, key, [value]);
  10483. }
  10484. });
  10485. /**
  10486. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10487. * checked for a substring of `value`, otherwise
  10488. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10489. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10490. * the offset from the end of `collection`.
  10491. *
  10492. * @static
  10493. * @memberOf _
  10494. * @since 0.1.0
  10495. * @category Collection
  10496. * @param {Array|Object|string} collection The collection to inspect.
  10497. * @param {*} value The value to search for.
  10498. * @param {number} [fromIndex=0] The index to search from.
  10499. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10500. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10501. * @example
  10502. *
  10503. * _.includes([1, 2, 3], 1);
  10504. * // => true
  10505. *
  10506. * _.includes([1, 2, 3], 1, 2);
  10507. * // => false
  10508. *
  10509. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10510. * // => true
  10511. *
  10512. * _.includes('abcd', 'bc');
  10513. * // => true
  10514. */
  10515. function includes(collection, value, fromIndex, guard) {
  10516. collection = isArrayLike(collection) ? collection : values(collection);
  10517. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10518. var length = collection.length;
  10519. if (fromIndex < 0) {
  10520. fromIndex = nativeMax(length + fromIndex, 0);
  10521. }
  10522. return isString(collection)
  10523. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10524. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10525. }
  10526. /**
  10527. * Invokes the method at `path` of each element in `collection`, returning
  10528. * an array of the results of each invoked method. Any additional arguments
  10529. * are provided to each invoked method. If `path` is a function, it's invoked
  10530. * for, and `this` bound to, each element in `collection`.
  10531. *
  10532. * @static
  10533. * @memberOf _
  10534. * @since 4.0.0
  10535. * @category Collection
  10536. * @param {Array|Object} collection The collection to iterate over.
  10537. * @param {Array|Function|string} path The path of the method to invoke or
  10538. * the function invoked per iteration.
  10539. * @param {...*} [args] The arguments to invoke each method with.
  10540. * @returns {Array} Returns the array of results.
  10541. * @example
  10542. *
  10543. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10544. * // => [[1, 5, 7], [1, 2, 3]]
  10545. *
  10546. * _.invokeMap([123, 456], String.prototype.split, '');
  10547. * // => [['1', '2', '3'], ['4', '5', '6']]
  10548. */
  10549. var invokeMap = baseRest(function(collection, path, args) {
  10550. var index = -1,
  10551. isFunc = typeof path == 'function',
  10552. result = isArrayLike(collection) ? Array(collection.length) : [];
  10553. baseEach(collection, function(value) {
  10554. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10555. });
  10556. return result;
  10557. });
  10558. /**
  10559. * Creates an object composed of keys generated from the results of running
  10560. * each element of `collection` thru `iteratee`. The corresponding value of
  10561. * each key is the last element responsible for generating the key. The
  10562. * iteratee is invoked with one argument: (value).
  10563. *
  10564. * @static
  10565. * @memberOf _
  10566. * @since 4.0.0
  10567. * @category Collection
  10568. * @param {Array|Object} collection The collection to iterate over.
  10569. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10570. * @returns {Object} Returns the composed aggregate object.
  10571. * @example
  10572. *
  10573. * var array = [
  10574. * { 'dir': 'left', 'code': 97 },
  10575. * { 'dir': 'right', 'code': 100 }
  10576. * ];
  10577. *
  10578. * _.keyBy(array, function(o) {
  10579. * return String.fromCharCode(o.code);
  10580. * });
  10581. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10582. *
  10583. * _.keyBy(array, 'dir');
  10584. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10585. */
  10586. var keyBy = createAggregator(function(result, value, key) {
  10587. baseAssignValue(result, key, value);
  10588. });
  10589. /**
  10590. * Creates an array of values by running each element in `collection` thru
  10591. * `iteratee`. The iteratee is invoked with three arguments:
  10592. * (value, index|key, collection).
  10593. *
  10594. * Many lodash methods are guarded to work as iteratees for methods like
  10595. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10596. *
  10597. * The guarded methods are:
  10598. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10599. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10600. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10601. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10602. *
  10603. * @static
  10604. * @memberOf _
  10605. * @since 0.1.0
  10606. * @category Collection
  10607. * @param {Array|Object} collection The collection to iterate over.
  10608. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10609. * @returns {Array} Returns the new mapped array.
  10610. * @example
  10611. *
  10612. * function square(n) {
  10613. * return n * n;
  10614. * }
  10615. *
  10616. * _.map([4, 8], square);
  10617. * // => [16, 64]
  10618. *
  10619. * _.map({ 'a': 4, 'b': 8 }, square);
  10620. * // => [16, 64] (iteration order is not guaranteed)
  10621. *
  10622. * var users = [
  10623. * { 'user': 'barney' },
  10624. * { 'user': 'fred' }
  10625. * ];
  10626. *
  10627. * // The `_.property` iteratee shorthand.
  10628. * _.map(users, 'user');
  10629. * // => ['barney', 'fred']
  10630. */
  10631. function map(collection, iteratee) {
  10632. var func = isArray(collection) ? arrayMap : baseMap;
  10633. return func(collection, getIteratee(iteratee, 3));
  10634. }
  10635. /**
  10636. * This method is like `_.sortBy` except that it allows specifying the sort
  10637. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10638. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10639. * descending or "asc" for ascending sort order of corresponding values.
  10640. *
  10641. * @static
  10642. * @memberOf _
  10643. * @since 4.0.0
  10644. * @category Collection
  10645. * @param {Array|Object} collection The collection to iterate over.
  10646. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10647. * The iteratees to sort by.
  10648. * @param {string[]} [orders] The sort orders of `iteratees`.
  10649. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10650. * @returns {Array} Returns the new sorted array.
  10651. * @example
  10652. *
  10653. * var users = [
  10654. * { 'user': 'fred', 'age': 48 },
  10655. * { 'user': 'barney', 'age': 34 },
  10656. * { 'user': 'fred', 'age': 40 },
  10657. * { 'user': 'barney', 'age': 36 }
  10658. * ];
  10659. *
  10660. * // Sort by `user` in ascending order and by `age` in descending order.
  10661. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10662. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10663. */
  10664. function orderBy(collection, iteratees, orders, guard) {
  10665. if (collection == null) {
  10666. return [];
  10667. }
  10668. if (!isArray(iteratees)) {
  10669. iteratees = iteratees == null ? [] : [iteratees];
  10670. }
  10671. orders = guard ? undefined : orders;
  10672. if (!isArray(orders)) {
  10673. orders = orders == null ? [] : [orders];
  10674. }
  10675. return baseOrderBy(collection, iteratees, orders);
  10676. }
  10677. /**
  10678. * Creates an array of elements split into two groups, the first of which
  10679. * contains elements `predicate` returns truthy for, the second of which
  10680. * contains elements `predicate` returns falsey for. The predicate is
  10681. * invoked with one argument: (value).
  10682. *
  10683. * @static
  10684. * @memberOf _
  10685. * @since 3.0.0
  10686. * @category Collection
  10687. * @param {Array|Object} collection The collection to iterate over.
  10688. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10689. * @returns {Array} Returns the array of grouped elements.
  10690. * @example
  10691. *
  10692. * var users = [
  10693. * { 'user': 'barney', 'age': 36, 'active': false },
  10694. * { 'user': 'fred', 'age': 40, 'active': true },
  10695. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10696. * ];
  10697. *
  10698. * _.partition(users, function(o) { return o.active; });
  10699. * // => objects for [['fred'], ['barney', 'pebbles']]
  10700. *
  10701. * // The `_.matches` iteratee shorthand.
  10702. * _.partition(users, { 'age': 1, 'active': false });
  10703. * // => objects for [['pebbles'], ['barney', 'fred']]
  10704. *
  10705. * // The `_.matchesProperty` iteratee shorthand.
  10706. * _.partition(users, ['active', false]);
  10707. * // => objects for [['barney', 'pebbles'], ['fred']]
  10708. *
  10709. * // The `_.property` iteratee shorthand.
  10710. * _.partition(users, 'active');
  10711. * // => objects for [['fred'], ['barney', 'pebbles']]
  10712. */
  10713. var partition = createAggregator(function(result, value, key) {
  10714. result[key ? 0 : 1].push(value);
  10715. }, function() { return [[], []]; });
  10716. /**
  10717. * Reduces `collection` to a value which is the accumulated result of running
  10718. * each element in `collection` thru `iteratee`, where each successive
  10719. * invocation is supplied the return value of the previous. If `accumulator`
  10720. * is not given, the first element of `collection` is used as the initial
  10721. * value. The iteratee is invoked with four arguments:
  10722. * (accumulator, value, index|key, collection).
  10723. *
  10724. * Many lodash methods are guarded to work as iteratees for methods like
  10725. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10726. *
  10727. * The guarded methods are:
  10728. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10729. * and `sortBy`
  10730. *
  10731. * @static
  10732. * @memberOf _
  10733. * @since 0.1.0
  10734. * @category Collection
  10735. * @param {Array|Object} collection The collection to iterate over.
  10736. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10737. * @param {*} [accumulator] The initial value.
  10738. * @returns {*} Returns the accumulated value.
  10739. * @see _.reduceRight
  10740. * @example
  10741. *
  10742. * _.reduce([1, 2], function(sum, n) {
  10743. * return sum + n;
  10744. * }, 0);
  10745. * // => 3
  10746. *
  10747. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10748. * (result[value] || (result[value] = [])).push(key);
  10749. * return result;
  10750. * }, {});
  10751. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10752. */
  10753. function reduce(collection, iteratee, accumulator) {
  10754. var func = isArray(collection) ? arrayReduce : baseReduce,
  10755. initAccum = arguments.length < 3;
  10756. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10757. }
  10758. /**
  10759. * This method is like `_.reduce` except that it iterates over elements of
  10760. * `collection` from right to left.
  10761. *
  10762. * @static
  10763. * @memberOf _
  10764. * @since 0.1.0
  10765. * @category Collection
  10766. * @param {Array|Object} collection The collection to iterate over.
  10767. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10768. * @param {*} [accumulator] The initial value.
  10769. * @returns {*} Returns the accumulated value.
  10770. * @see _.reduce
  10771. * @example
  10772. *
  10773. * var array = [[0, 1], [2, 3], [4, 5]];
  10774. *
  10775. * _.reduceRight(array, function(flattened, other) {
  10776. * return flattened.concat(other);
  10777. * }, []);
  10778. * // => [4, 5, 2, 3, 0, 1]
  10779. */
  10780. function reduceRight(collection, iteratee, accumulator) {
  10781. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10782. initAccum = arguments.length < 3;
  10783. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10784. }
  10785. /**
  10786. * The opposite of `_.filter`; this method returns the elements of `collection`
  10787. * that `predicate` does **not** return truthy for.
  10788. *
  10789. * @static
  10790. * @memberOf _
  10791. * @since 0.1.0
  10792. * @category Collection
  10793. * @param {Array|Object} collection The collection to iterate over.
  10794. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10795. * @returns {Array} Returns the new filtered array.
  10796. * @see _.filter
  10797. * @example
  10798. *
  10799. * var users = [
  10800. * { 'user': 'barney', 'age': 36, 'active': false },
  10801. * { 'user': 'fred', 'age': 40, 'active': true }
  10802. * ];
  10803. *
  10804. * _.reject(users, function(o) { return !o.active; });
  10805. * // => objects for ['fred']
  10806. *
  10807. * // The `_.matches` iteratee shorthand.
  10808. * _.reject(users, { 'age': 40, 'active': true });
  10809. * // => objects for ['barney']
  10810. *
  10811. * // The `_.matchesProperty` iteratee shorthand.
  10812. * _.reject(users, ['active', false]);
  10813. * // => objects for ['fred']
  10814. *
  10815. * // The `_.property` iteratee shorthand.
  10816. * _.reject(users, 'active');
  10817. * // => objects for ['barney']
  10818. */
  10819. function reject(collection, predicate) {
  10820. var func = isArray(collection) ? arrayFilter : baseFilter;
  10821. return func(collection, negate(getIteratee(predicate, 3)));
  10822. }
  10823. /**
  10824. * Gets a random element from `collection`.
  10825. *
  10826. * @static
  10827. * @memberOf _
  10828. * @since 2.0.0
  10829. * @category Collection
  10830. * @param {Array|Object} collection The collection to sample.
  10831. * @returns {*} Returns the random element.
  10832. * @example
  10833. *
  10834. * _.sample([1, 2, 3, 4]);
  10835. * // => 2
  10836. */
  10837. function sample(collection) {
  10838. var func = isArray(collection) ? arraySample : baseSample;
  10839. return func(collection);
  10840. }
  10841. /**
  10842. * Gets `n` random elements at unique keys from `collection` up to the
  10843. * size of `collection`.
  10844. *
  10845. * @static
  10846. * @memberOf _
  10847. * @since 4.0.0
  10848. * @category Collection
  10849. * @param {Array|Object} collection The collection to sample.
  10850. * @param {number} [n=1] The number of elements to sample.
  10851. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10852. * @returns {Array} Returns the random elements.
  10853. * @example
  10854. *
  10855. * _.sampleSize([1, 2, 3], 2);
  10856. * // => [3, 1]
  10857. *
  10858. * _.sampleSize([1, 2, 3], 4);
  10859. * // => [2, 3, 1]
  10860. */
  10861. function sampleSize(collection, n, guard) {
  10862. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10863. n = 1;
  10864. } else {
  10865. n = toInteger(n);
  10866. }
  10867. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10868. return func(collection, n);
  10869. }
  10870. /**
  10871. * Creates an array of shuffled values, using a version of the
  10872. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10873. *
  10874. * @static
  10875. * @memberOf _
  10876. * @since 0.1.0
  10877. * @category Collection
  10878. * @param {Array|Object} collection The collection to shuffle.
  10879. * @returns {Array} Returns the new shuffled array.
  10880. * @example
  10881. *
  10882. * _.shuffle([1, 2, 3, 4]);
  10883. * // => [4, 1, 3, 2]
  10884. */
  10885. function shuffle(collection) {
  10886. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10887. return func(collection);
  10888. }
  10889. /**
  10890. * Gets the size of `collection` by returning its length for array-like
  10891. * values or the number of own enumerable string keyed properties for objects.
  10892. *
  10893. * @static
  10894. * @memberOf _
  10895. * @since 0.1.0
  10896. * @category Collection
  10897. * @param {Array|Object|string} collection The collection to inspect.
  10898. * @returns {number} Returns the collection size.
  10899. * @example
  10900. *
  10901. * _.size([1, 2, 3]);
  10902. * // => 3
  10903. *
  10904. * _.size({ 'a': 1, 'b': 2 });
  10905. * // => 2
  10906. *
  10907. * _.size('pebbles');
  10908. * // => 7
  10909. */
  10910. function size(collection) {
  10911. if (collection == null) {
  10912. return 0;
  10913. }
  10914. if (isArrayLike(collection)) {
  10915. return isString(collection) ? stringSize(collection) : collection.length;
  10916. }
  10917. var tag = getTag(collection);
  10918. if (tag == mapTag || tag == setTag) {
  10919. return collection.size;
  10920. }
  10921. return baseKeys(collection).length;
  10922. }
  10923. /**
  10924. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10925. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10926. * invoked with three arguments: (value, index|key, collection).
  10927. *
  10928. * @static
  10929. * @memberOf _
  10930. * @since 0.1.0
  10931. * @category Collection
  10932. * @param {Array|Object} collection The collection to iterate over.
  10933. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10934. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10935. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10936. * else `false`.
  10937. * @example
  10938. *
  10939. * _.some([null, 0, 'yes', false], Boolean);
  10940. * // => true
  10941. *
  10942. * var users = [
  10943. * { 'user': 'barney', 'active': true },
  10944. * { 'user': 'fred', 'active': false }
  10945. * ];
  10946. *
  10947. * // The `_.matches` iteratee shorthand.
  10948. * _.some(users, { 'user': 'barney', 'active': false });
  10949. * // => false
  10950. *
  10951. * // The `_.matchesProperty` iteratee shorthand.
  10952. * _.some(users, ['active', false]);
  10953. * // => true
  10954. *
  10955. * // The `_.property` iteratee shorthand.
  10956. * _.some(users, 'active');
  10957. * // => true
  10958. */
  10959. function some(collection, predicate, guard) {
  10960. var func = isArray(collection) ? arraySome : baseSome;
  10961. if (guard && isIterateeCall(collection, predicate, guard)) {
  10962. predicate = undefined;
  10963. }
  10964. return func(collection, getIteratee(predicate, 3));
  10965. }
  10966. /**
  10967. * Creates an array of elements, sorted in ascending order by the results of
  10968. * running each element in a collection thru each iteratee. This method
  10969. * performs a stable sort, that is, it preserves the original sort order of
  10970. * equal elements. The iteratees are invoked with one argument: (value).
  10971. *
  10972. * @static
  10973. * @memberOf _
  10974. * @since 0.1.0
  10975. * @category Collection
  10976. * @param {Array|Object} collection The collection to iterate over.
  10977. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10978. * The iteratees to sort by.
  10979. * @returns {Array} Returns the new sorted array.
  10980. * @example
  10981. *
  10982. * var users = [
  10983. * { 'user': 'fred', 'age': 48 },
  10984. * { 'user': 'barney', 'age': 36 },
  10985. * { 'user': 'fred', 'age': 30 },
  10986. * { 'user': 'barney', 'age': 34 }
  10987. * ];
  10988. *
  10989. * _.sortBy(users, [function(o) { return o.user; }]);
  10990. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10991. *
  10992. * _.sortBy(users, ['user', 'age']);
  10993. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10994. */
  10995. var sortBy = baseRest(function(collection, iteratees) {
  10996. if (collection == null) {
  10997. return [];
  10998. }
  10999. var length = iteratees.length;
  11000. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  11001. iteratees = [];
  11002. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  11003. iteratees = [iteratees[0]];
  11004. }
  11005. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  11006. });
  11007. /*------------------------------------------------------------------------*/
  11008. /**
  11009. * Gets the timestamp of the number of milliseconds that have elapsed since
  11010. * the Unix epoch (1 January 1970 00:00:00 UTC).
  11011. *
  11012. * @static
  11013. * @memberOf _
  11014. * @since 2.4.0
  11015. * @category Date
  11016. * @returns {number} Returns the timestamp.
  11017. * @example
  11018. *
  11019. * _.defer(function(stamp) {
  11020. * console.log(_.now() - stamp);
  11021. * }, _.now());
  11022. * // => Logs the number of milliseconds it took for the deferred invocation.
  11023. */
  11024. var now = ctxNow || function() {
  11025. return root.Date.now();
  11026. };
  11027. /*------------------------------------------------------------------------*/
  11028. /**
  11029. * The opposite of `_.before`; this method creates a function that invokes
  11030. * `func` once it's called `n` or more times.
  11031. *
  11032. * @static
  11033. * @memberOf _
  11034. * @since 0.1.0
  11035. * @category Function
  11036. * @param {number} n The number of calls before `func` is invoked.
  11037. * @param {Function} func The function to restrict.
  11038. * @returns {Function} Returns the new restricted function.
  11039. * @example
  11040. *
  11041. * var saves = ['profile', 'settings'];
  11042. *
  11043. * var done = _.after(saves.length, function() {
  11044. * console.log('done saving!');
  11045. * });
  11046. *
  11047. * _.forEach(saves, function(type) {
  11048. * asyncSave({ 'type': type, 'complete': done });
  11049. * });
  11050. * // => Logs 'done saving!' after the two async saves have completed.
  11051. */
  11052. function after(n, func) {
  11053. if (typeof func != 'function') {
  11054. throw new TypeError(FUNC_ERROR_TEXT);
  11055. }
  11056. n = toInteger(n);
  11057. return function() {
  11058. if (--n < 1) {
  11059. return func.apply(this, arguments);
  11060. }
  11061. };
  11062. }
  11063. /**
  11064. * Creates a function that invokes `func`, with up to `n` arguments,
  11065. * ignoring any additional arguments.
  11066. *
  11067. * @static
  11068. * @memberOf _
  11069. * @since 3.0.0
  11070. * @category Function
  11071. * @param {Function} func The function to cap arguments for.
  11072. * @param {number} [n=func.length] The arity cap.
  11073. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11074. * @returns {Function} Returns the new capped function.
  11075. * @example
  11076. *
  11077. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  11078. * // => [6, 8, 10]
  11079. */
  11080. function ary(func, n, guard) {
  11081. n = guard ? undefined : n;
  11082. n = (func && n == null) ? func.length : n;
  11083. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  11084. }
  11085. /**
  11086. * Creates a function that invokes `func`, with the `this` binding and arguments
  11087. * of the created function, while it's called less than `n` times. Subsequent
  11088. * calls to the created function return the result of the last `func` invocation.
  11089. *
  11090. * @static
  11091. * @memberOf _
  11092. * @since 3.0.0
  11093. * @category Function
  11094. * @param {number} n The number of calls at which `func` is no longer invoked.
  11095. * @param {Function} func The function to restrict.
  11096. * @returns {Function} Returns the new restricted function.
  11097. * @example
  11098. *
  11099. * jQuery(element).on('click', _.before(5, addContactToList));
  11100. * // => Allows adding up to 4 contacts to the list.
  11101. */
  11102. function before(n, func) {
  11103. var result;
  11104. if (typeof func != 'function') {
  11105. throw new TypeError(FUNC_ERROR_TEXT);
  11106. }
  11107. n = toInteger(n);
  11108. return function() {
  11109. if (--n > 0) {
  11110. result = func.apply(this, arguments);
  11111. }
  11112. if (n <= 1) {
  11113. func = undefined;
  11114. }
  11115. return result;
  11116. };
  11117. }
  11118. /**
  11119. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  11120. * and `partials` prepended to the arguments it receives.
  11121. *
  11122. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  11123. * may be used as a placeholder for partially applied arguments.
  11124. *
  11125. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  11126. * property of bound functions.
  11127. *
  11128. * @static
  11129. * @memberOf _
  11130. * @since 0.1.0
  11131. * @category Function
  11132. * @param {Function} func The function to bind.
  11133. * @param {*} thisArg The `this` binding of `func`.
  11134. * @param {...*} [partials] The arguments to be partially applied.
  11135. * @returns {Function} Returns the new bound function.
  11136. * @example
  11137. *
  11138. * function greet(greeting, punctuation) {
  11139. * return greeting + ' ' + this.user + punctuation;
  11140. * }
  11141. *
  11142. * var object = { 'user': 'fred' };
  11143. *
  11144. * var bound = _.bind(greet, object, 'hi');
  11145. * bound('!');
  11146. * // => 'hi fred!'
  11147. *
  11148. * // Bound with placeholders.
  11149. * var bound = _.bind(greet, object, _, '!');
  11150. * bound('hi');
  11151. * // => 'hi fred!'
  11152. */
  11153. var bind = baseRest(function(func, thisArg, partials) {
  11154. var bitmask = WRAP_BIND_FLAG;
  11155. if (partials.length) {
  11156. var holders = replaceHolders(partials, getHolder(bind));
  11157. bitmask |= WRAP_PARTIAL_FLAG;
  11158. }
  11159. return createWrap(func, bitmask, thisArg, partials, holders);
  11160. });
  11161. /**
  11162. * Creates a function that invokes the method at `object[key]` with `partials`
  11163. * prepended to the arguments it receives.
  11164. *
  11165. * This method differs from `_.bind` by allowing bound functions to reference
  11166. * methods that may be redefined or don't yet exist. See
  11167. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  11168. * for more details.
  11169. *
  11170. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  11171. * builds, may be used as a placeholder for partially applied arguments.
  11172. *
  11173. * @static
  11174. * @memberOf _
  11175. * @since 0.10.0
  11176. * @category Function
  11177. * @param {Object} object The object to invoke the method on.
  11178. * @param {string} key The key of the method.
  11179. * @param {...*} [partials] The arguments to be partially applied.
  11180. * @returns {Function} Returns the new bound function.
  11181. * @example
  11182. *
  11183. * var object = {
  11184. * 'user': 'fred',
  11185. * 'greet': function(greeting, punctuation) {
  11186. * return greeting + ' ' + this.user + punctuation;
  11187. * }
  11188. * };
  11189. *
  11190. * var bound = _.bindKey(object, 'greet', 'hi');
  11191. * bound('!');
  11192. * // => 'hi fred!'
  11193. *
  11194. * object.greet = function(greeting, punctuation) {
  11195. * return greeting + 'ya ' + this.user + punctuation;
  11196. * };
  11197. *
  11198. * bound('!');
  11199. * // => 'hiya fred!'
  11200. *
  11201. * // Bound with placeholders.
  11202. * var bound = _.bindKey(object, 'greet', _, '!');
  11203. * bound('hi');
  11204. * // => 'hiya fred!'
  11205. */
  11206. var bindKey = baseRest(function(object, key, partials) {
  11207. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  11208. if (partials.length) {
  11209. var holders = replaceHolders(partials, getHolder(bindKey));
  11210. bitmask |= WRAP_PARTIAL_FLAG;
  11211. }
  11212. return createWrap(key, bitmask, object, partials, holders);
  11213. });
  11214. /**
  11215. * Creates a function that accepts arguments of `func` and either invokes
  11216. * `func` returning its result, if at least `arity` number of arguments have
  11217. * been provided, or returns a function that accepts the remaining `func`
  11218. * arguments, and so on. The arity of `func` may be specified if `func.length`
  11219. * is not sufficient.
  11220. *
  11221. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  11222. * may be used as a placeholder for provided arguments.
  11223. *
  11224. * **Note:** This method doesn't set the "length" property of curried functions.
  11225. *
  11226. * @static
  11227. * @memberOf _
  11228. * @since 2.0.0
  11229. * @category Function
  11230. * @param {Function} func The function to curry.
  11231. * @param {number} [arity=func.length] The arity of `func`.
  11232. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11233. * @returns {Function} Returns the new curried function.
  11234. * @example
  11235. *
  11236. * var abc = function(a, b, c) {
  11237. * return [a, b, c];
  11238. * };
  11239. *
  11240. * var curried = _.curry(abc);
  11241. *
  11242. * curried(1)(2)(3);
  11243. * // => [1, 2, 3]
  11244. *
  11245. * curried(1, 2)(3);
  11246. * // => [1, 2, 3]
  11247. *
  11248. * curried(1, 2, 3);
  11249. * // => [1, 2, 3]
  11250. *
  11251. * // Curried with placeholders.
  11252. * curried(1)(_, 3)(2);
  11253. * // => [1, 2, 3]
  11254. */
  11255. function curry(func, arity, guard) {
  11256. arity = guard ? undefined : arity;
  11257. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11258. result.placeholder = curry.placeholder;
  11259. return result;
  11260. }
  11261. /**
  11262. * This method is like `_.curry` except that arguments are applied to `func`
  11263. * in the manner of `_.partialRight` instead of `_.partial`.
  11264. *
  11265. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  11266. * builds, may be used as a placeholder for provided arguments.
  11267. *
  11268. * **Note:** This method doesn't set the "length" property of curried functions.
  11269. *
  11270. * @static
  11271. * @memberOf _
  11272. * @since 3.0.0
  11273. * @category Function
  11274. * @param {Function} func The function to curry.
  11275. * @param {number} [arity=func.length] The arity of `func`.
  11276. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11277. * @returns {Function} Returns the new curried function.
  11278. * @example
  11279. *
  11280. * var abc = function(a, b, c) {
  11281. * return [a, b, c];
  11282. * };
  11283. *
  11284. * var curried = _.curryRight(abc);
  11285. *
  11286. * curried(3)(2)(1);
  11287. * // => [1, 2, 3]
  11288. *
  11289. * curried(2, 3)(1);
  11290. * // => [1, 2, 3]
  11291. *
  11292. * curried(1, 2, 3);
  11293. * // => [1, 2, 3]
  11294. *
  11295. * // Curried with placeholders.
  11296. * curried(3)(1, _)(2);
  11297. * // => [1, 2, 3]
  11298. */
  11299. function curryRight(func, arity, guard) {
  11300. arity = guard ? undefined : arity;
  11301. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11302. result.placeholder = curryRight.placeholder;
  11303. return result;
  11304. }
  11305. /**
  11306. * Creates a debounced function that delays invoking `func` until after `wait`
  11307. * milliseconds have elapsed since the last time the debounced function was
  11308. * invoked. The debounced function comes with a `cancel` method to cancel
  11309. * delayed `func` invocations and a `flush` method to immediately invoke them.
  11310. * Provide `options` to indicate whether `func` should be invoked on the
  11311. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  11312. * with the last arguments provided to the debounced function. Subsequent
  11313. * calls to the debounced function return the result of the last `func`
  11314. * invocation.
  11315. *
  11316. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11317. * invoked on the trailing edge of the timeout only if the debounced function
  11318. * is invoked more than once during the `wait` timeout.
  11319. *
  11320. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11321. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11322. *
  11323. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11324. * for details over the differences between `_.debounce` and `_.throttle`.
  11325. *
  11326. * @static
  11327. * @memberOf _
  11328. * @since 0.1.0
  11329. * @category Function
  11330. * @param {Function} func The function to debounce.
  11331. * @param {number} [wait=0] The number of milliseconds to delay.
  11332. * @param {Object} [options={}] The options object.
  11333. * @param {boolean} [options.leading=false]
  11334. * Specify invoking on the leading edge of the timeout.
  11335. * @param {number} [options.maxWait]
  11336. * The maximum time `func` is allowed to be delayed before it's invoked.
  11337. * @param {boolean} [options.trailing=true]
  11338. * Specify invoking on the trailing edge of the timeout.
  11339. * @returns {Function} Returns the new debounced function.
  11340. * @example
  11341. *
  11342. * // Avoid costly calculations while the window size is in flux.
  11343. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  11344. *
  11345. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  11346. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  11347. * 'leading': true,
  11348. * 'trailing': false
  11349. * }));
  11350. *
  11351. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  11352. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  11353. * var source = new EventSource('/stream');
  11354. * jQuery(source).on('message', debounced);
  11355. *
  11356. * // Cancel the trailing debounced invocation.
  11357. * jQuery(window).on('popstate', debounced.cancel);
  11358. */
  11359. function debounce(func, wait, options) {
  11360. var lastArgs,
  11361. lastThis,
  11362. maxWait,
  11363. result,
  11364. timerId,
  11365. lastCallTime,
  11366. lastInvokeTime = 0,
  11367. leading = false,
  11368. maxing = false,
  11369. trailing = true;
  11370. if (typeof func != 'function') {
  11371. throw new TypeError(FUNC_ERROR_TEXT);
  11372. }
  11373. wait = toNumber(wait) || 0;
  11374. if (isObject(options)) {
  11375. leading = !!options.leading;
  11376. maxing = 'maxWait' in options;
  11377. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  11378. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11379. }
  11380. function invokeFunc(time) {
  11381. var args = lastArgs,
  11382. thisArg = lastThis;
  11383. lastArgs = lastThis = undefined;
  11384. lastInvokeTime = time;
  11385. result = func.apply(thisArg, args);
  11386. return result;
  11387. }
  11388. function leadingEdge(time) {
  11389. // Reset any `maxWait` timer.
  11390. lastInvokeTime = time;
  11391. // Start the timer for the trailing edge.
  11392. timerId = setTimeout(timerExpired, wait);
  11393. // Invoke the leading edge.
  11394. return leading ? invokeFunc(time) : result;
  11395. }
  11396. function remainingWait(time) {
  11397. var timeSinceLastCall = time - lastCallTime,
  11398. timeSinceLastInvoke = time - lastInvokeTime,
  11399. timeWaiting = wait - timeSinceLastCall;
  11400. return maxing
  11401. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11402. : timeWaiting;
  11403. }
  11404. function shouldInvoke(time) {
  11405. var timeSinceLastCall = time - lastCallTime,
  11406. timeSinceLastInvoke = time - lastInvokeTime;
  11407. // Either this is the first call, activity has stopped and we're at the
  11408. // trailing edge, the system time has gone backwards and we're treating
  11409. // it as the trailing edge, or we've hit the `maxWait` limit.
  11410. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11411. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11412. }
  11413. function timerExpired() {
  11414. var time = now();
  11415. if (shouldInvoke(time)) {
  11416. return trailingEdge(time);
  11417. }
  11418. // Restart the timer.
  11419. timerId = setTimeout(timerExpired, remainingWait(time));
  11420. }
  11421. function trailingEdge(time) {
  11422. timerId = undefined;
  11423. // Only invoke if we have `lastArgs` which means `func` has been
  11424. // debounced at least once.
  11425. if (trailing && lastArgs) {
  11426. return invokeFunc(time);
  11427. }
  11428. lastArgs = lastThis = undefined;
  11429. return result;
  11430. }
  11431. function cancel() {
  11432. if (timerId !== undefined) {
  11433. clearTimeout(timerId);
  11434. }
  11435. lastInvokeTime = 0;
  11436. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11437. }
  11438. function flush() {
  11439. return timerId === undefined ? result : trailingEdge(now());
  11440. }
  11441. function debounced() {
  11442. var time = now(),
  11443. isInvoking = shouldInvoke(time);
  11444. lastArgs = arguments;
  11445. lastThis = this;
  11446. lastCallTime = time;
  11447. if (isInvoking) {
  11448. if (timerId === undefined) {
  11449. return leadingEdge(lastCallTime);
  11450. }
  11451. if (maxing) {
  11452. // Handle invocations in a tight loop.
  11453. clearTimeout(timerId);
  11454. timerId = setTimeout(timerExpired, wait);
  11455. return invokeFunc(lastCallTime);
  11456. }
  11457. }
  11458. if (timerId === undefined) {
  11459. timerId = setTimeout(timerExpired, wait);
  11460. }
  11461. return result;
  11462. }
  11463. debounced.cancel = cancel;
  11464. debounced.flush = flush;
  11465. return debounced;
  11466. }
  11467. /**
  11468. * Defers invoking the `func` until the current call stack has cleared. Any
  11469. * additional arguments are provided to `func` when it's invoked.
  11470. *
  11471. * @static
  11472. * @memberOf _
  11473. * @since 0.1.0
  11474. * @category Function
  11475. * @param {Function} func The function to defer.
  11476. * @param {...*} [args] The arguments to invoke `func` with.
  11477. * @returns {number} Returns the timer id.
  11478. * @example
  11479. *
  11480. * _.defer(function(text) {
  11481. * console.log(text);
  11482. * }, 'deferred');
  11483. * // => Logs 'deferred' after one millisecond.
  11484. */
  11485. var defer = baseRest(function(func, args) {
  11486. return baseDelay(func, 1, args);
  11487. });
  11488. /**
  11489. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11490. * provided to `func` when it's invoked.
  11491. *
  11492. * @static
  11493. * @memberOf _
  11494. * @since 0.1.0
  11495. * @category Function
  11496. * @param {Function} func The function to delay.
  11497. * @param {number} wait The number of milliseconds to delay invocation.
  11498. * @param {...*} [args] The arguments to invoke `func` with.
  11499. * @returns {number} Returns the timer id.
  11500. * @example
  11501. *
  11502. * _.delay(function(text) {
  11503. * console.log(text);
  11504. * }, 1000, 'later');
  11505. * // => Logs 'later' after one second.
  11506. */
  11507. var delay = baseRest(function(func, wait, args) {
  11508. return baseDelay(func, toNumber(wait) || 0, args);
  11509. });
  11510. /**
  11511. * Creates a function that invokes `func` with arguments reversed.
  11512. *
  11513. * @static
  11514. * @memberOf _
  11515. * @since 4.0.0
  11516. * @category Function
  11517. * @param {Function} func The function to flip arguments for.
  11518. * @returns {Function} Returns the new flipped function.
  11519. * @example
  11520. *
  11521. * var flipped = _.flip(function() {
  11522. * return _.toArray(arguments);
  11523. * });
  11524. *
  11525. * flipped('a', 'b', 'c', 'd');
  11526. * // => ['d', 'c', 'b', 'a']
  11527. */
  11528. function flip(func) {
  11529. return createWrap(func, WRAP_FLIP_FLAG);
  11530. }
  11531. /**
  11532. * Creates a function that memoizes the result of `func`. If `resolver` is
  11533. * provided, it determines the cache key for storing the result based on the
  11534. * arguments provided to the memoized function. By default, the first argument
  11535. * provided to the memoized function is used as the map cache key. The `func`
  11536. * is invoked with the `this` binding of the memoized function.
  11537. *
  11538. * **Note:** The cache is exposed as the `cache` property on the memoized
  11539. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11540. * constructor with one whose instances implement the
  11541. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11542. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11543. *
  11544. * @static
  11545. * @memberOf _
  11546. * @since 0.1.0
  11547. * @category Function
  11548. * @param {Function} func The function to have its output memoized.
  11549. * @param {Function} [resolver] The function to resolve the cache key.
  11550. * @returns {Function} Returns the new memoized function.
  11551. * @example
  11552. *
  11553. * var object = { 'a': 1, 'b': 2 };
  11554. * var other = { 'c': 3, 'd': 4 };
  11555. *
  11556. * var values = _.memoize(_.values);
  11557. * values(object);
  11558. * // => [1, 2]
  11559. *
  11560. * values(other);
  11561. * // => [3, 4]
  11562. *
  11563. * object.a = 2;
  11564. * values(object);
  11565. * // => [1, 2]
  11566. *
  11567. * // Modify the result cache.
  11568. * values.cache.set(object, ['a', 'b']);
  11569. * values(object);
  11570. * // => ['a', 'b']
  11571. *
  11572. * // Replace `_.memoize.Cache`.
  11573. * _.memoize.Cache = WeakMap;
  11574. */
  11575. function memoize(func, resolver) {
  11576. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11577. throw new TypeError(FUNC_ERROR_TEXT);
  11578. }
  11579. var memoized = function() {
  11580. var args = arguments,
  11581. key = resolver ? resolver.apply(this, args) : args[0],
  11582. cache = memoized.cache;
  11583. if (cache.has(key)) {
  11584. return cache.get(key);
  11585. }
  11586. var result = func.apply(this, args);
  11587. memoized.cache = cache.set(key, result) || cache;
  11588. return result;
  11589. };
  11590. memoized.cache = new (memoize.Cache || MapCache);
  11591. return memoized;
  11592. }
  11593. // Expose `MapCache`.
  11594. memoize.Cache = MapCache;
  11595. /**
  11596. * Creates a function that negates the result of the predicate `func`. The
  11597. * `func` predicate is invoked with the `this` binding and arguments of the
  11598. * created function.
  11599. *
  11600. * @static
  11601. * @memberOf _
  11602. * @since 3.0.0
  11603. * @category Function
  11604. * @param {Function} predicate The predicate to negate.
  11605. * @returns {Function} Returns the new negated function.
  11606. * @example
  11607. *
  11608. * function isEven(n) {
  11609. * return n % 2 == 0;
  11610. * }
  11611. *
  11612. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11613. * // => [1, 3, 5]
  11614. */
  11615. function negate(predicate) {
  11616. if (typeof predicate != 'function') {
  11617. throw new TypeError(FUNC_ERROR_TEXT);
  11618. }
  11619. return function() {
  11620. var args = arguments;
  11621. switch (args.length) {
  11622. case 0: return !predicate.call(this);
  11623. case 1: return !predicate.call(this, args[0]);
  11624. case 2: return !predicate.call(this, args[0], args[1]);
  11625. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11626. }
  11627. return !predicate.apply(this, args);
  11628. };
  11629. }
  11630. /**
  11631. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11632. * to the function return the value of the first invocation. The `func` is
  11633. * invoked with the `this` binding and arguments of the created function.
  11634. *
  11635. * @static
  11636. * @memberOf _
  11637. * @since 0.1.0
  11638. * @category Function
  11639. * @param {Function} func The function to restrict.
  11640. * @returns {Function} Returns the new restricted function.
  11641. * @example
  11642. *
  11643. * var initialize = _.once(createApplication);
  11644. * initialize();
  11645. * initialize();
  11646. * // => `createApplication` is invoked once
  11647. */
  11648. function once(func) {
  11649. return before(2, func);
  11650. }
  11651. /**
  11652. * Creates a function that invokes `func` with its arguments transformed.
  11653. *
  11654. * @static
  11655. * @since 4.0.0
  11656. * @memberOf _
  11657. * @category Function
  11658. * @param {Function} func The function to wrap.
  11659. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11660. * The argument transforms.
  11661. * @returns {Function} Returns the new function.
  11662. * @example
  11663. *
  11664. * function doubled(n) {
  11665. * return n * 2;
  11666. * }
  11667. *
  11668. * function square(n) {
  11669. * return n * n;
  11670. * }
  11671. *
  11672. * var func = _.overArgs(function(x, y) {
  11673. * return [x, y];
  11674. * }, [square, doubled]);
  11675. *
  11676. * func(9, 3);
  11677. * // => [81, 6]
  11678. *
  11679. * func(10, 5);
  11680. * // => [100, 10]
  11681. */
  11682. var overArgs = castRest(function(func, transforms) {
  11683. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11684. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11685. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11686. var funcsLength = transforms.length;
  11687. return baseRest(function(args) {
  11688. var index = -1,
  11689. length = nativeMin(args.length, funcsLength);
  11690. while (++index < length) {
  11691. args[index] = transforms[index].call(this, args[index]);
  11692. }
  11693. return apply(func, this, args);
  11694. });
  11695. });
  11696. /**
  11697. * Creates a function that invokes `func` with `partials` prepended to the
  11698. * arguments it receives. This method is like `_.bind` except it does **not**
  11699. * alter the `this` binding.
  11700. *
  11701. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11702. * builds, may be used as a placeholder for partially applied arguments.
  11703. *
  11704. * **Note:** This method doesn't set the "length" property of partially
  11705. * applied functions.
  11706. *
  11707. * @static
  11708. * @memberOf _
  11709. * @since 0.2.0
  11710. * @category Function
  11711. * @param {Function} func The function to partially apply arguments to.
  11712. * @param {...*} [partials] The arguments to be partially applied.
  11713. * @returns {Function} Returns the new partially applied function.
  11714. * @example
  11715. *
  11716. * function greet(greeting, name) {
  11717. * return greeting + ' ' + name;
  11718. * }
  11719. *
  11720. * var sayHelloTo = _.partial(greet, 'hello');
  11721. * sayHelloTo('fred');
  11722. * // => 'hello fred'
  11723. *
  11724. * // Partially applied with placeholders.
  11725. * var greetFred = _.partial(greet, _, 'fred');
  11726. * greetFred('hi');
  11727. * // => 'hi fred'
  11728. */
  11729. var partial = baseRest(function(func, partials) {
  11730. var holders = replaceHolders(partials, getHolder(partial));
  11731. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11732. });
  11733. /**
  11734. * This method is like `_.partial` except that partially applied arguments
  11735. * are appended to the arguments it receives.
  11736. *
  11737. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11738. * builds, may be used as a placeholder for partially applied arguments.
  11739. *
  11740. * **Note:** This method doesn't set the "length" property of partially
  11741. * applied functions.
  11742. *
  11743. * @static
  11744. * @memberOf _
  11745. * @since 1.0.0
  11746. * @category Function
  11747. * @param {Function} func The function to partially apply arguments to.
  11748. * @param {...*} [partials] The arguments to be partially applied.
  11749. * @returns {Function} Returns the new partially applied function.
  11750. * @example
  11751. *
  11752. * function greet(greeting, name) {
  11753. * return greeting + ' ' + name;
  11754. * }
  11755. *
  11756. * var greetFred = _.partialRight(greet, 'fred');
  11757. * greetFred('hi');
  11758. * // => 'hi fred'
  11759. *
  11760. * // Partially applied with placeholders.
  11761. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11762. * sayHelloTo('fred');
  11763. * // => 'hello fred'
  11764. */
  11765. var partialRight = baseRest(function(func, partials) {
  11766. var holders = replaceHolders(partials, getHolder(partialRight));
  11767. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11768. });
  11769. /**
  11770. * Creates a function that invokes `func` with arguments arranged according
  11771. * to the specified `indexes` where the argument value at the first index is
  11772. * provided as the first argument, the argument value at the second index is
  11773. * provided as the second argument, and so on.
  11774. *
  11775. * @static
  11776. * @memberOf _
  11777. * @since 3.0.0
  11778. * @category Function
  11779. * @param {Function} func The function to rearrange arguments for.
  11780. * @param {...(number|number[])} indexes The arranged argument indexes.
  11781. * @returns {Function} Returns the new function.
  11782. * @example
  11783. *
  11784. * var rearged = _.rearg(function(a, b, c) {
  11785. * return [a, b, c];
  11786. * }, [2, 0, 1]);
  11787. *
  11788. * rearged('b', 'c', 'a')
  11789. * // => ['a', 'b', 'c']
  11790. */
  11791. var rearg = flatRest(function(func, indexes) {
  11792. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11793. });
  11794. /**
  11795. * Creates a function that invokes `func` with the `this` binding of the
  11796. * created function and arguments from `start` and beyond provided as
  11797. * an array.
  11798. *
  11799. * **Note:** This method is based on the
  11800. * [rest parameter](https://mdn.io/rest_parameters).
  11801. *
  11802. * @static
  11803. * @memberOf _
  11804. * @since 4.0.0
  11805. * @category Function
  11806. * @param {Function} func The function to apply a rest parameter to.
  11807. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11808. * @returns {Function} Returns the new function.
  11809. * @example
  11810. *
  11811. * var say = _.rest(function(what, names) {
  11812. * return what + ' ' + _.initial(names).join(', ') +
  11813. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11814. * });
  11815. *
  11816. * say('hello', 'fred', 'barney', 'pebbles');
  11817. * // => 'hello fred, barney, & pebbles'
  11818. */
  11819. function rest(func, start) {
  11820. if (typeof func != 'function') {
  11821. throw new TypeError(FUNC_ERROR_TEXT);
  11822. }
  11823. start = start === undefined ? start : toInteger(start);
  11824. return baseRest(func, start);
  11825. }
  11826. /**
  11827. * Creates a function that invokes `func` with the `this` binding of the
  11828. * create function and an array of arguments much like
  11829. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11830. *
  11831. * **Note:** This method is based on the
  11832. * [spread operator](https://mdn.io/spread_operator).
  11833. *
  11834. * @static
  11835. * @memberOf _
  11836. * @since 3.2.0
  11837. * @category Function
  11838. * @param {Function} func The function to spread arguments over.
  11839. * @param {number} [start=0] The start position of the spread.
  11840. * @returns {Function} Returns the new function.
  11841. * @example
  11842. *
  11843. * var say = _.spread(function(who, what) {
  11844. * return who + ' says ' + what;
  11845. * });
  11846. *
  11847. * say(['fred', 'hello']);
  11848. * // => 'fred says hello'
  11849. *
  11850. * var numbers = Promise.all([
  11851. * Promise.resolve(40),
  11852. * Promise.resolve(36)
  11853. * ]);
  11854. *
  11855. * numbers.then(_.spread(function(x, y) {
  11856. * return x + y;
  11857. * }));
  11858. * // => a Promise of 76
  11859. */
  11860. function spread(func, start) {
  11861. if (typeof func != 'function') {
  11862. throw new TypeError(FUNC_ERROR_TEXT);
  11863. }
  11864. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11865. return baseRest(function(args) {
  11866. var array = args[start],
  11867. otherArgs = castSlice(args, 0, start);
  11868. if (array) {
  11869. arrayPush(otherArgs, array);
  11870. }
  11871. return apply(func, this, otherArgs);
  11872. });
  11873. }
  11874. /**
  11875. * Creates a throttled function that only invokes `func` at most once per
  11876. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11877. * method to cancel delayed `func` invocations and a `flush` method to
  11878. * immediately invoke them. Provide `options` to indicate whether `func`
  11879. * should be invoked on the leading and/or trailing edge of the `wait`
  11880. * timeout. The `func` is invoked with the last arguments provided to the
  11881. * throttled function. Subsequent calls to the throttled function return the
  11882. * result of the last `func` invocation.
  11883. *
  11884. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11885. * invoked on the trailing edge of the timeout only if the throttled function
  11886. * is invoked more than once during the `wait` timeout.
  11887. *
  11888. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11889. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11890. *
  11891. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11892. * for details over the differences between `_.throttle` and `_.debounce`.
  11893. *
  11894. * @static
  11895. * @memberOf _
  11896. * @since 0.1.0
  11897. * @category Function
  11898. * @param {Function} func The function to throttle.
  11899. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11900. * @param {Object} [options={}] The options object.
  11901. * @param {boolean} [options.leading=true]
  11902. * Specify invoking on the leading edge of the timeout.
  11903. * @param {boolean} [options.trailing=true]
  11904. * Specify invoking on the trailing edge of the timeout.
  11905. * @returns {Function} Returns the new throttled function.
  11906. * @example
  11907. *
  11908. * // Avoid excessively updating the position while scrolling.
  11909. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11910. *
  11911. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11912. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11913. * jQuery(element).on('click', throttled);
  11914. *
  11915. * // Cancel the trailing throttled invocation.
  11916. * jQuery(window).on('popstate', throttled.cancel);
  11917. */
  11918. function throttle(func, wait, options) {
  11919. var leading = true,
  11920. trailing = true;
  11921. if (typeof func != 'function') {
  11922. throw new TypeError(FUNC_ERROR_TEXT);
  11923. }
  11924. if (isObject(options)) {
  11925. leading = 'leading' in options ? !!options.leading : leading;
  11926. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11927. }
  11928. return debounce(func, wait, {
  11929. 'leading': leading,
  11930. 'maxWait': wait,
  11931. 'trailing': trailing
  11932. });
  11933. }
  11934. /**
  11935. * Creates a function that accepts up to one argument, ignoring any
  11936. * additional arguments.
  11937. *
  11938. * @static
  11939. * @memberOf _
  11940. * @since 4.0.0
  11941. * @category Function
  11942. * @param {Function} func The function to cap arguments for.
  11943. * @returns {Function} Returns the new capped function.
  11944. * @example
  11945. *
  11946. * _.map(['6', '8', '10'], _.unary(parseInt));
  11947. * // => [6, 8, 10]
  11948. */
  11949. function unary(func) {
  11950. return ary(func, 1);
  11951. }
  11952. /**
  11953. * Creates a function that provides `value` to `wrapper` as its first
  11954. * argument. Any additional arguments provided to the function are appended
  11955. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11956. * binding of the created function.
  11957. *
  11958. * @static
  11959. * @memberOf _
  11960. * @since 0.1.0
  11961. * @category Function
  11962. * @param {*} value The value to wrap.
  11963. * @param {Function} [wrapper=identity] The wrapper function.
  11964. * @returns {Function} Returns the new function.
  11965. * @example
  11966. *
  11967. * var p = _.wrap(_.escape, function(func, text) {
  11968. * return '<p>' + func(text) + '</p>';
  11969. * });
  11970. *
  11971. * p('fred, barney, & pebbles');
  11972. * // => '<p>fred, barney, &amp; pebbles</p>'
  11973. */
  11974. function wrap(value, wrapper) {
  11975. return partial(castFunction(wrapper), value);
  11976. }
  11977. /*------------------------------------------------------------------------*/
  11978. /**
  11979. * Casts `value` as an array if it's not one.
  11980. *
  11981. * @static
  11982. * @memberOf _
  11983. * @since 4.4.0
  11984. * @category Lang
  11985. * @param {*} value The value to inspect.
  11986. * @returns {Array} Returns the cast array.
  11987. * @example
  11988. *
  11989. * _.castArray(1);
  11990. * // => [1]
  11991. *
  11992. * _.castArray({ 'a': 1 });
  11993. * // => [{ 'a': 1 }]
  11994. *
  11995. * _.castArray('abc');
  11996. * // => ['abc']
  11997. *
  11998. * _.castArray(null);
  11999. * // => [null]
  12000. *
  12001. * _.castArray(undefined);
  12002. * // => [undefined]
  12003. *
  12004. * _.castArray();
  12005. * // => []
  12006. *
  12007. * var array = [1, 2, 3];
  12008. * console.log(_.castArray(array) === array);
  12009. * // => true
  12010. */
  12011. function castArray() {
  12012. if (!arguments.length) {
  12013. return [];
  12014. }
  12015. var value = arguments[0];
  12016. return isArray(value) ? value : [value];
  12017. }
  12018. /**
  12019. * Creates a shallow clone of `value`.
  12020. *
  12021. * **Note:** This method is loosely based on the
  12022. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  12023. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  12024. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  12025. * arrays. The own enumerable properties of `arguments` objects are cloned
  12026. * as plain objects. An empty object is returned for uncloneable values such
  12027. * as error objects, functions, DOM nodes, and WeakMaps.
  12028. *
  12029. * @static
  12030. * @memberOf _
  12031. * @since 0.1.0
  12032. * @category Lang
  12033. * @param {*} value The value to clone.
  12034. * @returns {*} Returns the cloned value.
  12035. * @see _.cloneDeep
  12036. * @example
  12037. *
  12038. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12039. *
  12040. * var shallow = _.clone(objects);
  12041. * console.log(shallow[0] === objects[0]);
  12042. * // => true
  12043. */
  12044. function clone(value) {
  12045. return baseClone(value, CLONE_SYMBOLS_FLAG);
  12046. }
  12047. /**
  12048. * This method is like `_.clone` except that it accepts `customizer` which
  12049. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  12050. * cloning is handled by the method instead. The `customizer` is invoked with
  12051. * up to four arguments; (value [, index|key, object, stack]).
  12052. *
  12053. * @static
  12054. * @memberOf _
  12055. * @since 4.0.0
  12056. * @category Lang
  12057. * @param {*} value The value to clone.
  12058. * @param {Function} [customizer] The function to customize cloning.
  12059. * @returns {*} Returns the cloned value.
  12060. * @see _.cloneDeepWith
  12061. * @example
  12062. *
  12063. * function customizer(value) {
  12064. * if (_.isElement(value)) {
  12065. * return value.cloneNode(false);
  12066. * }
  12067. * }
  12068. *
  12069. * var el = _.cloneWith(document.body, customizer);
  12070. *
  12071. * console.log(el === document.body);
  12072. * // => false
  12073. * console.log(el.nodeName);
  12074. * // => 'BODY'
  12075. * console.log(el.childNodes.length);
  12076. * // => 0
  12077. */
  12078. function cloneWith(value, customizer) {
  12079. customizer = typeof customizer == 'function' ? customizer : undefined;
  12080. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  12081. }
  12082. /**
  12083. * This method is like `_.clone` except that it recursively clones `value`.
  12084. *
  12085. * @static
  12086. * @memberOf _
  12087. * @since 1.0.0
  12088. * @category Lang
  12089. * @param {*} value The value to recursively clone.
  12090. * @returns {*} Returns the deep cloned value.
  12091. * @see _.clone
  12092. * @example
  12093. *
  12094. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12095. *
  12096. * var deep = _.cloneDeep(objects);
  12097. * console.log(deep[0] === objects[0]);
  12098. * // => false
  12099. */
  12100. function cloneDeep(value) {
  12101. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  12102. }
  12103. /**
  12104. * This method is like `_.cloneWith` except that it recursively clones `value`.
  12105. *
  12106. * @static
  12107. * @memberOf _
  12108. * @since 4.0.0
  12109. * @category Lang
  12110. * @param {*} value The value to recursively clone.
  12111. * @param {Function} [customizer] The function to customize cloning.
  12112. * @returns {*} Returns the deep cloned value.
  12113. * @see _.cloneWith
  12114. * @example
  12115. *
  12116. * function customizer(value) {
  12117. * if (_.isElement(value)) {
  12118. * return value.cloneNode(true);
  12119. * }
  12120. * }
  12121. *
  12122. * var el = _.cloneDeepWith(document.body, customizer);
  12123. *
  12124. * console.log(el === document.body);
  12125. * // => false
  12126. * console.log(el.nodeName);
  12127. * // => 'BODY'
  12128. * console.log(el.childNodes.length);
  12129. * // => 20
  12130. */
  12131. function cloneDeepWith(value, customizer) {
  12132. customizer = typeof customizer == 'function' ? customizer : undefined;
  12133. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  12134. }
  12135. /**
  12136. * Checks if `object` conforms to `source` by invoking the predicate
  12137. * properties of `source` with the corresponding property values of `object`.
  12138. *
  12139. * **Note:** This method is equivalent to `_.conforms` when `source` is
  12140. * partially applied.
  12141. *
  12142. * @static
  12143. * @memberOf _
  12144. * @since 4.14.0
  12145. * @category Lang
  12146. * @param {Object} object The object to inspect.
  12147. * @param {Object} source The object of property predicates to conform to.
  12148. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  12149. * @example
  12150. *
  12151. * var object = { 'a': 1, 'b': 2 };
  12152. *
  12153. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  12154. * // => true
  12155. *
  12156. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  12157. * // => false
  12158. */
  12159. function conformsTo(object, source) {
  12160. return source == null || baseConformsTo(object, source, keys(source));
  12161. }
  12162. /**
  12163. * Performs a
  12164. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12165. * comparison between two values to determine if they are equivalent.
  12166. *
  12167. * @static
  12168. * @memberOf _
  12169. * @since 4.0.0
  12170. * @category Lang
  12171. * @param {*} value The value to compare.
  12172. * @param {*} other The other value to compare.
  12173. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12174. * @example
  12175. *
  12176. * var object = { 'a': 1 };
  12177. * var other = { 'a': 1 };
  12178. *
  12179. * _.eq(object, object);
  12180. * // => true
  12181. *
  12182. * _.eq(object, other);
  12183. * // => false
  12184. *
  12185. * _.eq('a', 'a');
  12186. * // => true
  12187. *
  12188. * _.eq('a', Object('a'));
  12189. * // => false
  12190. *
  12191. * _.eq(NaN, NaN);
  12192. * // => true
  12193. */
  12194. function eq(value, other) {
  12195. return value === other || (value !== value && other !== other);
  12196. }
  12197. /**
  12198. * Checks if `value` is greater than `other`.
  12199. *
  12200. * @static
  12201. * @memberOf _
  12202. * @since 3.9.0
  12203. * @category Lang
  12204. * @param {*} value The value to compare.
  12205. * @param {*} other The other value to compare.
  12206. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  12207. * else `false`.
  12208. * @see _.lt
  12209. * @example
  12210. *
  12211. * _.gt(3, 1);
  12212. * // => true
  12213. *
  12214. * _.gt(3, 3);
  12215. * // => false
  12216. *
  12217. * _.gt(1, 3);
  12218. * // => false
  12219. */
  12220. var gt = createRelationalOperation(baseGt);
  12221. /**
  12222. * Checks if `value` is greater than or equal to `other`.
  12223. *
  12224. * @static
  12225. * @memberOf _
  12226. * @since 3.9.0
  12227. * @category Lang
  12228. * @param {*} value The value to compare.
  12229. * @param {*} other The other value to compare.
  12230. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  12231. * `other`, else `false`.
  12232. * @see _.lte
  12233. * @example
  12234. *
  12235. * _.gte(3, 1);
  12236. * // => true
  12237. *
  12238. * _.gte(3, 3);
  12239. * // => true
  12240. *
  12241. * _.gte(1, 3);
  12242. * // => false
  12243. */
  12244. var gte = createRelationalOperation(function(value, other) {
  12245. return value >= other;
  12246. });
  12247. /**
  12248. * Checks if `value` is likely an `arguments` object.
  12249. *
  12250. * @static
  12251. * @memberOf _
  12252. * @since 0.1.0
  12253. * @category Lang
  12254. * @param {*} value The value to check.
  12255. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  12256. * else `false`.
  12257. * @example
  12258. *
  12259. * _.isArguments(function() { return arguments; }());
  12260. * // => true
  12261. *
  12262. * _.isArguments([1, 2, 3]);
  12263. * // => false
  12264. */
  12265. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  12266. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  12267. !propertyIsEnumerable.call(value, 'callee');
  12268. };
  12269. /**
  12270. * Checks if `value` is classified as an `Array` object.
  12271. *
  12272. * @static
  12273. * @memberOf _
  12274. * @since 0.1.0
  12275. * @category Lang
  12276. * @param {*} value The value to check.
  12277. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12278. * @example
  12279. *
  12280. * _.isArray([1, 2, 3]);
  12281. * // => true
  12282. *
  12283. * _.isArray(document.body.children);
  12284. * // => false
  12285. *
  12286. * _.isArray('abc');
  12287. * // => false
  12288. *
  12289. * _.isArray(_.noop);
  12290. * // => false
  12291. */
  12292. var isArray = Array.isArray;
  12293. /**
  12294. * Checks if `value` is classified as an `ArrayBuffer` object.
  12295. *
  12296. * @static
  12297. * @memberOf _
  12298. * @since 4.3.0
  12299. * @category Lang
  12300. * @param {*} value The value to check.
  12301. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  12302. * @example
  12303. *
  12304. * _.isArrayBuffer(new ArrayBuffer(2));
  12305. * // => true
  12306. *
  12307. * _.isArrayBuffer(new Array(2));
  12308. * // => false
  12309. */
  12310. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  12311. /**
  12312. * Checks if `value` is array-like. A value is considered array-like if it's
  12313. * not a function and has a `value.length` that's an integer greater than or
  12314. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  12315. *
  12316. * @static
  12317. * @memberOf _
  12318. * @since 4.0.0
  12319. * @category Lang
  12320. * @param {*} value The value to check.
  12321. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  12322. * @example
  12323. *
  12324. * _.isArrayLike([1, 2, 3]);
  12325. * // => true
  12326. *
  12327. * _.isArrayLike(document.body.children);
  12328. * // => true
  12329. *
  12330. * _.isArrayLike('abc');
  12331. * // => true
  12332. *
  12333. * _.isArrayLike(_.noop);
  12334. * // => false
  12335. */
  12336. function isArrayLike(value) {
  12337. return value != null && isLength(value.length) && !isFunction(value);
  12338. }
  12339. /**
  12340. * This method is like `_.isArrayLike` except that it also checks if `value`
  12341. * is an object.
  12342. *
  12343. * @static
  12344. * @memberOf _
  12345. * @since 4.0.0
  12346. * @category Lang
  12347. * @param {*} value The value to check.
  12348. * @returns {boolean} Returns `true` if `value` is an array-like object,
  12349. * else `false`.
  12350. * @example
  12351. *
  12352. * _.isArrayLikeObject([1, 2, 3]);
  12353. * // => true
  12354. *
  12355. * _.isArrayLikeObject(document.body.children);
  12356. * // => true
  12357. *
  12358. * _.isArrayLikeObject('abc');
  12359. * // => false
  12360. *
  12361. * _.isArrayLikeObject(_.noop);
  12362. * // => false
  12363. */
  12364. function isArrayLikeObject(value) {
  12365. return isObjectLike(value) && isArrayLike(value);
  12366. }
  12367. /**
  12368. * Checks if `value` is classified as a boolean primitive or object.
  12369. *
  12370. * @static
  12371. * @memberOf _
  12372. * @since 0.1.0
  12373. * @category Lang
  12374. * @param {*} value The value to check.
  12375. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  12376. * @example
  12377. *
  12378. * _.isBoolean(false);
  12379. * // => true
  12380. *
  12381. * _.isBoolean(null);
  12382. * // => false
  12383. */
  12384. function isBoolean(value) {
  12385. return value === true || value === false ||
  12386. (isObjectLike(value) && baseGetTag(value) == boolTag);
  12387. }
  12388. /**
  12389. * Checks if `value` is a buffer.
  12390. *
  12391. * @static
  12392. * @memberOf _
  12393. * @since 4.3.0
  12394. * @category Lang
  12395. * @param {*} value The value to check.
  12396. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12397. * @example
  12398. *
  12399. * _.isBuffer(new Buffer(2));
  12400. * // => true
  12401. *
  12402. * _.isBuffer(new Uint8Array(2));
  12403. * // => false
  12404. */
  12405. var isBuffer = nativeIsBuffer || stubFalse;
  12406. /**
  12407. * Checks if `value` is classified as a `Date` object.
  12408. *
  12409. * @static
  12410. * @memberOf _
  12411. * @since 0.1.0
  12412. * @category Lang
  12413. * @param {*} value The value to check.
  12414. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12415. * @example
  12416. *
  12417. * _.isDate(new Date);
  12418. * // => true
  12419. *
  12420. * _.isDate('Mon April 23 2012');
  12421. * // => false
  12422. */
  12423. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12424. /**
  12425. * Checks if `value` is likely a DOM element.
  12426. *
  12427. * @static
  12428. * @memberOf _
  12429. * @since 0.1.0
  12430. * @category Lang
  12431. * @param {*} value The value to check.
  12432. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12433. * @example
  12434. *
  12435. * _.isElement(document.body);
  12436. * // => true
  12437. *
  12438. * _.isElement('<body>');
  12439. * // => false
  12440. */
  12441. function isElement(value) {
  12442. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12443. }
  12444. /**
  12445. * Checks if `value` is an empty object, collection, map, or set.
  12446. *
  12447. * Objects are considered empty if they have no own enumerable string keyed
  12448. * properties.
  12449. *
  12450. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12451. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12452. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12453. *
  12454. * @static
  12455. * @memberOf _
  12456. * @since 0.1.0
  12457. * @category Lang
  12458. * @param {*} value The value to check.
  12459. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12460. * @example
  12461. *
  12462. * _.isEmpty(null);
  12463. * // => true
  12464. *
  12465. * _.isEmpty(true);
  12466. * // => true
  12467. *
  12468. * _.isEmpty(1);
  12469. * // => true
  12470. *
  12471. * _.isEmpty([1, 2, 3]);
  12472. * // => false
  12473. *
  12474. * _.isEmpty({ 'a': 1 });
  12475. * // => false
  12476. */
  12477. function isEmpty(value) {
  12478. if (value == null) {
  12479. return true;
  12480. }
  12481. if (isArrayLike(value) &&
  12482. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12483. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12484. return !value.length;
  12485. }
  12486. var tag = getTag(value);
  12487. if (tag == mapTag || tag == setTag) {
  12488. return !value.size;
  12489. }
  12490. if (isPrototype(value)) {
  12491. return !baseKeys(value).length;
  12492. }
  12493. for (var key in value) {
  12494. if (hasOwnProperty.call(value, key)) {
  12495. return false;
  12496. }
  12497. }
  12498. return true;
  12499. }
  12500. /**
  12501. * Performs a deep comparison between two values to determine if they are
  12502. * equivalent.
  12503. *
  12504. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12505. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12506. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12507. * by their own, not inherited, enumerable properties. Functions and DOM
  12508. * nodes are compared by strict equality, i.e. `===`.
  12509. *
  12510. * @static
  12511. * @memberOf _
  12512. * @since 0.1.0
  12513. * @category Lang
  12514. * @param {*} value The value to compare.
  12515. * @param {*} other The other value to compare.
  12516. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12517. * @example
  12518. *
  12519. * var object = { 'a': 1 };
  12520. * var other = { 'a': 1 };
  12521. *
  12522. * _.isEqual(object, other);
  12523. * // => true
  12524. *
  12525. * object === other;
  12526. * // => false
  12527. */
  12528. function isEqual(value, other) {
  12529. return baseIsEqual(value, other);
  12530. }
  12531. /**
  12532. * This method is like `_.isEqual` except that it accepts `customizer` which
  12533. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12534. * are handled by the method instead. The `customizer` is invoked with up to
  12535. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12536. *
  12537. * @static
  12538. * @memberOf _
  12539. * @since 4.0.0
  12540. * @category Lang
  12541. * @param {*} value The value to compare.
  12542. * @param {*} other The other value to compare.
  12543. * @param {Function} [customizer] The function to customize comparisons.
  12544. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12545. * @example
  12546. *
  12547. * function isGreeting(value) {
  12548. * return /^h(?:i|ello)$/.test(value);
  12549. * }
  12550. *
  12551. * function customizer(objValue, othValue) {
  12552. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12553. * return true;
  12554. * }
  12555. * }
  12556. *
  12557. * var array = ['hello', 'goodbye'];
  12558. * var other = ['hi', 'goodbye'];
  12559. *
  12560. * _.isEqualWith(array, other, customizer);
  12561. * // => true
  12562. */
  12563. function isEqualWith(value, other, customizer) {
  12564. customizer = typeof customizer == 'function' ? customizer : undefined;
  12565. var result = customizer ? customizer(value, other) : undefined;
  12566. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12567. }
  12568. /**
  12569. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12570. * `SyntaxError`, `TypeError`, or `URIError` object.
  12571. *
  12572. * @static
  12573. * @memberOf _
  12574. * @since 3.0.0
  12575. * @category Lang
  12576. * @param {*} value The value to check.
  12577. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12578. * @example
  12579. *
  12580. * _.isError(new Error);
  12581. * // => true
  12582. *
  12583. * _.isError(Error);
  12584. * // => false
  12585. */
  12586. function isError(value) {
  12587. if (!isObjectLike(value)) {
  12588. return false;
  12589. }
  12590. var tag = baseGetTag(value);
  12591. return tag == errorTag || tag == domExcTag ||
  12592. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12593. }
  12594. /**
  12595. * Checks if `value` is a finite primitive number.
  12596. *
  12597. * **Note:** This method is based on
  12598. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12599. *
  12600. * @static
  12601. * @memberOf _
  12602. * @since 0.1.0
  12603. * @category Lang
  12604. * @param {*} value The value to check.
  12605. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12606. * @example
  12607. *
  12608. * _.isFinite(3);
  12609. * // => true
  12610. *
  12611. * _.isFinite(Number.MIN_VALUE);
  12612. * // => true
  12613. *
  12614. * _.isFinite(Infinity);
  12615. * // => false
  12616. *
  12617. * _.isFinite('3');
  12618. * // => false
  12619. */
  12620. function isFinite(value) {
  12621. return typeof value == 'number' && nativeIsFinite(value);
  12622. }
  12623. /**
  12624. * Checks if `value` is classified as a `Function` object.
  12625. *
  12626. * @static
  12627. * @memberOf _
  12628. * @since 0.1.0
  12629. * @category Lang
  12630. * @param {*} value The value to check.
  12631. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12632. * @example
  12633. *
  12634. * _.isFunction(_);
  12635. * // => true
  12636. *
  12637. * _.isFunction(/abc/);
  12638. * // => false
  12639. */
  12640. function isFunction(value) {
  12641. if (!isObject(value)) {
  12642. return false;
  12643. }
  12644. // The use of `Object#toString` avoids issues with the `typeof` operator
  12645. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12646. var tag = baseGetTag(value);
  12647. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12648. }
  12649. /**
  12650. * Checks if `value` is an integer.
  12651. *
  12652. * **Note:** This method is based on
  12653. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12654. *
  12655. * @static
  12656. * @memberOf _
  12657. * @since 4.0.0
  12658. * @category Lang
  12659. * @param {*} value The value to check.
  12660. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12661. * @example
  12662. *
  12663. * _.isInteger(3);
  12664. * // => true
  12665. *
  12666. * _.isInteger(Number.MIN_VALUE);
  12667. * // => false
  12668. *
  12669. * _.isInteger(Infinity);
  12670. * // => false
  12671. *
  12672. * _.isInteger('3');
  12673. * // => false
  12674. */
  12675. function isInteger(value) {
  12676. return typeof value == 'number' && value == toInteger(value);
  12677. }
  12678. /**
  12679. * Checks if `value` is a valid array-like length.
  12680. *
  12681. * **Note:** This method is loosely based on
  12682. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12683. *
  12684. * @static
  12685. * @memberOf _
  12686. * @since 4.0.0
  12687. * @category Lang
  12688. * @param {*} value The value to check.
  12689. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12690. * @example
  12691. *
  12692. * _.isLength(3);
  12693. * // => true
  12694. *
  12695. * _.isLength(Number.MIN_VALUE);
  12696. * // => false
  12697. *
  12698. * _.isLength(Infinity);
  12699. * // => false
  12700. *
  12701. * _.isLength('3');
  12702. * // => false
  12703. */
  12704. function isLength(value) {
  12705. return typeof value == 'number' &&
  12706. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12707. }
  12708. /**
  12709. * Checks if `value` is the
  12710. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12711. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12712. *
  12713. * @static
  12714. * @memberOf _
  12715. * @since 0.1.0
  12716. * @category Lang
  12717. * @param {*} value The value to check.
  12718. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12719. * @example
  12720. *
  12721. * _.isObject({});
  12722. * // => true
  12723. *
  12724. * _.isObject([1, 2, 3]);
  12725. * // => true
  12726. *
  12727. * _.isObject(_.noop);
  12728. * // => true
  12729. *
  12730. * _.isObject(null);
  12731. * // => false
  12732. */
  12733. function isObject(value) {
  12734. var type = typeof value;
  12735. return value != null && (type == 'object' || type == 'function');
  12736. }
  12737. /**
  12738. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12739. * and has a `typeof` result of "object".
  12740. *
  12741. * @static
  12742. * @memberOf _
  12743. * @since 4.0.0
  12744. * @category Lang
  12745. * @param {*} value The value to check.
  12746. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12747. * @example
  12748. *
  12749. * _.isObjectLike({});
  12750. * // => true
  12751. *
  12752. * _.isObjectLike([1, 2, 3]);
  12753. * // => true
  12754. *
  12755. * _.isObjectLike(_.noop);
  12756. * // => false
  12757. *
  12758. * _.isObjectLike(null);
  12759. * // => false
  12760. */
  12761. function isObjectLike(value) {
  12762. return value != null && typeof value == 'object';
  12763. }
  12764. /**
  12765. * Checks if `value` is classified as a `Map` object.
  12766. *
  12767. * @static
  12768. * @memberOf _
  12769. * @since 4.3.0
  12770. * @category Lang
  12771. * @param {*} value The value to check.
  12772. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12773. * @example
  12774. *
  12775. * _.isMap(new Map);
  12776. * // => true
  12777. *
  12778. * _.isMap(new WeakMap);
  12779. * // => false
  12780. */
  12781. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12782. /**
  12783. * Performs a partial deep comparison between `object` and `source` to
  12784. * determine if `object` contains equivalent property values.
  12785. *
  12786. * **Note:** This method is equivalent to `_.matches` when `source` is
  12787. * partially applied.
  12788. *
  12789. * Partial comparisons will match empty array and empty object `source`
  12790. * values against any array or object value, respectively. See `_.isEqual`
  12791. * for a list of supported value comparisons.
  12792. *
  12793. * @static
  12794. * @memberOf _
  12795. * @since 3.0.0
  12796. * @category Lang
  12797. * @param {Object} object The object to inspect.
  12798. * @param {Object} source The object of property values to match.
  12799. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12800. * @example
  12801. *
  12802. * var object = { 'a': 1, 'b': 2 };
  12803. *
  12804. * _.isMatch(object, { 'b': 2 });
  12805. * // => true
  12806. *
  12807. * _.isMatch(object, { 'b': 1 });
  12808. * // => false
  12809. */
  12810. function isMatch(object, source) {
  12811. return object === source || baseIsMatch(object, source, getMatchData(source));
  12812. }
  12813. /**
  12814. * This method is like `_.isMatch` except that it accepts `customizer` which
  12815. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12816. * are handled by the method instead. The `customizer` is invoked with five
  12817. * arguments: (objValue, srcValue, index|key, object, source).
  12818. *
  12819. * @static
  12820. * @memberOf _
  12821. * @since 4.0.0
  12822. * @category Lang
  12823. * @param {Object} object The object to inspect.
  12824. * @param {Object} source The object of property values to match.
  12825. * @param {Function} [customizer] The function to customize comparisons.
  12826. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12827. * @example
  12828. *
  12829. * function isGreeting(value) {
  12830. * return /^h(?:i|ello)$/.test(value);
  12831. * }
  12832. *
  12833. * function customizer(objValue, srcValue) {
  12834. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12835. * return true;
  12836. * }
  12837. * }
  12838. *
  12839. * var object = { 'greeting': 'hello' };
  12840. * var source = { 'greeting': 'hi' };
  12841. *
  12842. * _.isMatchWith(object, source, customizer);
  12843. * // => true
  12844. */
  12845. function isMatchWith(object, source, customizer) {
  12846. customizer = typeof customizer == 'function' ? customizer : undefined;
  12847. return baseIsMatch(object, source, getMatchData(source), customizer);
  12848. }
  12849. /**
  12850. * Checks if `value` is `NaN`.
  12851. *
  12852. * **Note:** This method is based on
  12853. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12854. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12855. * `undefined` and other non-number values.
  12856. *
  12857. * @static
  12858. * @memberOf _
  12859. * @since 0.1.0
  12860. * @category Lang
  12861. * @param {*} value The value to check.
  12862. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12863. * @example
  12864. *
  12865. * _.isNaN(NaN);
  12866. * // => true
  12867. *
  12868. * _.isNaN(new Number(NaN));
  12869. * // => true
  12870. *
  12871. * isNaN(undefined);
  12872. * // => true
  12873. *
  12874. * _.isNaN(undefined);
  12875. * // => false
  12876. */
  12877. function isNaN(value) {
  12878. // An `NaN` primitive is the only value that is not equal to itself.
  12879. // Perform the `toStringTag` check first to avoid errors with some
  12880. // ActiveX objects in IE.
  12881. return isNumber(value) && value != +value;
  12882. }
  12883. /**
  12884. * Checks if `value` is a pristine native function.
  12885. *
  12886. * **Note:** This method can't reliably detect native functions in the presence
  12887. * of the core-js package because core-js circumvents this kind of detection.
  12888. * Despite multiple requests, the core-js maintainer has made it clear: any
  12889. * attempt to fix the detection will be obstructed. As a result, we're left
  12890. * with little choice but to throw an error. Unfortunately, this also affects
  12891. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12892. * which rely on core-js.
  12893. *
  12894. * @static
  12895. * @memberOf _
  12896. * @since 3.0.0
  12897. * @category Lang
  12898. * @param {*} value The value to check.
  12899. * @returns {boolean} Returns `true` if `value` is a native function,
  12900. * else `false`.
  12901. * @example
  12902. *
  12903. * _.isNative(Array.prototype.push);
  12904. * // => true
  12905. *
  12906. * _.isNative(_);
  12907. * // => false
  12908. */
  12909. function isNative(value) {
  12910. if (isMaskable(value)) {
  12911. throw new Error(CORE_ERROR_TEXT);
  12912. }
  12913. return baseIsNative(value);
  12914. }
  12915. /**
  12916. * Checks if `value` is `null`.
  12917. *
  12918. * @static
  12919. * @memberOf _
  12920. * @since 0.1.0
  12921. * @category Lang
  12922. * @param {*} value The value to check.
  12923. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12924. * @example
  12925. *
  12926. * _.isNull(null);
  12927. * // => true
  12928. *
  12929. * _.isNull(void 0);
  12930. * // => false
  12931. */
  12932. function isNull(value) {
  12933. return value === null;
  12934. }
  12935. /**
  12936. * Checks if `value` is `null` or `undefined`.
  12937. *
  12938. * @static
  12939. * @memberOf _
  12940. * @since 4.0.0
  12941. * @category Lang
  12942. * @param {*} value The value to check.
  12943. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12944. * @example
  12945. *
  12946. * _.isNil(null);
  12947. * // => true
  12948. *
  12949. * _.isNil(void 0);
  12950. * // => true
  12951. *
  12952. * _.isNil(NaN);
  12953. * // => false
  12954. */
  12955. function isNil(value) {
  12956. return value == null;
  12957. }
  12958. /**
  12959. * Checks if `value` is classified as a `Number` primitive or object.
  12960. *
  12961. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12962. * classified as numbers, use the `_.isFinite` method.
  12963. *
  12964. * @static
  12965. * @memberOf _
  12966. * @since 0.1.0
  12967. * @category Lang
  12968. * @param {*} value The value to check.
  12969. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12970. * @example
  12971. *
  12972. * _.isNumber(3);
  12973. * // => true
  12974. *
  12975. * _.isNumber(Number.MIN_VALUE);
  12976. * // => true
  12977. *
  12978. * _.isNumber(Infinity);
  12979. * // => true
  12980. *
  12981. * _.isNumber('3');
  12982. * // => false
  12983. */
  12984. function isNumber(value) {
  12985. return typeof value == 'number' ||
  12986. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12987. }
  12988. /**
  12989. * Checks if `value` is a plain object, that is, an object created by the
  12990. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12991. *
  12992. * @static
  12993. * @memberOf _
  12994. * @since 0.8.0
  12995. * @category Lang
  12996. * @param {*} value The value to check.
  12997. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12998. * @example
  12999. *
  13000. * function Foo() {
  13001. * this.a = 1;
  13002. * }
  13003. *
  13004. * _.isPlainObject(new Foo);
  13005. * // => false
  13006. *
  13007. * _.isPlainObject([1, 2, 3]);
  13008. * // => false
  13009. *
  13010. * _.isPlainObject({ 'x': 0, 'y': 0 });
  13011. * // => true
  13012. *
  13013. * _.isPlainObject(Object.create(null));
  13014. * // => true
  13015. */
  13016. function isPlainObject(value) {
  13017. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  13018. return false;
  13019. }
  13020. var proto = getPrototype(value);
  13021. if (proto === null) {
  13022. return true;
  13023. }
  13024. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  13025. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  13026. funcToString.call(Ctor) == objectCtorString;
  13027. }
  13028. /**
  13029. * Checks if `value` is classified as a `RegExp` object.
  13030. *
  13031. * @static
  13032. * @memberOf _
  13033. * @since 0.1.0
  13034. * @category Lang
  13035. * @param {*} value The value to check.
  13036. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  13037. * @example
  13038. *
  13039. * _.isRegExp(/abc/);
  13040. * // => true
  13041. *
  13042. * _.isRegExp('/abc/');
  13043. * // => false
  13044. */
  13045. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  13046. /**
  13047. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  13048. * double precision number which isn't the result of a rounded unsafe integer.
  13049. *
  13050. * **Note:** This method is based on
  13051. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  13052. *
  13053. * @static
  13054. * @memberOf _
  13055. * @since 4.0.0
  13056. * @category Lang
  13057. * @param {*} value The value to check.
  13058. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  13059. * @example
  13060. *
  13061. * _.isSafeInteger(3);
  13062. * // => true
  13063. *
  13064. * _.isSafeInteger(Number.MIN_VALUE);
  13065. * // => false
  13066. *
  13067. * _.isSafeInteger(Infinity);
  13068. * // => false
  13069. *
  13070. * _.isSafeInteger('3');
  13071. * // => false
  13072. */
  13073. function isSafeInteger(value) {
  13074. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  13075. }
  13076. /**
  13077. * Checks if `value` is classified as a `Set` object.
  13078. *
  13079. * @static
  13080. * @memberOf _
  13081. * @since 4.3.0
  13082. * @category Lang
  13083. * @param {*} value The value to check.
  13084. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  13085. * @example
  13086. *
  13087. * _.isSet(new Set);
  13088. * // => true
  13089. *
  13090. * _.isSet(new WeakSet);
  13091. * // => false
  13092. */
  13093. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  13094. /**
  13095. * Checks if `value` is classified as a `String` primitive or object.
  13096. *
  13097. * @static
  13098. * @since 0.1.0
  13099. * @memberOf _
  13100. * @category Lang
  13101. * @param {*} value The value to check.
  13102. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  13103. * @example
  13104. *
  13105. * _.isString('abc');
  13106. * // => true
  13107. *
  13108. * _.isString(1);
  13109. * // => false
  13110. */
  13111. function isString(value) {
  13112. return typeof value == 'string' ||
  13113. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  13114. }
  13115. /**
  13116. * Checks if `value` is classified as a `Symbol` primitive or object.
  13117. *
  13118. * @static
  13119. * @memberOf _
  13120. * @since 4.0.0
  13121. * @category Lang
  13122. * @param {*} value The value to check.
  13123. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13124. * @example
  13125. *
  13126. * _.isSymbol(Symbol.iterator);
  13127. * // => true
  13128. *
  13129. * _.isSymbol('abc');
  13130. * // => false
  13131. */
  13132. function isSymbol(value) {
  13133. return typeof value == 'symbol' ||
  13134. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  13135. }
  13136. /**
  13137. * Checks if `value` is classified as a typed array.
  13138. *
  13139. * @static
  13140. * @memberOf _
  13141. * @since 3.0.0
  13142. * @category Lang
  13143. * @param {*} value The value to check.
  13144. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  13145. * @example
  13146. *
  13147. * _.isTypedArray(new Uint8Array);
  13148. * // => true
  13149. *
  13150. * _.isTypedArray([]);
  13151. * // => false
  13152. */
  13153. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  13154. /**
  13155. * Checks if `value` is `undefined`.
  13156. *
  13157. * @static
  13158. * @since 0.1.0
  13159. * @memberOf _
  13160. * @category Lang
  13161. * @param {*} value The value to check.
  13162. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  13163. * @example
  13164. *
  13165. * _.isUndefined(void 0);
  13166. * // => true
  13167. *
  13168. * _.isUndefined(null);
  13169. * // => false
  13170. */
  13171. function isUndefined(value) {
  13172. return value === undefined;
  13173. }
  13174. /**
  13175. * Checks if `value` is classified as a `WeakMap` object.
  13176. *
  13177. * @static
  13178. * @memberOf _
  13179. * @since 4.3.0
  13180. * @category Lang
  13181. * @param {*} value The value to check.
  13182. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  13183. * @example
  13184. *
  13185. * _.isWeakMap(new WeakMap);
  13186. * // => true
  13187. *
  13188. * _.isWeakMap(new Map);
  13189. * // => false
  13190. */
  13191. function isWeakMap(value) {
  13192. return isObjectLike(value) && getTag(value) == weakMapTag;
  13193. }
  13194. /**
  13195. * Checks if `value` is classified as a `WeakSet` object.
  13196. *
  13197. * @static
  13198. * @memberOf _
  13199. * @since 4.3.0
  13200. * @category Lang
  13201. * @param {*} value The value to check.
  13202. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  13203. * @example
  13204. *
  13205. * _.isWeakSet(new WeakSet);
  13206. * // => true
  13207. *
  13208. * _.isWeakSet(new Set);
  13209. * // => false
  13210. */
  13211. function isWeakSet(value) {
  13212. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  13213. }
  13214. /**
  13215. * Checks if `value` is less than `other`.
  13216. *
  13217. * @static
  13218. * @memberOf _
  13219. * @since 3.9.0
  13220. * @category Lang
  13221. * @param {*} value The value to compare.
  13222. * @param {*} other The other value to compare.
  13223. * @returns {boolean} Returns `true` if `value` is less than `other`,
  13224. * else `false`.
  13225. * @see _.gt
  13226. * @example
  13227. *
  13228. * _.lt(1, 3);
  13229. * // => true
  13230. *
  13231. * _.lt(3, 3);
  13232. * // => false
  13233. *
  13234. * _.lt(3, 1);
  13235. * // => false
  13236. */
  13237. var lt = createRelationalOperation(baseLt);
  13238. /**
  13239. * Checks if `value` is less than or equal to `other`.
  13240. *
  13241. * @static
  13242. * @memberOf _
  13243. * @since 3.9.0
  13244. * @category Lang
  13245. * @param {*} value The value to compare.
  13246. * @param {*} other The other value to compare.
  13247. * @returns {boolean} Returns `true` if `value` is less than or equal to
  13248. * `other`, else `false`.
  13249. * @see _.gte
  13250. * @example
  13251. *
  13252. * _.lte(1, 3);
  13253. * // => true
  13254. *
  13255. * _.lte(3, 3);
  13256. * // => true
  13257. *
  13258. * _.lte(3, 1);
  13259. * // => false
  13260. */
  13261. var lte = createRelationalOperation(function(value, other) {
  13262. return value <= other;
  13263. });
  13264. /**
  13265. * Converts `value` to an array.
  13266. *
  13267. * @static
  13268. * @since 0.1.0
  13269. * @memberOf _
  13270. * @category Lang
  13271. * @param {*} value The value to convert.
  13272. * @returns {Array} Returns the converted array.
  13273. * @example
  13274. *
  13275. * _.toArray({ 'a': 1, 'b': 2 });
  13276. * // => [1, 2]
  13277. *
  13278. * _.toArray('abc');
  13279. * // => ['a', 'b', 'c']
  13280. *
  13281. * _.toArray(1);
  13282. * // => []
  13283. *
  13284. * _.toArray(null);
  13285. * // => []
  13286. */
  13287. function toArray(value) {
  13288. if (!value) {
  13289. return [];
  13290. }
  13291. if (isArrayLike(value)) {
  13292. return isString(value) ? stringToArray(value) : copyArray(value);
  13293. }
  13294. if (symIterator && value[symIterator]) {
  13295. return iteratorToArray(value[symIterator]());
  13296. }
  13297. var tag = getTag(value),
  13298. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  13299. return func(value);
  13300. }
  13301. /**
  13302. * Converts `value` to a finite number.
  13303. *
  13304. * @static
  13305. * @memberOf _
  13306. * @since 4.12.0
  13307. * @category Lang
  13308. * @param {*} value The value to convert.
  13309. * @returns {number} Returns the converted number.
  13310. * @example
  13311. *
  13312. * _.toFinite(3.2);
  13313. * // => 3.2
  13314. *
  13315. * _.toFinite(Number.MIN_VALUE);
  13316. * // => 5e-324
  13317. *
  13318. * _.toFinite(Infinity);
  13319. * // => 1.7976931348623157e+308
  13320. *
  13321. * _.toFinite('3.2');
  13322. * // => 3.2
  13323. */
  13324. function toFinite(value) {
  13325. if (!value) {
  13326. return value === 0 ? value : 0;
  13327. }
  13328. value = toNumber(value);
  13329. if (value === INFINITY || value === -INFINITY) {
  13330. var sign = (value < 0 ? -1 : 1);
  13331. return sign * MAX_INTEGER;
  13332. }
  13333. return value === value ? value : 0;
  13334. }
  13335. /**
  13336. * Converts `value` to an integer.
  13337. *
  13338. * **Note:** This method is loosely based on
  13339. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  13340. *
  13341. * @static
  13342. * @memberOf _
  13343. * @since 4.0.0
  13344. * @category Lang
  13345. * @param {*} value The value to convert.
  13346. * @returns {number} Returns the converted integer.
  13347. * @example
  13348. *
  13349. * _.toInteger(3.2);
  13350. * // => 3
  13351. *
  13352. * _.toInteger(Number.MIN_VALUE);
  13353. * // => 0
  13354. *
  13355. * _.toInteger(Infinity);
  13356. * // => 1.7976931348623157e+308
  13357. *
  13358. * _.toInteger('3.2');
  13359. * // => 3
  13360. */
  13361. function toInteger(value) {
  13362. var result = toFinite(value),
  13363. remainder = result % 1;
  13364. return result === result ? (remainder ? result - remainder : result) : 0;
  13365. }
  13366. /**
  13367. * Converts `value` to an integer suitable for use as the length of an
  13368. * array-like object.
  13369. *
  13370. * **Note:** This method is based on
  13371. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  13372. *
  13373. * @static
  13374. * @memberOf _
  13375. * @since 4.0.0
  13376. * @category Lang
  13377. * @param {*} value The value to convert.
  13378. * @returns {number} Returns the converted integer.
  13379. * @example
  13380. *
  13381. * _.toLength(3.2);
  13382. * // => 3
  13383. *
  13384. * _.toLength(Number.MIN_VALUE);
  13385. * // => 0
  13386. *
  13387. * _.toLength(Infinity);
  13388. * // => 4294967295
  13389. *
  13390. * _.toLength('3.2');
  13391. * // => 3
  13392. */
  13393. function toLength(value) {
  13394. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13395. }
  13396. /**
  13397. * Converts `value` to a number.
  13398. *
  13399. * @static
  13400. * @memberOf _
  13401. * @since 4.0.0
  13402. * @category Lang
  13403. * @param {*} value The value to process.
  13404. * @returns {number} Returns the number.
  13405. * @example
  13406. *
  13407. * _.toNumber(3.2);
  13408. * // => 3.2
  13409. *
  13410. * _.toNumber(Number.MIN_VALUE);
  13411. * // => 5e-324
  13412. *
  13413. * _.toNumber(Infinity);
  13414. * // => Infinity
  13415. *
  13416. * _.toNumber('3.2');
  13417. * // => 3.2
  13418. */
  13419. function toNumber(value) {
  13420. if (typeof value == 'number') {
  13421. return value;
  13422. }
  13423. if (isSymbol(value)) {
  13424. return NAN;
  13425. }
  13426. if (isObject(value)) {
  13427. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13428. value = isObject(other) ? (other + '') : other;
  13429. }
  13430. if (typeof value != 'string') {
  13431. return value === 0 ? value : +value;
  13432. }
  13433. value = baseTrim(value);
  13434. var isBinary = reIsBinary.test(value);
  13435. return (isBinary || reIsOctal.test(value))
  13436. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13437. : (reIsBadHex.test(value) ? NAN : +value);
  13438. }
  13439. /**
  13440. * Converts `value` to a plain object flattening inherited enumerable string
  13441. * keyed properties of `value` to own properties of the plain object.
  13442. *
  13443. * @static
  13444. * @memberOf _
  13445. * @since 3.0.0
  13446. * @category Lang
  13447. * @param {*} value The value to convert.
  13448. * @returns {Object} Returns the converted plain object.
  13449. * @example
  13450. *
  13451. * function Foo() {
  13452. * this.b = 2;
  13453. * }
  13454. *
  13455. * Foo.prototype.c = 3;
  13456. *
  13457. * _.assign({ 'a': 1 }, new Foo);
  13458. * // => { 'a': 1, 'b': 2 }
  13459. *
  13460. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13461. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13462. */
  13463. function toPlainObject(value) {
  13464. return copyObject(value, keysIn(value));
  13465. }
  13466. /**
  13467. * Converts `value` to a safe integer. A safe integer can be compared and
  13468. * represented correctly.
  13469. *
  13470. * @static
  13471. * @memberOf _
  13472. * @since 4.0.0
  13473. * @category Lang
  13474. * @param {*} value The value to convert.
  13475. * @returns {number} Returns the converted integer.
  13476. * @example
  13477. *
  13478. * _.toSafeInteger(3.2);
  13479. * // => 3
  13480. *
  13481. * _.toSafeInteger(Number.MIN_VALUE);
  13482. * // => 0
  13483. *
  13484. * _.toSafeInteger(Infinity);
  13485. * // => 9007199254740991
  13486. *
  13487. * _.toSafeInteger('3.2');
  13488. * // => 3
  13489. */
  13490. function toSafeInteger(value) {
  13491. return value
  13492. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13493. : (value === 0 ? value : 0);
  13494. }
  13495. /**
  13496. * Converts `value` to a string. An empty string is returned for `null`
  13497. * and `undefined` values. The sign of `-0` is preserved.
  13498. *
  13499. * @static
  13500. * @memberOf _
  13501. * @since 4.0.0
  13502. * @category Lang
  13503. * @param {*} value The value to convert.
  13504. * @returns {string} Returns the converted string.
  13505. * @example
  13506. *
  13507. * _.toString(null);
  13508. * // => ''
  13509. *
  13510. * _.toString(-0);
  13511. * // => '-0'
  13512. *
  13513. * _.toString([1, 2, 3]);
  13514. * // => '1,2,3'
  13515. */
  13516. function toString(value) {
  13517. return value == null ? '' : baseToString(value);
  13518. }
  13519. /*------------------------------------------------------------------------*/
  13520. /**
  13521. * Assigns own enumerable string keyed properties of source objects to the
  13522. * destination object. Source objects are applied from left to right.
  13523. * Subsequent sources overwrite property assignments of previous sources.
  13524. *
  13525. * **Note:** This method mutates `object` and is loosely based on
  13526. * [`Object.assign`](https://mdn.io/Object/assign).
  13527. *
  13528. * @static
  13529. * @memberOf _
  13530. * @since 0.10.0
  13531. * @category Object
  13532. * @param {Object} object The destination object.
  13533. * @param {...Object} [sources] The source objects.
  13534. * @returns {Object} Returns `object`.
  13535. * @see _.assignIn
  13536. * @example
  13537. *
  13538. * function Foo() {
  13539. * this.a = 1;
  13540. * }
  13541. *
  13542. * function Bar() {
  13543. * this.c = 3;
  13544. * }
  13545. *
  13546. * Foo.prototype.b = 2;
  13547. * Bar.prototype.d = 4;
  13548. *
  13549. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13550. * // => { 'a': 1, 'c': 3 }
  13551. */
  13552. var assign = createAssigner(function(object, source) {
  13553. if (isPrototype(source) || isArrayLike(source)) {
  13554. copyObject(source, keys(source), object);
  13555. return;
  13556. }
  13557. for (var key in source) {
  13558. if (hasOwnProperty.call(source, key)) {
  13559. assignValue(object, key, source[key]);
  13560. }
  13561. }
  13562. });
  13563. /**
  13564. * This method is like `_.assign` except that it iterates over own and
  13565. * inherited source properties.
  13566. *
  13567. * **Note:** This method mutates `object`.
  13568. *
  13569. * @static
  13570. * @memberOf _
  13571. * @since 4.0.0
  13572. * @alias extend
  13573. * @category Object
  13574. * @param {Object} object The destination object.
  13575. * @param {...Object} [sources] The source objects.
  13576. * @returns {Object} Returns `object`.
  13577. * @see _.assign
  13578. * @example
  13579. *
  13580. * function Foo() {
  13581. * this.a = 1;
  13582. * }
  13583. *
  13584. * function Bar() {
  13585. * this.c = 3;
  13586. * }
  13587. *
  13588. * Foo.prototype.b = 2;
  13589. * Bar.prototype.d = 4;
  13590. *
  13591. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13592. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13593. */
  13594. var assignIn = createAssigner(function(object, source) {
  13595. copyObject(source, keysIn(source), object);
  13596. });
  13597. /**
  13598. * This method is like `_.assignIn` except that it accepts `customizer`
  13599. * which is invoked to produce the assigned values. If `customizer` returns
  13600. * `undefined`, assignment is handled by the method instead. The `customizer`
  13601. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13602. *
  13603. * **Note:** This method mutates `object`.
  13604. *
  13605. * @static
  13606. * @memberOf _
  13607. * @since 4.0.0
  13608. * @alias extendWith
  13609. * @category Object
  13610. * @param {Object} object The destination object.
  13611. * @param {...Object} sources The source objects.
  13612. * @param {Function} [customizer] The function to customize assigned values.
  13613. * @returns {Object} Returns `object`.
  13614. * @see _.assignWith
  13615. * @example
  13616. *
  13617. * function customizer(objValue, srcValue) {
  13618. * return _.isUndefined(objValue) ? srcValue : objValue;
  13619. * }
  13620. *
  13621. * var defaults = _.partialRight(_.assignInWith, customizer);
  13622. *
  13623. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13624. * // => { 'a': 1, 'b': 2 }
  13625. */
  13626. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13627. copyObject(source, keysIn(source), object, customizer);
  13628. });
  13629. /**
  13630. * This method is like `_.assign` except that it accepts `customizer`
  13631. * which is invoked to produce the assigned values. If `customizer` returns
  13632. * `undefined`, assignment is handled by the method instead. The `customizer`
  13633. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13634. *
  13635. * **Note:** This method mutates `object`.
  13636. *
  13637. * @static
  13638. * @memberOf _
  13639. * @since 4.0.0
  13640. * @category Object
  13641. * @param {Object} object The destination object.
  13642. * @param {...Object} sources The source objects.
  13643. * @param {Function} [customizer] The function to customize assigned values.
  13644. * @returns {Object} Returns `object`.
  13645. * @see _.assignInWith
  13646. * @example
  13647. *
  13648. * function customizer(objValue, srcValue) {
  13649. * return _.isUndefined(objValue) ? srcValue : objValue;
  13650. * }
  13651. *
  13652. * var defaults = _.partialRight(_.assignWith, customizer);
  13653. *
  13654. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13655. * // => { 'a': 1, 'b': 2 }
  13656. */
  13657. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13658. copyObject(source, keys(source), object, customizer);
  13659. });
  13660. /**
  13661. * Creates an array of values corresponding to `paths` of `object`.
  13662. *
  13663. * @static
  13664. * @memberOf _
  13665. * @since 1.0.0
  13666. * @category Object
  13667. * @param {Object} object The object to iterate over.
  13668. * @param {...(string|string[])} [paths] The property paths to pick.
  13669. * @returns {Array} Returns the picked values.
  13670. * @example
  13671. *
  13672. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13673. *
  13674. * _.at(object, ['a[0].b.c', 'a[1]']);
  13675. * // => [3, 4]
  13676. */
  13677. var at = flatRest(baseAt);
  13678. /**
  13679. * Creates an object that inherits from the `prototype` object. If a
  13680. * `properties` object is given, its own enumerable string keyed properties
  13681. * are assigned to the created object.
  13682. *
  13683. * @static
  13684. * @memberOf _
  13685. * @since 2.3.0
  13686. * @category Object
  13687. * @param {Object} prototype The object to inherit from.
  13688. * @param {Object} [properties] The properties to assign to the object.
  13689. * @returns {Object} Returns the new object.
  13690. * @example
  13691. *
  13692. * function Shape() {
  13693. * this.x = 0;
  13694. * this.y = 0;
  13695. * }
  13696. *
  13697. * function Circle() {
  13698. * Shape.call(this);
  13699. * }
  13700. *
  13701. * Circle.prototype = _.create(Shape.prototype, {
  13702. * 'constructor': Circle
  13703. * });
  13704. *
  13705. * var circle = new Circle;
  13706. * circle instanceof Circle;
  13707. * // => true
  13708. *
  13709. * circle instanceof Shape;
  13710. * // => true
  13711. */
  13712. function create(prototype, properties) {
  13713. var result = baseCreate(prototype);
  13714. return properties == null ? result : baseAssign(result, properties);
  13715. }
  13716. /**
  13717. * Assigns own and inherited enumerable string keyed properties of source
  13718. * objects to the destination object for all destination properties that
  13719. * resolve to `undefined`. Source objects are applied from left to right.
  13720. * Once a property is set, additional values of the same property are ignored.
  13721. *
  13722. * **Note:** This method mutates `object`.
  13723. *
  13724. * @static
  13725. * @since 0.1.0
  13726. * @memberOf _
  13727. * @category Object
  13728. * @param {Object} object The destination object.
  13729. * @param {...Object} [sources] The source objects.
  13730. * @returns {Object} Returns `object`.
  13731. * @see _.defaultsDeep
  13732. * @example
  13733. *
  13734. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13735. * // => { 'a': 1, 'b': 2 }
  13736. */
  13737. var defaults = baseRest(function(object, sources) {
  13738. object = Object(object);
  13739. var index = -1;
  13740. var length = sources.length;
  13741. var guard = length > 2 ? sources[2] : undefined;
  13742. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13743. length = 1;
  13744. }
  13745. while (++index < length) {
  13746. var source = sources[index];
  13747. var props = keysIn(source);
  13748. var propsIndex = -1;
  13749. var propsLength = props.length;
  13750. while (++propsIndex < propsLength) {
  13751. var key = props[propsIndex];
  13752. var value = object[key];
  13753. if (value === undefined ||
  13754. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13755. object[key] = source[key];
  13756. }
  13757. }
  13758. }
  13759. return object;
  13760. });
  13761. /**
  13762. * This method is like `_.defaults` except that it recursively assigns
  13763. * default properties.
  13764. *
  13765. * **Note:** This method mutates `object`.
  13766. *
  13767. * @static
  13768. * @memberOf _
  13769. * @since 3.10.0
  13770. * @category Object
  13771. * @param {Object} object The destination object.
  13772. * @param {...Object} [sources] The source objects.
  13773. * @returns {Object} Returns `object`.
  13774. * @see _.defaults
  13775. * @example
  13776. *
  13777. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13778. * // => { 'a': { 'b': 2, 'c': 3 } }
  13779. */
  13780. var defaultsDeep = baseRest(function(args) {
  13781. args.push(undefined, customDefaultsMerge);
  13782. return apply(mergeWith, undefined, args);
  13783. });
  13784. /**
  13785. * This method is like `_.find` except that it returns the key of the first
  13786. * element `predicate` returns truthy for instead of the element itself.
  13787. *
  13788. * @static
  13789. * @memberOf _
  13790. * @since 1.1.0
  13791. * @category Object
  13792. * @param {Object} object The object to inspect.
  13793. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13794. * @returns {string|undefined} Returns the key of the matched element,
  13795. * else `undefined`.
  13796. * @example
  13797. *
  13798. * var users = {
  13799. * 'barney': { 'age': 36, 'active': true },
  13800. * 'fred': { 'age': 40, 'active': false },
  13801. * 'pebbles': { 'age': 1, 'active': true }
  13802. * };
  13803. *
  13804. * _.findKey(users, function(o) { return o.age < 40; });
  13805. * // => 'barney' (iteration order is not guaranteed)
  13806. *
  13807. * // The `_.matches` iteratee shorthand.
  13808. * _.findKey(users, { 'age': 1, 'active': true });
  13809. * // => 'pebbles'
  13810. *
  13811. * // The `_.matchesProperty` iteratee shorthand.
  13812. * _.findKey(users, ['active', false]);
  13813. * // => 'fred'
  13814. *
  13815. * // The `_.property` iteratee shorthand.
  13816. * _.findKey(users, 'active');
  13817. * // => 'barney'
  13818. */
  13819. function findKey(object, predicate) {
  13820. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13821. }
  13822. /**
  13823. * This method is like `_.findKey` except that it iterates over elements of
  13824. * a collection in the opposite order.
  13825. *
  13826. * @static
  13827. * @memberOf _
  13828. * @since 2.0.0
  13829. * @category Object
  13830. * @param {Object} object The object to inspect.
  13831. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13832. * @returns {string|undefined} Returns the key of the matched element,
  13833. * else `undefined`.
  13834. * @example
  13835. *
  13836. * var users = {
  13837. * 'barney': { 'age': 36, 'active': true },
  13838. * 'fred': { 'age': 40, 'active': false },
  13839. * 'pebbles': { 'age': 1, 'active': true }
  13840. * };
  13841. *
  13842. * _.findLastKey(users, function(o) { return o.age < 40; });
  13843. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13844. *
  13845. * // The `_.matches` iteratee shorthand.
  13846. * _.findLastKey(users, { 'age': 36, 'active': true });
  13847. * // => 'barney'
  13848. *
  13849. * // The `_.matchesProperty` iteratee shorthand.
  13850. * _.findLastKey(users, ['active', false]);
  13851. * // => 'fred'
  13852. *
  13853. * // The `_.property` iteratee shorthand.
  13854. * _.findLastKey(users, 'active');
  13855. * // => 'pebbles'
  13856. */
  13857. function findLastKey(object, predicate) {
  13858. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13859. }
  13860. /**
  13861. * Iterates over own and inherited enumerable string keyed properties of an
  13862. * object and invokes `iteratee` for each property. The iteratee is invoked
  13863. * with three arguments: (value, key, object). Iteratee functions may exit
  13864. * iteration early by explicitly returning `false`.
  13865. *
  13866. * @static
  13867. * @memberOf _
  13868. * @since 0.3.0
  13869. * @category Object
  13870. * @param {Object} object The object to iterate over.
  13871. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13872. * @returns {Object} Returns `object`.
  13873. * @see _.forInRight
  13874. * @example
  13875. *
  13876. * function Foo() {
  13877. * this.a = 1;
  13878. * this.b = 2;
  13879. * }
  13880. *
  13881. * Foo.prototype.c = 3;
  13882. *
  13883. * _.forIn(new Foo, function(value, key) {
  13884. * console.log(key);
  13885. * });
  13886. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13887. */
  13888. function forIn(object, iteratee) {
  13889. return object == null
  13890. ? object
  13891. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13892. }
  13893. /**
  13894. * This method is like `_.forIn` except that it iterates over properties of
  13895. * `object` in the opposite order.
  13896. *
  13897. * @static
  13898. * @memberOf _
  13899. * @since 2.0.0
  13900. * @category Object
  13901. * @param {Object} object The object to iterate over.
  13902. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13903. * @returns {Object} Returns `object`.
  13904. * @see _.forIn
  13905. * @example
  13906. *
  13907. * function Foo() {
  13908. * this.a = 1;
  13909. * this.b = 2;
  13910. * }
  13911. *
  13912. * Foo.prototype.c = 3;
  13913. *
  13914. * _.forInRight(new Foo, function(value, key) {
  13915. * console.log(key);
  13916. * });
  13917. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13918. */
  13919. function forInRight(object, iteratee) {
  13920. return object == null
  13921. ? object
  13922. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13923. }
  13924. /**
  13925. * Iterates over own enumerable string keyed properties of an object and
  13926. * invokes `iteratee` for each property. The iteratee is invoked with three
  13927. * arguments: (value, key, object). Iteratee functions may exit iteration
  13928. * early by explicitly returning `false`.
  13929. *
  13930. * @static
  13931. * @memberOf _
  13932. * @since 0.3.0
  13933. * @category Object
  13934. * @param {Object} object The object to iterate over.
  13935. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13936. * @returns {Object} Returns `object`.
  13937. * @see _.forOwnRight
  13938. * @example
  13939. *
  13940. * function Foo() {
  13941. * this.a = 1;
  13942. * this.b = 2;
  13943. * }
  13944. *
  13945. * Foo.prototype.c = 3;
  13946. *
  13947. * _.forOwn(new Foo, function(value, key) {
  13948. * console.log(key);
  13949. * });
  13950. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13951. */
  13952. function forOwn(object, iteratee) {
  13953. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13954. }
  13955. /**
  13956. * This method is like `_.forOwn` except that it iterates over properties of
  13957. * `object` in the opposite order.
  13958. *
  13959. * @static
  13960. * @memberOf _
  13961. * @since 2.0.0
  13962. * @category Object
  13963. * @param {Object} object The object to iterate over.
  13964. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13965. * @returns {Object} Returns `object`.
  13966. * @see _.forOwn
  13967. * @example
  13968. *
  13969. * function Foo() {
  13970. * this.a = 1;
  13971. * this.b = 2;
  13972. * }
  13973. *
  13974. * Foo.prototype.c = 3;
  13975. *
  13976. * _.forOwnRight(new Foo, function(value, key) {
  13977. * console.log(key);
  13978. * });
  13979. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13980. */
  13981. function forOwnRight(object, iteratee) {
  13982. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13983. }
  13984. /**
  13985. * Creates an array of function property names from own enumerable properties
  13986. * of `object`.
  13987. *
  13988. * @static
  13989. * @since 0.1.0
  13990. * @memberOf _
  13991. * @category Object
  13992. * @param {Object} object The object to inspect.
  13993. * @returns {Array} Returns the function names.
  13994. * @see _.functionsIn
  13995. * @example
  13996. *
  13997. * function Foo() {
  13998. * this.a = _.constant('a');
  13999. * this.b = _.constant('b');
  14000. * }
  14001. *
  14002. * Foo.prototype.c = _.constant('c');
  14003. *
  14004. * _.functions(new Foo);
  14005. * // => ['a', 'b']
  14006. */
  14007. function functions(object) {
  14008. return object == null ? [] : baseFunctions(object, keys(object));
  14009. }
  14010. /**
  14011. * Creates an array of function property names from own and inherited
  14012. * enumerable properties of `object`.
  14013. *
  14014. * @static
  14015. * @memberOf _
  14016. * @since 4.0.0
  14017. * @category Object
  14018. * @param {Object} object The object to inspect.
  14019. * @returns {Array} Returns the function names.
  14020. * @see _.functions
  14021. * @example
  14022. *
  14023. * function Foo() {
  14024. * this.a = _.constant('a');
  14025. * this.b = _.constant('b');
  14026. * }
  14027. *
  14028. * Foo.prototype.c = _.constant('c');
  14029. *
  14030. * _.functionsIn(new Foo);
  14031. * // => ['a', 'b', 'c']
  14032. */
  14033. function functionsIn(object) {
  14034. return object == null ? [] : baseFunctions(object, keysIn(object));
  14035. }
  14036. /**
  14037. * Gets the value at `path` of `object`. If the resolved value is
  14038. * `undefined`, the `defaultValue` is returned in its place.
  14039. *
  14040. * @static
  14041. * @memberOf _
  14042. * @since 3.7.0
  14043. * @category Object
  14044. * @param {Object} object The object to query.
  14045. * @param {Array|string} path The path of the property to get.
  14046. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14047. * @returns {*} Returns the resolved value.
  14048. * @example
  14049. *
  14050. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14051. *
  14052. * _.get(object, 'a[0].b.c');
  14053. * // => 3
  14054. *
  14055. * _.get(object, ['a', '0', 'b', 'c']);
  14056. * // => 3
  14057. *
  14058. * _.get(object, 'a.b.c', 'default');
  14059. * // => 'default'
  14060. */
  14061. function get(object, path, defaultValue) {
  14062. var result = object == null ? undefined : baseGet(object, path);
  14063. return result === undefined ? defaultValue : result;
  14064. }
  14065. /**
  14066. * Checks if `path` is a direct property of `object`.
  14067. *
  14068. * @static
  14069. * @since 0.1.0
  14070. * @memberOf _
  14071. * @category Object
  14072. * @param {Object} object The object to query.
  14073. * @param {Array|string} path The path to check.
  14074. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14075. * @example
  14076. *
  14077. * var object = { 'a': { 'b': 2 } };
  14078. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  14079. *
  14080. * _.has(object, 'a');
  14081. * // => true
  14082. *
  14083. * _.has(object, 'a.b');
  14084. * // => true
  14085. *
  14086. * _.has(object, ['a', 'b']);
  14087. * // => true
  14088. *
  14089. * _.has(other, 'a');
  14090. * // => false
  14091. */
  14092. function has(object, path) {
  14093. return object != null && hasPath(object, path, baseHas);
  14094. }
  14095. /**
  14096. * Checks if `path` is a direct or inherited property of `object`.
  14097. *
  14098. * @static
  14099. * @memberOf _
  14100. * @since 4.0.0
  14101. * @category Object
  14102. * @param {Object} object The object to query.
  14103. * @param {Array|string} path The path to check.
  14104. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14105. * @example
  14106. *
  14107. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  14108. *
  14109. * _.hasIn(object, 'a');
  14110. * // => true
  14111. *
  14112. * _.hasIn(object, 'a.b');
  14113. * // => true
  14114. *
  14115. * _.hasIn(object, ['a', 'b']);
  14116. * // => true
  14117. *
  14118. * _.hasIn(object, 'b');
  14119. * // => false
  14120. */
  14121. function hasIn(object, path) {
  14122. return object != null && hasPath(object, path, baseHasIn);
  14123. }
  14124. /**
  14125. * Creates an object composed of the inverted keys and values of `object`.
  14126. * If `object` contains duplicate values, subsequent values overwrite
  14127. * property assignments of previous values.
  14128. *
  14129. * @static
  14130. * @memberOf _
  14131. * @since 0.7.0
  14132. * @category Object
  14133. * @param {Object} object The object to invert.
  14134. * @returns {Object} Returns the new inverted object.
  14135. * @example
  14136. *
  14137. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14138. *
  14139. * _.invert(object);
  14140. * // => { '1': 'c', '2': 'b' }
  14141. */
  14142. var invert = createInverter(function(result, value, key) {
  14143. if (value != null &&
  14144. typeof value.toString != 'function') {
  14145. value = nativeObjectToString.call(value);
  14146. }
  14147. result[value] = key;
  14148. }, constant(identity));
  14149. /**
  14150. * This method is like `_.invert` except that the inverted object is generated
  14151. * from the results of running each element of `object` thru `iteratee`. The
  14152. * corresponding inverted value of each inverted key is an array of keys
  14153. * responsible for generating the inverted value. The iteratee is invoked
  14154. * with one argument: (value).
  14155. *
  14156. * @static
  14157. * @memberOf _
  14158. * @since 4.1.0
  14159. * @category Object
  14160. * @param {Object} object The object to invert.
  14161. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14162. * @returns {Object} Returns the new inverted object.
  14163. * @example
  14164. *
  14165. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14166. *
  14167. * _.invertBy(object);
  14168. * // => { '1': ['a', 'c'], '2': ['b'] }
  14169. *
  14170. * _.invertBy(object, function(value) {
  14171. * return 'group' + value;
  14172. * });
  14173. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  14174. */
  14175. var invertBy = createInverter(function(result, value, key) {
  14176. if (value != null &&
  14177. typeof value.toString != 'function') {
  14178. value = nativeObjectToString.call(value);
  14179. }
  14180. if (hasOwnProperty.call(result, value)) {
  14181. result[value].push(key);
  14182. } else {
  14183. result[value] = [key];
  14184. }
  14185. }, getIteratee);
  14186. /**
  14187. * Invokes the method at `path` of `object`.
  14188. *
  14189. * @static
  14190. * @memberOf _
  14191. * @since 4.0.0
  14192. * @category Object
  14193. * @param {Object} object The object to query.
  14194. * @param {Array|string} path The path of the method to invoke.
  14195. * @param {...*} [args] The arguments to invoke the method with.
  14196. * @returns {*} Returns the result of the invoked method.
  14197. * @example
  14198. *
  14199. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  14200. *
  14201. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  14202. * // => [2, 3]
  14203. */
  14204. var invoke = baseRest(baseInvoke);
  14205. /**
  14206. * Creates an array of the own enumerable property names of `object`.
  14207. *
  14208. * **Note:** Non-object values are coerced to objects. See the
  14209. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  14210. * for more details.
  14211. *
  14212. * @static
  14213. * @since 0.1.0
  14214. * @memberOf _
  14215. * @category Object
  14216. * @param {Object} object The object to query.
  14217. * @returns {Array} Returns the array of property names.
  14218. * @example
  14219. *
  14220. * function Foo() {
  14221. * this.a = 1;
  14222. * this.b = 2;
  14223. * }
  14224. *
  14225. * Foo.prototype.c = 3;
  14226. *
  14227. * _.keys(new Foo);
  14228. * // => ['a', 'b'] (iteration order is not guaranteed)
  14229. *
  14230. * _.keys('hi');
  14231. * // => ['0', '1']
  14232. */
  14233. function keys(object) {
  14234. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14235. }
  14236. /**
  14237. * Creates an array of the own and inherited enumerable property names of `object`.
  14238. *
  14239. * **Note:** Non-object values are coerced to objects.
  14240. *
  14241. * @static
  14242. * @memberOf _
  14243. * @since 3.0.0
  14244. * @category Object
  14245. * @param {Object} object The object to query.
  14246. * @returns {Array} Returns the array of property names.
  14247. * @example
  14248. *
  14249. * function Foo() {
  14250. * this.a = 1;
  14251. * this.b = 2;
  14252. * }
  14253. *
  14254. * Foo.prototype.c = 3;
  14255. *
  14256. * _.keysIn(new Foo);
  14257. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  14258. */
  14259. function keysIn(object) {
  14260. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  14261. }
  14262. /**
  14263. * The opposite of `_.mapValues`; this method creates an object with the
  14264. * same values as `object` and keys generated by running each own enumerable
  14265. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  14266. * with three arguments: (value, key, object).
  14267. *
  14268. * @static
  14269. * @memberOf _
  14270. * @since 3.8.0
  14271. * @category Object
  14272. * @param {Object} object The object to iterate over.
  14273. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14274. * @returns {Object} Returns the new mapped object.
  14275. * @see _.mapValues
  14276. * @example
  14277. *
  14278. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  14279. * return key + value;
  14280. * });
  14281. * // => { 'a1': 1, 'b2': 2 }
  14282. */
  14283. function mapKeys(object, iteratee) {
  14284. var result = {};
  14285. iteratee = getIteratee(iteratee, 3);
  14286. baseForOwn(object, function(value, key, object) {
  14287. baseAssignValue(result, iteratee(value, key, object), value);
  14288. });
  14289. return result;
  14290. }
  14291. /**
  14292. * Creates an object with the same keys as `object` and values generated
  14293. * by running each own enumerable string keyed property of `object` thru
  14294. * `iteratee`. The iteratee is invoked with three arguments:
  14295. * (value, key, object).
  14296. *
  14297. * @static
  14298. * @memberOf _
  14299. * @since 2.4.0
  14300. * @category Object
  14301. * @param {Object} object The object to iterate over.
  14302. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14303. * @returns {Object} Returns the new mapped object.
  14304. * @see _.mapKeys
  14305. * @example
  14306. *
  14307. * var users = {
  14308. * 'fred': { 'user': 'fred', 'age': 40 },
  14309. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  14310. * };
  14311. *
  14312. * _.mapValues(users, function(o) { return o.age; });
  14313. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14314. *
  14315. * // The `_.property` iteratee shorthand.
  14316. * _.mapValues(users, 'age');
  14317. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14318. */
  14319. function mapValues(object, iteratee) {
  14320. var result = {};
  14321. iteratee = getIteratee(iteratee, 3);
  14322. baseForOwn(object, function(value, key, object) {
  14323. baseAssignValue(result, key, iteratee(value, key, object));
  14324. });
  14325. return result;
  14326. }
  14327. /**
  14328. * This method is like `_.assign` except that it recursively merges own and
  14329. * inherited enumerable string keyed properties of source objects into the
  14330. * destination object. Source properties that resolve to `undefined` are
  14331. * skipped if a destination value exists. Array and plain object properties
  14332. * are merged recursively. Other objects and value types are overridden by
  14333. * assignment. Source objects are applied from left to right. Subsequent
  14334. * sources overwrite property assignments of previous sources.
  14335. *
  14336. * **Note:** This method mutates `object`.
  14337. *
  14338. * @static
  14339. * @memberOf _
  14340. * @since 0.5.0
  14341. * @category Object
  14342. * @param {Object} object The destination object.
  14343. * @param {...Object} [sources] The source objects.
  14344. * @returns {Object} Returns `object`.
  14345. * @example
  14346. *
  14347. * var object = {
  14348. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  14349. * };
  14350. *
  14351. * var other = {
  14352. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  14353. * };
  14354. *
  14355. * _.merge(object, other);
  14356. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  14357. */
  14358. var merge = createAssigner(function(object, source, srcIndex) {
  14359. baseMerge(object, source, srcIndex);
  14360. });
  14361. /**
  14362. * This method is like `_.merge` except that it accepts `customizer` which
  14363. * is invoked to produce the merged values of the destination and source
  14364. * properties. If `customizer` returns `undefined`, merging is handled by the
  14365. * method instead. The `customizer` is invoked with six arguments:
  14366. * (objValue, srcValue, key, object, source, stack).
  14367. *
  14368. * **Note:** This method mutates `object`.
  14369. *
  14370. * @static
  14371. * @memberOf _
  14372. * @since 4.0.0
  14373. * @category Object
  14374. * @param {Object} object The destination object.
  14375. * @param {...Object} sources The source objects.
  14376. * @param {Function} customizer The function to customize assigned values.
  14377. * @returns {Object} Returns `object`.
  14378. * @example
  14379. *
  14380. * function customizer(objValue, srcValue) {
  14381. * if (_.isArray(objValue)) {
  14382. * return objValue.concat(srcValue);
  14383. * }
  14384. * }
  14385. *
  14386. * var object = { 'a': [1], 'b': [2] };
  14387. * var other = { 'a': [3], 'b': [4] };
  14388. *
  14389. * _.mergeWith(object, other, customizer);
  14390. * // => { 'a': [1, 3], 'b': [2, 4] }
  14391. */
  14392. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14393. baseMerge(object, source, srcIndex, customizer);
  14394. });
  14395. /**
  14396. * The opposite of `_.pick`; this method creates an object composed of the
  14397. * own and inherited enumerable property paths of `object` that are not omitted.
  14398. *
  14399. * **Note:** This method is considerably slower than `_.pick`.
  14400. *
  14401. * @static
  14402. * @since 0.1.0
  14403. * @memberOf _
  14404. * @category Object
  14405. * @param {Object} object The source object.
  14406. * @param {...(string|string[])} [paths] The property paths to omit.
  14407. * @returns {Object} Returns the new object.
  14408. * @example
  14409. *
  14410. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14411. *
  14412. * _.omit(object, ['a', 'c']);
  14413. * // => { 'b': '2' }
  14414. */
  14415. var omit = flatRest(function(object, paths) {
  14416. var result = {};
  14417. if (object == null) {
  14418. return result;
  14419. }
  14420. var isDeep = false;
  14421. paths = arrayMap(paths, function(path) {
  14422. path = castPath(path, object);
  14423. isDeep || (isDeep = path.length > 1);
  14424. return path;
  14425. });
  14426. copyObject(object, getAllKeysIn(object), result);
  14427. if (isDeep) {
  14428. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14429. }
  14430. var length = paths.length;
  14431. while (length--) {
  14432. baseUnset(result, paths[length]);
  14433. }
  14434. return result;
  14435. });
  14436. /**
  14437. * The opposite of `_.pickBy`; this method creates an object composed of
  14438. * the own and inherited enumerable string keyed properties of `object` that
  14439. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14440. * arguments: (value, key).
  14441. *
  14442. * @static
  14443. * @memberOf _
  14444. * @since 4.0.0
  14445. * @category Object
  14446. * @param {Object} object The source object.
  14447. * @param {Function} [predicate=_.identity] The function invoked per property.
  14448. * @returns {Object} Returns the new object.
  14449. * @example
  14450. *
  14451. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14452. *
  14453. * _.omitBy(object, _.isNumber);
  14454. * // => { 'b': '2' }
  14455. */
  14456. function omitBy(object, predicate) {
  14457. return pickBy(object, negate(getIteratee(predicate)));
  14458. }
  14459. /**
  14460. * Creates an object composed of the picked `object` properties.
  14461. *
  14462. * @static
  14463. * @since 0.1.0
  14464. * @memberOf _
  14465. * @category Object
  14466. * @param {Object} object The source object.
  14467. * @param {...(string|string[])} [paths] The property paths to pick.
  14468. * @returns {Object} Returns the new object.
  14469. * @example
  14470. *
  14471. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14472. *
  14473. * _.pick(object, ['a', 'c']);
  14474. * // => { 'a': 1, 'c': 3 }
  14475. */
  14476. var pick = flatRest(function(object, paths) {
  14477. return object == null ? {} : basePick(object, paths);
  14478. });
  14479. /**
  14480. * Creates an object composed of the `object` properties `predicate` returns
  14481. * truthy for. The predicate is invoked with two arguments: (value, key).
  14482. *
  14483. * @static
  14484. * @memberOf _
  14485. * @since 4.0.0
  14486. * @category Object
  14487. * @param {Object} object The source object.
  14488. * @param {Function} [predicate=_.identity] The function invoked per property.
  14489. * @returns {Object} Returns the new object.
  14490. * @example
  14491. *
  14492. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14493. *
  14494. * _.pickBy(object, _.isNumber);
  14495. * // => { 'a': 1, 'c': 3 }
  14496. */
  14497. function pickBy(object, predicate) {
  14498. if (object == null) {
  14499. return {};
  14500. }
  14501. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14502. return [prop];
  14503. });
  14504. predicate = getIteratee(predicate);
  14505. return basePickBy(object, props, function(value, path) {
  14506. return predicate(value, path[0]);
  14507. });
  14508. }
  14509. /**
  14510. * This method is like `_.get` except that if the resolved value is a
  14511. * function it's invoked with the `this` binding of its parent object and
  14512. * its result is returned.
  14513. *
  14514. * @static
  14515. * @since 0.1.0
  14516. * @memberOf _
  14517. * @category Object
  14518. * @param {Object} object The object to query.
  14519. * @param {Array|string} path The path of the property to resolve.
  14520. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14521. * @returns {*} Returns the resolved value.
  14522. * @example
  14523. *
  14524. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14525. *
  14526. * _.result(object, 'a[0].b.c1');
  14527. * // => 3
  14528. *
  14529. * _.result(object, 'a[0].b.c2');
  14530. * // => 4
  14531. *
  14532. * _.result(object, 'a[0].b.c3', 'default');
  14533. * // => 'default'
  14534. *
  14535. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14536. * // => 'default'
  14537. */
  14538. function result(object, path, defaultValue) {
  14539. path = castPath(path, object);
  14540. var index = -1,
  14541. length = path.length;
  14542. // Ensure the loop is entered when path is empty.
  14543. if (!length) {
  14544. length = 1;
  14545. object = undefined;
  14546. }
  14547. while (++index < length) {
  14548. var value = object == null ? undefined : object[toKey(path[index])];
  14549. if (value === undefined) {
  14550. index = length;
  14551. value = defaultValue;
  14552. }
  14553. object = isFunction(value) ? value.call(object) : value;
  14554. }
  14555. return object;
  14556. }
  14557. /**
  14558. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14559. * it's created. Arrays are created for missing index properties while objects
  14560. * are created for all other missing properties. Use `_.setWith` to customize
  14561. * `path` creation.
  14562. *
  14563. * **Note:** This method mutates `object`.
  14564. *
  14565. * @static
  14566. * @memberOf _
  14567. * @since 3.7.0
  14568. * @category Object
  14569. * @param {Object} object The object to modify.
  14570. * @param {Array|string} path The path of the property to set.
  14571. * @param {*} value The value to set.
  14572. * @returns {Object} Returns `object`.
  14573. * @example
  14574. *
  14575. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14576. *
  14577. * _.set(object, 'a[0].b.c', 4);
  14578. * console.log(object.a[0].b.c);
  14579. * // => 4
  14580. *
  14581. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14582. * console.log(object.x[0].y.z);
  14583. * // => 5
  14584. */
  14585. function set(object, path, value) {
  14586. return object == null ? object : baseSet(object, path, value);
  14587. }
  14588. /**
  14589. * This method is like `_.set` except that it accepts `customizer` which is
  14590. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14591. * path creation is handled by the method instead. The `customizer` is invoked
  14592. * with three arguments: (nsValue, key, nsObject).
  14593. *
  14594. * **Note:** This method mutates `object`.
  14595. *
  14596. * @static
  14597. * @memberOf _
  14598. * @since 4.0.0
  14599. * @category Object
  14600. * @param {Object} object The object to modify.
  14601. * @param {Array|string} path The path of the property to set.
  14602. * @param {*} value The value to set.
  14603. * @param {Function} [customizer] The function to customize assigned values.
  14604. * @returns {Object} Returns `object`.
  14605. * @example
  14606. *
  14607. * var object = {};
  14608. *
  14609. * _.setWith(object, '[0][1]', 'a', Object);
  14610. * // => { '0': { '1': 'a' } }
  14611. */
  14612. function setWith(object, path, value, customizer) {
  14613. customizer = typeof customizer == 'function' ? customizer : undefined;
  14614. return object == null ? object : baseSet(object, path, value, customizer);
  14615. }
  14616. /**
  14617. * Creates an array of own enumerable string keyed-value pairs for `object`
  14618. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14619. * entries are returned.
  14620. *
  14621. * @static
  14622. * @memberOf _
  14623. * @since 4.0.0
  14624. * @alias entries
  14625. * @category Object
  14626. * @param {Object} object The object to query.
  14627. * @returns {Array} Returns the key-value pairs.
  14628. * @example
  14629. *
  14630. * function Foo() {
  14631. * this.a = 1;
  14632. * this.b = 2;
  14633. * }
  14634. *
  14635. * Foo.prototype.c = 3;
  14636. *
  14637. * _.toPairs(new Foo);
  14638. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14639. */
  14640. var toPairs = createToPairs(keys);
  14641. /**
  14642. * Creates an array of own and inherited enumerable string keyed-value pairs
  14643. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14644. * or set, its entries are returned.
  14645. *
  14646. * @static
  14647. * @memberOf _
  14648. * @since 4.0.0
  14649. * @alias entriesIn
  14650. * @category Object
  14651. * @param {Object} object The object to query.
  14652. * @returns {Array} Returns the key-value pairs.
  14653. * @example
  14654. *
  14655. * function Foo() {
  14656. * this.a = 1;
  14657. * this.b = 2;
  14658. * }
  14659. *
  14660. * Foo.prototype.c = 3;
  14661. *
  14662. * _.toPairsIn(new Foo);
  14663. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14664. */
  14665. var toPairsIn = createToPairs(keysIn);
  14666. /**
  14667. * An alternative to `_.reduce`; this method transforms `object` to a new
  14668. * `accumulator` object which is the result of running each of its own
  14669. * enumerable string keyed properties thru `iteratee`, with each invocation
  14670. * potentially mutating the `accumulator` object. If `accumulator` is not
  14671. * provided, a new object with the same `[[Prototype]]` will be used. The
  14672. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14673. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14674. *
  14675. * @static
  14676. * @memberOf _
  14677. * @since 1.3.0
  14678. * @category Object
  14679. * @param {Object} object The object to iterate over.
  14680. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14681. * @param {*} [accumulator] The custom accumulator value.
  14682. * @returns {*} Returns the accumulated value.
  14683. * @example
  14684. *
  14685. * _.transform([2, 3, 4], function(result, n) {
  14686. * result.push(n *= n);
  14687. * return n % 2 == 0;
  14688. * }, []);
  14689. * // => [4, 9]
  14690. *
  14691. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14692. * (result[value] || (result[value] = [])).push(key);
  14693. * }, {});
  14694. * // => { '1': ['a', 'c'], '2': ['b'] }
  14695. */
  14696. function transform(object, iteratee, accumulator) {
  14697. var isArr = isArray(object),
  14698. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14699. iteratee = getIteratee(iteratee, 4);
  14700. if (accumulator == null) {
  14701. var Ctor = object && object.constructor;
  14702. if (isArrLike) {
  14703. accumulator = isArr ? new Ctor : [];
  14704. }
  14705. else if (isObject(object)) {
  14706. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14707. }
  14708. else {
  14709. accumulator = {};
  14710. }
  14711. }
  14712. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14713. return iteratee(accumulator, value, index, object);
  14714. });
  14715. return accumulator;
  14716. }
  14717. /**
  14718. * Removes the property at `path` of `object`.
  14719. *
  14720. * **Note:** This method mutates `object`.
  14721. *
  14722. * @static
  14723. * @memberOf _
  14724. * @since 4.0.0
  14725. * @category Object
  14726. * @param {Object} object The object to modify.
  14727. * @param {Array|string} path The path of the property to unset.
  14728. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14729. * @example
  14730. *
  14731. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14732. * _.unset(object, 'a[0].b.c');
  14733. * // => true
  14734. *
  14735. * console.log(object);
  14736. * // => { 'a': [{ 'b': {} }] };
  14737. *
  14738. * _.unset(object, ['a', '0', 'b', 'c']);
  14739. * // => true
  14740. *
  14741. * console.log(object);
  14742. * // => { 'a': [{ 'b': {} }] };
  14743. */
  14744. function unset(object, path) {
  14745. return object == null ? true : baseUnset(object, path);
  14746. }
  14747. /**
  14748. * This method is like `_.set` except that accepts `updater` to produce the
  14749. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14750. * is invoked with one argument: (value).
  14751. *
  14752. * **Note:** This method mutates `object`.
  14753. *
  14754. * @static
  14755. * @memberOf _
  14756. * @since 4.6.0
  14757. * @category Object
  14758. * @param {Object} object The object to modify.
  14759. * @param {Array|string} path The path of the property to set.
  14760. * @param {Function} updater The function to produce the updated value.
  14761. * @returns {Object} Returns `object`.
  14762. * @example
  14763. *
  14764. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14765. *
  14766. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14767. * console.log(object.a[0].b.c);
  14768. * // => 9
  14769. *
  14770. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14771. * console.log(object.x[0].y.z);
  14772. * // => 0
  14773. */
  14774. function update(object, path, updater) {
  14775. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14776. }
  14777. /**
  14778. * This method is like `_.update` except that it accepts `customizer` which is
  14779. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14780. * path creation is handled by the method instead. The `customizer` is invoked
  14781. * with three arguments: (nsValue, key, nsObject).
  14782. *
  14783. * **Note:** This method mutates `object`.
  14784. *
  14785. * @static
  14786. * @memberOf _
  14787. * @since 4.6.0
  14788. * @category Object
  14789. * @param {Object} object The object to modify.
  14790. * @param {Array|string} path The path of the property to set.
  14791. * @param {Function} updater The function to produce the updated value.
  14792. * @param {Function} [customizer] The function to customize assigned values.
  14793. * @returns {Object} Returns `object`.
  14794. * @example
  14795. *
  14796. * var object = {};
  14797. *
  14798. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14799. * // => { '0': { '1': 'a' } }
  14800. */
  14801. function updateWith(object, path, updater, customizer) {
  14802. customizer = typeof customizer == 'function' ? customizer : undefined;
  14803. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14804. }
  14805. /**
  14806. * Creates an array of the own enumerable string keyed property values of `object`.
  14807. *
  14808. * **Note:** Non-object values are coerced to objects.
  14809. *
  14810. * @static
  14811. * @since 0.1.0
  14812. * @memberOf _
  14813. * @category Object
  14814. * @param {Object} object The object to query.
  14815. * @returns {Array} Returns the array of property values.
  14816. * @example
  14817. *
  14818. * function Foo() {
  14819. * this.a = 1;
  14820. * this.b = 2;
  14821. * }
  14822. *
  14823. * Foo.prototype.c = 3;
  14824. *
  14825. * _.values(new Foo);
  14826. * // => [1, 2] (iteration order is not guaranteed)
  14827. *
  14828. * _.values('hi');
  14829. * // => ['h', 'i']
  14830. */
  14831. function values(object) {
  14832. return object == null ? [] : baseValues(object, keys(object));
  14833. }
  14834. /**
  14835. * Creates an array of the own and inherited enumerable string keyed property
  14836. * values of `object`.
  14837. *
  14838. * **Note:** Non-object values are coerced to objects.
  14839. *
  14840. * @static
  14841. * @memberOf _
  14842. * @since 3.0.0
  14843. * @category Object
  14844. * @param {Object} object The object to query.
  14845. * @returns {Array} Returns the array of property values.
  14846. * @example
  14847. *
  14848. * function Foo() {
  14849. * this.a = 1;
  14850. * this.b = 2;
  14851. * }
  14852. *
  14853. * Foo.prototype.c = 3;
  14854. *
  14855. * _.valuesIn(new Foo);
  14856. * // => [1, 2, 3] (iteration order is not guaranteed)
  14857. */
  14858. function valuesIn(object) {
  14859. return object == null ? [] : baseValues(object, keysIn(object));
  14860. }
  14861. /*------------------------------------------------------------------------*/
  14862. /**
  14863. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14864. *
  14865. * @static
  14866. * @memberOf _
  14867. * @since 4.0.0
  14868. * @category Number
  14869. * @param {number} number The number to clamp.
  14870. * @param {number} [lower] The lower bound.
  14871. * @param {number} upper The upper bound.
  14872. * @returns {number} Returns the clamped number.
  14873. * @example
  14874. *
  14875. * _.clamp(-10, -5, 5);
  14876. * // => -5
  14877. *
  14878. * _.clamp(10, -5, 5);
  14879. * // => 5
  14880. */
  14881. function clamp(number, lower, upper) {
  14882. if (upper === undefined) {
  14883. upper = lower;
  14884. lower = undefined;
  14885. }
  14886. if (upper !== undefined) {
  14887. upper = toNumber(upper);
  14888. upper = upper === upper ? upper : 0;
  14889. }
  14890. if (lower !== undefined) {
  14891. lower = toNumber(lower);
  14892. lower = lower === lower ? lower : 0;
  14893. }
  14894. return baseClamp(toNumber(number), lower, upper);
  14895. }
  14896. /**
  14897. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14898. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14899. * If `start` is greater than `end` the params are swapped to support
  14900. * negative ranges.
  14901. *
  14902. * @static
  14903. * @memberOf _
  14904. * @since 3.3.0
  14905. * @category Number
  14906. * @param {number} number The number to check.
  14907. * @param {number} [start=0] The start of the range.
  14908. * @param {number} end The end of the range.
  14909. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14910. * @see _.range, _.rangeRight
  14911. * @example
  14912. *
  14913. * _.inRange(3, 2, 4);
  14914. * // => true
  14915. *
  14916. * _.inRange(4, 8);
  14917. * // => true
  14918. *
  14919. * _.inRange(4, 2);
  14920. * // => false
  14921. *
  14922. * _.inRange(2, 2);
  14923. * // => false
  14924. *
  14925. * _.inRange(1.2, 2);
  14926. * // => true
  14927. *
  14928. * _.inRange(5.2, 4);
  14929. * // => false
  14930. *
  14931. * _.inRange(-3, -2, -6);
  14932. * // => true
  14933. */
  14934. function inRange(number, start, end) {
  14935. start = toFinite(start);
  14936. if (end === undefined) {
  14937. end = start;
  14938. start = 0;
  14939. } else {
  14940. end = toFinite(end);
  14941. }
  14942. number = toNumber(number);
  14943. return baseInRange(number, start, end);
  14944. }
  14945. /**
  14946. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14947. * If only one argument is provided a number between `0` and the given number
  14948. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14949. * floats, a floating-point number is returned instead of an integer.
  14950. *
  14951. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14952. * floating-point values which can produce unexpected results.
  14953. *
  14954. * @static
  14955. * @memberOf _
  14956. * @since 0.7.0
  14957. * @category Number
  14958. * @param {number} [lower=0] The lower bound.
  14959. * @param {number} [upper=1] The upper bound.
  14960. * @param {boolean} [floating] Specify returning a floating-point number.
  14961. * @returns {number} Returns the random number.
  14962. * @example
  14963. *
  14964. * _.random(0, 5);
  14965. * // => an integer between 0 and 5
  14966. *
  14967. * _.random(5);
  14968. * // => also an integer between 0 and 5
  14969. *
  14970. * _.random(5, true);
  14971. * // => a floating-point number between 0 and 5
  14972. *
  14973. * _.random(1.2, 5.2);
  14974. * // => a floating-point number between 1.2 and 5.2
  14975. */
  14976. function random(lower, upper, floating) {
  14977. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14978. upper = floating = undefined;
  14979. }
  14980. if (floating === undefined) {
  14981. if (typeof upper == 'boolean') {
  14982. floating = upper;
  14983. upper = undefined;
  14984. }
  14985. else if (typeof lower == 'boolean') {
  14986. floating = lower;
  14987. lower = undefined;
  14988. }
  14989. }
  14990. if (lower === undefined && upper === undefined) {
  14991. lower = 0;
  14992. upper = 1;
  14993. }
  14994. else {
  14995. lower = toFinite(lower);
  14996. if (upper === undefined) {
  14997. upper = lower;
  14998. lower = 0;
  14999. } else {
  15000. upper = toFinite(upper);
  15001. }
  15002. }
  15003. if (lower > upper) {
  15004. var temp = lower;
  15005. lower = upper;
  15006. upper = temp;
  15007. }
  15008. if (floating || lower % 1 || upper % 1) {
  15009. var rand = nativeRandom();
  15010. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  15011. }
  15012. return baseRandom(lower, upper);
  15013. }
  15014. /*------------------------------------------------------------------------*/
  15015. /**
  15016. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  15017. *
  15018. * @static
  15019. * @memberOf _
  15020. * @since 3.0.0
  15021. * @category String
  15022. * @param {string} [string=''] The string to convert.
  15023. * @returns {string} Returns the camel cased string.
  15024. * @example
  15025. *
  15026. * _.camelCase('Foo Bar');
  15027. * // => 'fooBar'
  15028. *
  15029. * _.camelCase('--foo-bar--');
  15030. * // => 'fooBar'
  15031. *
  15032. * _.camelCase('__FOO_BAR__');
  15033. * // => 'fooBar'
  15034. */
  15035. var camelCase = createCompounder(function(result, word, index) {
  15036. word = word.toLowerCase();
  15037. return result + (index ? capitalize(word) : word);
  15038. });
  15039. /**
  15040. * Converts the first character of `string` to upper case and the remaining
  15041. * to lower case.
  15042. *
  15043. * @static
  15044. * @memberOf _
  15045. * @since 3.0.0
  15046. * @category String
  15047. * @param {string} [string=''] The string to capitalize.
  15048. * @returns {string} Returns the capitalized string.
  15049. * @example
  15050. *
  15051. * _.capitalize('FRED');
  15052. * // => 'Fred'
  15053. */
  15054. function capitalize(string) {
  15055. return upperFirst(toString(string).toLowerCase());
  15056. }
  15057. /**
  15058. * Deburrs `string` by converting
  15059. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  15060. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  15061. * letters to basic Latin letters and removing
  15062. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  15063. *
  15064. * @static
  15065. * @memberOf _
  15066. * @since 3.0.0
  15067. * @category String
  15068. * @param {string} [string=''] The string to deburr.
  15069. * @returns {string} Returns the deburred string.
  15070. * @example
  15071. *
  15072. * _.deburr('déjà vu');
  15073. * // => 'deja vu'
  15074. */
  15075. function deburr(string) {
  15076. string = toString(string);
  15077. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  15078. }
  15079. /**
  15080. * Checks if `string` ends with the given target string.
  15081. *
  15082. * @static
  15083. * @memberOf _
  15084. * @since 3.0.0
  15085. * @category String
  15086. * @param {string} [string=''] The string to inspect.
  15087. * @param {string} [target] The string to search for.
  15088. * @param {number} [position=string.length] The position to search up to.
  15089. * @returns {boolean} Returns `true` if `string` ends with `target`,
  15090. * else `false`.
  15091. * @example
  15092. *
  15093. * _.endsWith('abc', 'c');
  15094. * // => true
  15095. *
  15096. * _.endsWith('abc', 'b');
  15097. * // => false
  15098. *
  15099. * _.endsWith('abc', 'b', 2);
  15100. * // => true
  15101. */
  15102. function endsWith(string, target, position) {
  15103. string = toString(string);
  15104. target = baseToString(target);
  15105. var length = string.length;
  15106. position = position === undefined
  15107. ? length
  15108. : baseClamp(toInteger(position), 0, length);
  15109. var end = position;
  15110. position -= target.length;
  15111. return position >= 0 && string.slice(position, end) == target;
  15112. }
  15113. /**
  15114. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  15115. * corresponding HTML entities.
  15116. *
  15117. * **Note:** No other characters are escaped. To escape additional
  15118. * characters use a third-party library like [_he_](https://mths.be/he).
  15119. *
  15120. * Though the ">" character is escaped for symmetry, characters like
  15121. * ">" and "/" don't need escaping in HTML and have no special meaning
  15122. * unless they're part of a tag or unquoted attribute value. See
  15123. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  15124. * (under "semi-related fun fact") for more details.
  15125. *
  15126. * When working with HTML you should always
  15127. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  15128. * XSS vectors.
  15129. *
  15130. * @static
  15131. * @since 0.1.0
  15132. * @memberOf _
  15133. * @category String
  15134. * @param {string} [string=''] The string to escape.
  15135. * @returns {string} Returns the escaped string.
  15136. * @example
  15137. *
  15138. * _.escape('fred, barney, & pebbles');
  15139. * // => 'fred, barney, &amp; pebbles'
  15140. */
  15141. function escape(string) {
  15142. string = toString(string);
  15143. return (string && reHasUnescapedHtml.test(string))
  15144. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  15145. : string;
  15146. }
  15147. /**
  15148. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  15149. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  15150. *
  15151. * @static
  15152. * @memberOf _
  15153. * @since 3.0.0
  15154. * @category String
  15155. * @param {string} [string=''] The string to escape.
  15156. * @returns {string} Returns the escaped string.
  15157. * @example
  15158. *
  15159. * _.escapeRegExp('[lodash](https://lodash.com/)');
  15160. * // => '\[lodash\]\(https://lodash\.com/\)'
  15161. */
  15162. function escapeRegExp(string) {
  15163. string = toString(string);
  15164. return (string && reHasRegExpChar.test(string))
  15165. ? string.replace(reRegExpChar, '\\$&')
  15166. : string;
  15167. }
  15168. /**
  15169. * Converts `string` to
  15170. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  15171. *
  15172. * @static
  15173. * @memberOf _
  15174. * @since 3.0.0
  15175. * @category String
  15176. * @param {string} [string=''] The string to convert.
  15177. * @returns {string} Returns the kebab cased string.
  15178. * @example
  15179. *
  15180. * _.kebabCase('Foo Bar');
  15181. * // => 'foo-bar'
  15182. *
  15183. * _.kebabCase('fooBar');
  15184. * // => 'foo-bar'
  15185. *
  15186. * _.kebabCase('__FOO_BAR__');
  15187. * // => 'foo-bar'
  15188. */
  15189. var kebabCase = createCompounder(function(result, word, index) {
  15190. return result + (index ? '-' : '') + word.toLowerCase();
  15191. });
  15192. /**
  15193. * Converts `string`, as space separated words, to lower case.
  15194. *
  15195. * @static
  15196. * @memberOf _
  15197. * @since 4.0.0
  15198. * @category String
  15199. * @param {string} [string=''] The string to convert.
  15200. * @returns {string} Returns the lower cased string.
  15201. * @example
  15202. *
  15203. * _.lowerCase('--Foo-Bar--');
  15204. * // => 'foo bar'
  15205. *
  15206. * _.lowerCase('fooBar');
  15207. * // => 'foo bar'
  15208. *
  15209. * _.lowerCase('__FOO_BAR__');
  15210. * // => 'foo bar'
  15211. */
  15212. var lowerCase = createCompounder(function(result, word, index) {
  15213. return result + (index ? ' ' : '') + word.toLowerCase();
  15214. });
  15215. /**
  15216. * Converts the first character of `string` to lower case.
  15217. *
  15218. * @static
  15219. * @memberOf _
  15220. * @since 4.0.0
  15221. * @category String
  15222. * @param {string} [string=''] The string to convert.
  15223. * @returns {string} Returns the converted string.
  15224. * @example
  15225. *
  15226. * _.lowerFirst('Fred');
  15227. * // => 'fred'
  15228. *
  15229. * _.lowerFirst('FRED');
  15230. * // => 'fRED'
  15231. */
  15232. var lowerFirst = createCaseFirst('toLowerCase');
  15233. /**
  15234. * Pads `string` on the left and right sides if it's shorter than `length`.
  15235. * Padding characters are truncated if they can't be evenly divided by `length`.
  15236. *
  15237. * @static
  15238. * @memberOf _
  15239. * @since 3.0.0
  15240. * @category String
  15241. * @param {string} [string=''] The string to pad.
  15242. * @param {number} [length=0] The padding length.
  15243. * @param {string} [chars=' '] The string used as padding.
  15244. * @returns {string} Returns the padded string.
  15245. * @example
  15246. *
  15247. * _.pad('abc', 8);
  15248. * // => ' abc '
  15249. *
  15250. * _.pad('abc', 8, '_-');
  15251. * // => '_-abc_-_'
  15252. *
  15253. * _.pad('abc', 3);
  15254. * // => 'abc'
  15255. */
  15256. function pad(string, length, chars) {
  15257. string = toString(string);
  15258. length = toInteger(length);
  15259. var strLength = length ? stringSize(string) : 0;
  15260. if (!length || strLength >= length) {
  15261. return string;
  15262. }
  15263. var mid = (length - strLength) / 2;
  15264. return (
  15265. createPadding(nativeFloor(mid), chars) +
  15266. string +
  15267. createPadding(nativeCeil(mid), chars)
  15268. );
  15269. }
  15270. /**
  15271. * Pads `string` on the right side if it's shorter than `length`. Padding
  15272. * characters are truncated if they exceed `length`.
  15273. *
  15274. * @static
  15275. * @memberOf _
  15276. * @since 4.0.0
  15277. * @category String
  15278. * @param {string} [string=''] The string to pad.
  15279. * @param {number} [length=0] The padding length.
  15280. * @param {string} [chars=' '] The string used as padding.
  15281. * @returns {string} Returns the padded string.
  15282. * @example
  15283. *
  15284. * _.padEnd('abc', 6);
  15285. * // => 'abc '
  15286. *
  15287. * _.padEnd('abc', 6, '_-');
  15288. * // => 'abc_-_'
  15289. *
  15290. * _.padEnd('abc', 3);
  15291. * // => 'abc'
  15292. */
  15293. function padEnd(string, length, chars) {
  15294. string = toString(string);
  15295. length = toInteger(length);
  15296. var strLength = length ? stringSize(string) : 0;
  15297. return (length && strLength < length)
  15298. ? (string + createPadding(length - strLength, chars))
  15299. : string;
  15300. }
  15301. /**
  15302. * Pads `string` on the left side if it's shorter than `length`. Padding
  15303. * characters are truncated if they exceed `length`.
  15304. *
  15305. * @static
  15306. * @memberOf _
  15307. * @since 4.0.0
  15308. * @category String
  15309. * @param {string} [string=''] The string to pad.
  15310. * @param {number} [length=0] The padding length.
  15311. * @param {string} [chars=' '] The string used as padding.
  15312. * @returns {string} Returns the padded string.
  15313. * @example
  15314. *
  15315. * _.padStart('abc', 6);
  15316. * // => ' abc'
  15317. *
  15318. * _.padStart('abc', 6, '_-');
  15319. * // => '_-_abc'
  15320. *
  15321. * _.padStart('abc', 3);
  15322. * // => 'abc'
  15323. */
  15324. function padStart(string, length, chars) {
  15325. string = toString(string);
  15326. length = toInteger(length);
  15327. var strLength = length ? stringSize(string) : 0;
  15328. return (length && strLength < length)
  15329. ? (createPadding(length - strLength, chars) + string)
  15330. : string;
  15331. }
  15332. /**
  15333. * Converts `string` to an integer of the specified radix. If `radix` is
  15334. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  15335. * hexadecimal, in which case a `radix` of `16` is used.
  15336. *
  15337. * **Note:** This method aligns with the
  15338. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  15339. *
  15340. * @static
  15341. * @memberOf _
  15342. * @since 1.1.0
  15343. * @category String
  15344. * @param {string} string The string to convert.
  15345. * @param {number} [radix=10] The radix to interpret `value` by.
  15346. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15347. * @returns {number} Returns the converted integer.
  15348. * @example
  15349. *
  15350. * _.parseInt('08');
  15351. * // => 8
  15352. *
  15353. * _.map(['6', '08', '10'], _.parseInt);
  15354. * // => [6, 8, 10]
  15355. */
  15356. function parseInt(string, radix, guard) {
  15357. if (guard || radix == null) {
  15358. radix = 0;
  15359. } else if (radix) {
  15360. radix = +radix;
  15361. }
  15362. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  15363. }
  15364. /**
  15365. * Repeats the given string `n` times.
  15366. *
  15367. * @static
  15368. * @memberOf _
  15369. * @since 3.0.0
  15370. * @category String
  15371. * @param {string} [string=''] The string to repeat.
  15372. * @param {number} [n=1] The number of times to repeat the string.
  15373. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15374. * @returns {string} Returns the repeated string.
  15375. * @example
  15376. *
  15377. * _.repeat('*', 3);
  15378. * // => '***'
  15379. *
  15380. * _.repeat('abc', 2);
  15381. * // => 'abcabc'
  15382. *
  15383. * _.repeat('abc', 0);
  15384. * // => ''
  15385. */
  15386. function repeat(string, n, guard) {
  15387. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  15388. n = 1;
  15389. } else {
  15390. n = toInteger(n);
  15391. }
  15392. return baseRepeat(toString(string), n);
  15393. }
  15394. /**
  15395. * Replaces matches for `pattern` in `string` with `replacement`.
  15396. *
  15397. * **Note:** This method is based on
  15398. * [`String#replace`](https://mdn.io/String/replace).
  15399. *
  15400. * @static
  15401. * @memberOf _
  15402. * @since 4.0.0
  15403. * @category String
  15404. * @param {string} [string=''] The string to modify.
  15405. * @param {RegExp|string} pattern The pattern to replace.
  15406. * @param {Function|string} replacement The match replacement.
  15407. * @returns {string} Returns the modified string.
  15408. * @example
  15409. *
  15410. * _.replace('Hi Fred', 'Fred', 'Barney');
  15411. * // => 'Hi Barney'
  15412. */
  15413. function replace() {
  15414. var args = arguments,
  15415. string = toString(args[0]);
  15416. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15417. }
  15418. /**
  15419. * Converts `string` to
  15420. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15421. *
  15422. * @static
  15423. * @memberOf _
  15424. * @since 3.0.0
  15425. * @category String
  15426. * @param {string} [string=''] The string to convert.
  15427. * @returns {string} Returns the snake cased string.
  15428. * @example
  15429. *
  15430. * _.snakeCase('Foo Bar');
  15431. * // => 'foo_bar'
  15432. *
  15433. * _.snakeCase('fooBar');
  15434. * // => 'foo_bar'
  15435. *
  15436. * _.snakeCase('--FOO-BAR--');
  15437. * // => 'foo_bar'
  15438. */
  15439. var snakeCase = createCompounder(function(result, word, index) {
  15440. return result + (index ? '_' : '') + word.toLowerCase();
  15441. });
  15442. /**
  15443. * Splits `string` by `separator`.
  15444. *
  15445. * **Note:** This method is based on
  15446. * [`String#split`](https://mdn.io/String/split).
  15447. *
  15448. * @static
  15449. * @memberOf _
  15450. * @since 4.0.0
  15451. * @category String
  15452. * @param {string} [string=''] The string to split.
  15453. * @param {RegExp|string} separator The separator pattern to split by.
  15454. * @param {number} [limit] The length to truncate results to.
  15455. * @returns {Array} Returns the string segments.
  15456. * @example
  15457. *
  15458. * _.split('a-b-c', '-', 2);
  15459. * // => ['a', 'b']
  15460. */
  15461. function split(string, separator, limit) {
  15462. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15463. separator = limit = undefined;
  15464. }
  15465. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15466. if (!limit) {
  15467. return [];
  15468. }
  15469. string = toString(string);
  15470. if (string && (
  15471. typeof separator == 'string' ||
  15472. (separator != null && !isRegExp(separator))
  15473. )) {
  15474. separator = baseToString(separator);
  15475. if (!separator && hasUnicode(string)) {
  15476. return castSlice(stringToArray(string), 0, limit);
  15477. }
  15478. }
  15479. return string.split(separator, limit);
  15480. }
  15481. /**
  15482. * Converts `string` to
  15483. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15484. *
  15485. * @static
  15486. * @memberOf _
  15487. * @since 3.1.0
  15488. * @category String
  15489. * @param {string} [string=''] The string to convert.
  15490. * @returns {string} Returns the start cased string.
  15491. * @example
  15492. *
  15493. * _.startCase('--foo-bar--');
  15494. * // => 'Foo Bar'
  15495. *
  15496. * _.startCase('fooBar');
  15497. * // => 'Foo Bar'
  15498. *
  15499. * _.startCase('__FOO_BAR__');
  15500. * // => 'FOO BAR'
  15501. */
  15502. var startCase = createCompounder(function(result, word, index) {
  15503. return result + (index ? ' ' : '') + upperFirst(word);
  15504. });
  15505. /**
  15506. * Checks if `string` starts with the given target string.
  15507. *
  15508. * @static
  15509. * @memberOf _
  15510. * @since 3.0.0
  15511. * @category String
  15512. * @param {string} [string=''] The string to inspect.
  15513. * @param {string} [target] The string to search for.
  15514. * @param {number} [position=0] The position to search from.
  15515. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15516. * else `false`.
  15517. * @example
  15518. *
  15519. * _.startsWith('abc', 'a');
  15520. * // => true
  15521. *
  15522. * _.startsWith('abc', 'b');
  15523. * // => false
  15524. *
  15525. * _.startsWith('abc', 'b', 1);
  15526. * // => true
  15527. */
  15528. function startsWith(string, target, position) {
  15529. string = toString(string);
  15530. position = position == null
  15531. ? 0
  15532. : baseClamp(toInteger(position), 0, string.length);
  15533. target = baseToString(target);
  15534. return string.slice(position, position + target.length) == target;
  15535. }
  15536. /**
  15537. * Creates a compiled template function that can interpolate data properties
  15538. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15539. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15540. * properties may be accessed as free variables in the template. If a setting
  15541. * object is given, it takes precedence over `_.templateSettings` values.
  15542. *
  15543. * **Note:** In the development build `_.template` utilizes
  15544. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15545. * for easier debugging.
  15546. *
  15547. * For more information on precompiling templates see
  15548. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15549. *
  15550. * For more information on Chrome extension sandboxes see
  15551. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15552. *
  15553. * @static
  15554. * @since 0.1.0
  15555. * @memberOf _
  15556. * @category String
  15557. * @param {string} [string=''] The template string.
  15558. * @param {Object} [options={}] The options object.
  15559. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15560. * The HTML "escape" delimiter.
  15561. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15562. * The "evaluate" delimiter.
  15563. * @param {Object} [options.imports=_.templateSettings.imports]
  15564. * An object to import into the template as free variables.
  15565. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15566. * The "interpolate" delimiter.
  15567. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15568. * The sourceURL of the compiled template.
  15569. * @param {string} [options.variable='obj']
  15570. * The data object variable name.
  15571. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15572. * @returns {Function} Returns the compiled template function.
  15573. * @example
  15574. *
  15575. * // Use the "interpolate" delimiter to create a compiled template.
  15576. * var compiled = _.template('hello <%= user %>!');
  15577. * compiled({ 'user': 'fred' });
  15578. * // => 'hello fred!'
  15579. *
  15580. * // Use the HTML "escape" delimiter to escape data property values.
  15581. * var compiled = _.template('<b><%- value %></b>');
  15582. * compiled({ 'value': '<script>' });
  15583. * // => '<b>&lt;script&gt;</b>'
  15584. *
  15585. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15586. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15587. * compiled({ 'users': ['fred', 'barney'] });
  15588. * // => '<li>fred</li><li>barney</li>'
  15589. *
  15590. * // Use the internal `print` function in "evaluate" delimiters.
  15591. * var compiled = _.template('<% print("hello " + user); %>!');
  15592. * compiled({ 'user': 'barney' });
  15593. * // => 'hello barney!'
  15594. *
  15595. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15596. * // Disable support by replacing the "interpolate" delimiter.
  15597. * var compiled = _.template('hello ${ user }!');
  15598. * compiled({ 'user': 'pebbles' });
  15599. * // => 'hello pebbles!'
  15600. *
  15601. * // Use backslashes to treat delimiters as plain text.
  15602. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15603. * compiled({ 'value': 'ignored' });
  15604. * // => '<%- value %>'
  15605. *
  15606. * // Use the `imports` option to import `jQuery` as `jq`.
  15607. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15608. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15609. * compiled({ 'users': ['fred', 'barney'] });
  15610. * // => '<li>fred</li><li>barney</li>'
  15611. *
  15612. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15613. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15614. * compiled(data);
  15615. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15616. *
  15617. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15618. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15619. * compiled.source;
  15620. * // => function(data) {
  15621. * // var __t, __p = '';
  15622. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15623. * // return __p;
  15624. * // }
  15625. *
  15626. * // Use custom template delimiters.
  15627. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15628. * var compiled = _.template('hello {{ user }}!');
  15629. * compiled({ 'user': 'mustache' });
  15630. * // => 'hello mustache!'
  15631. *
  15632. * // Use the `source` property to inline compiled templates for meaningful
  15633. * // line numbers in error messages and stack traces.
  15634. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15635. * var JST = {\
  15636. * "main": ' + _.template(mainText).source + '\
  15637. * };\
  15638. * ');
  15639. */
  15640. function template(string, options, guard) {
  15641. // Based on John Resig's `tmpl` implementation
  15642. // (http://ejohn.org/blog/javascript-micro-templating/)
  15643. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15644. var settings = lodash.templateSettings;
  15645. if (guard && isIterateeCall(string, options, guard)) {
  15646. options = undefined;
  15647. }
  15648. string = toString(string);
  15649. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15650. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15651. importsKeys = keys(imports),
  15652. importsValues = baseValues(imports, importsKeys);
  15653. var isEscaping,
  15654. isEvaluating,
  15655. index = 0,
  15656. interpolate = options.interpolate || reNoMatch,
  15657. source = "__p += '";
  15658. // Compile the regexp to match each delimiter.
  15659. var reDelimiters = RegExp(
  15660. (options.escape || reNoMatch).source + '|' +
  15661. interpolate.source + '|' +
  15662. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15663. (options.evaluate || reNoMatch).source + '|$'
  15664. , 'g');
  15665. // Use a sourceURL for easier debugging.
  15666. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15667. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15668. // and escape the comment, thus injecting code that gets evaled.
  15669. var sourceURL = '//# sourceURL=' +
  15670. (hasOwnProperty.call(options, 'sourceURL')
  15671. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15672. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15673. ) + '\n';
  15674. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15675. interpolateValue || (interpolateValue = esTemplateValue);
  15676. // Escape characters that can't be included in string literals.
  15677. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15678. // Replace delimiters with snippets.
  15679. if (escapeValue) {
  15680. isEscaping = true;
  15681. source += "' +\n__e(" + escapeValue + ") +\n'";
  15682. }
  15683. if (evaluateValue) {
  15684. isEvaluating = true;
  15685. source += "';\n" + evaluateValue + ";\n__p += '";
  15686. }
  15687. if (interpolateValue) {
  15688. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15689. }
  15690. index = offset + match.length;
  15691. // The JS engine embedded in Adobe products needs `match` returned in
  15692. // order to produce the correct `offset` value.
  15693. return match;
  15694. });
  15695. source += "';\n";
  15696. // If `variable` is not specified wrap a with-statement around the generated
  15697. // code to add the data object to the top of the scope chain.
  15698. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15699. if (!variable) {
  15700. source = 'with (obj) {\n' + source + '\n}\n';
  15701. }
  15702. // Throw an error if a forbidden character was found in `variable`, to prevent
  15703. // potential command injection attacks.
  15704. else if (reForbiddenIdentifierChars.test(variable)) {
  15705. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15706. }
  15707. // Cleanup code by stripping empty strings.
  15708. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15709. .replace(reEmptyStringMiddle, '$1')
  15710. .replace(reEmptyStringTrailing, '$1;');
  15711. // Frame code as the function body.
  15712. source = 'function(' + (variable || 'obj') + ') {\n' +
  15713. (variable
  15714. ? ''
  15715. : 'obj || (obj = {});\n'
  15716. ) +
  15717. "var __t, __p = ''" +
  15718. (isEscaping
  15719. ? ', __e = _.escape'
  15720. : ''
  15721. ) +
  15722. (isEvaluating
  15723. ? ', __j = Array.prototype.join;\n' +
  15724. "function print() { __p += __j.call(arguments, '') }\n"
  15725. : ';\n'
  15726. ) +
  15727. source +
  15728. 'return __p\n}';
  15729. var result = attempt(function() {
  15730. return Function(importsKeys, sourceURL + 'return ' + source)
  15731. .apply(undefined, importsValues);
  15732. });
  15733. // Provide the compiled function's source by its `toString` method or
  15734. // the `source` property as a convenience for inlining compiled templates.
  15735. result.source = source;
  15736. if (isError(result)) {
  15737. throw result;
  15738. }
  15739. return result;
  15740. }
  15741. /**
  15742. * Converts `string`, as a whole, to lower case just like
  15743. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15744. *
  15745. * @static
  15746. * @memberOf _
  15747. * @since 4.0.0
  15748. * @category String
  15749. * @param {string} [string=''] The string to convert.
  15750. * @returns {string} Returns the lower cased string.
  15751. * @example
  15752. *
  15753. * _.toLower('--Foo-Bar--');
  15754. * // => '--foo-bar--'
  15755. *
  15756. * _.toLower('fooBar');
  15757. * // => 'foobar'
  15758. *
  15759. * _.toLower('__FOO_BAR__');
  15760. * // => '__foo_bar__'
  15761. */
  15762. function toLower(value) {
  15763. return toString(value).toLowerCase();
  15764. }
  15765. /**
  15766. * Converts `string`, as a whole, to upper case just like
  15767. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15768. *
  15769. * @static
  15770. * @memberOf _
  15771. * @since 4.0.0
  15772. * @category String
  15773. * @param {string} [string=''] The string to convert.
  15774. * @returns {string} Returns the upper cased string.
  15775. * @example
  15776. *
  15777. * _.toUpper('--foo-bar--');
  15778. * // => '--FOO-BAR--'
  15779. *
  15780. * _.toUpper('fooBar');
  15781. * // => 'FOOBAR'
  15782. *
  15783. * _.toUpper('__foo_bar__');
  15784. * // => '__FOO_BAR__'
  15785. */
  15786. function toUpper(value) {
  15787. return toString(value).toUpperCase();
  15788. }
  15789. /**
  15790. * Removes leading and trailing whitespace or specified characters from `string`.
  15791. *
  15792. * @static
  15793. * @memberOf _
  15794. * @since 3.0.0
  15795. * @category String
  15796. * @param {string} [string=''] The string to trim.
  15797. * @param {string} [chars=whitespace] The characters to trim.
  15798. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15799. * @returns {string} Returns the trimmed string.
  15800. * @example
  15801. *
  15802. * _.trim(' abc ');
  15803. * // => 'abc'
  15804. *
  15805. * _.trim('-_-abc-_-', '_-');
  15806. * // => 'abc'
  15807. *
  15808. * _.map([' foo ', ' bar '], _.trim);
  15809. * // => ['foo', 'bar']
  15810. */
  15811. function trim(string, chars, guard) {
  15812. string = toString(string);
  15813. if (string && (guard || chars === undefined)) {
  15814. return baseTrim(string);
  15815. }
  15816. if (!string || !(chars = baseToString(chars))) {
  15817. return string;
  15818. }
  15819. var strSymbols = stringToArray(string),
  15820. chrSymbols = stringToArray(chars),
  15821. start = charsStartIndex(strSymbols, chrSymbols),
  15822. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15823. return castSlice(strSymbols, start, end).join('');
  15824. }
  15825. /**
  15826. * Removes trailing whitespace or specified characters from `string`.
  15827. *
  15828. * @static
  15829. * @memberOf _
  15830. * @since 4.0.0
  15831. * @category String
  15832. * @param {string} [string=''] The string to trim.
  15833. * @param {string} [chars=whitespace] The characters to trim.
  15834. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15835. * @returns {string} Returns the trimmed string.
  15836. * @example
  15837. *
  15838. * _.trimEnd(' abc ');
  15839. * // => ' abc'
  15840. *
  15841. * _.trimEnd('-_-abc-_-', '_-');
  15842. * // => '-_-abc'
  15843. */
  15844. function trimEnd(string, chars, guard) {
  15845. string = toString(string);
  15846. if (string && (guard || chars === undefined)) {
  15847. return string.slice(0, trimmedEndIndex(string) + 1);
  15848. }
  15849. if (!string || !(chars = baseToString(chars))) {
  15850. return string;
  15851. }
  15852. var strSymbols = stringToArray(string),
  15853. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15854. return castSlice(strSymbols, 0, end).join('');
  15855. }
  15856. /**
  15857. * Removes leading whitespace or specified characters from `string`.
  15858. *
  15859. * @static
  15860. * @memberOf _
  15861. * @since 4.0.0
  15862. * @category String
  15863. * @param {string} [string=''] The string to trim.
  15864. * @param {string} [chars=whitespace] The characters to trim.
  15865. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15866. * @returns {string} Returns the trimmed string.
  15867. * @example
  15868. *
  15869. * _.trimStart(' abc ');
  15870. * // => 'abc '
  15871. *
  15872. * _.trimStart('-_-abc-_-', '_-');
  15873. * // => 'abc-_-'
  15874. */
  15875. function trimStart(string, chars, guard) {
  15876. string = toString(string);
  15877. if (string && (guard || chars === undefined)) {
  15878. return string.replace(reTrimStart, '');
  15879. }
  15880. if (!string || !(chars = baseToString(chars))) {
  15881. return string;
  15882. }
  15883. var strSymbols = stringToArray(string),
  15884. start = charsStartIndex(strSymbols, stringToArray(chars));
  15885. return castSlice(strSymbols, start).join('');
  15886. }
  15887. /**
  15888. * Truncates `string` if it's longer than the given maximum string length.
  15889. * The last characters of the truncated string are replaced with the omission
  15890. * string which defaults to "...".
  15891. *
  15892. * @static
  15893. * @memberOf _
  15894. * @since 4.0.0
  15895. * @category String
  15896. * @param {string} [string=''] The string to truncate.
  15897. * @param {Object} [options={}] The options object.
  15898. * @param {number} [options.length=30] The maximum string length.
  15899. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15900. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15901. * @returns {string} Returns the truncated string.
  15902. * @example
  15903. *
  15904. * _.truncate('hi-diddly-ho there, neighborino');
  15905. * // => 'hi-diddly-ho there, neighbo...'
  15906. *
  15907. * _.truncate('hi-diddly-ho there, neighborino', {
  15908. * 'length': 24,
  15909. * 'separator': ' '
  15910. * });
  15911. * // => 'hi-diddly-ho there,...'
  15912. *
  15913. * _.truncate('hi-diddly-ho there, neighborino', {
  15914. * 'length': 24,
  15915. * 'separator': /,? +/
  15916. * });
  15917. * // => 'hi-diddly-ho there...'
  15918. *
  15919. * _.truncate('hi-diddly-ho there, neighborino', {
  15920. * 'omission': ' [...]'
  15921. * });
  15922. * // => 'hi-diddly-ho there, neig [...]'
  15923. */
  15924. function truncate(string, options) {
  15925. var length = DEFAULT_TRUNC_LENGTH,
  15926. omission = DEFAULT_TRUNC_OMISSION;
  15927. if (isObject(options)) {
  15928. var separator = 'separator' in options ? options.separator : separator;
  15929. length = 'length' in options ? toInteger(options.length) : length;
  15930. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15931. }
  15932. string = toString(string);
  15933. var strLength = string.length;
  15934. if (hasUnicode(string)) {
  15935. var strSymbols = stringToArray(string);
  15936. strLength = strSymbols.length;
  15937. }
  15938. if (length >= strLength) {
  15939. return string;
  15940. }
  15941. var end = length - stringSize(omission);
  15942. if (end < 1) {
  15943. return omission;
  15944. }
  15945. var result = strSymbols
  15946. ? castSlice(strSymbols, 0, end).join('')
  15947. : string.slice(0, end);
  15948. if (separator === undefined) {
  15949. return result + omission;
  15950. }
  15951. if (strSymbols) {
  15952. end += (result.length - end);
  15953. }
  15954. if (isRegExp(separator)) {
  15955. if (string.slice(end).search(separator)) {
  15956. var match,
  15957. substring = result;
  15958. if (!separator.global) {
  15959. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15960. }
  15961. separator.lastIndex = 0;
  15962. while ((match = separator.exec(substring))) {
  15963. var newEnd = match.index;
  15964. }
  15965. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15966. }
  15967. } else if (string.indexOf(baseToString(separator), end) != end) {
  15968. var index = result.lastIndexOf(separator);
  15969. if (index > -1) {
  15970. result = result.slice(0, index);
  15971. }
  15972. }
  15973. return result + omission;
  15974. }
  15975. /**
  15976. * The inverse of `_.escape`; this method converts the HTML entities
  15977. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15978. * their corresponding characters.
  15979. *
  15980. * **Note:** No other HTML entities are unescaped. To unescape additional
  15981. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15982. *
  15983. * @static
  15984. * @memberOf _
  15985. * @since 0.6.0
  15986. * @category String
  15987. * @param {string} [string=''] The string to unescape.
  15988. * @returns {string} Returns the unescaped string.
  15989. * @example
  15990. *
  15991. * _.unescape('fred, barney, &amp; pebbles');
  15992. * // => 'fred, barney, & pebbles'
  15993. */
  15994. function unescape(string) {
  15995. string = toString(string);
  15996. return (string && reHasEscapedHtml.test(string))
  15997. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15998. : string;
  15999. }
  16000. /**
  16001. * Converts `string`, as space separated words, to upper case.
  16002. *
  16003. * @static
  16004. * @memberOf _
  16005. * @since 4.0.0
  16006. * @category String
  16007. * @param {string} [string=''] The string to convert.
  16008. * @returns {string} Returns the upper cased string.
  16009. * @example
  16010. *
  16011. * _.upperCase('--foo-bar');
  16012. * // => 'FOO BAR'
  16013. *
  16014. * _.upperCase('fooBar');
  16015. * // => 'FOO BAR'
  16016. *
  16017. * _.upperCase('__foo_bar__');
  16018. * // => 'FOO BAR'
  16019. */
  16020. var upperCase = createCompounder(function(result, word, index) {
  16021. return result + (index ? ' ' : '') + word.toUpperCase();
  16022. });
  16023. /**
  16024. * Converts the first character of `string` to upper case.
  16025. *
  16026. * @static
  16027. * @memberOf _
  16028. * @since 4.0.0
  16029. * @category String
  16030. * @param {string} [string=''] The string to convert.
  16031. * @returns {string} Returns the converted string.
  16032. * @example
  16033. *
  16034. * _.upperFirst('fred');
  16035. * // => 'Fred'
  16036. *
  16037. * _.upperFirst('FRED');
  16038. * // => 'FRED'
  16039. */
  16040. var upperFirst = createCaseFirst('toUpperCase');
  16041. /**
  16042. * Splits `string` into an array of its words.
  16043. *
  16044. * @static
  16045. * @memberOf _
  16046. * @since 3.0.0
  16047. * @category String
  16048. * @param {string} [string=''] The string to inspect.
  16049. * @param {RegExp|string} [pattern] The pattern to match words.
  16050. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16051. * @returns {Array} Returns the words of `string`.
  16052. * @example
  16053. *
  16054. * _.words('fred, barney, & pebbles');
  16055. * // => ['fred', 'barney', 'pebbles']
  16056. *
  16057. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  16058. * // => ['fred', 'barney', '&', 'pebbles']
  16059. */
  16060. function words(string, pattern, guard) {
  16061. string = toString(string);
  16062. pattern = guard ? undefined : pattern;
  16063. if (pattern === undefined) {
  16064. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  16065. }
  16066. return string.match(pattern) || [];
  16067. }
  16068. /*------------------------------------------------------------------------*/
  16069. /**
  16070. * Attempts to invoke `func`, returning either the result or the caught error
  16071. * object. Any additional arguments are provided to `func` when it's invoked.
  16072. *
  16073. * @static
  16074. * @memberOf _
  16075. * @since 3.0.0
  16076. * @category Util
  16077. * @param {Function} func The function to attempt.
  16078. * @param {...*} [args] The arguments to invoke `func` with.
  16079. * @returns {*} Returns the `func` result or error object.
  16080. * @example
  16081. *
  16082. * // Avoid throwing errors for invalid selectors.
  16083. * var elements = _.attempt(function(selector) {
  16084. * return document.querySelectorAll(selector);
  16085. * }, '>_>');
  16086. *
  16087. * if (_.isError(elements)) {
  16088. * elements = [];
  16089. * }
  16090. */
  16091. var attempt = baseRest(function(func, args) {
  16092. try {
  16093. return apply(func, undefined, args);
  16094. } catch (e) {
  16095. return isError(e) ? e : new Error(e);
  16096. }
  16097. });
  16098. /**
  16099. * Binds methods of an object to the object itself, overwriting the existing
  16100. * method.
  16101. *
  16102. * **Note:** This method doesn't set the "length" property of bound functions.
  16103. *
  16104. * @static
  16105. * @since 0.1.0
  16106. * @memberOf _
  16107. * @category Util
  16108. * @param {Object} object The object to bind and assign the bound methods to.
  16109. * @param {...(string|string[])} methodNames The object method names to bind.
  16110. * @returns {Object} Returns `object`.
  16111. * @example
  16112. *
  16113. * var view = {
  16114. * 'label': 'docs',
  16115. * 'click': function() {
  16116. * console.log('clicked ' + this.label);
  16117. * }
  16118. * };
  16119. *
  16120. * _.bindAll(view, ['click']);
  16121. * jQuery(element).on('click', view.click);
  16122. * // => Logs 'clicked docs' when clicked.
  16123. */
  16124. var bindAll = flatRest(function(object, methodNames) {
  16125. arrayEach(methodNames, function(key) {
  16126. key = toKey(key);
  16127. baseAssignValue(object, key, bind(object[key], object));
  16128. });
  16129. return object;
  16130. });
  16131. /**
  16132. * Creates a function that iterates over `pairs` and invokes the corresponding
  16133. * function of the first predicate to return truthy. The predicate-function
  16134. * pairs are invoked with the `this` binding and arguments of the created
  16135. * function.
  16136. *
  16137. * @static
  16138. * @memberOf _
  16139. * @since 4.0.0
  16140. * @category Util
  16141. * @param {Array} pairs The predicate-function pairs.
  16142. * @returns {Function} Returns the new composite function.
  16143. * @example
  16144. *
  16145. * var func = _.cond([
  16146. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  16147. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  16148. * [_.stubTrue, _.constant('no match')]
  16149. * ]);
  16150. *
  16151. * func({ 'a': 1, 'b': 2 });
  16152. * // => 'matches A'
  16153. *
  16154. * func({ 'a': 0, 'b': 1 });
  16155. * // => 'matches B'
  16156. *
  16157. * func({ 'a': '1', 'b': '2' });
  16158. * // => 'no match'
  16159. */
  16160. function cond(pairs) {
  16161. var length = pairs == null ? 0 : pairs.length,
  16162. toIteratee = getIteratee();
  16163. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  16164. if (typeof pair[1] != 'function') {
  16165. throw new TypeError(FUNC_ERROR_TEXT);
  16166. }
  16167. return [toIteratee(pair[0]), pair[1]];
  16168. });
  16169. return baseRest(function(args) {
  16170. var index = -1;
  16171. while (++index < length) {
  16172. var pair = pairs[index];
  16173. if (apply(pair[0], this, args)) {
  16174. return apply(pair[1], this, args);
  16175. }
  16176. }
  16177. });
  16178. }
  16179. /**
  16180. * Creates a function that invokes the predicate properties of `source` with
  16181. * the corresponding property values of a given object, returning `true` if
  16182. * all predicates return truthy, else `false`.
  16183. *
  16184. * **Note:** The created function is equivalent to `_.conformsTo` with
  16185. * `source` partially applied.
  16186. *
  16187. * @static
  16188. * @memberOf _
  16189. * @since 4.0.0
  16190. * @category Util
  16191. * @param {Object} source The object of property predicates to conform to.
  16192. * @returns {Function} Returns the new spec function.
  16193. * @example
  16194. *
  16195. * var objects = [
  16196. * { 'a': 2, 'b': 1 },
  16197. * { 'a': 1, 'b': 2 }
  16198. * ];
  16199. *
  16200. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  16201. * // => [{ 'a': 1, 'b': 2 }]
  16202. */
  16203. function conforms(source) {
  16204. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  16205. }
  16206. /**
  16207. * Creates a function that returns `value`.
  16208. *
  16209. * @static
  16210. * @memberOf _
  16211. * @since 2.4.0
  16212. * @category Util
  16213. * @param {*} value The value to return from the new function.
  16214. * @returns {Function} Returns the new constant function.
  16215. * @example
  16216. *
  16217. * var objects = _.times(2, _.constant({ 'a': 1 }));
  16218. *
  16219. * console.log(objects);
  16220. * // => [{ 'a': 1 }, { 'a': 1 }]
  16221. *
  16222. * console.log(objects[0] === objects[1]);
  16223. * // => true
  16224. */
  16225. function constant(value) {
  16226. return function() {
  16227. return value;
  16228. };
  16229. }
  16230. /**
  16231. * Checks `value` to determine whether a default value should be returned in
  16232. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  16233. * or `undefined`.
  16234. *
  16235. * @static
  16236. * @memberOf _
  16237. * @since 4.14.0
  16238. * @category Util
  16239. * @param {*} value The value to check.
  16240. * @param {*} defaultValue The default value.
  16241. * @returns {*} Returns the resolved value.
  16242. * @example
  16243. *
  16244. * _.defaultTo(1, 10);
  16245. * // => 1
  16246. *
  16247. * _.defaultTo(undefined, 10);
  16248. * // => 10
  16249. */
  16250. function defaultTo(value, defaultValue) {
  16251. return (value == null || value !== value) ? defaultValue : value;
  16252. }
  16253. /**
  16254. * Creates a function that returns the result of invoking the given functions
  16255. * with the `this` binding of the created function, where each successive
  16256. * invocation is supplied the return value of the previous.
  16257. *
  16258. * @static
  16259. * @memberOf _
  16260. * @since 3.0.0
  16261. * @category Util
  16262. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16263. * @returns {Function} Returns the new composite function.
  16264. * @see _.flowRight
  16265. * @example
  16266. *
  16267. * function square(n) {
  16268. * return n * n;
  16269. * }
  16270. *
  16271. * var addSquare = _.flow([_.add, square]);
  16272. * addSquare(1, 2);
  16273. * // => 9
  16274. */
  16275. var flow = createFlow();
  16276. /**
  16277. * This method is like `_.flow` except that it creates a function that
  16278. * invokes the given functions from right to left.
  16279. *
  16280. * @static
  16281. * @since 3.0.0
  16282. * @memberOf _
  16283. * @category Util
  16284. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16285. * @returns {Function} Returns the new composite function.
  16286. * @see _.flow
  16287. * @example
  16288. *
  16289. * function square(n) {
  16290. * return n * n;
  16291. * }
  16292. *
  16293. * var addSquare = _.flowRight([square, _.add]);
  16294. * addSquare(1, 2);
  16295. * // => 9
  16296. */
  16297. var flowRight = createFlow(true);
  16298. /**
  16299. * This method returns the first argument it receives.
  16300. *
  16301. * @static
  16302. * @since 0.1.0
  16303. * @memberOf _
  16304. * @category Util
  16305. * @param {*} value Any value.
  16306. * @returns {*} Returns `value`.
  16307. * @example
  16308. *
  16309. * var object = { 'a': 1 };
  16310. *
  16311. * console.log(_.identity(object) === object);
  16312. * // => true
  16313. */
  16314. function identity(value) {
  16315. return value;
  16316. }
  16317. /**
  16318. * Creates a function that invokes `func` with the arguments of the created
  16319. * function. If `func` is a property name, the created function returns the
  16320. * property value for a given element. If `func` is an array or object, the
  16321. * created function returns `true` for elements that contain the equivalent
  16322. * source properties, otherwise it returns `false`.
  16323. *
  16324. * @static
  16325. * @since 4.0.0
  16326. * @memberOf _
  16327. * @category Util
  16328. * @param {*} [func=_.identity] The value to convert to a callback.
  16329. * @returns {Function} Returns the callback.
  16330. * @example
  16331. *
  16332. * var users = [
  16333. * { 'user': 'barney', 'age': 36, 'active': true },
  16334. * { 'user': 'fred', 'age': 40, 'active': false }
  16335. * ];
  16336. *
  16337. * // The `_.matches` iteratee shorthand.
  16338. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  16339. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  16340. *
  16341. * // The `_.matchesProperty` iteratee shorthand.
  16342. * _.filter(users, _.iteratee(['user', 'fred']));
  16343. * // => [{ 'user': 'fred', 'age': 40 }]
  16344. *
  16345. * // The `_.property` iteratee shorthand.
  16346. * _.map(users, _.iteratee('user'));
  16347. * // => ['barney', 'fred']
  16348. *
  16349. * // Create custom iteratee shorthands.
  16350. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  16351. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  16352. * return func.test(string);
  16353. * };
  16354. * });
  16355. *
  16356. * _.filter(['abc', 'def'], /ef/);
  16357. * // => ['def']
  16358. */
  16359. function iteratee(func) {
  16360. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  16361. }
  16362. /**
  16363. * Creates a function that performs a partial deep comparison between a given
  16364. * object and `source`, returning `true` if the given object has equivalent
  16365. * property values, else `false`.
  16366. *
  16367. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  16368. * partially applied.
  16369. *
  16370. * Partial comparisons will match empty array and empty object `source`
  16371. * values against any array or object value, respectively. See `_.isEqual`
  16372. * for a list of supported value comparisons.
  16373. *
  16374. * **Note:** Multiple values can be checked by combining several matchers
  16375. * using `_.overSome`
  16376. *
  16377. * @static
  16378. * @memberOf _
  16379. * @since 3.0.0
  16380. * @category Util
  16381. * @param {Object} source The object of property values to match.
  16382. * @returns {Function} Returns the new spec function.
  16383. * @example
  16384. *
  16385. * var objects = [
  16386. * { 'a': 1, 'b': 2, 'c': 3 },
  16387. * { 'a': 4, 'b': 5, 'c': 6 }
  16388. * ];
  16389. *
  16390. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  16391. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  16392. *
  16393. * // Checking for several possible values
  16394. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16395. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16396. */
  16397. function matches(source) {
  16398. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16399. }
  16400. /**
  16401. * Creates a function that performs a partial deep comparison between the
  16402. * value at `path` of a given object to `srcValue`, returning `true` if the
  16403. * object value is equivalent, else `false`.
  16404. *
  16405. * **Note:** Partial comparisons will match empty array and empty object
  16406. * `srcValue` values against any array or object value, respectively. See
  16407. * `_.isEqual` for a list of supported value comparisons.
  16408. *
  16409. * **Note:** Multiple values can be checked by combining several matchers
  16410. * using `_.overSome`
  16411. *
  16412. * @static
  16413. * @memberOf _
  16414. * @since 3.2.0
  16415. * @category Util
  16416. * @param {Array|string} path The path of the property to get.
  16417. * @param {*} srcValue The value to match.
  16418. * @returns {Function} Returns the new spec function.
  16419. * @example
  16420. *
  16421. * var objects = [
  16422. * { 'a': 1, 'b': 2, 'c': 3 },
  16423. * { 'a': 4, 'b': 5, 'c': 6 }
  16424. * ];
  16425. *
  16426. * _.find(objects, _.matchesProperty('a', 4));
  16427. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16428. *
  16429. * // Checking for several possible values
  16430. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16431. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16432. */
  16433. function matchesProperty(path, srcValue) {
  16434. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16435. }
  16436. /**
  16437. * Creates a function that invokes the method at `path` of a given object.
  16438. * Any additional arguments are provided to the invoked method.
  16439. *
  16440. * @static
  16441. * @memberOf _
  16442. * @since 3.7.0
  16443. * @category Util
  16444. * @param {Array|string} path The path of the method to invoke.
  16445. * @param {...*} [args] The arguments to invoke the method with.
  16446. * @returns {Function} Returns the new invoker function.
  16447. * @example
  16448. *
  16449. * var objects = [
  16450. * { 'a': { 'b': _.constant(2) } },
  16451. * { 'a': { 'b': _.constant(1) } }
  16452. * ];
  16453. *
  16454. * _.map(objects, _.method('a.b'));
  16455. * // => [2, 1]
  16456. *
  16457. * _.map(objects, _.method(['a', 'b']));
  16458. * // => [2, 1]
  16459. */
  16460. var method = baseRest(function(path, args) {
  16461. return function(object) {
  16462. return baseInvoke(object, path, args);
  16463. };
  16464. });
  16465. /**
  16466. * The opposite of `_.method`; this method creates a function that invokes
  16467. * the method at a given path of `object`. Any additional arguments are
  16468. * provided to the invoked method.
  16469. *
  16470. * @static
  16471. * @memberOf _
  16472. * @since 3.7.0
  16473. * @category Util
  16474. * @param {Object} object The object to query.
  16475. * @param {...*} [args] The arguments to invoke the method with.
  16476. * @returns {Function} Returns the new invoker function.
  16477. * @example
  16478. *
  16479. * var array = _.times(3, _.constant),
  16480. * object = { 'a': array, 'b': array, 'c': array };
  16481. *
  16482. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16483. * // => [2, 0]
  16484. *
  16485. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16486. * // => [2, 0]
  16487. */
  16488. var methodOf = baseRest(function(object, args) {
  16489. return function(path) {
  16490. return baseInvoke(object, path, args);
  16491. };
  16492. });
  16493. /**
  16494. * Adds all own enumerable string keyed function properties of a source
  16495. * object to the destination object. If `object` is a function, then methods
  16496. * are added to its prototype as well.
  16497. *
  16498. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16499. * avoid conflicts caused by modifying the original.
  16500. *
  16501. * @static
  16502. * @since 0.1.0
  16503. * @memberOf _
  16504. * @category Util
  16505. * @param {Function|Object} [object=lodash] The destination object.
  16506. * @param {Object} source The object of functions to add.
  16507. * @param {Object} [options={}] The options object.
  16508. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16509. * @returns {Function|Object} Returns `object`.
  16510. * @example
  16511. *
  16512. * function vowels(string) {
  16513. * return _.filter(string, function(v) {
  16514. * return /[aeiou]/i.test(v);
  16515. * });
  16516. * }
  16517. *
  16518. * _.mixin({ 'vowels': vowels });
  16519. * _.vowels('fred');
  16520. * // => ['e']
  16521. *
  16522. * _('fred').vowels().value();
  16523. * // => ['e']
  16524. *
  16525. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16526. * _('fred').vowels();
  16527. * // => ['e']
  16528. */
  16529. function mixin(object, source, options) {
  16530. var props = keys(source),
  16531. methodNames = baseFunctions(source, props);
  16532. if (options == null &&
  16533. !(isObject(source) && (methodNames.length || !props.length))) {
  16534. options = source;
  16535. source = object;
  16536. object = this;
  16537. methodNames = baseFunctions(source, keys(source));
  16538. }
  16539. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16540. isFunc = isFunction(object);
  16541. arrayEach(methodNames, function(methodName) {
  16542. var func = source[methodName];
  16543. object[methodName] = func;
  16544. if (isFunc) {
  16545. object.prototype[methodName] = function() {
  16546. var chainAll = this.__chain__;
  16547. if (chain || chainAll) {
  16548. var result = object(this.__wrapped__),
  16549. actions = result.__actions__ = copyArray(this.__actions__);
  16550. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16551. result.__chain__ = chainAll;
  16552. return result;
  16553. }
  16554. return func.apply(object, arrayPush([this.value()], arguments));
  16555. };
  16556. }
  16557. });
  16558. return object;
  16559. }
  16560. /**
  16561. * Reverts the `_` variable to its previous value and returns a reference to
  16562. * the `lodash` function.
  16563. *
  16564. * @static
  16565. * @since 0.1.0
  16566. * @memberOf _
  16567. * @category Util
  16568. * @returns {Function} Returns the `lodash` function.
  16569. * @example
  16570. *
  16571. * var lodash = _.noConflict();
  16572. */
  16573. function noConflict() {
  16574. if (root._ === this) {
  16575. root._ = oldDash;
  16576. }
  16577. return this;
  16578. }
  16579. /**
  16580. * This method returns `undefined`.
  16581. *
  16582. * @static
  16583. * @memberOf _
  16584. * @since 2.3.0
  16585. * @category Util
  16586. * @example
  16587. *
  16588. * _.times(2, _.noop);
  16589. * // => [undefined, undefined]
  16590. */
  16591. function noop() {
  16592. // No operation performed.
  16593. }
  16594. /**
  16595. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16596. * the nth argument from the end is returned.
  16597. *
  16598. * @static
  16599. * @memberOf _
  16600. * @since 4.0.0
  16601. * @category Util
  16602. * @param {number} [n=0] The index of the argument to return.
  16603. * @returns {Function} Returns the new pass-thru function.
  16604. * @example
  16605. *
  16606. * var func = _.nthArg(1);
  16607. * func('a', 'b', 'c', 'd');
  16608. * // => 'b'
  16609. *
  16610. * var func = _.nthArg(-2);
  16611. * func('a', 'b', 'c', 'd');
  16612. * // => 'c'
  16613. */
  16614. function nthArg(n) {
  16615. n = toInteger(n);
  16616. return baseRest(function(args) {
  16617. return baseNth(args, n);
  16618. });
  16619. }
  16620. /**
  16621. * Creates a function that invokes `iteratees` with the arguments it receives
  16622. * and returns their results.
  16623. *
  16624. * @static
  16625. * @memberOf _
  16626. * @since 4.0.0
  16627. * @category Util
  16628. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16629. * The iteratees to invoke.
  16630. * @returns {Function} Returns the new function.
  16631. * @example
  16632. *
  16633. * var func = _.over([Math.max, Math.min]);
  16634. *
  16635. * func(1, 2, 3, 4);
  16636. * // => [4, 1]
  16637. */
  16638. var over = createOver(arrayMap);
  16639. /**
  16640. * Creates a function that checks if **all** of the `predicates` return
  16641. * truthy when invoked with the arguments it receives.
  16642. *
  16643. * Following shorthands are possible for providing predicates.
  16644. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16645. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16646. *
  16647. * @static
  16648. * @memberOf _
  16649. * @since 4.0.0
  16650. * @category Util
  16651. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16652. * The predicates to check.
  16653. * @returns {Function} Returns the new function.
  16654. * @example
  16655. *
  16656. * var func = _.overEvery([Boolean, isFinite]);
  16657. *
  16658. * func('1');
  16659. * // => true
  16660. *
  16661. * func(null);
  16662. * // => false
  16663. *
  16664. * func(NaN);
  16665. * // => false
  16666. */
  16667. var overEvery = createOver(arrayEvery);
  16668. /**
  16669. * Creates a function that checks if **any** of the `predicates` return
  16670. * truthy when invoked with the arguments it receives.
  16671. *
  16672. * Following shorthands are possible for providing predicates.
  16673. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16674. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16675. *
  16676. * @static
  16677. * @memberOf _
  16678. * @since 4.0.0
  16679. * @category Util
  16680. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16681. * The predicates to check.
  16682. * @returns {Function} Returns the new function.
  16683. * @example
  16684. *
  16685. * var func = _.overSome([Boolean, isFinite]);
  16686. *
  16687. * func('1');
  16688. * // => true
  16689. *
  16690. * func(null);
  16691. * // => true
  16692. *
  16693. * func(NaN);
  16694. * // => false
  16695. *
  16696. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16697. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16698. */
  16699. var overSome = createOver(arraySome);
  16700. /**
  16701. * Creates a function that returns the value at `path` of a given object.
  16702. *
  16703. * @static
  16704. * @memberOf _
  16705. * @since 2.4.0
  16706. * @category Util
  16707. * @param {Array|string} path The path of the property to get.
  16708. * @returns {Function} Returns the new accessor function.
  16709. * @example
  16710. *
  16711. * var objects = [
  16712. * { 'a': { 'b': 2 } },
  16713. * { 'a': { 'b': 1 } }
  16714. * ];
  16715. *
  16716. * _.map(objects, _.property('a.b'));
  16717. * // => [2, 1]
  16718. *
  16719. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16720. * // => [1, 2]
  16721. */
  16722. function property(path) {
  16723. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16724. }
  16725. /**
  16726. * The opposite of `_.property`; this method creates a function that returns
  16727. * the value at a given path of `object`.
  16728. *
  16729. * @static
  16730. * @memberOf _
  16731. * @since 3.0.0
  16732. * @category Util
  16733. * @param {Object} object The object to query.
  16734. * @returns {Function} Returns the new accessor function.
  16735. * @example
  16736. *
  16737. * var array = [0, 1, 2],
  16738. * object = { 'a': array, 'b': array, 'c': array };
  16739. *
  16740. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16741. * // => [2, 0]
  16742. *
  16743. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16744. * // => [2, 0]
  16745. */
  16746. function propertyOf(object) {
  16747. return function(path) {
  16748. return object == null ? undefined : baseGet(object, path);
  16749. };
  16750. }
  16751. /**
  16752. * Creates an array of numbers (positive and/or negative) progressing from
  16753. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16754. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16755. * it's set to `start` with `start` then set to `0`.
  16756. *
  16757. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16758. * floating-point values which can produce unexpected results.
  16759. *
  16760. * @static
  16761. * @since 0.1.0
  16762. * @memberOf _
  16763. * @category Util
  16764. * @param {number} [start=0] The start of the range.
  16765. * @param {number} end The end of the range.
  16766. * @param {number} [step=1] The value to increment or decrement by.
  16767. * @returns {Array} Returns the range of numbers.
  16768. * @see _.inRange, _.rangeRight
  16769. * @example
  16770. *
  16771. * _.range(4);
  16772. * // => [0, 1, 2, 3]
  16773. *
  16774. * _.range(-4);
  16775. * // => [0, -1, -2, -3]
  16776. *
  16777. * _.range(1, 5);
  16778. * // => [1, 2, 3, 4]
  16779. *
  16780. * _.range(0, 20, 5);
  16781. * // => [0, 5, 10, 15]
  16782. *
  16783. * _.range(0, -4, -1);
  16784. * // => [0, -1, -2, -3]
  16785. *
  16786. * _.range(1, 4, 0);
  16787. * // => [1, 1, 1]
  16788. *
  16789. * _.range(0);
  16790. * // => []
  16791. */
  16792. var range = createRange();
  16793. /**
  16794. * This method is like `_.range` except that it populates values in
  16795. * descending order.
  16796. *
  16797. * @static
  16798. * @memberOf _
  16799. * @since 4.0.0
  16800. * @category Util
  16801. * @param {number} [start=0] The start of the range.
  16802. * @param {number} end The end of the range.
  16803. * @param {number} [step=1] The value to increment or decrement by.
  16804. * @returns {Array} Returns the range of numbers.
  16805. * @see _.inRange, _.range
  16806. * @example
  16807. *
  16808. * _.rangeRight(4);
  16809. * // => [3, 2, 1, 0]
  16810. *
  16811. * _.rangeRight(-4);
  16812. * // => [-3, -2, -1, 0]
  16813. *
  16814. * _.rangeRight(1, 5);
  16815. * // => [4, 3, 2, 1]
  16816. *
  16817. * _.rangeRight(0, 20, 5);
  16818. * // => [15, 10, 5, 0]
  16819. *
  16820. * _.rangeRight(0, -4, -1);
  16821. * // => [-3, -2, -1, 0]
  16822. *
  16823. * _.rangeRight(1, 4, 0);
  16824. * // => [1, 1, 1]
  16825. *
  16826. * _.rangeRight(0);
  16827. * // => []
  16828. */
  16829. var rangeRight = createRange(true);
  16830. /**
  16831. * This method returns a new empty array.
  16832. *
  16833. * @static
  16834. * @memberOf _
  16835. * @since 4.13.0
  16836. * @category Util
  16837. * @returns {Array} Returns the new empty array.
  16838. * @example
  16839. *
  16840. * var arrays = _.times(2, _.stubArray);
  16841. *
  16842. * console.log(arrays);
  16843. * // => [[], []]
  16844. *
  16845. * console.log(arrays[0] === arrays[1]);
  16846. * // => false
  16847. */
  16848. function stubArray() {
  16849. return [];
  16850. }
  16851. /**
  16852. * This method returns `false`.
  16853. *
  16854. * @static
  16855. * @memberOf _
  16856. * @since 4.13.0
  16857. * @category Util
  16858. * @returns {boolean} Returns `false`.
  16859. * @example
  16860. *
  16861. * _.times(2, _.stubFalse);
  16862. * // => [false, false]
  16863. */
  16864. function stubFalse() {
  16865. return false;
  16866. }
  16867. /**
  16868. * This method returns a new empty object.
  16869. *
  16870. * @static
  16871. * @memberOf _
  16872. * @since 4.13.0
  16873. * @category Util
  16874. * @returns {Object} Returns the new empty object.
  16875. * @example
  16876. *
  16877. * var objects = _.times(2, _.stubObject);
  16878. *
  16879. * console.log(objects);
  16880. * // => [{}, {}]
  16881. *
  16882. * console.log(objects[0] === objects[1]);
  16883. * // => false
  16884. */
  16885. function stubObject() {
  16886. return {};
  16887. }
  16888. /**
  16889. * This method returns an empty string.
  16890. *
  16891. * @static
  16892. * @memberOf _
  16893. * @since 4.13.0
  16894. * @category Util
  16895. * @returns {string} Returns the empty string.
  16896. * @example
  16897. *
  16898. * _.times(2, _.stubString);
  16899. * // => ['', '']
  16900. */
  16901. function stubString() {
  16902. return '';
  16903. }
  16904. /**
  16905. * This method returns `true`.
  16906. *
  16907. * @static
  16908. * @memberOf _
  16909. * @since 4.13.0
  16910. * @category Util
  16911. * @returns {boolean} Returns `true`.
  16912. * @example
  16913. *
  16914. * _.times(2, _.stubTrue);
  16915. * // => [true, true]
  16916. */
  16917. function stubTrue() {
  16918. return true;
  16919. }
  16920. /**
  16921. * Invokes the iteratee `n` times, returning an array of the results of
  16922. * each invocation. The iteratee is invoked with one argument; (index).
  16923. *
  16924. * @static
  16925. * @since 0.1.0
  16926. * @memberOf _
  16927. * @category Util
  16928. * @param {number} n The number of times to invoke `iteratee`.
  16929. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16930. * @returns {Array} Returns the array of results.
  16931. * @example
  16932. *
  16933. * _.times(3, String);
  16934. * // => ['0', '1', '2']
  16935. *
  16936. * _.times(4, _.constant(0));
  16937. * // => [0, 0, 0, 0]
  16938. */
  16939. function times(n, iteratee) {
  16940. n = toInteger(n);
  16941. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16942. return [];
  16943. }
  16944. var index = MAX_ARRAY_LENGTH,
  16945. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16946. iteratee = getIteratee(iteratee);
  16947. n -= MAX_ARRAY_LENGTH;
  16948. var result = baseTimes(length, iteratee);
  16949. while (++index < n) {
  16950. iteratee(index);
  16951. }
  16952. return result;
  16953. }
  16954. /**
  16955. * Converts `value` to a property path array.
  16956. *
  16957. * @static
  16958. * @memberOf _
  16959. * @since 4.0.0
  16960. * @category Util
  16961. * @param {*} value The value to convert.
  16962. * @returns {Array} Returns the new property path array.
  16963. * @example
  16964. *
  16965. * _.toPath('a.b.c');
  16966. * // => ['a', 'b', 'c']
  16967. *
  16968. * _.toPath('a[0].b.c');
  16969. * // => ['a', '0', 'b', 'c']
  16970. */
  16971. function toPath(value) {
  16972. if (isArray(value)) {
  16973. return arrayMap(value, toKey);
  16974. }
  16975. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16976. }
  16977. /**
  16978. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16979. *
  16980. * @static
  16981. * @since 0.1.0
  16982. * @memberOf _
  16983. * @category Util
  16984. * @param {string} [prefix=''] The value to prefix the ID with.
  16985. * @returns {string} Returns the unique ID.
  16986. * @example
  16987. *
  16988. * _.uniqueId('contact_');
  16989. * // => 'contact_104'
  16990. *
  16991. * _.uniqueId();
  16992. * // => '105'
  16993. */
  16994. function uniqueId(prefix) {
  16995. var id = ++idCounter;
  16996. return toString(prefix) + id;
  16997. }
  16998. /*------------------------------------------------------------------------*/
  16999. /**
  17000. * Adds two numbers.
  17001. *
  17002. * @static
  17003. * @memberOf _
  17004. * @since 3.4.0
  17005. * @category Math
  17006. * @param {number} augend The first number in an addition.
  17007. * @param {number} addend The second number in an addition.
  17008. * @returns {number} Returns the total.
  17009. * @example
  17010. *
  17011. * _.add(6, 4);
  17012. * // => 10
  17013. */
  17014. var add = createMathOperation(function(augend, addend) {
  17015. return augend + addend;
  17016. }, 0);
  17017. /**
  17018. * Computes `number` rounded up to `precision`.
  17019. *
  17020. * @static
  17021. * @memberOf _
  17022. * @since 3.10.0
  17023. * @category Math
  17024. * @param {number} number The number to round up.
  17025. * @param {number} [precision=0] The precision to round up to.
  17026. * @returns {number} Returns the rounded up number.
  17027. * @example
  17028. *
  17029. * _.ceil(4.006);
  17030. * // => 5
  17031. *
  17032. * _.ceil(6.004, 2);
  17033. * // => 6.01
  17034. *
  17035. * _.ceil(6040, -2);
  17036. * // => 6100
  17037. */
  17038. var ceil = createRound('ceil');
  17039. /**
  17040. * Divide two numbers.
  17041. *
  17042. * @static
  17043. * @memberOf _
  17044. * @since 4.7.0
  17045. * @category Math
  17046. * @param {number} dividend The first number in a division.
  17047. * @param {number} divisor The second number in a division.
  17048. * @returns {number} Returns the quotient.
  17049. * @example
  17050. *
  17051. * _.divide(6, 4);
  17052. * // => 1.5
  17053. */
  17054. var divide = createMathOperation(function(dividend, divisor) {
  17055. return dividend / divisor;
  17056. }, 1);
  17057. /**
  17058. * Computes `number` rounded down to `precision`.
  17059. *
  17060. * @static
  17061. * @memberOf _
  17062. * @since 3.10.0
  17063. * @category Math
  17064. * @param {number} number The number to round down.
  17065. * @param {number} [precision=0] The precision to round down to.
  17066. * @returns {number} Returns the rounded down number.
  17067. * @example
  17068. *
  17069. * _.floor(4.006);
  17070. * // => 4
  17071. *
  17072. * _.floor(0.046, 2);
  17073. * // => 0.04
  17074. *
  17075. * _.floor(4060, -2);
  17076. * // => 4000
  17077. */
  17078. var floor = createRound('floor');
  17079. /**
  17080. * Computes the maximum value of `array`. If `array` is empty or falsey,
  17081. * `undefined` is returned.
  17082. *
  17083. * @static
  17084. * @since 0.1.0
  17085. * @memberOf _
  17086. * @category Math
  17087. * @param {Array} array The array to iterate over.
  17088. * @returns {*} Returns the maximum value.
  17089. * @example
  17090. *
  17091. * _.max([4, 2, 8, 6]);
  17092. * // => 8
  17093. *
  17094. * _.max([]);
  17095. * // => undefined
  17096. */
  17097. function max(array) {
  17098. return (array && array.length)
  17099. ? baseExtremum(array, identity, baseGt)
  17100. : undefined;
  17101. }
  17102. /**
  17103. * This method is like `_.max` except that it accepts `iteratee` which is
  17104. * invoked for each element in `array` to generate the criterion by which
  17105. * the value is ranked. The iteratee is invoked with one argument: (value).
  17106. *
  17107. * @static
  17108. * @memberOf _
  17109. * @since 4.0.0
  17110. * @category Math
  17111. * @param {Array} array The array to iterate over.
  17112. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17113. * @returns {*} Returns the maximum value.
  17114. * @example
  17115. *
  17116. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17117. *
  17118. * _.maxBy(objects, function(o) { return o.n; });
  17119. * // => { 'n': 2 }
  17120. *
  17121. * // The `_.property` iteratee shorthand.
  17122. * _.maxBy(objects, 'n');
  17123. * // => { 'n': 2 }
  17124. */
  17125. function maxBy(array, iteratee) {
  17126. return (array && array.length)
  17127. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  17128. : undefined;
  17129. }
  17130. /**
  17131. * Computes the mean of the values in `array`.
  17132. *
  17133. * @static
  17134. * @memberOf _
  17135. * @since 4.0.0
  17136. * @category Math
  17137. * @param {Array} array The array to iterate over.
  17138. * @returns {number} Returns the mean.
  17139. * @example
  17140. *
  17141. * _.mean([4, 2, 8, 6]);
  17142. * // => 5
  17143. */
  17144. function mean(array) {
  17145. return baseMean(array, identity);
  17146. }
  17147. /**
  17148. * This method is like `_.mean` except that it accepts `iteratee` which is
  17149. * invoked for each element in `array` to generate the value to be averaged.
  17150. * The iteratee is invoked with one argument: (value).
  17151. *
  17152. * @static
  17153. * @memberOf _
  17154. * @since 4.7.0
  17155. * @category Math
  17156. * @param {Array} array The array to iterate over.
  17157. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17158. * @returns {number} Returns the mean.
  17159. * @example
  17160. *
  17161. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17162. *
  17163. * _.meanBy(objects, function(o) { return o.n; });
  17164. * // => 5
  17165. *
  17166. * // The `_.property` iteratee shorthand.
  17167. * _.meanBy(objects, 'n');
  17168. * // => 5
  17169. */
  17170. function meanBy(array, iteratee) {
  17171. return baseMean(array, getIteratee(iteratee, 2));
  17172. }
  17173. /**
  17174. * Computes the minimum value of `array`. If `array` is empty or falsey,
  17175. * `undefined` is returned.
  17176. *
  17177. * @static
  17178. * @since 0.1.0
  17179. * @memberOf _
  17180. * @category Math
  17181. * @param {Array} array The array to iterate over.
  17182. * @returns {*} Returns the minimum value.
  17183. * @example
  17184. *
  17185. * _.min([4, 2, 8, 6]);
  17186. * // => 2
  17187. *
  17188. * _.min([]);
  17189. * // => undefined
  17190. */
  17191. function min(array) {
  17192. return (array && array.length)
  17193. ? baseExtremum(array, identity, baseLt)
  17194. : undefined;
  17195. }
  17196. /**
  17197. * This method is like `_.min` except that it accepts `iteratee` which is
  17198. * invoked for each element in `array` to generate the criterion by which
  17199. * the value is ranked. The iteratee is invoked with one argument: (value).
  17200. *
  17201. * @static
  17202. * @memberOf _
  17203. * @since 4.0.0
  17204. * @category Math
  17205. * @param {Array} array The array to iterate over.
  17206. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17207. * @returns {*} Returns the minimum value.
  17208. * @example
  17209. *
  17210. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17211. *
  17212. * _.minBy(objects, function(o) { return o.n; });
  17213. * // => { 'n': 1 }
  17214. *
  17215. * // The `_.property` iteratee shorthand.
  17216. * _.minBy(objects, 'n');
  17217. * // => { 'n': 1 }
  17218. */
  17219. function minBy(array, iteratee) {
  17220. return (array && array.length)
  17221. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  17222. : undefined;
  17223. }
  17224. /**
  17225. * Multiply two numbers.
  17226. *
  17227. * @static
  17228. * @memberOf _
  17229. * @since 4.7.0
  17230. * @category Math
  17231. * @param {number} multiplier The first number in a multiplication.
  17232. * @param {number} multiplicand The second number in a multiplication.
  17233. * @returns {number} Returns the product.
  17234. * @example
  17235. *
  17236. * _.multiply(6, 4);
  17237. * // => 24
  17238. */
  17239. var multiply = createMathOperation(function(multiplier, multiplicand) {
  17240. return multiplier * multiplicand;
  17241. }, 1);
  17242. /**
  17243. * Computes `number` rounded to `precision`.
  17244. *
  17245. * @static
  17246. * @memberOf _
  17247. * @since 3.10.0
  17248. * @category Math
  17249. * @param {number} number The number to round.
  17250. * @param {number} [precision=0] The precision to round to.
  17251. * @returns {number} Returns the rounded number.
  17252. * @example
  17253. *
  17254. * _.round(4.006);
  17255. * // => 4
  17256. *
  17257. * _.round(4.006, 2);
  17258. * // => 4.01
  17259. *
  17260. * _.round(4060, -2);
  17261. * // => 4100
  17262. */
  17263. var round = createRound('round');
  17264. /**
  17265. * Subtract two numbers.
  17266. *
  17267. * @static
  17268. * @memberOf _
  17269. * @since 4.0.0
  17270. * @category Math
  17271. * @param {number} minuend The first number in a subtraction.
  17272. * @param {number} subtrahend The second number in a subtraction.
  17273. * @returns {number} Returns the difference.
  17274. * @example
  17275. *
  17276. * _.subtract(6, 4);
  17277. * // => 2
  17278. */
  17279. var subtract = createMathOperation(function(minuend, subtrahend) {
  17280. return minuend - subtrahend;
  17281. }, 0);
  17282. /**
  17283. * Computes the sum of the values in `array`.
  17284. *
  17285. * @static
  17286. * @memberOf _
  17287. * @since 3.4.0
  17288. * @category Math
  17289. * @param {Array} array The array to iterate over.
  17290. * @returns {number} Returns the sum.
  17291. * @example
  17292. *
  17293. * _.sum([4, 2, 8, 6]);
  17294. * // => 20
  17295. */
  17296. function sum(array) {
  17297. return (array && array.length)
  17298. ? baseSum(array, identity)
  17299. : 0;
  17300. }
  17301. /**
  17302. * This method is like `_.sum` except that it accepts `iteratee` which is
  17303. * invoked for each element in `array` to generate the value to be summed.
  17304. * The iteratee is invoked with one argument: (value).
  17305. *
  17306. * @static
  17307. * @memberOf _
  17308. * @since 4.0.0
  17309. * @category Math
  17310. * @param {Array} array The array to iterate over.
  17311. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17312. * @returns {number} Returns the sum.
  17313. * @example
  17314. *
  17315. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17316. *
  17317. * _.sumBy(objects, function(o) { return o.n; });
  17318. * // => 20
  17319. *
  17320. * // The `_.property` iteratee shorthand.
  17321. * _.sumBy(objects, 'n');
  17322. * // => 20
  17323. */
  17324. function sumBy(array, iteratee) {
  17325. return (array && array.length)
  17326. ? baseSum(array, getIteratee(iteratee, 2))
  17327. : 0;
  17328. }
  17329. /*------------------------------------------------------------------------*/
  17330. // Add methods that return wrapped values in chain sequences.
  17331. lodash.after = after;
  17332. lodash.ary = ary;
  17333. lodash.assign = assign;
  17334. lodash.assignIn = assignIn;
  17335. lodash.assignInWith = assignInWith;
  17336. lodash.assignWith = assignWith;
  17337. lodash.at = at;
  17338. lodash.before = before;
  17339. lodash.bind = bind;
  17340. lodash.bindAll = bindAll;
  17341. lodash.bindKey = bindKey;
  17342. lodash.castArray = castArray;
  17343. lodash.chain = chain;
  17344. lodash.chunk = chunk;
  17345. lodash.compact = compact;
  17346. lodash.concat = concat;
  17347. lodash.cond = cond;
  17348. lodash.conforms = conforms;
  17349. lodash.constant = constant;
  17350. lodash.countBy = countBy;
  17351. lodash.create = create;
  17352. lodash.curry = curry;
  17353. lodash.curryRight = curryRight;
  17354. lodash.debounce = debounce;
  17355. lodash.defaults = defaults;
  17356. lodash.defaultsDeep = defaultsDeep;
  17357. lodash.defer = defer;
  17358. lodash.delay = delay;
  17359. lodash.difference = difference;
  17360. lodash.differenceBy = differenceBy;
  17361. lodash.differenceWith = differenceWith;
  17362. lodash.drop = drop;
  17363. lodash.dropRight = dropRight;
  17364. lodash.dropRightWhile = dropRightWhile;
  17365. lodash.dropWhile = dropWhile;
  17366. lodash.fill = fill;
  17367. lodash.filter = filter;
  17368. lodash.flatMap = flatMap;
  17369. lodash.flatMapDeep = flatMapDeep;
  17370. lodash.flatMapDepth = flatMapDepth;
  17371. lodash.flatten = flatten;
  17372. lodash.flattenDeep = flattenDeep;
  17373. lodash.flattenDepth = flattenDepth;
  17374. lodash.flip = flip;
  17375. lodash.flow = flow;
  17376. lodash.flowRight = flowRight;
  17377. lodash.fromPairs = fromPairs;
  17378. lodash.functions = functions;
  17379. lodash.functionsIn = functionsIn;
  17380. lodash.groupBy = groupBy;
  17381. lodash.initial = initial;
  17382. lodash.intersection = intersection;
  17383. lodash.intersectionBy = intersectionBy;
  17384. lodash.intersectionWith = intersectionWith;
  17385. lodash.invert = invert;
  17386. lodash.invertBy = invertBy;
  17387. lodash.invokeMap = invokeMap;
  17388. lodash.iteratee = iteratee;
  17389. lodash.keyBy = keyBy;
  17390. lodash.keys = keys;
  17391. lodash.keysIn = keysIn;
  17392. lodash.map = map;
  17393. lodash.mapKeys = mapKeys;
  17394. lodash.mapValues = mapValues;
  17395. lodash.matches = matches;
  17396. lodash.matchesProperty = matchesProperty;
  17397. lodash.memoize = memoize;
  17398. lodash.merge = merge;
  17399. lodash.mergeWith = mergeWith;
  17400. lodash.method = method;
  17401. lodash.methodOf = methodOf;
  17402. lodash.mixin = mixin;
  17403. lodash.negate = negate;
  17404. lodash.nthArg = nthArg;
  17405. lodash.omit = omit;
  17406. lodash.omitBy = omitBy;
  17407. lodash.once = once;
  17408. lodash.orderBy = orderBy;
  17409. lodash.over = over;
  17410. lodash.overArgs = overArgs;
  17411. lodash.overEvery = overEvery;
  17412. lodash.overSome = overSome;
  17413. lodash.partial = partial;
  17414. lodash.partialRight = partialRight;
  17415. lodash.partition = partition;
  17416. lodash.pick = pick;
  17417. lodash.pickBy = pickBy;
  17418. lodash.property = property;
  17419. lodash.propertyOf = propertyOf;
  17420. lodash.pull = pull;
  17421. lodash.pullAll = pullAll;
  17422. lodash.pullAllBy = pullAllBy;
  17423. lodash.pullAllWith = pullAllWith;
  17424. lodash.pullAt = pullAt;
  17425. lodash.range = range;
  17426. lodash.rangeRight = rangeRight;
  17427. lodash.rearg = rearg;
  17428. lodash.reject = reject;
  17429. lodash.remove = remove;
  17430. lodash.rest = rest;
  17431. lodash.reverse = reverse;
  17432. lodash.sampleSize = sampleSize;
  17433. lodash.set = set;
  17434. lodash.setWith = setWith;
  17435. lodash.shuffle = shuffle;
  17436. lodash.slice = slice;
  17437. lodash.sortBy = sortBy;
  17438. lodash.sortedUniq = sortedUniq;
  17439. lodash.sortedUniqBy = sortedUniqBy;
  17440. lodash.split = split;
  17441. lodash.spread = spread;
  17442. lodash.tail = tail;
  17443. lodash.take = take;
  17444. lodash.takeRight = takeRight;
  17445. lodash.takeRightWhile = takeRightWhile;
  17446. lodash.takeWhile = takeWhile;
  17447. lodash.tap = tap;
  17448. lodash.throttle = throttle;
  17449. lodash.thru = thru;
  17450. lodash.toArray = toArray;
  17451. lodash.toPairs = toPairs;
  17452. lodash.toPairsIn = toPairsIn;
  17453. lodash.toPath = toPath;
  17454. lodash.toPlainObject = toPlainObject;
  17455. lodash.transform = transform;
  17456. lodash.unary = unary;
  17457. lodash.union = union;
  17458. lodash.unionBy = unionBy;
  17459. lodash.unionWith = unionWith;
  17460. lodash.uniq = uniq;
  17461. lodash.uniqBy = uniqBy;
  17462. lodash.uniqWith = uniqWith;
  17463. lodash.unset = unset;
  17464. lodash.unzip = unzip;
  17465. lodash.unzipWith = unzipWith;
  17466. lodash.update = update;
  17467. lodash.updateWith = updateWith;
  17468. lodash.values = values;
  17469. lodash.valuesIn = valuesIn;
  17470. lodash.without = without;
  17471. lodash.words = words;
  17472. lodash.wrap = wrap;
  17473. lodash.xor = xor;
  17474. lodash.xorBy = xorBy;
  17475. lodash.xorWith = xorWith;
  17476. lodash.zip = zip;
  17477. lodash.zipObject = zipObject;
  17478. lodash.zipObjectDeep = zipObjectDeep;
  17479. lodash.zipWith = zipWith;
  17480. // Add aliases.
  17481. lodash.entries = toPairs;
  17482. lodash.entriesIn = toPairsIn;
  17483. lodash.extend = assignIn;
  17484. lodash.extendWith = assignInWith;
  17485. // Add methods to `lodash.prototype`.
  17486. mixin(lodash, lodash);
  17487. /*------------------------------------------------------------------------*/
  17488. // Add methods that return unwrapped values in chain sequences.
  17489. lodash.add = add;
  17490. lodash.attempt = attempt;
  17491. lodash.camelCase = camelCase;
  17492. lodash.capitalize = capitalize;
  17493. lodash.ceil = ceil;
  17494. lodash.clamp = clamp;
  17495. lodash.clone = clone;
  17496. lodash.cloneDeep = cloneDeep;
  17497. lodash.cloneDeepWith = cloneDeepWith;
  17498. lodash.cloneWith = cloneWith;
  17499. lodash.conformsTo = conformsTo;
  17500. lodash.deburr = deburr;
  17501. lodash.defaultTo = defaultTo;
  17502. lodash.divide = divide;
  17503. lodash.endsWith = endsWith;
  17504. lodash.eq = eq;
  17505. lodash.escape = escape;
  17506. lodash.escapeRegExp = escapeRegExp;
  17507. lodash.every = every;
  17508. lodash.find = find;
  17509. lodash.findIndex = findIndex;
  17510. lodash.findKey = findKey;
  17511. lodash.findLast = findLast;
  17512. lodash.findLastIndex = findLastIndex;
  17513. lodash.findLastKey = findLastKey;
  17514. lodash.floor = floor;
  17515. lodash.forEach = forEach;
  17516. lodash.forEachRight = forEachRight;
  17517. lodash.forIn = forIn;
  17518. lodash.forInRight = forInRight;
  17519. lodash.forOwn = forOwn;
  17520. lodash.forOwnRight = forOwnRight;
  17521. lodash.get = get;
  17522. lodash.gt = gt;
  17523. lodash.gte = gte;
  17524. lodash.has = has;
  17525. lodash.hasIn = hasIn;
  17526. lodash.head = head;
  17527. lodash.identity = identity;
  17528. lodash.includes = includes;
  17529. lodash.indexOf = indexOf;
  17530. lodash.inRange = inRange;
  17531. lodash.invoke = invoke;
  17532. lodash.isArguments = isArguments;
  17533. lodash.isArray = isArray;
  17534. lodash.isArrayBuffer = isArrayBuffer;
  17535. lodash.isArrayLike = isArrayLike;
  17536. lodash.isArrayLikeObject = isArrayLikeObject;
  17537. lodash.isBoolean = isBoolean;
  17538. lodash.isBuffer = isBuffer;
  17539. lodash.isDate = isDate;
  17540. lodash.isElement = isElement;
  17541. lodash.isEmpty = isEmpty;
  17542. lodash.isEqual = isEqual;
  17543. lodash.isEqualWith = isEqualWith;
  17544. lodash.isError = isError;
  17545. lodash.isFinite = isFinite;
  17546. lodash.isFunction = isFunction;
  17547. lodash.isInteger = isInteger;
  17548. lodash.isLength = isLength;
  17549. lodash.isMap = isMap;
  17550. lodash.isMatch = isMatch;
  17551. lodash.isMatchWith = isMatchWith;
  17552. lodash.isNaN = isNaN;
  17553. lodash.isNative = isNative;
  17554. lodash.isNil = isNil;
  17555. lodash.isNull = isNull;
  17556. lodash.isNumber = isNumber;
  17557. lodash.isObject = isObject;
  17558. lodash.isObjectLike = isObjectLike;
  17559. lodash.isPlainObject = isPlainObject;
  17560. lodash.isRegExp = isRegExp;
  17561. lodash.isSafeInteger = isSafeInteger;
  17562. lodash.isSet = isSet;
  17563. lodash.isString = isString;
  17564. lodash.isSymbol = isSymbol;
  17565. lodash.isTypedArray = isTypedArray;
  17566. lodash.isUndefined = isUndefined;
  17567. lodash.isWeakMap = isWeakMap;
  17568. lodash.isWeakSet = isWeakSet;
  17569. lodash.join = join;
  17570. lodash.kebabCase = kebabCase;
  17571. lodash.last = last;
  17572. lodash.lastIndexOf = lastIndexOf;
  17573. lodash.lowerCase = lowerCase;
  17574. lodash.lowerFirst = lowerFirst;
  17575. lodash.lt = lt;
  17576. lodash.lte = lte;
  17577. lodash.max = max;
  17578. lodash.maxBy = maxBy;
  17579. lodash.mean = mean;
  17580. lodash.meanBy = meanBy;
  17581. lodash.min = min;
  17582. lodash.minBy = minBy;
  17583. lodash.stubArray = stubArray;
  17584. lodash.stubFalse = stubFalse;
  17585. lodash.stubObject = stubObject;
  17586. lodash.stubString = stubString;
  17587. lodash.stubTrue = stubTrue;
  17588. lodash.multiply = multiply;
  17589. lodash.nth = nth;
  17590. lodash.noConflict = noConflict;
  17591. lodash.noop = noop;
  17592. lodash.now = now;
  17593. lodash.pad = pad;
  17594. lodash.padEnd = padEnd;
  17595. lodash.padStart = padStart;
  17596. lodash.parseInt = parseInt;
  17597. lodash.random = random;
  17598. lodash.reduce = reduce;
  17599. lodash.reduceRight = reduceRight;
  17600. lodash.repeat = repeat;
  17601. lodash.replace = replace;
  17602. lodash.result = result;
  17603. lodash.round = round;
  17604. lodash.runInContext = runInContext;
  17605. lodash.sample = sample;
  17606. lodash.size = size;
  17607. lodash.snakeCase = snakeCase;
  17608. lodash.some = some;
  17609. lodash.sortedIndex = sortedIndex;
  17610. lodash.sortedIndexBy = sortedIndexBy;
  17611. lodash.sortedIndexOf = sortedIndexOf;
  17612. lodash.sortedLastIndex = sortedLastIndex;
  17613. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17614. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17615. lodash.startCase = startCase;
  17616. lodash.startsWith = startsWith;
  17617. lodash.subtract = subtract;
  17618. lodash.sum = sum;
  17619. lodash.sumBy = sumBy;
  17620. lodash.template = template;
  17621. lodash.times = times;
  17622. lodash.toFinite = toFinite;
  17623. lodash.toInteger = toInteger;
  17624. lodash.toLength = toLength;
  17625. lodash.toLower = toLower;
  17626. lodash.toNumber = toNumber;
  17627. lodash.toSafeInteger = toSafeInteger;
  17628. lodash.toString = toString;
  17629. lodash.toUpper = toUpper;
  17630. lodash.trim = trim;
  17631. lodash.trimEnd = trimEnd;
  17632. lodash.trimStart = trimStart;
  17633. lodash.truncate = truncate;
  17634. lodash.unescape = unescape;
  17635. lodash.uniqueId = uniqueId;
  17636. lodash.upperCase = upperCase;
  17637. lodash.upperFirst = upperFirst;
  17638. // Add aliases.
  17639. lodash.each = forEach;
  17640. lodash.eachRight = forEachRight;
  17641. lodash.first = head;
  17642. mixin(lodash, (function() {
  17643. var source = {};
  17644. baseForOwn(lodash, function(func, methodName) {
  17645. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17646. source[methodName] = func;
  17647. }
  17648. });
  17649. return source;
  17650. }()), { 'chain': false });
  17651. /*------------------------------------------------------------------------*/
  17652. /**
  17653. * The semantic version number.
  17654. *
  17655. * @static
  17656. * @memberOf _
  17657. * @type {string}
  17658. */
  17659. lodash.VERSION = VERSION;
  17660. // Assign default placeholders.
  17661. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17662. lodash[methodName].placeholder = lodash;
  17663. });
  17664. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17665. arrayEach(['drop', 'take'], function(methodName, index) {
  17666. LazyWrapper.prototype[methodName] = function(n) {
  17667. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17668. var result = (this.__filtered__ && !index)
  17669. ? new LazyWrapper(this)
  17670. : this.clone();
  17671. if (result.__filtered__) {
  17672. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17673. } else {
  17674. result.__views__.push({
  17675. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17676. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17677. });
  17678. }
  17679. return result;
  17680. };
  17681. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17682. return this.reverse()[methodName](n).reverse();
  17683. };
  17684. });
  17685. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17686. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17687. var type = index + 1,
  17688. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17689. LazyWrapper.prototype[methodName] = function(iteratee) {
  17690. var result = this.clone();
  17691. result.__iteratees__.push({
  17692. 'iteratee': getIteratee(iteratee, 3),
  17693. 'type': type
  17694. });
  17695. result.__filtered__ = result.__filtered__ || isFilter;
  17696. return result;
  17697. };
  17698. });
  17699. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17700. arrayEach(['head', 'last'], function(methodName, index) {
  17701. var takeName = 'take' + (index ? 'Right' : '');
  17702. LazyWrapper.prototype[methodName] = function() {
  17703. return this[takeName](1).value()[0];
  17704. };
  17705. });
  17706. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17707. arrayEach(['initial', 'tail'], function(methodName, index) {
  17708. var dropName = 'drop' + (index ? '' : 'Right');
  17709. LazyWrapper.prototype[methodName] = function() {
  17710. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17711. };
  17712. });
  17713. LazyWrapper.prototype.compact = function() {
  17714. return this.filter(identity);
  17715. };
  17716. LazyWrapper.prototype.find = function(predicate) {
  17717. return this.filter(predicate).head();
  17718. };
  17719. LazyWrapper.prototype.findLast = function(predicate) {
  17720. return this.reverse().find(predicate);
  17721. };
  17722. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17723. if (typeof path == 'function') {
  17724. return new LazyWrapper(this);
  17725. }
  17726. return this.map(function(value) {
  17727. return baseInvoke(value, path, args);
  17728. });
  17729. });
  17730. LazyWrapper.prototype.reject = function(predicate) {
  17731. return this.filter(negate(getIteratee(predicate)));
  17732. };
  17733. LazyWrapper.prototype.slice = function(start, end) {
  17734. start = toInteger(start);
  17735. var result = this;
  17736. if (result.__filtered__ && (start > 0 || end < 0)) {
  17737. return new LazyWrapper(result);
  17738. }
  17739. if (start < 0) {
  17740. result = result.takeRight(-start);
  17741. } else if (start) {
  17742. result = result.drop(start);
  17743. }
  17744. if (end !== undefined) {
  17745. end = toInteger(end);
  17746. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17747. }
  17748. return result;
  17749. };
  17750. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17751. return this.reverse().takeWhile(predicate).reverse();
  17752. };
  17753. LazyWrapper.prototype.toArray = function() {
  17754. return this.take(MAX_ARRAY_LENGTH);
  17755. };
  17756. // Add `LazyWrapper` methods to `lodash.prototype`.
  17757. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17758. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17759. isTaker = /^(?:head|last)$/.test(methodName),
  17760. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17761. retUnwrapped = isTaker || /^find/.test(methodName);
  17762. if (!lodashFunc) {
  17763. return;
  17764. }
  17765. lodash.prototype[methodName] = function() {
  17766. var value = this.__wrapped__,
  17767. args = isTaker ? [1] : arguments,
  17768. isLazy = value instanceof LazyWrapper,
  17769. iteratee = args[0],
  17770. useLazy = isLazy || isArray(value);
  17771. var interceptor = function(value) {
  17772. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17773. return (isTaker && chainAll) ? result[0] : result;
  17774. };
  17775. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17776. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17777. isLazy = useLazy = false;
  17778. }
  17779. var chainAll = this.__chain__,
  17780. isHybrid = !!this.__actions__.length,
  17781. isUnwrapped = retUnwrapped && !chainAll,
  17782. onlyLazy = isLazy && !isHybrid;
  17783. if (!retUnwrapped && useLazy) {
  17784. value = onlyLazy ? value : new LazyWrapper(this);
  17785. var result = func.apply(value, args);
  17786. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17787. return new LodashWrapper(result, chainAll);
  17788. }
  17789. if (isUnwrapped && onlyLazy) {
  17790. return func.apply(this, args);
  17791. }
  17792. result = this.thru(interceptor);
  17793. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17794. };
  17795. });
  17796. // Add `Array` methods to `lodash.prototype`.
  17797. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17798. var func = arrayProto[methodName],
  17799. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17800. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17801. lodash.prototype[methodName] = function() {
  17802. var args = arguments;
  17803. if (retUnwrapped && !this.__chain__) {
  17804. var value = this.value();
  17805. return func.apply(isArray(value) ? value : [], args);
  17806. }
  17807. return this[chainName](function(value) {
  17808. return func.apply(isArray(value) ? value : [], args);
  17809. });
  17810. };
  17811. });
  17812. // Map minified method names to their real names.
  17813. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17814. var lodashFunc = lodash[methodName];
  17815. if (lodashFunc) {
  17816. var key = lodashFunc.name + '';
  17817. if (!hasOwnProperty.call(realNames, key)) {
  17818. realNames[key] = [];
  17819. }
  17820. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17821. }
  17822. });
  17823. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17824. 'name': 'wrapper',
  17825. 'func': undefined
  17826. }];
  17827. // Add methods to `LazyWrapper`.
  17828. LazyWrapper.prototype.clone = lazyClone;
  17829. LazyWrapper.prototype.reverse = lazyReverse;
  17830. LazyWrapper.prototype.value = lazyValue;
  17831. // Add chain sequence methods to the `lodash` wrapper.
  17832. lodash.prototype.at = wrapperAt;
  17833. lodash.prototype.chain = wrapperChain;
  17834. lodash.prototype.commit = wrapperCommit;
  17835. lodash.prototype.next = wrapperNext;
  17836. lodash.prototype.plant = wrapperPlant;
  17837. lodash.prototype.reverse = wrapperReverse;
  17838. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17839. // Add lazy aliases.
  17840. lodash.prototype.first = lodash.prototype.head;
  17841. if (symIterator) {
  17842. lodash.prototype[symIterator] = wrapperToIterator;
  17843. }
  17844. return lodash;
  17845. });
  17846. /*--------------------------------------------------------------------------*/
  17847. // Export lodash.
  17848. var _ = runInContext();
  17849. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17850. if (true) {
  17851. // Expose Lodash on the global object to prevent errors when Lodash is
  17852. // loaded by a script tag in the presence of an AMD loader.
  17853. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17854. // Use `_.noConflict` to remove Lodash from the global object.
  17855. root._ = _;
  17856. // Define as an anonymous module so, through path mapping, it can be
  17857. // referenced as the "underscore" module.
  17858. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17859. return _;
  17860. }).call(exports, __webpack_require__, exports, module),
  17861. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17862. }
  17863. // Check for `exports` after `define` in case a build optimizer adds it.
  17864. else {}
  17865. }.call(this));
  17866. /***/ }),
  17867. /***/ "./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":
  17868. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17869. !*** ./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 ***!
  17870. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17871. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17872. "use strict";
  17873. __webpack_require__.r(__webpack_exports__);
  17874. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17875. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17876. /* harmony export */ });
  17877. /* 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");
  17878. /* 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__);
  17879. /* 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");
  17880. var options = {};
  17881. options.insert = "head";
  17882. options.singleton = false;
  17883. 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);
  17884. /* 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 || {});
  17885. /***/ }),
  17886. /***/ "./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":
  17887. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17888. !*** ./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 ***!
  17889. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17890. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17891. "use strict";
  17892. __webpack_require__.r(__webpack_exports__);
  17893. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17894. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17895. /* harmony export */ });
  17896. /* 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");
  17897. /* 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__);
  17898. /* 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");
  17899. var options = {};
  17900. options.insert = "head";
  17901. options.singleton = false;
  17902. 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);
  17903. /* 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 || {});
  17904. /***/ }),
  17905. /***/ "./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":
  17906. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17907. !*** ./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 ***!
  17908. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17909. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17910. "use strict";
  17911. __webpack_require__.r(__webpack_exports__);
  17912. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17913. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17914. /* harmony export */ });
  17915. /* 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");
  17916. /* 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__);
  17917. /* 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");
  17918. var options = {};
  17919. options.insert = "head";
  17920. options.singleton = false;
  17921. 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);
  17922. /* 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 || {});
  17923. /***/ }),
  17924. /***/ "./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":
  17925. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17926. !*** ./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 ***!
  17927. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17928. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17929. "use strict";
  17930. __webpack_require__.r(__webpack_exports__);
  17931. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17932. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17933. /* harmony export */ });
  17934. /* 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");
  17935. /* 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__);
  17936. /* 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");
  17937. var options = {};
  17938. options.insert = "head";
  17939. options.singleton = false;
  17940. 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);
  17941. /* 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 || {});
  17942. /***/ }),
  17943. /***/ "./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":
  17944. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17945. !*** ./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 ***!
  17946. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17947. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17948. "use strict";
  17949. __webpack_require__.r(__webpack_exports__);
  17950. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17951. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17952. /* harmony export */ });
  17953. /* 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");
  17954. /* 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__);
  17955. /* 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");
  17956. var options = {};
  17957. options.insert = "head";
  17958. options.singleton = false;
  17959. 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);
  17960. /* 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 || {});
  17961. /***/ }),
  17962. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17963. /*!******************************************************!*\
  17964. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17965. \******************************************************/
  17966. /***/ ((__unused_webpack_module, exports) => {
  17967. "use strict";
  17968. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17969. // runtime helper for setting properties on components
  17970. // in a tree-shakable way
  17971. exports["default"] = (sfc, props) => {
  17972. const target = sfc.__vccOpts || sfc;
  17973. for (const [key, val] of props) {
  17974. target[key] = val;
  17975. }
  17976. return target;
  17977. };
  17978. /***/ }),
  17979. /***/ "./resources/js/components/AppDropdown.vue":
  17980. /*!*************************************************!*\
  17981. !*** ./resources/js/components/AppDropdown.vue ***!
  17982. \*************************************************/
  17983. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17984. "use strict";
  17985. __webpack_require__.r(__webpack_exports__);
  17986. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17987. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17988. /* harmony export */ });
  17989. /* harmony import */ var _AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992");
  17990. /* harmony import */ var _AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  17991. /* 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");
  17992. ;
  17993. 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"])(_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppDropdown.vue"]])
  17994. /* hot reload */
  17995. if (false) {}
  17996. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17997. /***/ }),
  17998. /***/ "./resources/js/components/AppFooter.vue":
  17999. /*!***********************************************!*\
  18000. !*** ./resources/js/components/AppFooter.vue ***!
  18001. \***********************************************/
  18002. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18003. "use strict";
  18004. __webpack_require__.r(__webpack_exports__);
  18005. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18006. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18007. /* harmony export */ });
  18008. /* 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");
  18009. /* 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");
  18010. /* 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");
  18011. const script = {}
  18012. ;
  18013. 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"]])
  18014. /* hot reload */
  18015. if (false) {}
  18016. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18017. /***/ }),
  18018. /***/ "./resources/js/components/AppInputText.vue":
  18019. /*!**************************************************!*\
  18020. !*** ./resources/js/components/AppInputText.vue ***!
  18021. \**************************************************/
  18022. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18023. "use strict";
  18024. __webpack_require__.r(__webpack_exports__);
  18025. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18026. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18027. /* harmony export */ });
  18028. /* harmony import */ var _AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=template&id=16729fe1 */ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1");
  18029. /* harmony import */ var _AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js");
  18030. /* 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");
  18031. ;
  18032. 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"])(_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppInputText.vue"]])
  18033. /* hot reload */
  18034. if (false) {}
  18035. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18036. /***/ }),
  18037. /***/ "./resources/js/components/AppMessage.vue":
  18038. /*!************************************************!*\
  18039. !*** ./resources/js/components/AppMessage.vue ***!
  18040. \************************************************/
  18041. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18042. "use strict";
  18043. __webpack_require__.r(__webpack_exports__);
  18044. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18045. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18046. /* harmony export */ });
  18047. /* 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");
  18048. /* 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");
  18049. /* 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");
  18050. ;
  18051. 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"]])
  18052. /* hot reload */
  18053. if (false) {}
  18054. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18055. /***/ }),
  18056. /***/ "./resources/js/components/AppSidebar.vue":
  18057. /*!************************************************!*\
  18058. !*** ./resources/js/components/AppSidebar.vue ***!
  18059. \************************************************/
  18060. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18061. "use strict";
  18062. __webpack_require__.r(__webpack_exports__);
  18063. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18064. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18065. /* harmony export */ });
  18066. /* 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");
  18067. /* 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");
  18068. /* 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");
  18069. /* 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");
  18070. ;
  18071. 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"]])
  18072. /* hot reload */
  18073. if (false) {}
  18074. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18075. /***/ }),
  18076. /***/ "./resources/js/components/AppSubSidebar.vue":
  18077. /*!***************************************************!*\
  18078. !*** ./resources/js/components/AppSubSidebar.vue ***!
  18079. \***************************************************/
  18080. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18081. "use strict";
  18082. __webpack_require__.r(__webpack_exports__);
  18083. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18084. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18085. /* harmony export */ });
  18086. /* 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");
  18087. /* 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");
  18088. /* 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");
  18089. /* 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");
  18090. ;
  18091. 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"]])
  18092. /* hot reload */
  18093. if (false) {}
  18094. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18095. /***/ }),
  18096. /***/ "./resources/js/components/AppTopBar.vue":
  18097. /*!***********************************************!*\
  18098. !*** ./resources/js/components/AppTopBar.vue ***!
  18099. \***********************************************/
  18100. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18101. "use strict";
  18102. __webpack_require__.r(__webpack_exports__);
  18103. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18104. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18105. /* harmony export */ });
  18106. /* 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");
  18107. /* 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");
  18108. /* 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");
  18109. /* 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");
  18110. ;
  18111. 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"]])
  18112. /* hot reload */
  18113. if (false) {}
  18114. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18115. /***/ }),
  18116. /***/ "./resources/js/layouts/DashboardLayout.vue":
  18117. /*!**************************************************!*\
  18118. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  18119. \**************************************************/
  18120. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18121. "use strict";
  18122. __webpack_require__.r(__webpack_exports__);
  18123. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18124. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18125. /* harmony export */ });
  18126. /* 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");
  18127. /* 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");
  18128. /* 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");
  18129. /* 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");
  18130. ;
  18131. 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"]])
  18132. /* hot reload */
  18133. if (false) {}
  18134. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18135. /***/ }),
  18136. /***/ "./resources/js/pages/member/Edit.vue":
  18137. /*!********************************************!*\
  18138. !*** ./resources/js/pages/member/Edit.vue ***!
  18139. \********************************************/
  18140. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18141. "use strict";
  18142. __webpack_require__.r(__webpack_exports__);
  18143. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18144. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18145. /* harmony export */ });
  18146. /* harmony import */ var _Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Edit.vue?vue&type=template&id=1a9fb226 */ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226");
  18147. /* harmony import */ var _Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Edit.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js");
  18148. /* 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");
  18149. ;
  18150. 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"])(_Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/member/Edit.vue"]])
  18151. /* hot reload */
  18152. if (false) {}
  18153. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18154. /***/ }),
  18155. /***/ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  18156. /*!************************************************************************************!*\
  18157. !*** ./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  18158. \************************************************************************************/
  18159. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18160. "use strict";
  18161. __webpack_require__.r(__webpack_exports__);
  18162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18163. /* 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_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18164. /* harmony export */ });
  18165. /* 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_AppDropdown_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]!./AppDropdown.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/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  18166. /***/ }),
  18167. /***/ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  18168. /*!*************************************************************************************!*\
  18169. !*** ./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  18170. \*************************************************************************************/
  18171. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18172. "use strict";
  18173. __webpack_require__.r(__webpack_exports__);
  18174. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18175. /* 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_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18176. /* harmony export */ });
  18177. /* 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_AppInputText_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]!./AppInputText.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/AppInputText.vue?vue&type=script&setup=true&lang=js");
  18178. /***/ }),
  18179. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  18180. /*!***********************************************************************************!*\
  18181. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  18182. \***********************************************************************************/
  18183. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18184. "use strict";
  18185. __webpack_require__.r(__webpack_exports__);
  18186. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18187. /* 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"])
  18188. /* harmony export */ });
  18189. /* 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");
  18190. /***/ }),
  18191. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  18192. /*!***********************************************************************************!*\
  18193. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18194. \***********************************************************************************/
  18195. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18196. "use strict";
  18197. __webpack_require__.r(__webpack_exports__);
  18198. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18199. /* 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"])
  18200. /* harmony export */ });
  18201. /* 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");
  18202. /***/ }),
  18203. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  18204. /*!**************************************************************************************!*\
  18205. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18206. \**************************************************************************************/
  18207. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18208. "use strict";
  18209. __webpack_require__.r(__webpack_exports__);
  18210. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18211. /* 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"])
  18212. /* harmony export */ });
  18213. /* 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");
  18214. /***/ }),
  18215. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  18216. /*!**********************************************************************************!*\
  18217. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  18218. \**********************************************************************************/
  18219. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18220. "use strict";
  18221. __webpack_require__.r(__webpack_exports__);
  18222. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18223. /* 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"])
  18224. /* harmony export */ });
  18225. /* 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");
  18226. /***/ }),
  18227. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  18228. /*!*************************************************************************************!*\
  18229. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  18230. \*************************************************************************************/
  18231. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18232. "use strict";
  18233. __webpack_require__.r(__webpack_exports__);
  18234. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18235. /* 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"])
  18236. /* harmony export */ });
  18237. /* 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");
  18238. /***/ }),
  18239. /***/ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js":
  18240. /*!*******************************************************************************!*\
  18241. !*** ./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  18242. \*******************************************************************************/
  18243. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18244. "use strict";
  18245. __webpack_require__.r(__webpack_exports__);
  18246. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18247. /* 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_Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18248. /* harmony export */ });
  18249. /* 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_Edit_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]!./Edit.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/member/Edit.vue?vue&type=script&setup=true&lang=js");
  18250. /***/ }),
  18251. /***/ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  18252. /*!*******************************************************************************!*\
  18253. !*** ./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  18254. \*******************************************************************************/
  18255. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18256. "use strict";
  18257. __webpack_require__.r(__webpack_exports__);
  18258. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18259. /* 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_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render)
  18260. /* harmony export */ });
  18261. /* 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_AppDropdown_vue_vue_type_template_id_ce0d1992__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]!./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppDropdown.vue?vue&type=template&id=ce0d1992");
  18262. /***/ }),
  18263. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  18264. /*!*****************************************************************************************!*\
  18265. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  18266. \*****************************************************************************************/
  18267. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18268. "use strict";
  18269. __webpack_require__.r(__webpack_exports__);
  18270. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18271. /* 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)
  18272. /* harmony export */ });
  18273. /* 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");
  18274. /***/ }),
  18275. /***/ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  18276. /*!********************************************************************************!*\
  18277. !*** ./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  18278. \********************************************************************************/
  18279. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18280. "use strict";
  18281. __webpack_require__.r(__webpack_exports__);
  18282. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18283. /* 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_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render)
  18284. /* harmony export */ });
  18285. /* 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_AppInputText_vue_vue_type_template_id_16729fe1__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]!./AppInputText.vue?vue&type=template&id=16729fe1 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1");
  18286. /***/ }),
  18287. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  18288. /*!******************************************************************************!*\
  18289. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  18290. \******************************************************************************/
  18291. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18292. "use strict";
  18293. __webpack_require__.r(__webpack_exports__);
  18294. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18295. /* 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)
  18296. /* harmony export */ });
  18297. /* 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");
  18298. /***/ }),
  18299. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  18300. /*!******************************************************************************************!*\
  18301. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  18302. \******************************************************************************************/
  18303. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18304. "use strict";
  18305. __webpack_require__.r(__webpack_exports__);
  18306. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18307. /* 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)
  18308. /* harmony export */ });
  18309. /* 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");
  18310. /***/ }),
  18311. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  18312. /*!*********************************************************************************************!*\
  18313. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  18314. \*********************************************************************************************/
  18315. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18316. "use strict";
  18317. __webpack_require__.r(__webpack_exports__);
  18318. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18319. /* 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)
  18320. /* harmony export */ });
  18321. /* 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");
  18322. /***/ }),
  18323. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  18324. /*!*****************************************************************************************!*\
  18325. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  18326. \*****************************************************************************************/
  18327. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18328. "use strict";
  18329. __webpack_require__.r(__webpack_exports__);
  18330. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18331. /* 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)
  18332. /* harmony export */ });
  18333. /* 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");
  18334. /***/ }),
  18335. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  18336. /*!********************************************************************************************!*\
  18337. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  18338. \********************************************************************************************/
  18339. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18340. "use strict";
  18341. __webpack_require__.r(__webpack_exports__);
  18342. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18343. /* 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)
  18344. /* harmony export */ });
  18345. /* 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");
  18346. /***/ }),
  18347. /***/ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226":
  18348. /*!**************************************************************************!*\
  18349. !*** ./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  18350. \**************************************************************************/
  18351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18352. "use strict";
  18353. __webpack_require__.r(__webpack_exports__);
  18354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18355. /* 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_Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__.render)
  18356. /* harmony export */ });
  18357. /* 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_Edit_vue_vue_type_template_id_1a9fb226__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]!./Edit.vue?vue&type=template&id=1a9fb226 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226");
  18358. /***/ }),
  18359. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  18360. /*!********************************************************************************************************!*\
  18361. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  18362. \********************************************************************************************************/
  18363. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18364. "use strict";
  18365. __webpack_require__.r(__webpack_exports__);
  18366. /* 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");
  18367. /***/ }),
  18368. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  18369. /*!*********************************************************************************************************!*\
  18370. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  18371. \*********************************************************************************************************/
  18372. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18373. "use strict";
  18374. __webpack_require__.r(__webpack_exports__);
  18375. /* 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");
  18376. /***/ }),
  18377. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  18378. /*!************************************************************************************************************!*\
  18379. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  18380. \************************************************************************************************************/
  18381. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18382. "use strict";
  18383. __webpack_require__.r(__webpack_exports__);
  18384. /* 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");
  18385. /***/ }),
  18386. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  18387. /*!********************************************************************************************************!*\
  18388. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  18389. \********************************************************************************************************/
  18390. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18391. "use strict";
  18392. __webpack_require__.r(__webpack_exports__);
  18393. /* 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");
  18394. /***/ }),
  18395. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18396. /*!***********************************************************************************************************!*\
  18397. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18398. \***********************************************************************************************************/
  18399. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18400. "use strict";
  18401. __webpack_require__.r(__webpack_exports__);
  18402. /* 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");
  18403. /***/ })
  18404. }]);