resources_js_pages_member_Edit_vue.js 719KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920
  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: props.member.phone,
  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)(form, props.typeMember.maxVehicles, props.initialVehicles),
  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. "class": "grid"
  650. };
  651. var _hoisted_2 = {
  652. "class": "col-12"
  653. };
  654. var _hoisted_3 = {
  655. key: 0
  656. };
  657. var _hoisted_4 = {
  658. key: 1
  659. };
  660. function render(_ctx, _cache, $props, $setup, $data, $options) {
  661. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  662. 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)("div", _hoisted_2, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  663. key: 0,
  664. severity: "success",
  665. onClose: $setup.onClose
  666. }, {
  667. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  668. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  669. /* TEXT */
  670. )];
  671. }),
  672. _: 1
  673. /* STABLE */
  674. })) : (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, {
  675. key: 1,
  676. severity: "error",
  677. onClose: $setup.onClose
  678. }, {
  679. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  680. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  681. /* TEXT */
  682. )];
  683. }),
  684. _: 1
  685. /* STABLE */
  686. })) : (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, {
  687. key: 2,
  688. severity: "error",
  689. onClose: $setup.onClose
  690. }, {
  691. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  692. 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_3, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  693. /* TEXT */
  694. ))];
  695. }),
  696. _: 1
  697. /* STABLE */
  698. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]);
  699. }
  700. /***/ }),
  701. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  702. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  703. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  704. \********************************************************************************************************************************************************************************************************************************************************************************************/
  705. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  706. "use strict";
  707. __webpack_require__.r(__webpack_exports__);
  708. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  709. /* harmony export */ "render": () => (/* binding */ render)
  710. /* harmony export */ });
  711. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  712. function render(_ctx, _cache, $props, $setup, $data, $options) {
  713. 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"], {
  714. "class": "layout-menu",
  715. items: $props.menu,
  716. root: true
  717. }, null, 8
  718. /* PROPS */
  719. , ["items"])]);
  720. }
  721. /***/ }),
  722. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  723. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  724. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  725. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  727. "use strict";
  728. __webpack_require__.r(__webpack_exports__);
  729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  730. /* harmony export */ "render": () => (/* binding */ render)
  731. /* harmony export */ });
  732. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  733. var _withScopeId = function _withScopeId(n) {
  734. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  735. };
  736. var _hoisted_1 = {
  737. key: 0
  738. };
  739. var _hoisted_2 = ["aria-label"];
  740. var _hoisted_3 = ["aria-label"];
  741. function render(_ctx, _cache, $props, $setup, $data, $options) {
  742. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  743. 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) {
  744. 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", {
  745. key: i,
  746. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  747. 'layout-menuitem-category': $props.root
  748. }]),
  749. role: "none"
  750. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  751. key: 0
  752. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  753. "class": "layout-menuitem-root-text",
  754. "aria-label": item.label
  755. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  756. /* TEXT, PROPS */
  757. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  758. items: item.items
  759. }, null, 8
  760. /* PROPS */
  761. , ["items"])], 64
  762. /* STABLE_FRAGMENT */
  763. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  764. key: 1
  765. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  766. key: 0,
  767. role: "menuitem",
  768. href: item.to,
  769. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  770. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  771. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  772. }]),
  773. "aria-label": item.label
  774. }, {
  775. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  776. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  777. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  778. }, null, 2
  779. /* CLASS */
  780. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  781. /* TEXT */
  782. )];
  783. }),
  784. _: 2
  785. /* DYNAMIC */
  786. }, 1032
  787. /* PROPS, DYNAMIC_SLOTS */
  788. , ["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", {
  789. key: 1,
  790. href: "#",
  791. role: "menuitem",
  792. "aria-label": item.label
  793. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  794. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  795. }, null, 2
  796. /* CLASS */
  797. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  798. /* TEXT */
  799. )], 8
  800. /* PROPS */
  801. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  802. items: item.items
  803. }, null, 8
  804. /* PROPS */
  805. , ["items"])], 64
  806. /* STABLE_FRAGMENT */
  807. ))], 2
  808. /* CLASS */
  809. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  810. /* STABLE_FRAGMENT */
  811. );
  812. }), 256
  813. /* UNKEYED_FRAGMENT */
  814. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  815. }
  816. /***/ }),
  817. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  818. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  819. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  820. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  821. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  822. "use strict";
  823. __webpack_require__.r(__webpack_exports__);
  824. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  825. /* harmony export */ "render": () => (/* binding */ render)
  826. /* harmony export */ });
  827. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  828. var _withScopeId = function _withScopeId(n) {
  829. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  830. };
  831. var _hoisted_1 = {
  832. "class": "layout-topbar"
  833. };
  834. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  835. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  836. alt: "Logo",
  837. src: "/images/logo.svg",
  838. "class": "md:mr-3"
  839. }, null, -1
  840. /* HOISTED */
  841. );
  842. });
  843. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  844. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  845. /* HOISTED */
  846. );
  847. });
  848. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  849. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  850. "class": "pi pi-bars"
  851. }, null, -1
  852. /* HOISTED */
  853. );
  854. });
  855. var _hoisted_5 = [_hoisted_4];
  856. var _hoisted_6 = {
  857. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  858. };
  859. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  860. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  861. "class": "pi pi-ellipsis-v"
  862. }, null, -1
  863. /* HOISTED */
  864. );
  865. });
  866. var _hoisted_8 = [_hoisted_7];
  867. var _hoisted_9 = {
  868. "class": "layout-topbar-menu hidden lg:flex origin-top"
  869. };
  870. var _hoisted_10 = {
  871. "class": "align-self-center"
  872. };
  873. var _hoisted_11 = {
  874. "class": "hidden lg:inline"
  875. };
  876. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  877. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  878. "class": "pi pi-user"
  879. }, null, -1
  880. /* HOISTED */
  881. );
  882. });
  883. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  884. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  885. /* HOISTED */
  886. );
  887. });
  888. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  889. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  890. "class": "pi pi-sign-out"
  891. }, null, -1
  892. /* HOISTED */
  893. );
  894. });
  895. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  896. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  897. /* HOISTED */
  898. );
  899. });
  900. function render(_ctx, _cache, $props, $setup, $data, $options) {
  901. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  902. 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"], {
  903. href: "/",
  904. "class": "layout-topbar-logo"
  905. }, {
  906. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  907. return [_hoisted_2, _hoisted_3];
  908. }),
  909. _: 1
  910. /* STABLE */
  911. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  912. "class": "p-link layout-menu-button layout-topbar-button",
  913. onClick: _cache[0] || (_cache[0] = function ($event) {
  914. return _ctx.$emit('menu-toggle', $event);
  915. })
  916. }, _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, {
  917. selector: '@next',
  918. enterClass: 'hidden',
  919. enterActiveClass: 'scalein',
  920. leaveToClass: 'hidden',
  921. leaveActiveClass: 'fadeout',
  922. hideOnOutsideClick: true
  923. }]]), (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
  924. /* TEXT */
  925. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  926. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  927. "class": "p-link layout-topbar-button"
  928. }, {
  929. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  930. return [_hoisted_12, _hoisted_13];
  931. }),
  932. _: 1
  933. /* STABLE */
  934. }, 8
  935. /* PROPS */
  936. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  937. href: _ctx.route('logout'),
  938. as: "button",
  939. method: "post",
  940. "class": "p-link layout-topbar-button"
  941. }, {
  942. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  943. return [_hoisted_14, _hoisted_15];
  944. }),
  945. _: 1
  946. /* STABLE */
  947. }, 8
  948. /* PROPS */
  949. , ["href"])])])]);
  950. }
  951. /***/ }),
  952. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  953. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  954. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  955. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  956. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  957. "use strict";
  958. __webpack_require__.r(__webpack_exports__);
  959. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  960. /* harmony export */ "render": () => (/* binding */ render)
  961. /* harmony export */ });
  962. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  963. var _withScopeId = function _withScopeId(n) {
  964. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  965. };
  966. var _hoisted_1 = {
  967. "class": "layout-sidebar"
  968. };
  969. var _hoisted_2 = {
  970. "class": "layout-main-container"
  971. };
  972. var _hoisted_3 = {
  973. "class": "layout-main"
  974. };
  975. var _hoisted_4 = {
  976. key: 0,
  977. "class": "layout-mask p-component-overlay"
  978. };
  979. function render(_ctx, _cache, $props, $setup, $data, $options) {
  980. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  981. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  982. onClick: $setup.onWrapperClick
  983. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  984. onMenuToggle: $setup.onMenuToggle
  985. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  986. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  987. }, null, 8
  988. /* PROPS */
  989. , ["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, {
  990. name: "layout-mask"
  991. }, {
  992. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  993. 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)];
  994. }),
  995. _: 1
  996. /* STABLE */
  997. })], 2
  998. /* CLASS */
  999. );
  1000. }
  1001. /***/ }),
  1002. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  1003. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  1004. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  1005. \****************************************************************************************************************************************************************************************************************************************************************************/
  1006. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1007. "use strict";
  1008. __webpack_require__.r(__webpack_exports__);
  1009. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1010. /* harmony export */ "render": () => (/* binding */ render)
  1011. /* harmony export */ });
  1012. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1013. var _hoisted_1 = {
  1014. "class": "grid"
  1015. };
  1016. var _hoisted_2 = {
  1017. "class": "col-12 md:col-8"
  1018. };
  1019. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Ubah Member ");
  1020. var _hoisted_4 = {
  1021. "class": "grid"
  1022. };
  1023. var _hoisted_5 = {
  1024. "class": "col-12 md:col-6"
  1025. };
  1026. var _hoisted_6 = {
  1027. "class": "col-12 md:col-6"
  1028. };
  1029. var _hoisted_7 = {
  1030. "class": "col-12 md:col-6"
  1031. };
  1032. var _hoisted_8 = {
  1033. "class": "grid"
  1034. };
  1035. var _hoisted_9 = {
  1036. "class": "col-12 md:col-8"
  1037. };
  1038. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Detail Harga");
  1039. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1040. "class": "text-base font-bold mb-0"
  1041. }, "Jenis Member", -1
  1042. /* HOISTED */
  1043. );
  1044. var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1045. "class": "text-base font-bold mb-0"
  1046. }, "Batas Maksimal Kendaraan", -1
  1047. /* HOISTED */
  1048. );
  1049. var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1050. "class": "text-base font-bold mb-0"
  1051. }, "Keterangan", -1
  1052. /* HOISTED */
  1053. );
  1054. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1055. "class": "text-base font-bold mb-0"
  1056. }, "Tarif Member", -1
  1057. /* HOISTED */
  1058. );
  1059. var _hoisted_15 = {
  1060. key: 0,
  1061. "class": "grid"
  1062. };
  1063. var _hoisted_16 = {
  1064. "class": "col-12 md:col-8"
  1065. };
  1066. var _hoisted_17 = {
  1067. "class": "grid"
  1068. };
  1069. var _hoisted_18 = {
  1070. "class": "col-12 md:col-6"
  1071. };
  1072. var _hoisted_19 = {
  1073. "class": "col-12 md:col-6"
  1074. };
  1075. var _hoisted_20 = {
  1076. "class": "col-12 mb-3 md:mb-0"
  1077. };
  1078. var _hoisted_21 = {
  1079. "class": "flex flex-column md:flex-row md:align-items-center justify-content-end"
  1080. };
  1081. var _hoisted_22 = {
  1082. "class": "col-12"
  1083. };
  1084. var _hoisted_23 = {
  1085. style: {
  1086. "color": "#b71c1c"
  1087. }
  1088. };
  1089. var _hoisted_24 = {
  1090. "class": "flex justify-content-end"
  1091. };
  1092. var _hoisted_25 = {
  1093. "class": "grid"
  1094. };
  1095. var _hoisted_26 = {
  1096. "class": "col-12 flex flex-column md:flex-row justify-content-center md:justify-content-end"
  1097. };
  1098. function render(_ctx, _cache, $props, $setup, $data, $options) {
  1099. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  1100. var _component_Dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dialog");
  1101. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  1102. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  1103. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  1104. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  1105. 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"], {
  1106. title: "Ubah Member"
  1107. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  1108. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1109. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dialog, {
  1110. modal: "",
  1111. header: "Error",
  1112. visible: $setup.errorSubmitVisible,
  1113. "onUpdate:visible": _cache[0] || (_cache[0] = function ($event) {
  1114. return $setup.errorSubmitVisible = $event;
  1115. }),
  1116. contentStyle: "color: #b71c1c",
  1117. closable: false,
  1118. style: {
  1119. width: '40vw'
  1120. }
  1121. }, {
  1122. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1123. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.errorSubmitText), 1
  1124. /* TEXT */
  1125. )];
  1126. }),
  1127. _: 1
  1128. /* STABLE */
  1129. }, 8
  1130. /* PROPS */
  1131. , ["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, {
  1132. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1133. return [_hoisted_3];
  1134. }),
  1135. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1136. 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"], {
  1137. modelValue: $setup.form.name,
  1138. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  1139. return $setup.form.name = $event;
  1140. }),
  1141. label: "Nama",
  1142. placeholder: "nama",
  1143. error: $setup.form.errors.name
  1144. }, null, 8
  1145. /* PROPS */
  1146. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1147. modelValue: $setup.form.phone,
  1148. "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
  1149. return $setup.form.phone = $event;
  1150. }),
  1151. label: "Nomor HP",
  1152. placeholder: "nomor hp",
  1153. error: $setup.form.errors.phone
  1154. }, null, 8
  1155. /* PROPS */
  1156. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1157. label: "Jenis member",
  1158. placeholder: "pilih satu",
  1159. modelValue: $setup.form.type_member_id,
  1160. "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
  1161. return $setup.form.type_member_id = $event;
  1162. }),
  1163. options: $props.typeMembers,
  1164. error: $setup.form.errors.type_member_id
  1165. }, null, 8
  1166. /* PROPS */
  1167. , ["modelValue", "options", "error"])])])];
  1168. }),
  1169. _: 1
  1170. /* STABLE */
  1171. })])]), (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, {
  1172. "class": "bg-primary"
  1173. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  1174. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1175. return [_hoisted_10];
  1176. }),
  1177. _: 2
  1178. /* DYNAMIC */
  1179. }, [$props.typeMember ? {
  1180. name: "content",
  1181. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1182. return [_hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.type), 1
  1183. /* TEXT */
  1184. ), _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.max), 1
  1185. /* TEXT */
  1186. ), _hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.description), 1
  1187. /* TEXT */
  1188. ), _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.price), 1
  1189. /* TEXT */
  1190. )];
  1191. })
  1192. } : undefined]), 1024
  1193. /* DYNAMIC_SLOTS */
  1194. )])]), $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, {
  1195. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1196. 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"], {
  1197. modelValue: $setup.form.plat_number,
  1198. "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
  1199. return $setup.form.plat_number = $event;
  1200. }),
  1201. label: "Plat Kendaraan",
  1202. placeholder: "plat kendaraan",
  1203. disabled: !$setup.form.type_member_id,
  1204. error: $setup.form.errors.plat_number
  1205. }, null, 8
  1206. /* PROPS */
  1207. , ["modelValue", "disabled", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_19, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1208. modelValue: $setup.form.max_vehicle_id,
  1209. "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
  1210. return $setup.form.max_vehicle_id = $event;
  1211. }),
  1212. label: "Jenis Kendaraan",
  1213. placeholder: "jenis kendaraan",
  1214. disabled: !$setup.form.type_member_id,
  1215. options: $props.typeMember.maxVehicles,
  1216. error: $setup.form.errors.max_vehicle_id
  1217. }, null, 8
  1218. /* PROPS */
  1219. , ["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, {
  1220. label: "Tambah",
  1221. "class": "p-button-outlined",
  1222. icon: "pi pi-car",
  1223. disabled: !$setup.form.type_member_id,
  1224. onClick: $setup.vehicleOnAdd
  1225. }, null, 8
  1226. /* PROPS */
  1227. , ["disabled", "onClick"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_22, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  1228. "striped-rows": "",
  1229. "row-hover": "",
  1230. "responsive-layout": "scroll",
  1231. "column-resize-mode": "expand",
  1232. "edit-mode": "cell",
  1233. value: $setup.listVehicle
  1234. }, {
  1235. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1236. 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) {
  1237. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  1238. field: value.field,
  1239. header: value.header,
  1240. key: value.field
  1241. }, null, 8
  1242. /* PROPS */
  1243. , ["field", "header"]);
  1244. }), 128
  1245. /* KEYED_FRAGMENT */
  1246. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1247. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1248. var index = _ref.index;
  1249. 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
  1250. /* TEXT */
  1251. )];
  1252. }),
  1253. _: 1
  1254. /* STABLE */
  1255. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1256. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  1257. var index = _ref2.index;
  1258. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_24, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1259. icon: "pi pi-trash",
  1260. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-rounded p-button-text", {
  1261. 'p-button-danger': _ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]
  1262. }]),
  1263. onClick: function onClick($event) {
  1264. return $setup.vehicleOnDelete(index);
  1265. }
  1266. }, null, 8
  1267. /* PROPS */
  1268. , ["class", "onClick"])])];
  1269. }),
  1270. _: 1
  1271. /* STABLE */
  1272. })];
  1273. }),
  1274. _: 1
  1275. /* STABLE */
  1276. }, 8
  1277. /* PROPS */
  1278. , ["value"])])])];
  1279. }),
  1280. footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1281. 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, {
  1282. label: "Simpan",
  1283. icon: "pi pi-check",
  1284. "class": "p-button-outlined",
  1285. disabled: $setup.form.processing || $setup.listVehicle.length === 0,
  1286. onClick: $setup.onSubmit
  1287. }, null, 8
  1288. /* PROPS */
  1289. , ["disabled"])])])];
  1290. }),
  1291. _: 1
  1292. /* STABLE */
  1293. })])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1294. }),
  1295. _: 1
  1296. /* STABLE */
  1297. })], 64
  1298. /* STABLE_FRAGMENT */
  1299. );
  1300. }
  1301. /***/ }),
  1302. /***/ "./resources/js/components/useFormErrorReset.js":
  1303. /*!******************************************************!*\
  1304. !*** ./resources/js/components/useFormErrorReset.js ***!
  1305. \******************************************************/
  1306. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1307. "use strict";
  1308. __webpack_require__.r(__webpack_exports__);
  1309. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1310. /* harmony export */ "useFormErrorReset": () => (/* binding */ useFormErrorReset)
  1311. /* harmony export */ });
  1312. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1313. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1314. function useFormErrorReset(form) {
  1315. var errors = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  1316. return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.errors;
  1317. });
  1318. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(errors, function () {
  1319. form.clearErrors();
  1320. });
  1321. }
  1322. /***/ }),
  1323. /***/ "./resources/js/pages/member/tableHeader.js":
  1324. /*!**************************************************!*\
  1325. !*** ./resources/js/pages/member/tableHeader.js ***!
  1326. \**************************************************/
  1327. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1328. "use strict";
  1329. __webpack_require__.r(__webpack_exports__);
  1330. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1331. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1332. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  1333. /* harmony export */ });
  1334. var indexTable = [{
  1335. field: 'updatedAt',
  1336. header: 'Diperbaharui'
  1337. }, {
  1338. field: 'name',
  1339. header: 'Nama'
  1340. }, {
  1341. field: 'phone',
  1342. header: 'Nomor HP'
  1343. }, {
  1344. field: 'platNumber',
  1345. header: 'Plat Kendaraan'
  1346. }, {
  1347. field: 'type',
  1348. header: 'Jenis Member'
  1349. }, {
  1350. field: 'price',
  1351. header: 'Tarif Member'
  1352. }, {
  1353. field: 'expDate',
  1354. header: 'Berakhir'
  1355. }];
  1356. var platNumberTable = [{
  1357. field: 'platNumber',
  1358. header: 'Plat Kendaraan'
  1359. }, {
  1360. field: 'typeVehicle',
  1361. header: 'Jenis Kendaraan'
  1362. }];
  1363. /***/ }),
  1364. /***/ "./resources/js/pages/member/useVehicle.js":
  1365. /*!*************************************************!*\
  1366. !*** ./resources/js/pages/member/useVehicle.js ***!
  1367. \*************************************************/
  1368. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1369. "use strict";
  1370. __webpack_require__.r(__webpack_exports__);
  1371. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1372. /* harmony export */ "useVehicle": () => (/* binding */ useVehicle)
  1373. /* harmony export */ });
  1374. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1375. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  1376. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1377. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  1378. function useVehicle(form, maxVehicles) {
  1379. var initialVehicles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1380. var listVehicle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)([]);
  1381. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1382. initialVehicles.forEach(function (val) {
  1383. return listVehicle.push(val);
  1384. });
  1385. });
  1386. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
  1387. return form.type_member_id;
  1388. }, function () {
  1389. vehicleClear();
  1390. form.reset('plat_number', 'max_vehicle_id');
  1391. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  1392. only: ['typeMember'],
  1393. data: {
  1394. id: form.type_member_id
  1395. }
  1396. });
  1397. });
  1398. var vehicleClear = function vehicleClear() {
  1399. listVehicle.splice(0);
  1400. };
  1401. var vehicleOnDelete = function vehicleOnDelete(index) {
  1402. listVehicle.splice(index, 1);
  1403. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage)().props.value.errors = {};
  1404. };
  1405. var vehicleAddValidation = function vehicleAddValidation() {
  1406. if (!form.plat_number) {
  1407. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Plat kendaraan tidak boleh kosong', 'plat_number');
  1408. }
  1409. if (!form.max_vehicle_id) {
  1410. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Tidak boleh kosong', 'max_vehicle_id');
  1411. }
  1412. var platNumberExist = listVehicle.filter(function (vehicle) {
  1413. return vehicle.platNumber === form.plat_number.toUpperCase();
  1414. });
  1415. if (platNumberExist.length) {
  1416. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Nomor plat kendaraan tidak boleh sama', 'plat_number');
  1417. }
  1418. var maxVehicles = listVehicle.filter(function (vehicle) {
  1419. return vehicle.maxVehicleId === form.max_vehicle_id;
  1420. });
  1421. if (maxVehicles.length) {
  1422. if (maxVehicles.length + 1 > maxVehicles[0].maxVehicle) {
  1423. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Melibihi batas maksimal kendaraan', 'plat_number');
  1424. }
  1425. }
  1426. };
  1427. var vehicleOnAdd = function vehicleOnAdd() {
  1428. try {
  1429. form.clearErrors('plat_number', 'max_vehicle_id');
  1430. vehicleAddValidation();
  1431. var typeVehicle = maxVehicles.filter(function (maxVehicle) {
  1432. return maxVehicle.value === form.max_vehicle_id;
  1433. })[0];
  1434. listVehicle.push({
  1435. platNumber: form.plat_number.toUpperCase(),
  1436. typeVehicle: typeVehicle.label,
  1437. typeVehicleId: typeVehicle.typeVehicleId,
  1438. maxVehicleId: typeVehicle.value,
  1439. maxVehicle: typeVehicle.maxVehicle
  1440. });
  1441. form.reset('plat_number', 'max_vehicle_id');
  1442. } catch (err) {
  1443. form.setError(err.field, err.message);
  1444. }
  1445. };
  1446. return {
  1447. listVehicle: listVehicle,
  1448. vehicleClear: vehicleClear,
  1449. vehicleOnDelete: vehicleOnDelete,
  1450. vehicleOnAdd: vehicleOnAdd
  1451. };
  1452. }
  1453. /***/ }),
  1454. /***/ "./resources/js/utils/formValidationError.js":
  1455. /*!***************************************************!*\
  1456. !*** ./resources/js/utils/formValidationError.js ***!
  1457. \***************************************************/
  1458. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1459. "use strict";
  1460. __webpack_require__.r(__webpack_exports__);
  1461. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1462. /* harmony export */ "default": () => (/* binding */ FormValidationError)
  1463. /* harmony export */ });
  1464. 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); }
  1465. 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); } }
  1466. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  1467. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1468. 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); }
  1469. 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); }; }
  1470. 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); }
  1471. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1472. 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); }
  1473. 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); }
  1474. 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; } }
  1475. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  1476. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1477. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1478. var FormValidationError = /*#__PURE__*/function (_Error) {
  1479. _inherits(FormValidationError, _Error);
  1480. var _super = _createSuper(FormValidationError);
  1481. function FormValidationError(message, field) {
  1482. var _this;
  1483. _classCallCheck(this, FormValidationError);
  1484. _this = _super.call(this, message);
  1485. _this.field = field;
  1486. return _this;
  1487. }
  1488. return _createClass(FormValidationError);
  1489. }( /*#__PURE__*/_wrapNativeSuper(Error));
  1490. /***/ }),
  1491. /***/ "./resources/js/utils/menu.js":
  1492. /*!************************************!*\
  1493. !*** ./resources/js/utils/menu.js ***!
  1494. \************************************/
  1495. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1496. "use strict";
  1497. __webpack_require__.r(__webpack_exports__);
  1498. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1499. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1500. /* harmony export */ });
  1501. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1502. // Admin
  1503. 1: [{
  1504. label: 'Home',
  1505. items: [{
  1506. label: 'Dashboard',
  1507. icon: 'pi pi-home',
  1508. to: '/dashboards',
  1509. component: 'home/Index'
  1510. }]
  1511. }, {
  1512. label: 'Master',
  1513. items: [{
  1514. label: 'User',
  1515. icon: 'pi pi-user',
  1516. to: '/users',
  1517. component: 'user/Index'
  1518. }]
  1519. }],
  1520. // Supervisor
  1521. 2: [{
  1522. label: 'Home',
  1523. items: [{
  1524. label: 'Dashboard',
  1525. icon: 'pi pi-home',
  1526. to: '/dashboards',
  1527. component: 'home/Index'
  1528. }]
  1529. }, {
  1530. label: 'Menu',
  1531. items: [{
  1532. label: 'Pengeluaran',
  1533. icon: 'pi pi-wallet',
  1534. to: '/expenses',
  1535. component: 'expense/Index'
  1536. }, {
  1537. label: 'Laporan',
  1538. icon: 'pi pi-book',
  1539. items: [{
  1540. label: 'Mutasi',
  1541. icon: 'pi pi-circle',
  1542. to: '/reports/mutations',
  1543. component: 'mutation/Report'
  1544. }]
  1545. }]
  1546. }, {
  1547. label: 'Master',
  1548. items: [{
  1549. label: 'Jenis Kendaraan',
  1550. icon: 'pi pi-car',
  1551. to: '/type-vehicles',
  1552. component: 'typevehicle/Index'
  1553. }, {
  1554. label: 'Jenis Member',
  1555. icon: 'pi pi-id-card',
  1556. to: '/type-members',
  1557. component: 'typemember/Index'
  1558. }]
  1559. }, {
  1560. label: 'Pengaturan',
  1561. items: [{
  1562. label: 'Tarif Parkir',
  1563. icon: 'pi pi-car',
  1564. to: '/parking-fees/create',
  1565. component: 'parkingfee/Create'
  1566. }]
  1567. }],
  1568. // Operator
  1569. 3: [{
  1570. label: 'Home',
  1571. items: [{
  1572. label: 'Dashboard',
  1573. icon: 'pi pi-home',
  1574. to: '/dashboards',
  1575. component: 'home/Index'
  1576. }]
  1577. }, {
  1578. label: 'Menu',
  1579. items: [{
  1580. label: 'Pengeluaran',
  1581. icon: 'pi pi-wallet',
  1582. to: '/expenses',
  1583. component: 'expense/Index'
  1584. }, {
  1585. label: 'Member',
  1586. icon: 'pi pi-id-card',
  1587. to: '/members',
  1588. component: 'member/Index'
  1589. }, {
  1590. label: 'Top Up',
  1591. icon: 'pi pi-car',
  1592. to: '/top-ups',
  1593. component: 'topup/Index'
  1594. }]
  1595. }]
  1596. });
  1597. /***/ }),
  1598. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1599. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1600. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1601. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1602. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1603. "use strict";
  1604. __webpack_require__.r(__webpack_exports__);
  1605. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1606. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1607. /* harmony export */ });
  1608. /* 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");
  1609. /* 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__);
  1610. // Imports
  1611. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1612. // Module
  1613. ___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}", ""]);
  1614. // Exports
  1615. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1616. /***/ }),
  1617. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  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/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1620. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1621. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1622. "use strict";
  1623. __webpack_require__.r(__webpack_exports__);
  1624. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1625. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1626. /* harmony export */ });
  1627. /* 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");
  1628. /* 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__);
  1629. // Imports
  1630. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1631. // Module
  1632. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1633. // Exports
  1634. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1635. /***/ }),
  1636. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  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/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1639. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1640. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1641. "use strict";
  1642. __webpack_require__.r(__webpack_exports__);
  1643. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1644. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1645. /* harmony export */ });
  1646. /* 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");
  1647. /* 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__);
  1648. // Imports
  1649. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1650. // Module
  1651. ___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}", ""]);
  1652. // Exports
  1653. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1654. /***/ }),
  1655. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  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/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1658. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1659. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1660. "use strict";
  1661. __webpack_require__.r(__webpack_exports__);
  1662. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1663. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1664. /* harmony export */ });
  1665. /* 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");
  1666. /* 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__);
  1667. // Imports
  1668. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1669. // Module
  1670. ___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: 12px;\n padding: 1rem;\n right: 2rem;\n top: 5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1671. // Exports
  1672. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1673. /***/ }),
  1674. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  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/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1677. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1678. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1679. "use strict";
  1680. __webpack_require__.r(__webpack_exports__);
  1681. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1682. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1683. /* harmony export */ });
  1684. /* 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");
  1685. /* 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__);
  1686. // Imports
  1687. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1688. // Module
  1689. ___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}", ""]);
  1690. // Exports
  1691. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1692. /***/ }),
  1693. /***/ "./node_modules/lodash/lodash.js":
  1694. /*!***************************************!*\
  1695. !*** ./node_modules/lodash/lodash.js ***!
  1696. \***************************************/
  1697. /***/ (function(module, exports, __webpack_require__) {
  1698. /* module decorator */ module = __webpack_require__.nmd(module);
  1699. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1700. * @license
  1701. * Lodash <https://lodash.com/>
  1702. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1703. * Released under MIT license <https://lodash.com/license>
  1704. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1705. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1706. */
  1707. ;(function() {
  1708. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1709. var undefined;
  1710. /** Used as the semantic version number. */
  1711. var VERSION = '4.17.21';
  1712. /** Used as the size to enable large array optimizations. */
  1713. var LARGE_ARRAY_SIZE = 200;
  1714. /** Error message constants. */
  1715. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1716. FUNC_ERROR_TEXT = 'Expected a function',
  1717. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1718. /** Used to stand-in for `undefined` hash values. */
  1719. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1720. /** Used as the maximum memoize cache size. */
  1721. var MAX_MEMOIZE_SIZE = 500;
  1722. /** Used as the internal argument placeholder. */
  1723. var PLACEHOLDER = '__lodash_placeholder__';
  1724. /** Used to compose bitmasks for cloning. */
  1725. var CLONE_DEEP_FLAG = 1,
  1726. CLONE_FLAT_FLAG = 2,
  1727. CLONE_SYMBOLS_FLAG = 4;
  1728. /** Used to compose bitmasks for value comparisons. */
  1729. var COMPARE_PARTIAL_FLAG = 1,
  1730. COMPARE_UNORDERED_FLAG = 2;
  1731. /** Used to compose bitmasks for function metadata. */
  1732. var WRAP_BIND_FLAG = 1,
  1733. WRAP_BIND_KEY_FLAG = 2,
  1734. WRAP_CURRY_BOUND_FLAG = 4,
  1735. WRAP_CURRY_FLAG = 8,
  1736. WRAP_CURRY_RIGHT_FLAG = 16,
  1737. WRAP_PARTIAL_FLAG = 32,
  1738. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1739. WRAP_ARY_FLAG = 128,
  1740. WRAP_REARG_FLAG = 256,
  1741. WRAP_FLIP_FLAG = 512;
  1742. /** Used as default options for `_.truncate`. */
  1743. var DEFAULT_TRUNC_LENGTH = 30,
  1744. DEFAULT_TRUNC_OMISSION = '...';
  1745. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1746. var HOT_COUNT = 800,
  1747. HOT_SPAN = 16;
  1748. /** Used to indicate the type of lazy iteratees. */
  1749. var LAZY_FILTER_FLAG = 1,
  1750. LAZY_MAP_FLAG = 2,
  1751. LAZY_WHILE_FLAG = 3;
  1752. /** Used as references for various `Number` constants. */
  1753. var INFINITY = 1 / 0,
  1754. MAX_SAFE_INTEGER = 9007199254740991,
  1755. MAX_INTEGER = 1.7976931348623157e+308,
  1756. NAN = 0 / 0;
  1757. /** Used as references for the maximum length and index of an array. */
  1758. var MAX_ARRAY_LENGTH = 4294967295,
  1759. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1760. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1761. /** Used to associate wrap methods with their bit flags. */
  1762. var wrapFlags = [
  1763. ['ary', WRAP_ARY_FLAG],
  1764. ['bind', WRAP_BIND_FLAG],
  1765. ['bindKey', WRAP_BIND_KEY_FLAG],
  1766. ['curry', WRAP_CURRY_FLAG],
  1767. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1768. ['flip', WRAP_FLIP_FLAG],
  1769. ['partial', WRAP_PARTIAL_FLAG],
  1770. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1771. ['rearg', WRAP_REARG_FLAG]
  1772. ];
  1773. /** `Object#toString` result references. */
  1774. var argsTag = '[object Arguments]',
  1775. arrayTag = '[object Array]',
  1776. asyncTag = '[object AsyncFunction]',
  1777. boolTag = '[object Boolean]',
  1778. dateTag = '[object Date]',
  1779. domExcTag = '[object DOMException]',
  1780. errorTag = '[object Error]',
  1781. funcTag = '[object Function]',
  1782. genTag = '[object GeneratorFunction]',
  1783. mapTag = '[object Map]',
  1784. numberTag = '[object Number]',
  1785. nullTag = '[object Null]',
  1786. objectTag = '[object Object]',
  1787. promiseTag = '[object Promise]',
  1788. proxyTag = '[object Proxy]',
  1789. regexpTag = '[object RegExp]',
  1790. setTag = '[object Set]',
  1791. stringTag = '[object String]',
  1792. symbolTag = '[object Symbol]',
  1793. undefinedTag = '[object Undefined]',
  1794. weakMapTag = '[object WeakMap]',
  1795. weakSetTag = '[object WeakSet]';
  1796. var arrayBufferTag = '[object ArrayBuffer]',
  1797. dataViewTag = '[object DataView]',
  1798. float32Tag = '[object Float32Array]',
  1799. float64Tag = '[object Float64Array]',
  1800. int8Tag = '[object Int8Array]',
  1801. int16Tag = '[object Int16Array]',
  1802. int32Tag = '[object Int32Array]',
  1803. uint8Tag = '[object Uint8Array]',
  1804. uint8ClampedTag = '[object Uint8ClampedArray]',
  1805. uint16Tag = '[object Uint16Array]',
  1806. uint32Tag = '[object Uint32Array]';
  1807. /** Used to match empty string literals in compiled template source. */
  1808. var reEmptyStringLeading = /\b__p \+= '';/g,
  1809. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1810. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1811. /** Used to match HTML entities and HTML characters. */
  1812. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1813. reUnescapedHtml = /[&<>"']/g,
  1814. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1815. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1816. /** Used to match template delimiters. */
  1817. var reEscape = /<%-([\s\S]+?)%>/g,
  1818. reEvaluate = /<%([\s\S]+?)%>/g,
  1819. reInterpolate = /<%=([\s\S]+?)%>/g;
  1820. /** Used to match property names within property paths. */
  1821. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1822. reIsPlainProp = /^\w*$/,
  1823. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1824. /**
  1825. * Used to match `RegExp`
  1826. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1827. */
  1828. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1829. reHasRegExpChar = RegExp(reRegExpChar.source);
  1830. /** Used to match leading whitespace. */
  1831. var reTrimStart = /^\s+/;
  1832. /** Used to match a single whitespace character. */
  1833. var reWhitespace = /\s/;
  1834. /** Used to match wrap detail comments. */
  1835. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1836. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1837. reSplitDetails = /,? & /;
  1838. /** Used to match words composed of alphanumeric characters. */
  1839. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1840. /**
  1841. * Used to validate the `validate` option in `_.template` variable.
  1842. *
  1843. * Forbids characters which could potentially change the meaning of the function argument definition:
  1844. * - "()," (modification of function parameters)
  1845. * - "=" (default value)
  1846. * - "[]{}" (destructuring of function parameters)
  1847. * - "/" (beginning of a comment)
  1848. * - whitespace
  1849. */
  1850. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1851. /** Used to match backslashes in property paths. */
  1852. var reEscapeChar = /\\(\\)?/g;
  1853. /**
  1854. * Used to match
  1855. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1856. */
  1857. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1858. /** Used to match `RegExp` flags from their coerced string values. */
  1859. var reFlags = /\w*$/;
  1860. /** Used to detect bad signed hexadecimal string values. */
  1861. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1862. /** Used to detect binary string values. */
  1863. var reIsBinary = /^0b[01]+$/i;
  1864. /** Used to detect host constructors (Safari). */
  1865. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1866. /** Used to detect octal string values. */
  1867. var reIsOctal = /^0o[0-7]+$/i;
  1868. /** Used to detect unsigned integer values. */
  1869. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1870. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1871. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1872. /** Used to ensure capturing order of template delimiters. */
  1873. var reNoMatch = /($^)/;
  1874. /** Used to match unescaped characters in compiled string literals. */
  1875. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1876. /** Used to compose unicode character classes. */
  1877. var rsAstralRange = '\\ud800-\\udfff',
  1878. rsComboMarksRange = '\\u0300-\\u036f',
  1879. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1880. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1881. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1882. rsDingbatRange = '\\u2700-\\u27bf',
  1883. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1884. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1885. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1886. rsPunctuationRange = '\\u2000-\\u206f',
  1887. 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',
  1888. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1889. rsVarRange = '\\ufe0e\\ufe0f',
  1890. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1891. /** Used to compose unicode capture groups. */
  1892. var rsApos = "['\u2019]",
  1893. rsAstral = '[' + rsAstralRange + ']',
  1894. rsBreak = '[' + rsBreakRange + ']',
  1895. rsCombo = '[' + rsComboRange + ']',
  1896. rsDigits = '\\d+',
  1897. rsDingbat = '[' + rsDingbatRange + ']',
  1898. rsLower = '[' + rsLowerRange + ']',
  1899. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1900. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1901. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1902. rsNonAstral = '[^' + rsAstralRange + ']',
  1903. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1904. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1905. rsUpper = '[' + rsUpperRange + ']',
  1906. rsZWJ = '\\u200d';
  1907. /** Used to compose unicode regexes. */
  1908. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1909. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1910. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1911. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1912. reOptMod = rsModifier + '?',
  1913. rsOptVar = '[' + rsVarRange + ']?',
  1914. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1915. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1916. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1917. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1918. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1919. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1920. /** Used to match apostrophes. */
  1921. var reApos = RegExp(rsApos, 'g');
  1922. /**
  1923. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1924. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1925. */
  1926. var reComboMark = RegExp(rsCombo, 'g');
  1927. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1928. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1929. /** Used to match complex or compound words. */
  1930. var reUnicodeWord = RegExp([
  1931. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1932. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1933. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1934. rsUpper + '+' + rsOptContrUpper,
  1935. rsOrdUpper,
  1936. rsOrdLower,
  1937. rsDigits,
  1938. rsEmoji
  1939. ].join('|'), 'g');
  1940. /** 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/). */
  1941. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1942. /** Used to detect strings that need a more robust regexp to match words. */
  1943. 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 ]/;
  1944. /** Used to assign default `context` object properties. */
  1945. var contextProps = [
  1946. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1947. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1948. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1949. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1950. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1951. ];
  1952. /** Used to make template sourceURLs easier to identify. */
  1953. var templateCounter = -1;
  1954. /** Used to identify `toStringTag` values of typed arrays. */
  1955. var typedArrayTags = {};
  1956. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1957. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1958. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1959. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1960. typedArrayTags[uint32Tag] = true;
  1961. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1962. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1963. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1964. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1965. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1966. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1967. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1968. typedArrayTags[weakMapTag] = false;
  1969. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1970. var cloneableTags = {};
  1971. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1972. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1973. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1974. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1975. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1976. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1977. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1978. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1979. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1980. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1981. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1982. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1983. cloneableTags[weakMapTag] = false;
  1984. /** Used to map Latin Unicode letters to basic Latin letters. */
  1985. var deburredLetters = {
  1986. // Latin-1 Supplement block.
  1987. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1988. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1989. '\xc7': 'C', '\xe7': 'c',
  1990. '\xd0': 'D', '\xf0': 'd',
  1991. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1992. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1993. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1994. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1995. '\xd1': 'N', '\xf1': 'n',
  1996. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1997. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1998. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1999. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  2000. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  2001. '\xc6': 'Ae', '\xe6': 'ae',
  2002. '\xde': 'Th', '\xfe': 'th',
  2003. '\xdf': 'ss',
  2004. // Latin Extended-A block.
  2005. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  2006. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  2007. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  2008. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  2009. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  2010. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  2011. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  2012. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  2013. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  2014. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  2015. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  2016. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  2017. '\u0134': 'J', '\u0135': 'j',
  2018. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  2019. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  2020. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  2021. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  2022. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  2023. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  2024. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  2025. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  2026. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  2027. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  2028. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  2029. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  2030. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  2031. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  2032. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  2033. '\u0174': 'W', '\u0175': 'w',
  2034. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  2035. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  2036. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  2037. '\u0132': 'IJ', '\u0133': 'ij',
  2038. '\u0152': 'Oe', '\u0153': 'oe',
  2039. '\u0149': "'n", '\u017f': 's'
  2040. };
  2041. /** Used to map characters to HTML entities. */
  2042. var htmlEscapes = {
  2043. '&': '&amp;',
  2044. '<': '&lt;',
  2045. '>': '&gt;',
  2046. '"': '&quot;',
  2047. "'": '&#39;'
  2048. };
  2049. /** Used to map HTML entities to characters. */
  2050. var htmlUnescapes = {
  2051. '&amp;': '&',
  2052. '&lt;': '<',
  2053. '&gt;': '>',
  2054. '&quot;': '"',
  2055. '&#39;': "'"
  2056. };
  2057. /** Used to escape characters for inclusion in compiled string literals. */
  2058. var stringEscapes = {
  2059. '\\': '\\',
  2060. "'": "'",
  2061. '\n': 'n',
  2062. '\r': 'r',
  2063. '\u2028': 'u2028',
  2064. '\u2029': 'u2029'
  2065. };
  2066. /** Built-in method references without a dependency on `root`. */
  2067. var freeParseFloat = parseFloat,
  2068. freeParseInt = parseInt;
  2069. /** Detect free variable `global` from Node.js. */
  2070. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2071. /** Detect free variable `self`. */
  2072. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  2073. /** Used as a reference to the global object. */
  2074. var root = freeGlobal || freeSelf || Function('return this')();
  2075. /** Detect free variable `exports`. */
  2076. var freeExports = true && exports && !exports.nodeType && exports;
  2077. /** Detect free variable `module`. */
  2078. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  2079. /** Detect the popular CommonJS extension `module.exports`. */
  2080. var moduleExports = freeModule && freeModule.exports === freeExports;
  2081. /** Detect free variable `process` from Node.js. */
  2082. var freeProcess = moduleExports && freeGlobal.process;
  2083. /** Used to access faster Node.js helpers. */
  2084. var nodeUtil = (function() {
  2085. try {
  2086. // Use `util.types` for Node.js 10+.
  2087. var types = freeModule && freeModule.require && freeModule.require('util').types;
  2088. if (types) {
  2089. return types;
  2090. }
  2091. // Legacy `process.binding('util')` for Node.js < 10.
  2092. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  2093. } catch (e) {}
  2094. }());
  2095. /* Node.js helper references. */
  2096. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  2097. nodeIsDate = nodeUtil && nodeUtil.isDate,
  2098. nodeIsMap = nodeUtil && nodeUtil.isMap,
  2099. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  2100. nodeIsSet = nodeUtil && nodeUtil.isSet,
  2101. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2102. /*--------------------------------------------------------------------------*/
  2103. /**
  2104. * A faster alternative to `Function#apply`, this function invokes `func`
  2105. * with the `this` binding of `thisArg` and the arguments of `args`.
  2106. *
  2107. * @private
  2108. * @param {Function} func The function to invoke.
  2109. * @param {*} thisArg The `this` binding of `func`.
  2110. * @param {Array} args The arguments to invoke `func` with.
  2111. * @returns {*} Returns the result of `func`.
  2112. */
  2113. function apply(func, thisArg, args) {
  2114. switch (args.length) {
  2115. case 0: return func.call(thisArg);
  2116. case 1: return func.call(thisArg, args[0]);
  2117. case 2: return func.call(thisArg, args[0], args[1]);
  2118. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  2119. }
  2120. return func.apply(thisArg, args);
  2121. }
  2122. /**
  2123. * A specialized version of `baseAggregator` for arrays.
  2124. *
  2125. * @private
  2126. * @param {Array} [array] The array to iterate over.
  2127. * @param {Function} setter The function to set `accumulator` values.
  2128. * @param {Function} iteratee The iteratee to transform keys.
  2129. * @param {Object} accumulator The initial aggregated object.
  2130. * @returns {Function} Returns `accumulator`.
  2131. */
  2132. function arrayAggregator(array, setter, iteratee, accumulator) {
  2133. var index = -1,
  2134. length = array == null ? 0 : array.length;
  2135. while (++index < length) {
  2136. var value = array[index];
  2137. setter(accumulator, value, iteratee(value), array);
  2138. }
  2139. return accumulator;
  2140. }
  2141. /**
  2142. * A specialized version of `_.forEach` for arrays without support for
  2143. * iteratee shorthands.
  2144. *
  2145. * @private
  2146. * @param {Array} [array] The array to iterate over.
  2147. * @param {Function} iteratee The function invoked per iteration.
  2148. * @returns {Array} Returns `array`.
  2149. */
  2150. function arrayEach(array, iteratee) {
  2151. var index = -1,
  2152. length = array == null ? 0 : array.length;
  2153. while (++index < length) {
  2154. if (iteratee(array[index], index, array) === false) {
  2155. break;
  2156. }
  2157. }
  2158. return array;
  2159. }
  2160. /**
  2161. * A specialized version of `_.forEachRight` for arrays without support for
  2162. * iteratee shorthands.
  2163. *
  2164. * @private
  2165. * @param {Array} [array] The array to iterate over.
  2166. * @param {Function} iteratee The function invoked per iteration.
  2167. * @returns {Array} Returns `array`.
  2168. */
  2169. function arrayEachRight(array, iteratee) {
  2170. var length = array == null ? 0 : array.length;
  2171. while (length--) {
  2172. if (iteratee(array[length], length, array) === false) {
  2173. break;
  2174. }
  2175. }
  2176. return array;
  2177. }
  2178. /**
  2179. * A specialized version of `_.every` for arrays without support for
  2180. * iteratee shorthands.
  2181. *
  2182. * @private
  2183. * @param {Array} [array] The array to iterate over.
  2184. * @param {Function} predicate The function invoked per iteration.
  2185. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  2186. * else `false`.
  2187. */
  2188. function arrayEvery(array, predicate) {
  2189. var index = -1,
  2190. length = array == null ? 0 : array.length;
  2191. while (++index < length) {
  2192. if (!predicate(array[index], index, array)) {
  2193. return false;
  2194. }
  2195. }
  2196. return true;
  2197. }
  2198. /**
  2199. * A specialized version of `_.filter` for arrays without support for
  2200. * iteratee shorthands.
  2201. *
  2202. * @private
  2203. * @param {Array} [array] The array to iterate over.
  2204. * @param {Function} predicate The function invoked per iteration.
  2205. * @returns {Array} Returns the new filtered array.
  2206. */
  2207. function arrayFilter(array, predicate) {
  2208. var index = -1,
  2209. length = array == null ? 0 : array.length,
  2210. resIndex = 0,
  2211. result = [];
  2212. while (++index < length) {
  2213. var value = array[index];
  2214. if (predicate(value, index, array)) {
  2215. result[resIndex++] = value;
  2216. }
  2217. }
  2218. return result;
  2219. }
  2220. /**
  2221. * A specialized version of `_.includes` for arrays without support for
  2222. * specifying an index to search from.
  2223. *
  2224. * @private
  2225. * @param {Array} [array] The array to inspect.
  2226. * @param {*} target The value to search for.
  2227. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2228. */
  2229. function arrayIncludes(array, value) {
  2230. var length = array == null ? 0 : array.length;
  2231. return !!length && baseIndexOf(array, value, 0) > -1;
  2232. }
  2233. /**
  2234. * This function is like `arrayIncludes` except that it accepts a comparator.
  2235. *
  2236. * @private
  2237. * @param {Array} [array] The array to inspect.
  2238. * @param {*} target The value to search for.
  2239. * @param {Function} comparator The comparator invoked per element.
  2240. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2241. */
  2242. function arrayIncludesWith(array, value, comparator) {
  2243. var index = -1,
  2244. length = array == null ? 0 : array.length;
  2245. while (++index < length) {
  2246. if (comparator(value, array[index])) {
  2247. return true;
  2248. }
  2249. }
  2250. return false;
  2251. }
  2252. /**
  2253. * A specialized version of `_.map` for arrays without support for iteratee
  2254. * shorthands.
  2255. *
  2256. * @private
  2257. * @param {Array} [array] The array to iterate over.
  2258. * @param {Function} iteratee The function invoked per iteration.
  2259. * @returns {Array} Returns the new mapped array.
  2260. */
  2261. function arrayMap(array, iteratee) {
  2262. var index = -1,
  2263. length = array == null ? 0 : array.length,
  2264. result = Array(length);
  2265. while (++index < length) {
  2266. result[index] = iteratee(array[index], index, array);
  2267. }
  2268. return result;
  2269. }
  2270. /**
  2271. * Appends the elements of `values` to `array`.
  2272. *
  2273. * @private
  2274. * @param {Array} array The array to modify.
  2275. * @param {Array} values The values to append.
  2276. * @returns {Array} Returns `array`.
  2277. */
  2278. function arrayPush(array, values) {
  2279. var index = -1,
  2280. length = values.length,
  2281. offset = array.length;
  2282. while (++index < length) {
  2283. array[offset + index] = values[index];
  2284. }
  2285. return array;
  2286. }
  2287. /**
  2288. * A specialized version of `_.reduce` for arrays without support for
  2289. * iteratee shorthands.
  2290. *
  2291. * @private
  2292. * @param {Array} [array] The array to iterate over.
  2293. * @param {Function} iteratee The function invoked per iteration.
  2294. * @param {*} [accumulator] The initial value.
  2295. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2296. * the initial value.
  2297. * @returns {*} Returns the accumulated value.
  2298. */
  2299. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2300. var index = -1,
  2301. length = array == null ? 0 : array.length;
  2302. if (initAccum && length) {
  2303. accumulator = array[++index];
  2304. }
  2305. while (++index < length) {
  2306. accumulator = iteratee(accumulator, array[index], index, array);
  2307. }
  2308. return accumulator;
  2309. }
  2310. /**
  2311. * A specialized version of `_.reduceRight` for arrays without support for
  2312. * iteratee shorthands.
  2313. *
  2314. * @private
  2315. * @param {Array} [array] The array to iterate over.
  2316. * @param {Function} iteratee The function invoked per iteration.
  2317. * @param {*} [accumulator] The initial value.
  2318. * @param {boolean} [initAccum] Specify using the last element of `array` as
  2319. * the initial value.
  2320. * @returns {*} Returns the accumulated value.
  2321. */
  2322. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  2323. var length = array == null ? 0 : array.length;
  2324. if (initAccum && length) {
  2325. accumulator = array[--length];
  2326. }
  2327. while (length--) {
  2328. accumulator = iteratee(accumulator, array[length], length, array);
  2329. }
  2330. return accumulator;
  2331. }
  2332. /**
  2333. * A specialized version of `_.some` for arrays without support for iteratee
  2334. * shorthands.
  2335. *
  2336. * @private
  2337. * @param {Array} [array] The array to iterate over.
  2338. * @param {Function} predicate The function invoked per iteration.
  2339. * @returns {boolean} Returns `true` if any element passes the predicate check,
  2340. * else `false`.
  2341. */
  2342. function arraySome(array, predicate) {
  2343. var index = -1,
  2344. length = array == null ? 0 : array.length;
  2345. while (++index < length) {
  2346. if (predicate(array[index], index, array)) {
  2347. return true;
  2348. }
  2349. }
  2350. return false;
  2351. }
  2352. /**
  2353. * Gets the size of an ASCII `string`.
  2354. *
  2355. * @private
  2356. * @param {string} string The string inspect.
  2357. * @returns {number} Returns the string size.
  2358. */
  2359. var asciiSize = baseProperty('length');
  2360. /**
  2361. * Converts an ASCII `string` to an array.
  2362. *
  2363. * @private
  2364. * @param {string} string The string to convert.
  2365. * @returns {Array} Returns the converted array.
  2366. */
  2367. function asciiToArray(string) {
  2368. return string.split('');
  2369. }
  2370. /**
  2371. * Splits an ASCII `string` into an array of its words.
  2372. *
  2373. * @private
  2374. * @param {string} The string to inspect.
  2375. * @returns {Array} Returns the words of `string`.
  2376. */
  2377. function asciiWords(string) {
  2378. return string.match(reAsciiWord) || [];
  2379. }
  2380. /**
  2381. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2382. * without support for iteratee shorthands, which iterates over `collection`
  2383. * using `eachFunc`.
  2384. *
  2385. * @private
  2386. * @param {Array|Object} collection The collection to inspect.
  2387. * @param {Function} predicate The function invoked per iteration.
  2388. * @param {Function} eachFunc The function to iterate over `collection`.
  2389. * @returns {*} Returns the found element or its key, else `undefined`.
  2390. */
  2391. function baseFindKey(collection, predicate, eachFunc) {
  2392. var result;
  2393. eachFunc(collection, function(value, key, collection) {
  2394. if (predicate(value, key, collection)) {
  2395. result = key;
  2396. return false;
  2397. }
  2398. });
  2399. return result;
  2400. }
  2401. /**
  2402. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2403. * support for iteratee shorthands.
  2404. *
  2405. * @private
  2406. * @param {Array} array The array to inspect.
  2407. * @param {Function} predicate The function invoked per iteration.
  2408. * @param {number} fromIndex The index to search from.
  2409. * @param {boolean} [fromRight] Specify iterating from right to left.
  2410. * @returns {number} Returns the index of the matched value, else `-1`.
  2411. */
  2412. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2413. var length = array.length,
  2414. index = fromIndex + (fromRight ? 1 : -1);
  2415. while ((fromRight ? index-- : ++index < length)) {
  2416. if (predicate(array[index], index, array)) {
  2417. return index;
  2418. }
  2419. }
  2420. return -1;
  2421. }
  2422. /**
  2423. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2424. *
  2425. * @private
  2426. * @param {Array} array The array to inspect.
  2427. * @param {*} value The value to search for.
  2428. * @param {number} fromIndex The index to search from.
  2429. * @returns {number} Returns the index of the matched value, else `-1`.
  2430. */
  2431. function baseIndexOf(array, value, fromIndex) {
  2432. return value === value
  2433. ? strictIndexOf(array, value, fromIndex)
  2434. : baseFindIndex(array, baseIsNaN, fromIndex);
  2435. }
  2436. /**
  2437. * This function is like `baseIndexOf` except that it accepts a comparator.
  2438. *
  2439. * @private
  2440. * @param {Array} array The array to inspect.
  2441. * @param {*} value The value to search for.
  2442. * @param {number} fromIndex The index to search from.
  2443. * @param {Function} comparator The comparator invoked per element.
  2444. * @returns {number} Returns the index of the matched value, else `-1`.
  2445. */
  2446. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2447. var index = fromIndex - 1,
  2448. length = array.length;
  2449. while (++index < length) {
  2450. if (comparator(array[index], value)) {
  2451. return index;
  2452. }
  2453. }
  2454. return -1;
  2455. }
  2456. /**
  2457. * The base implementation of `_.isNaN` without support for number objects.
  2458. *
  2459. * @private
  2460. * @param {*} value The value to check.
  2461. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2462. */
  2463. function baseIsNaN(value) {
  2464. return value !== value;
  2465. }
  2466. /**
  2467. * The base implementation of `_.mean` and `_.meanBy` without support for
  2468. * iteratee shorthands.
  2469. *
  2470. * @private
  2471. * @param {Array} array The array to iterate over.
  2472. * @param {Function} iteratee The function invoked per iteration.
  2473. * @returns {number} Returns the mean.
  2474. */
  2475. function baseMean(array, iteratee) {
  2476. var length = array == null ? 0 : array.length;
  2477. return length ? (baseSum(array, iteratee) / length) : NAN;
  2478. }
  2479. /**
  2480. * The base implementation of `_.property` without support for deep paths.
  2481. *
  2482. * @private
  2483. * @param {string} key The key of the property to get.
  2484. * @returns {Function} Returns the new accessor function.
  2485. */
  2486. function baseProperty(key) {
  2487. return function(object) {
  2488. return object == null ? undefined : object[key];
  2489. };
  2490. }
  2491. /**
  2492. * The base implementation of `_.propertyOf` without support for deep paths.
  2493. *
  2494. * @private
  2495. * @param {Object} object The object to query.
  2496. * @returns {Function} Returns the new accessor function.
  2497. */
  2498. function basePropertyOf(object) {
  2499. return function(key) {
  2500. return object == null ? undefined : object[key];
  2501. };
  2502. }
  2503. /**
  2504. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2505. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2506. *
  2507. * @private
  2508. * @param {Array|Object} collection The collection to iterate over.
  2509. * @param {Function} iteratee The function invoked per iteration.
  2510. * @param {*} accumulator The initial value.
  2511. * @param {boolean} initAccum Specify using the first or last element of
  2512. * `collection` as the initial value.
  2513. * @param {Function} eachFunc The function to iterate over `collection`.
  2514. * @returns {*} Returns the accumulated value.
  2515. */
  2516. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2517. eachFunc(collection, function(value, index, collection) {
  2518. accumulator = initAccum
  2519. ? (initAccum = false, value)
  2520. : iteratee(accumulator, value, index, collection);
  2521. });
  2522. return accumulator;
  2523. }
  2524. /**
  2525. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2526. * sort order of `array` and replaces criteria objects with their corresponding
  2527. * values.
  2528. *
  2529. * @private
  2530. * @param {Array} array The array to sort.
  2531. * @param {Function} comparer The function to define sort order.
  2532. * @returns {Array} Returns `array`.
  2533. */
  2534. function baseSortBy(array, comparer) {
  2535. var length = array.length;
  2536. array.sort(comparer);
  2537. while (length--) {
  2538. array[length] = array[length].value;
  2539. }
  2540. return array;
  2541. }
  2542. /**
  2543. * The base implementation of `_.sum` and `_.sumBy` without support for
  2544. * iteratee shorthands.
  2545. *
  2546. * @private
  2547. * @param {Array} array The array to iterate over.
  2548. * @param {Function} iteratee The function invoked per iteration.
  2549. * @returns {number} Returns the sum.
  2550. */
  2551. function baseSum(array, iteratee) {
  2552. var result,
  2553. index = -1,
  2554. length = array.length;
  2555. while (++index < length) {
  2556. var current = iteratee(array[index]);
  2557. if (current !== undefined) {
  2558. result = result === undefined ? current : (result + current);
  2559. }
  2560. }
  2561. return result;
  2562. }
  2563. /**
  2564. * The base implementation of `_.times` without support for iteratee shorthands
  2565. * or max array length checks.
  2566. *
  2567. * @private
  2568. * @param {number} n The number of times to invoke `iteratee`.
  2569. * @param {Function} iteratee The function invoked per iteration.
  2570. * @returns {Array} Returns the array of results.
  2571. */
  2572. function baseTimes(n, iteratee) {
  2573. var index = -1,
  2574. result = Array(n);
  2575. while (++index < n) {
  2576. result[index] = iteratee(index);
  2577. }
  2578. return result;
  2579. }
  2580. /**
  2581. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2582. * of key-value pairs for `object` corresponding to the property names of `props`.
  2583. *
  2584. * @private
  2585. * @param {Object} object The object to query.
  2586. * @param {Array} props The property names to get values for.
  2587. * @returns {Object} Returns the key-value pairs.
  2588. */
  2589. function baseToPairs(object, props) {
  2590. return arrayMap(props, function(key) {
  2591. return [key, object[key]];
  2592. });
  2593. }
  2594. /**
  2595. * The base implementation of `_.trim`.
  2596. *
  2597. * @private
  2598. * @param {string} string The string to trim.
  2599. * @returns {string} Returns the trimmed string.
  2600. */
  2601. function baseTrim(string) {
  2602. return string
  2603. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2604. : string;
  2605. }
  2606. /**
  2607. * The base implementation of `_.unary` without support for storing metadata.
  2608. *
  2609. * @private
  2610. * @param {Function} func The function to cap arguments for.
  2611. * @returns {Function} Returns the new capped function.
  2612. */
  2613. function baseUnary(func) {
  2614. return function(value) {
  2615. return func(value);
  2616. };
  2617. }
  2618. /**
  2619. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2620. * array of `object` property values corresponding to the property names
  2621. * of `props`.
  2622. *
  2623. * @private
  2624. * @param {Object} object The object to query.
  2625. * @param {Array} props The property names to get values for.
  2626. * @returns {Object} Returns the array of property values.
  2627. */
  2628. function baseValues(object, props) {
  2629. return arrayMap(props, function(key) {
  2630. return object[key];
  2631. });
  2632. }
  2633. /**
  2634. * Checks if a `cache` value for `key` exists.
  2635. *
  2636. * @private
  2637. * @param {Object} cache The cache to query.
  2638. * @param {string} key The key of the entry to check.
  2639. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2640. */
  2641. function cacheHas(cache, key) {
  2642. return cache.has(key);
  2643. }
  2644. /**
  2645. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2646. * that is not found in the character symbols.
  2647. *
  2648. * @private
  2649. * @param {Array} strSymbols The string symbols to inspect.
  2650. * @param {Array} chrSymbols The character symbols to find.
  2651. * @returns {number} Returns the index of the first unmatched string symbol.
  2652. */
  2653. function charsStartIndex(strSymbols, chrSymbols) {
  2654. var index = -1,
  2655. length = strSymbols.length;
  2656. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2657. return index;
  2658. }
  2659. /**
  2660. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2661. * that is not found in the character symbols.
  2662. *
  2663. * @private
  2664. * @param {Array} strSymbols The string symbols to inspect.
  2665. * @param {Array} chrSymbols The character symbols to find.
  2666. * @returns {number} Returns the index of the last unmatched string symbol.
  2667. */
  2668. function charsEndIndex(strSymbols, chrSymbols) {
  2669. var index = strSymbols.length;
  2670. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2671. return index;
  2672. }
  2673. /**
  2674. * Gets the number of `placeholder` occurrences in `array`.
  2675. *
  2676. * @private
  2677. * @param {Array} array The array to inspect.
  2678. * @param {*} placeholder The placeholder to search for.
  2679. * @returns {number} Returns the placeholder count.
  2680. */
  2681. function countHolders(array, placeholder) {
  2682. var length = array.length,
  2683. result = 0;
  2684. while (length--) {
  2685. if (array[length] === placeholder) {
  2686. ++result;
  2687. }
  2688. }
  2689. return result;
  2690. }
  2691. /**
  2692. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2693. * letters to basic Latin letters.
  2694. *
  2695. * @private
  2696. * @param {string} letter The matched letter to deburr.
  2697. * @returns {string} Returns the deburred letter.
  2698. */
  2699. var deburrLetter = basePropertyOf(deburredLetters);
  2700. /**
  2701. * Used by `_.escape` to convert characters to HTML entities.
  2702. *
  2703. * @private
  2704. * @param {string} chr The matched character to escape.
  2705. * @returns {string} Returns the escaped character.
  2706. */
  2707. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2708. /**
  2709. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2710. *
  2711. * @private
  2712. * @param {string} chr The matched character to escape.
  2713. * @returns {string} Returns the escaped character.
  2714. */
  2715. function escapeStringChar(chr) {
  2716. return '\\' + stringEscapes[chr];
  2717. }
  2718. /**
  2719. * Gets the value at `key` of `object`.
  2720. *
  2721. * @private
  2722. * @param {Object} [object] The object to query.
  2723. * @param {string} key The key of the property to get.
  2724. * @returns {*} Returns the property value.
  2725. */
  2726. function getValue(object, key) {
  2727. return object == null ? undefined : object[key];
  2728. }
  2729. /**
  2730. * Checks if `string` contains Unicode symbols.
  2731. *
  2732. * @private
  2733. * @param {string} string The string to inspect.
  2734. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2735. */
  2736. function hasUnicode(string) {
  2737. return reHasUnicode.test(string);
  2738. }
  2739. /**
  2740. * Checks if `string` contains a word composed of Unicode symbols.
  2741. *
  2742. * @private
  2743. * @param {string} string The string to inspect.
  2744. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2745. */
  2746. function hasUnicodeWord(string) {
  2747. return reHasUnicodeWord.test(string);
  2748. }
  2749. /**
  2750. * Converts `iterator` to an array.
  2751. *
  2752. * @private
  2753. * @param {Object} iterator The iterator to convert.
  2754. * @returns {Array} Returns the converted array.
  2755. */
  2756. function iteratorToArray(iterator) {
  2757. var data,
  2758. result = [];
  2759. while (!(data = iterator.next()).done) {
  2760. result.push(data.value);
  2761. }
  2762. return result;
  2763. }
  2764. /**
  2765. * Converts `map` to its key-value pairs.
  2766. *
  2767. * @private
  2768. * @param {Object} map The map to convert.
  2769. * @returns {Array} Returns the key-value pairs.
  2770. */
  2771. function mapToArray(map) {
  2772. var index = -1,
  2773. result = Array(map.size);
  2774. map.forEach(function(value, key) {
  2775. result[++index] = [key, value];
  2776. });
  2777. return result;
  2778. }
  2779. /**
  2780. * Creates a unary function that invokes `func` with its argument transformed.
  2781. *
  2782. * @private
  2783. * @param {Function} func The function to wrap.
  2784. * @param {Function} transform The argument transform.
  2785. * @returns {Function} Returns the new function.
  2786. */
  2787. function overArg(func, transform) {
  2788. return function(arg) {
  2789. return func(transform(arg));
  2790. };
  2791. }
  2792. /**
  2793. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2794. * and returns an array of their indexes.
  2795. *
  2796. * @private
  2797. * @param {Array} array The array to modify.
  2798. * @param {*} placeholder The placeholder to replace.
  2799. * @returns {Array} Returns the new array of placeholder indexes.
  2800. */
  2801. function replaceHolders(array, placeholder) {
  2802. var index = -1,
  2803. length = array.length,
  2804. resIndex = 0,
  2805. result = [];
  2806. while (++index < length) {
  2807. var value = array[index];
  2808. if (value === placeholder || value === PLACEHOLDER) {
  2809. array[index] = PLACEHOLDER;
  2810. result[resIndex++] = index;
  2811. }
  2812. }
  2813. return result;
  2814. }
  2815. /**
  2816. * Converts `set` to an array of its values.
  2817. *
  2818. * @private
  2819. * @param {Object} set The set to convert.
  2820. * @returns {Array} Returns the values.
  2821. */
  2822. function setToArray(set) {
  2823. var index = -1,
  2824. result = Array(set.size);
  2825. set.forEach(function(value) {
  2826. result[++index] = value;
  2827. });
  2828. return result;
  2829. }
  2830. /**
  2831. * Converts `set` to its value-value pairs.
  2832. *
  2833. * @private
  2834. * @param {Object} set The set to convert.
  2835. * @returns {Array} Returns the value-value pairs.
  2836. */
  2837. function setToPairs(set) {
  2838. var index = -1,
  2839. result = Array(set.size);
  2840. set.forEach(function(value) {
  2841. result[++index] = [value, value];
  2842. });
  2843. return result;
  2844. }
  2845. /**
  2846. * A specialized version of `_.indexOf` which performs strict equality
  2847. * comparisons of values, i.e. `===`.
  2848. *
  2849. * @private
  2850. * @param {Array} array The array to inspect.
  2851. * @param {*} value The value to search for.
  2852. * @param {number} fromIndex The index to search from.
  2853. * @returns {number} Returns the index of the matched value, else `-1`.
  2854. */
  2855. function strictIndexOf(array, value, fromIndex) {
  2856. var index = fromIndex - 1,
  2857. length = array.length;
  2858. while (++index < length) {
  2859. if (array[index] === value) {
  2860. return index;
  2861. }
  2862. }
  2863. return -1;
  2864. }
  2865. /**
  2866. * A specialized version of `_.lastIndexOf` which performs strict equality
  2867. * comparisons of values, i.e. `===`.
  2868. *
  2869. * @private
  2870. * @param {Array} array The array to inspect.
  2871. * @param {*} value The value to search for.
  2872. * @param {number} fromIndex The index to search from.
  2873. * @returns {number} Returns the index of the matched value, else `-1`.
  2874. */
  2875. function strictLastIndexOf(array, value, fromIndex) {
  2876. var index = fromIndex + 1;
  2877. while (index--) {
  2878. if (array[index] === value) {
  2879. return index;
  2880. }
  2881. }
  2882. return index;
  2883. }
  2884. /**
  2885. * Gets the number of symbols in `string`.
  2886. *
  2887. * @private
  2888. * @param {string} string The string to inspect.
  2889. * @returns {number} Returns the string size.
  2890. */
  2891. function stringSize(string) {
  2892. return hasUnicode(string)
  2893. ? unicodeSize(string)
  2894. : asciiSize(string);
  2895. }
  2896. /**
  2897. * Converts `string` to an array.
  2898. *
  2899. * @private
  2900. * @param {string} string The string to convert.
  2901. * @returns {Array} Returns the converted array.
  2902. */
  2903. function stringToArray(string) {
  2904. return hasUnicode(string)
  2905. ? unicodeToArray(string)
  2906. : asciiToArray(string);
  2907. }
  2908. /**
  2909. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2910. * character of `string`.
  2911. *
  2912. * @private
  2913. * @param {string} string The string to inspect.
  2914. * @returns {number} Returns the index of the last non-whitespace character.
  2915. */
  2916. function trimmedEndIndex(string) {
  2917. var index = string.length;
  2918. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2919. return index;
  2920. }
  2921. /**
  2922. * Used by `_.unescape` to convert HTML entities to characters.
  2923. *
  2924. * @private
  2925. * @param {string} chr The matched character to unescape.
  2926. * @returns {string} Returns the unescaped character.
  2927. */
  2928. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2929. /**
  2930. * Gets the size of a Unicode `string`.
  2931. *
  2932. * @private
  2933. * @param {string} string The string inspect.
  2934. * @returns {number} Returns the string size.
  2935. */
  2936. function unicodeSize(string) {
  2937. var result = reUnicode.lastIndex = 0;
  2938. while (reUnicode.test(string)) {
  2939. ++result;
  2940. }
  2941. return result;
  2942. }
  2943. /**
  2944. * Converts a Unicode `string` to an array.
  2945. *
  2946. * @private
  2947. * @param {string} string The string to convert.
  2948. * @returns {Array} Returns the converted array.
  2949. */
  2950. function unicodeToArray(string) {
  2951. return string.match(reUnicode) || [];
  2952. }
  2953. /**
  2954. * Splits a Unicode `string` into an array of its words.
  2955. *
  2956. * @private
  2957. * @param {string} The string to inspect.
  2958. * @returns {Array} Returns the words of `string`.
  2959. */
  2960. function unicodeWords(string) {
  2961. return string.match(reUnicodeWord) || [];
  2962. }
  2963. /*--------------------------------------------------------------------------*/
  2964. /**
  2965. * Create a new pristine `lodash` function using the `context` object.
  2966. *
  2967. * @static
  2968. * @memberOf _
  2969. * @since 1.1.0
  2970. * @category Util
  2971. * @param {Object} [context=root] The context object.
  2972. * @returns {Function} Returns a new `lodash` function.
  2973. * @example
  2974. *
  2975. * _.mixin({ 'foo': _.constant('foo') });
  2976. *
  2977. * var lodash = _.runInContext();
  2978. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2979. *
  2980. * _.isFunction(_.foo);
  2981. * // => true
  2982. * _.isFunction(_.bar);
  2983. * // => false
  2984. *
  2985. * lodash.isFunction(lodash.foo);
  2986. * // => false
  2987. * lodash.isFunction(lodash.bar);
  2988. * // => true
  2989. *
  2990. * // Create a suped-up `defer` in Node.js.
  2991. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2992. */
  2993. var runInContext = (function runInContext(context) {
  2994. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2995. /** Built-in constructor references. */
  2996. var Array = context.Array,
  2997. Date = context.Date,
  2998. Error = context.Error,
  2999. Function = context.Function,
  3000. Math = context.Math,
  3001. Object = context.Object,
  3002. RegExp = context.RegExp,
  3003. String = context.String,
  3004. TypeError = context.TypeError;
  3005. /** Used for built-in method references. */
  3006. var arrayProto = Array.prototype,
  3007. funcProto = Function.prototype,
  3008. objectProto = Object.prototype;
  3009. /** Used to detect overreaching core-js shims. */
  3010. var coreJsData = context['__core-js_shared__'];
  3011. /** Used to resolve the decompiled source of functions. */
  3012. var funcToString = funcProto.toString;
  3013. /** Used to check objects for own properties. */
  3014. var hasOwnProperty = objectProto.hasOwnProperty;
  3015. /** Used to generate unique IDs. */
  3016. var idCounter = 0;
  3017. /** Used to detect methods masquerading as native. */
  3018. var maskSrcKey = (function() {
  3019. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3020. return uid ? ('Symbol(src)_1.' + uid) : '';
  3021. }());
  3022. /**
  3023. * Used to resolve the
  3024. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3025. * of values.
  3026. */
  3027. var nativeObjectToString = objectProto.toString;
  3028. /** Used to infer the `Object` constructor. */
  3029. var objectCtorString = funcToString.call(Object);
  3030. /** Used to restore the original `_` reference in `_.noConflict`. */
  3031. var oldDash = root._;
  3032. /** Used to detect if a method is native. */
  3033. var reIsNative = RegExp('^' +
  3034. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  3035. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  3036. );
  3037. /** Built-in value references. */
  3038. var Buffer = moduleExports ? context.Buffer : undefined,
  3039. Symbol = context.Symbol,
  3040. Uint8Array = context.Uint8Array,
  3041. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  3042. getPrototype = overArg(Object.getPrototypeOf, Object),
  3043. objectCreate = Object.create,
  3044. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3045. splice = arrayProto.splice,
  3046. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  3047. symIterator = Symbol ? Symbol.iterator : undefined,
  3048. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3049. var defineProperty = (function() {
  3050. try {
  3051. var func = getNative(Object, 'defineProperty');
  3052. func({}, '', {});
  3053. return func;
  3054. } catch (e) {}
  3055. }());
  3056. /** Mocked built-ins. */
  3057. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  3058. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  3059. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  3060. /* Built-in method references for those with the same name as other `lodash` methods. */
  3061. var nativeCeil = Math.ceil,
  3062. nativeFloor = Math.floor,
  3063. nativeGetSymbols = Object.getOwnPropertySymbols,
  3064. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3065. nativeIsFinite = context.isFinite,
  3066. nativeJoin = arrayProto.join,
  3067. nativeKeys = overArg(Object.keys, Object),
  3068. nativeMax = Math.max,
  3069. nativeMin = Math.min,
  3070. nativeNow = Date.now,
  3071. nativeParseInt = context.parseInt,
  3072. nativeRandom = Math.random,
  3073. nativeReverse = arrayProto.reverse;
  3074. /* Built-in method references that are verified to be native. */
  3075. var DataView = getNative(context, 'DataView'),
  3076. Map = getNative(context, 'Map'),
  3077. Promise = getNative(context, 'Promise'),
  3078. Set = getNative(context, 'Set'),
  3079. WeakMap = getNative(context, 'WeakMap'),
  3080. nativeCreate = getNative(Object, 'create');
  3081. /** Used to store function metadata. */
  3082. var metaMap = WeakMap && new WeakMap;
  3083. /** Used to lookup unminified function names. */
  3084. var realNames = {};
  3085. /** Used to detect maps, sets, and weakmaps. */
  3086. var dataViewCtorString = toSource(DataView),
  3087. mapCtorString = toSource(Map),
  3088. promiseCtorString = toSource(Promise),
  3089. setCtorString = toSource(Set),
  3090. weakMapCtorString = toSource(WeakMap);
  3091. /** Used to convert symbols to primitives and strings. */
  3092. var symbolProto = Symbol ? Symbol.prototype : undefined,
  3093. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  3094. symbolToString = symbolProto ? symbolProto.toString : undefined;
  3095. /*------------------------------------------------------------------------*/
  3096. /**
  3097. * Creates a `lodash` object which wraps `value` to enable implicit method
  3098. * chain sequences. Methods that operate on and return arrays, collections,
  3099. * and functions can be chained together. Methods that retrieve a single value
  3100. * or may return a primitive value will automatically end the chain sequence
  3101. * and return the unwrapped value. Otherwise, the value must be unwrapped
  3102. * with `_#value`.
  3103. *
  3104. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  3105. * enabled using `_.chain`.
  3106. *
  3107. * The execution of chained methods is lazy, that is, it's deferred until
  3108. * `_#value` is implicitly or explicitly called.
  3109. *
  3110. * Lazy evaluation allows several methods to support shortcut fusion.
  3111. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  3112. * the creation of intermediate arrays and can greatly reduce the number of
  3113. * iteratee executions. Sections of a chain sequence qualify for shortcut
  3114. * fusion if the section is applied to an array and iteratees accept only
  3115. * one argument. The heuristic for whether a section qualifies for shortcut
  3116. * fusion is subject to change.
  3117. *
  3118. * Chaining is supported in custom builds as long as the `_#value` method is
  3119. * directly or indirectly included in the build.
  3120. *
  3121. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  3122. *
  3123. * The wrapper `Array` methods are:
  3124. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  3125. *
  3126. * The wrapper `String` methods are:
  3127. * `replace` and `split`
  3128. *
  3129. * The wrapper methods that support shortcut fusion are:
  3130. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  3131. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  3132. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  3133. *
  3134. * The chainable wrapper methods are:
  3135. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  3136. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  3137. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  3138. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  3139. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  3140. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  3141. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  3142. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  3143. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  3144. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  3145. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  3146. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  3147. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  3148. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  3149. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  3150. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  3151. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  3152. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  3153. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  3154. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  3155. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  3156. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  3157. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  3158. * `zipObject`, `zipObjectDeep`, and `zipWith`
  3159. *
  3160. * The wrapper methods that are **not** chainable by default are:
  3161. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  3162. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  3163. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  3164. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  3165. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  3166. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  3167. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  3168. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  3169. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  3170. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  3171. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  3172. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  3173. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  3174. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  3175. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  3176. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  3177. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  3178. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  3179. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  3180. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  3181. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  3182. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  3183. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  3184. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  3185. * `upperFirst`, `value`, and `words`
  3186. *
  3187. * @name _
  3188. * @constructor
  3189. * @category Seq
  3190. * @param {*} value The value to wrap in a `lodash` instance.
  3191. * @returns {Object} Returns the new `lodash` wrapper instance.
  3192. * @example
  3193. *
  3194. * function square(n) {
  3195. * return n * n;
  3196. * }
  3197. *
  3198. * var wrapped = _([1, 2, 3]);
  3199. *
  3200. * // Returns an unwrapped value.
  3201. * wrapped.reduce(_.add);
  3202. * // => 6
  3203. *
  3204. * // Returns a wrapped value.
  3205. * var squares = wrapped.map(square);
  3206. *
  3207. * _.isArray(squares);
  3208. * // => false
  3209. *
  3210. * _.isArray(squares.value());
  3211. * // => true
  3212. */
  3213. function lodash(value) {
  3214. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  3215. if (value instanceof LodashWrapper) {
  3216. return value;
  3217. }
  3218. if (hasOwnProperty.call(value, '__wrapped__')) {
  3219. return wrapperClone(value);
  3220. }
  3221. }
  3222. return new LodashWrapper(value);
  3223. }
  3224. /**
  3225. * The base implementation of `_.create` without support for assigning
  3226. * properties to the created object.
  3227. *
  3228. * @private
  3229. * @param {Object} proto The object to inherit from.
  3230. * @returns {Object} Returns the new object.
  3231. */
  3232. var baseCreate = (function() {
  3233. function object() {}
  3234. return function(proto) {
  3235. if (!isObject(proto)) {
  3236. return {};
  3237. }
  3238. if (objectCreate) {
  3239. return objectCreate(proto);
  3240. }
  3241. object.prototype = proto;
  3242. var result = new object;
  3243. object.prototype = undefined;
  3244. return result;
  3245. };
  3246. }());
  3247. /**
  3248. * The function whose prototype chain sequence wrappers inherit from.
  3249. *
  3250. * @private
  3251. */
  3252. function baseLodash() {
  3253. // No operation performed.
  3254. }
  3255. /**
  3256. * The base constructor for creating `lodash` wrapper objects.
  3257. *
  3258. * @private
  3259. * @param {*} value The value to wrap.
  3260. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  3261. */
  3262. function LodashWrapper(value, chainAll) {
  3263. this.__wrapped__ = value;
  3264. this.__actions__ = [];
  3265. this.__chain__ = !!chainAll;
  3266. this.__index__ = 0;
  3267. this.__values__ = undefined;
  3268. }
  3269. /**
  3270. * By default, the template delimiters used by lodash are like those in
  3271. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  3272. * following template settings to use alternative delimiters.
  3273. *
  3274. * @static
  3275. * @memberOf _
  3276. * @type {Object}
  3277. */
  3278. lodash.templateSettings = {
  3279. /**
  3280. * Used to detect `data` property values to be HTML-escaped.
  3281. *
  3282. * @memberOf _.templateSettings
  3283. * @type {RegExp}
  3284. */
  3285. 'escape': reEscape,
  3286. /**
  3287. * Used to detect code to be evaluated.
  3288. *
  3289. * @memberOf _.templateSettings
  3290. * @type {RegExp}
  3291. */
  3292. 'evaluate': reEvaluate,
  3293. /**
  3294. * Used to detect `data` property values to inject.
  3295. *
  3296. * @memberOf _.templateSettings
  3297. * @type {RegExp}
  3298. */
  3299. 'interpolate': reInterpolate,
  3300. /**
  3301. * Used to reference the data object in the template text.
  3302. *
  3303. * @memberOf _.templateSettings
  3304. * @type {string}
  3305. */
  3306. 'variable': '',
  3307. /**
  3308. * Used to import variables into the compiled template.
  3309. *
  3310. * @memberOf _.templateSettings
  3311. * @type {Object}
  3312. */
  3313. 'imports': {
  3314. /**
  3315. * A reference to the `lodash` function.
  3316. *
  3317. * @memberOf _.templateSettings.imports
  3318. * @type {Function}
  3319. */
  3320. '_': lodash
  3321. }
  3322. };
  3323. // Ensure wrappers are instances of `baseLodash`.
  3324. lodash.prototype = baseLodash.prototype;
  3325. lodash.prototype.constructor = lodash;
  3326. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  3327. LodashWrapper.prototype.constructor = LodashWrapper;
  3328. /*------------------------------------------------------------------------*/
  3329. /**
  3330. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  3331. *
  3332. * @private
  3333. * @constructor
  3334. * @param {*} value The value to wrap.
  3335. */
  3336. function LazyWrapper(value) {
  3337. this.__wrapped__ = value;
  3338. this.__actions__ = [];
  3339. this.__dir__ = 1;
  3340. this.__filtered__ = false;
  3341. this.__iteratees__ = [];
  3342. this.__takeCount__ = MAX_ARRAY_LENGTH;
  3343. this.__views__ = [];
  3344. }
  3345. /**
  3346. * Creates a clone of the lazy wrapper object.
  3347. *
  3348. * @private
  3349. * @name clone
  3350. * @memberOf LazyWrapper
  3351. * @returns {Object} Returns the cloned `LazyWrapper` object.
  3352. */
  3353. function lazyClone() {
  3354. var result = new LazyWrapper(this.__wrapped__);
  3355. result.__actions__ = copyArray(this.__actions__);
  3356. result.__dir__ = this.__dir__;
  3357. result.__filtered__ = this.__filtered__;
  3358. result.__iteratees__ = copyArray(this.__iteratees__);
  3359. result.__takeCount__ = this.__takeCount__;
  3360. result.__views__ = copyArray(this.__views__);
  3361. return result;
  3362. }
  3363. /**
  3364. * Reverses the direction of lazy iteration.
  3365. *
  3366. * @private
  3367. * @name reverse
  3368. * @memberOf LazyWrapper
  3369. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  3370. */
  3371. function lazyReverse() {
  3372. if (this.__filtered__) {
  3373. var result = new LazyWrapper(this);
  3374. result.__dir__ = -1;
  3375. result.__filtered__ = true;
  3376. } else {
  3377. result = this.clone();
  3378. result.__dir__ *= -1;
  3379. }
  3380. return result;
  3381. }
  3382. /**
  3383. * Extracts the unwrapped value from its lazy wrapper.
  3384. *
  3385. * @private
  3386. * @name value
  3387. * @memberOf LazyWrapper
  3388. * @returns {*} Returns the unwrapped value.
  3389. */
  3390. function lazyValue() {
  3391. var array = this.__wrapped__.value(),
  3392. dir = this.__dir__,
  3393. isArr = isArray(array),
  3394. isRight = dir < 0,
  3395. arrLength = isArr ? array.length : 0,
  3396. view = getView(0, arrLength, this.__views__),
  3397. start = view.start,
  3398. end = view.end,
  3399. length = end - start,
  3400. index = isRight ? end : (start - 1),
  3401. iteratees = this.__iteratees__,
  3402. iterLength = iteratees.length,
  3403. resIndex = 0,
  3404. takeCount = nativeMin(length, this.__takeCount__);
  3405. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3406. return baseWrapperValue(array, this.__actions__);
  3407. }
  3408. var result = [];
  3409. outer:
  3410. while (length-- && resIndex < takeCount) {
  3411. index += dir;
  3412. var iterIndex = -1,
  3413. value = array[index];
  3414. while (++iterIndex < iterLength) {
  3415. var data = iteratees[iterIndex],
  3416. iteratee = data.iteratee,
  3417. type = data.type,
  3418. computed = iteratee(value);
  3419. if (type == LAZY_MAP_FLAG) {
  3420. value = computed;
  3421. } else if (!computed) {
  3422. if (type == LAZY_FILTER_FLAG) {
  3423. continue outer;
  3424. } else {
  3425. break outer;
  3426. }
  3427. }
  3428. }
  3429. result[resIndex++] = value;
  3430. }
  3431. return result;
  3432. }
  3433. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3434. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3435. LazyWrapper.prototype.constructor = LazyWrapper;
  3436. /*------------------------------------------------------------------------*/
  3437. /**
  3438. * Creates a hash object.
  3439. *
  3440. * @private
  3441. * @constructor
  3442. * @param {Array} [entries] The key-value pairs to cache.
  3443. */
  3444. function Hash(entries) {
  3445. var index = -1,
  3446. length = entries == null ? 0 : entries.length;
  3447. this.clear();
  3448. while (++index < length) {
  3449. var entry = entries[index];
  3450. this.set(entry[0], entry[1]);
  3451. }
  3452. }
  3453. /**
  3454. * Removes all key-value entries from the hash.
  3455. *
  3456. * @private
  3457. * @name clear
  3458. * @memberOf Hash
  3459. */
  3460. function hashClear() {
  3461. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3462. this.size = 0;
  3463. }
  3464. /**
  3465. * Removes `key` and its value from the hash.
  3466. *
  3467. * @private
  3468. * @name delete
  3469. * @memberOf Hash
  3470. * @param {Object} hash The hash to modify.
  3471. * @param {string} key The key of the value to remove.
  3472. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3473. */
  3474. function hashDelete(key) {
  3475. var result = this.has(key) && delete this.__data__[key];
  3476. this.size -= result ? 1 : 0;
  3477. return result;
  3478. }
  3479. /**
  3480. * Gets the hash value for `key`.
  3481. *
  3482. * @private
  3483. * @name get
  3484. * @memberOf Hash
  3485. * @param {string} key The key of the value to get.
  3486. * @returns {*} Returns the entry value.
  3487. */
  3488. function hashGet(key) {
  3489. var data = this.__data__;
  3490. if (nativeCreate) {
  3491. var result = data[key];
  3492. return result === HASH_UNDEFINED ? undefined : result;
  3493. }
  3494. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3495. }
  3496. /**
  3497. * Checks if a hash value for `key` exists.
  3498. *
  3499. * @private
  3500. * @name has
  3501. * @memberOf Hash
  3502. * @param {string} key The key of the entry to check.
  3503. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3504. */
  3505. function hashHas(key) {
  3506. var data = this.__data__;
  3507. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3508. }
  3509. /**
  3510. * Sets the hash `key` to `value`.
  3511. *
  3512. * @private
  3513. * @name set
  3514. * @memberOf Hash
  3515. * @param {string} key The key of the value to set.
  3516. * @param {*} value The value to set.
  3517. * @returns {Object} Returns the hash instance.
  3518. */
  3519. function hashSet(key, value) {
  3520. var data = this.__data__;
  3521. this.size += this.has(key) ? 0 : 1;
  3522. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3523. return this;
  3524. }
  3525. // Add methods to `Hash`.
  3526. Hash.prototype.clear = hashClear;
  3527. Hash.prototype['delete'] = hashDelete;
  3528. Hash.prototype.get = hashGet;
  3529. Hash.prototype.has = hashHas;
  3530. Hash.prototype.set = hashSet;
  3531. /*------------------------------------------------------------------------*/
  3532. /**
  3533. * Creates an list cache object.
  3534. *
  3535. * @private
  3536. * @constructor
  3537. * @param {Array} [entries] The key-value pairs to cache.
  3538. */
  3539. function ListCache(entries) {
  3540. var index = -1,
  3541. length = entries == null ? 0 : entries.length;
  3542. this.clear();
  3543. while (++index < length) {
  3544. var entry = entries[index];
  3545. this.set(entry[0], entry[1]);
  3546. }
  3547. }
  3548. /**
  3549. * Removes all key-value entries from the list cache.
  3550. *
  3551. * @private
  3552. * @name clear
  3553. * @memberOf ListCache
  3554. */
  3555. function listCacheClear() {
  3556. this.__data__ = [];
  3557. this.size = 0;
  3558. }
  3559. /**
  3560. * Removes `key` and its value from the list cache.
  3561. *
  3562. * @private
  3563. * @name delete
  3564. * @memberOf ListCache
  3565. * @param {string} key The key of the value to remove.
  3566. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3567. */
  3568. function listCacheDelete(key) {
  3569. var data = this.__data__,
  3570. index = assocIndexOf(data, key);
  3571. if (index < 0) {
  3572. return false;
  3573. }
  3574. var lastIndex = data.length - 1;
  3575. if (index == lastIndex) {
  3576. data.pop();
  3577. } else {
  3578. splice.call(data, index, 1);
  3579. }
  3580. --this.size;
  3581. return true;
  3582. }
  3583. /**
  3584. * Gets the list cache value for `key`.
  3585. *
  3586. * @private
  3587. * @name get
  3588. * @memberOf ListCache
  3589. * @param {string} key The key of the value to get.
  3590. * @returns {*} Returns the entry value.
  3591. */
  3592. function listCacheGet(key) {
  3593. var data = this.__data__,
  3594. index = assocIndexOf(data, key);
  3595. return index < 0 ? undefined : data[index][1];
  3596. }
  3597. /**
  3598. * Checks if a list cache value for `key` exists.
  3599. *
  3600. * @private
  3601. * @name has
  3602. * @memberOf ListCache
  3603. * @param {string} key The key of the entry to check.
  3604. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3605. */
  3606. function listCacheHas(key) {
  3607. return assocIndexOf(this.__data__, key) > -1;
  3608. }
  3609. /**
  3610. * Sets the list cache `key` to `value`.
  3611. *
  3612. * @private
  3613. * @name set
  3614. * @memberOf ListCache
  3615. * @param {string} key The key of the value to set.
  3616. * @param {*} value The value to set.
  3617. * @returns {Object} Returns the list cache instance.
  3618. */
  3619. function listCacheSet(key, value) {
  3620. var data = this.__data__,
  3621. index = assocIndexOf(data, key);
  3622. if (index < 0) {
  3623. ++this.size;
  3624. data.push([key, value]);
  3625. } else {
  3626. data[index][1] = value;
  3627. }
  3628. return this;
  3629. }
  3630. // Add methods to `ListCache`.
  3631. ListCache.prototype.clear = listCacheClear;
  3632. ListCache.prototype['delete'] = listCacheDelete;
  3633. ListCache.prototype.get = listCacheGet;
  3634. ListCache.prototype.has = listCacheHas;
  3635. ListCache.prototype.set = listCacheSet;
  3636. /*------------------------------------------------------------------------*/
  3637. /**
  3638. * Creates a map cache object to store key-value pairs.
  3639. *
  3640. * @private
  3641. * @constructor
  3642. * @param {Array} [entries] The key-value pairs to cache.
  3643. */
  3644. function MapCache(entries) {
  3645. var index = -1,
  3646. length = entries == null ? 0 : entries.length;
  3647. this.clear();
  3648. while (++index < length) {
  3649. var entry = entries[index];
  3650. this.set(entry[0], entry[1]);
  3651. }
  3652. }
  3653. /**
  3654. * Removes all key-value entries from the map.
  3655. *
  3656. * @private
  3657. * @name clear
  3658. * @memberOf MapCache
  3659. */
  3660. function mapCacheClear() {
  3661. this.size = 0;
  3662. this.__data__ = {
  3663. 'hash': new Hash,
  3664. 'map': new (Map || ListCache),
  3665. 'string': new Hash
  3666. };
  3667. }
  3668. /**
  3669. * Removes `key` and its value from the map.
  3670. *
  3671. * @private
  3672. * @name delete
  3673. * @memberOf MapCache
  3674. * @param {string} key The key of the value to remove.
  3675. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3676. */
  3677. function mapCacheDelete(key) {
  3678. var result = getMapData(this, key)['delete'](key);
  3679. this.size -= result ? 1 : 0;
  3680. return result;
  3681. }
  3682. /**
  3683. * Gets the map value for `key`.
  3684. *
  3685. * @private
  3686. * @name get
  3687. * @memberOf MapCache
  3688. * @param {string} key The key of the value to get.
  3689. * @returns {*} Returns the entry value.
  3690. */
  3691. function mapCacheGet(key) {
  3692. return getMapData(this, key).get(key);
  3693. }
  3694. /**
  3695. * Checks if a map value for `key` exists.
  3696. *
  3697. * @private
  3698. * @name has
  3699. * @memberOf MapCache
  3700. * @param {string} key The key of the entry to check.
  3701. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3702. */
  3703. function mapCacheHas(key) {
  3704. return getMapData(this, key).has(key);
  3705. }
  3706. /**
  3707. * Sets the map `key` to `value`.
  3708. *
  3709. * @private
  3710. * @name set
  3711. * @memberOf MapCache
  3712. * @param {string} key The key of the value to set.
  3713. * @param {*} value The value to set.
  3714. * @returns {Object} Returns the map cache instance.
  3715. */
  3716. function mapCacheSet(key, value) {
  3717. var data = getMapData(this, key),
  3718. size = data.size;
  3719. data.set(key, value);
  3720. this.size += data.size == size ? 0 : 1;
  3721. return this;
  3722. }
  3723. // Add methods to `MapCache`.
  3724. MapCache.prototype.clear = mapCacheClear;
  3725. MapCache.prototype['delete'] = mapCacheDelete;
  3726. MapCache.prototype.get = mapCacheGet;
  3727. MapCache.prototype.has = mapCacheHas;
  3728. MapCache.prototype.set = mapCacheSet;
  3729. /*------------------------------------------------------------------------*/
  3730. /**
  3731. *
  3732. * Creates an array cache object to store unique values.
  3733. *
  3734. * @private
  3735. * @constructor
  3736. * @param {Array} [values] The values to cache.
  3737. */
  3738. function SetCache(values) {
  3739. var index = -1,
  3740. length = values == null ? 0 : values.length;
  3741. this.__data__ = new MapCache;
  3742. while (++index < length) {
  3743. this.add(values[index]);
  3744. }
  3745. }
  3746. /**
  3747. * Adds `value` to the array cache.
  3748. *
  3749. * @private
  3750. * @name add
  3751. * @memberOf SetCache
  3752. * @alias push
  3753. * @param {*} value The value to cache.
  3754. * @returns {Object} Returns the cache instance.
  3755. */
  3756. function setCacheAdd(value) {
  3757. this.__data__.set(value, HASH_UNDEFINED);
  3758. return this;
  3759. }
  3760. /**
  3761. * Checks if `value` is in the array cache.
  3762. *
  3763. * @private
  3764. * @name has
  3765. * @memberOf SetCache
  3766. * @param {*} value The value to search for.
  3767. * @returns {number} Returns `true` if `value` is found, else `false`.
  3768. */
  3769. function setCacheHas(value) {
  3770. return this.__data__.has(value);
  3771. }
  3772. // Add methods to `SetCache`.
  3773. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3774. SetCache.prototype.has = setCacheHas;
  3775. /*------------------------------------------------------------------------*/
  3776. /**
  3777. * Creates a stack cache object to store key-value pairs.
  3778. *
  3779. * @private
  3780. * @constructor
  3781. * @param {Array} [entries] The key-value pairs to cache.
  3782. */
  3783. function Stack(entries) {
  3784. var data = this.__data__ = new ListCache(entries);
  3785. this.size = data.size;
  3786. }
  3787. /**
  3788. * Removes all key-value entries from the stack.
  3789. *
  3790. * @private
  3791. * @name clear
  3792. * @memberOf Stack
  3793. */
  3794. function stackClear() {
  3795. this.__data__ = new ListCache;
  3796. this.size = 0;
  3797. }
  3798. /**
  3799. * Removes `key` and its value from the stack.
  3800. *
  3801. * @private
  3802. * @name delete
  3803. * @memberOf Stack
  3804. * @param {string} key The key of the value to remove.
  3805. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3806. */
  3807. function stackDelete(key) {
  3808. var data = this.__data__,
  3809. result = data['delete'](key);
  3810. this.size = data.size;
  3811. return result;
  3812. }
  3813. /**
  3814. * Gets the stack value for `key`.
  3815. *
  3816. * @private
  3817. * @name get
  3818. * @memberOf Stack
  3819. * @param {string} key The key of the value to get.
  3820. * @returns {*} Returns the entry value.
  3821. */
  3822. function stackGet(key) {
  3823. return this.__data__.get(key);
  3824. }
  3825. /**
  3826. * Checks if a stack value for `key` exists.
  3827. *
  3828. * @private
  3829. * @name has
  3830. * @memberOf Stack
  3831. * @param {string} key The key of the entry to check.
  3832. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3833. */
  3834. function stackHas(key) {
  3835. return this.__data__.has(key);
  3836. }
  3837. /**
  3838. * Sets the stack `key` to `value`.
  3839. *
  3840. * @private
  3841. * @name set
  3842. * @memberOf Stack
  3843. * @param {string} key The key of the value to set.
  3844. * @param {*} value The value to set.
  3845. * @returns {Object} Returns the stack cache instance.
  3846. */
  3847. function stackSet(key, value) {
  3848. var data = this.__data__;
  3849. if (data instanceof ListCache) {
  3850. var pairs = data.__data__;
  3851. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3852. pairs.push([key, value]);
  3853. this.size = ++data.size;
  3854. return this;
  3855. }
  3856. data = this.__data__ = new MapCache(pairs);
  3857. }
  3858. data.set(key, value);
  3859. this.size = data.size;
  3860. return this;
  3861. }
  3862. // Add methods to `Stack`.
  3863. Stack.prototype.clear = stackClear;
  3864. Stack.prototype['delete'] = stackDelete;
  3865. Stack.prototype.get = stackGet;
  3866. Stack.prototype.has = stackHas;
  3867. Stack.prototype.set = stackSet;
  3868. /*------------------------------------------------------------------------*/
  3869. /**
  3870. * Creates an array of the enumerable property names of the array-like `value`.
  3871. *
  3872. * @private
  3873. * @param {*} value The value to query.
  3874. * @param {boolean} inherited Specify returning inherited property names.
  3875. * @returns {Array} Returns the array of property names.
  3876. */
  3877. function arrayLikeKeys(value, inherited) {
  3878. var isArr = isArray(value),
  3879. isArg = !isArr && isArguments(value),
  3880. isBuff = !isArr && !isArg && isBuffer(value),
  3881. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3882. skipIndexes = isArr || isArg || isBuff || isType,
  3883. result = skipIndexes ? baseTimes(value.length, String) : [],
  3884. length = result.length;
  3885. for (var key in value) {
  3886. if ((inherited || hasOwnProperty.call(value, key)) &&
  3887. !(skipIndexes && (
  3888. // Safari 9 has enumerable `arguments.length` in strict mode.
  3889. key == 'length' ||
  3890. // Node.js 0.10 has enumerable non-index properties on buffers.
  3891. (isBuff && (key == 'offset' || key == 'parent')) ||
  3892. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3893. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3894. // Skip index properties.
  3895. isIndex(key, length)
  3896. ))) {
  3897. result.push(key);
  3898. }
  3899. }
  3900. return result;
  3901. }
  3902. /**
  3903. * A specialized version of `_.sample` for arrays.
  3904. *
  3905. * @private
  3906. * @param {Array} array The array to sample.
  3907. * @returns {*} Returns the random element.
  3908. */
  3909. function arraySample(array) {
  3910. var length = array.length;
  3911. return length ? array[baseRandom(0, length - 1)] : undefined;
  3912. }
  3913. /**
  3914. * A specialized version of `_.sampleSize` for arrays.
  3915. *
  3916. * @private
  3917. * @param {Array} array The array to sample.
  3918. * @param {number} n The number of elements to sample.
  3919. * @returns {Array} Returns the random elements.
  3920. */
  3921. function arraySampleSize(array, n) {
  3922. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3923. }
  3924. /**
  3925. * A specialized version of `_.shuffle` for arrays.
  3926. *
  3927. * @private
  3928. * @param {Array} array The array to shuffle.
  3929. * @returns {Array} Returns the new shuffled array.
  3930. */
  3931. function arrayShuffle(array) {
  3932. return shuffleSelf(copyArray(array));
  3933. }
  3934. /**
  3935. * This function is like `assignValue` except that it doesn't assign
  3936. * `undefined` values.
  3937. *
  3938. * @private
  3939. * @param {Object} object The object to modify.
  3940. * @param {string} key The key of the property to assign.
  3941. * @param {*} value The value to assign.
  3942. */
  3943. function assignMergeValue(object, key, value) {
  3944. if ((value !== undefined && !eq(object[key], value)) ||
  3945. (value === undefined && !(key in object))) {
  3946. baseAssignValue(object, key, value);
  3947. }
  3948. }
  3949. /**
  3950. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3951. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3952. * for equality comparisons.
  3953. *
  3954. * @private
  3955. * @param {Object} object The object to modify.
  3956. * @param {string} key The key of the property to assign.
  3957. * @param {*} value The value to assign.
  3958. */
  3959. function assignValue(object, key, value) {
  3960. var objValue = object[key];
  3961. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3962. (value === undefined && !(key in object))) {
  3963. baseAssignValue(object, key, value);
  3964. }
  3965. }
  3966. /**
  3967. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3968. *
  3969. * @private
  3970. * @param {Array} array The array to inspect.
  3971. * @param {*} key The key to search for.
  3972. * @returns {number} Returns the index of the matched value, else `-1`.
  3973. */
  3974. function assocIndexOf(array, key) {
  3975. var length = array.length;
  3976. while (length--) {
  3977. if (eq(array[length][0], key)) {
  3978. return length;
  3979. }
  3980. }
  3981. return -1;
  3982. }
  3983. /**
  3984. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3985. * by `iteratee` and values set by `setter`.
  3986. *
  3987. * @private
  3988. * @param {Array|Object} collection The collection to iterate over.
  3989. * @param {Function} setter The function to set `accumulator` values.
  3990. * @param {Function} iteratee The iteratee to transform keys.
  3991. * @param {Object} accumulator The initial aggregated object.
  3992. * @returns {Function} Returns `accumulator`.
  3993. */
  3994. function baseAggregator(collection, setter, iteratee, accumulator) {
  3995. baseEach(collection, function(value, key, collection) {
  3996. setter(accumulator, value, iteratee(value), collection);
  3997. });
  3998. return accumulator;
  3999. }
  4000. /**
  4001. * The base implementation of `_.assign` without support for multiple sources
  4002. * or `customizer` functions.
  4003. *
  4004. * @private
  4005. * @param {Object} object The destination object.
  4006. * @param {Object} source The source object.
  4007. * @returns {Object} Returns `object`.
  4008. */
  4009. function baseAssign(object, source) {
  4010. return object && copyObject(source, keys(source), object);
  4011. }
  4012. /**
  4013. * The base implementation of `_.assignIn` without support for multiple sources
  4014. * or `customizer` functions.
  4015. *
  4016. * @private
  4017. * @param {Object} object The destination object.
  4018. * @param {Object} source The source object.
  4019. * @returns {Object} Returns `object`.
  4020. */
  4021. function baseAssignIn(object, source) {
  4022. return object && copyObject(source, keysIn(source), object);
  4023. }
  4024. /**
  4025. * The base implementation of `assignValue` and `assignMergeValue` without
  4026. * value checks.
  4027. *
  4028. * @private
  4029. * @param {Object} object The object to modify.
  4030. * @param {string} key The key of the property to assign.
  4031. * @param {*} value The value to assign.
  4032. */
  4033. function baseAssignValue(object, key, value) {
  4034. if (key == '__proto__' && defineProperty) {
  4035. defineProperty(object, key, {
  4036. 'configurable': true,
  4037. 'enumerable': true,
  4038. 'value': value,
  4039. 'writable': true
  4040. });
  4041. } else {
  4042. object[key] = value;
  4043. }
  4044. }
  4045. /**
  4046. * The base implementation of `_.at` without support for individual paths.
  4047. *
  4048. * @private
  4049. * @param {Object} object The object to iterate over.
  4050. * @param {string[]} paths The property paths to pick.
  4051. * @returns {Array} Returns the picked elements.
  4052. */
  4053. function baseAt(object, paths) {
  4054. var index = -1,
  4055. length = paths.length,
  4056. result = Array(length),
  4057. skip = object == null;
  4058. while (++index < length) {
  4059. result[index] = skip ? undefined : get(object, paths[index]);
  4060. }
  4061. return result;
  4062. }
  4063. /**
  4064. * The base implementation of `_.clamp` which doesn't coerce arguments.
  4065. *
  4066. * @private
  4067. * @param {number} number The number to clamp.
  4068. * @param {number} [lower] The lower bound.
  4069. * @param {number} upper The upper bound.
  4070. * @returns {number} Returns the clamped number.
  4071. */
  4072. function baseClamp(number, lower, upper) {
  4073. if (number === number) {
  4074. if (upper !== undefined) {
  4075. number = number <= upper ? number : upper;
  4076. }
  4077. if (lower !== undefined) {
  4078. number = number >= lower ? number : lower;
  4079. }
  4080. }
  4081. return number;
  4082. }
  4083. /**
  4084. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4085. * traversed objects.
  4086. *
  4087. * @private
  4088. * @param {*} value The value to clone.
  4089. * @param {boolean} bitmask The bitmask flags.
  4090. * 1 - Deep clone
  4091. * 2 - Flatten inherited properties
  4092. * 4 - Clone symbols
  4093. * @param {Function} [customizer] The function to customize cloning.
  4094. * @param {string} [key] The key of `value`.
  4095. * @param {Object} [object] The parent object of `value`.
  4096. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4097. * @returns {*} Returns the cloned value.
  4098. */
  4099. function baseClone(value, bitmask, customizer, key, object, stack) {
  4100. var result,
  4101. isDeep = bitmask & CLONE_DEEP_FLAG,
  4102. isFlat = bitmask & CLONE_FLAT_FLAG,
  4103. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  4104. if (customizer) {
  4105. result = object ? customizer(value, key, object, stack) : customizer(value);
  4106. }
  4107. if (result !== undefined) {
  4108. return result;
  4109. }
  4110. if (!isObject(value)) {
  4111. return value;
  4112. }
  4113. var isArr = isArray(value);
  4114. if (isArr) {
  4115. result = initCloneArray(value);
  4116. if (!isDeep) {
  4117. return copyArray(value, result);
  4118. }
  4119. } else {
  4120. var tag = getTag(value),
  4121. isFunc = tag == funcTag || tag == genTag;
  4122. if (isBuffer(value)) {
  4123. return cloneBuffer(value, isDeep);
  4124. }
  4125. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  4126. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  4127. if (!isDeep) {
  4128. return isFlat
  4129. ? copySymbolsIn(value, baseAssignIn(result, value))
  4130. : copySymbols(value, baseAssign(result, value));
  4131. }
  4132. } else {
  4133. if (!cloneableTags[tag]) {
  4134. return object ? value : {};
  4135. }
  4136. result = initCloneByTag(value, tag, isDeep);
  4137. }
  4138. }
  4139. // Check for circular references and return its corresponding clone.
  4140. stack || (stack = new Stack);
  4141. var stacked = stack.get(value);
  4142. if (stacked) {
  4143. return stacked;
  4144. }
  4145. stack.set(value, result);
  4146. if (isSet(value)) {
  4147. value.forEach(function(subValue) {
  4148. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  4149. });
  4150. } else if (isMap(value)) {
  4151. value.forEach(function(subValue, key) {
  4152. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4153. });
  4154. }
  4155. var keysFunc = isFull
  4156. ? (isFlat ? getAllKeysIn : getAllKeys)
  4157. : (isFlat ? keysIn : keys);
  4158. var props = isArr ? undefined : keysFunc(value);
  4159. arrayEach(props || value, function(subValue, key) {
  4160. if (props) {
  4161. key = subValue;
  4162. subValue = value[key];
  4163. }
  4164. // Recursively populate clone (susceptible to call stack limits).
  4165. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4166. });
  4167. return result;
  4168. }
  4169. /**
  4170. * The base implementation of `_.conforms` which doesn't clone `source`.
  4171. *
  4172. * @private
  4173. * @param {Object} source The object of property predicates to conform to.
  4174. * @returns {Function} Returns the new spec function.
  4175. */
  4176. function baseConforms(source) {
  4177. var props = keys(source);
  4178. return function(object) {
  4179. return baseConformsTo(object, source, props);
  4180. };
  4181. }
  4182. /**
  4183. * The base implementation of `_.conformsTo` which accepts `props` to check.
  4184. *
  4185. * @private
  4186. * @param {Object} object The object to inspect.
  4187. * @param {Object} source The object of property predicates to conform to.
  4188. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  4189. */
  4190. function baseConformsTo(object, source, props) {
  4191. var length = props.length;
  4192. if (object == null) {
  4193. return !length;
  4194. }
  4195. object = Object(object);
  4196. while (length--) {
  4197. var key = props[length],
  4198. predicate = source[key],
  4199. value = object[key];
  4200. if ((value === undefined && !(key in object)) || !predicate(value)) {
  4201. return false;
  4202. }
  4203. }
  4204. return true;
  4205. }
  4206. /**
  4207. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  4208. * to provide to `func`.
  4209. *
  4210. * @private
  4211. * @param {Function} func The function to delay.
  4212. * @param {number} wait The number of milliseconds to delay invocation.
  4213. * @param {Array} args The arguments to provide to `func`.
  4214. * @returns {number|Object} Returns the timer id or timeout object.
  4215. */
  4216. function baseDelay(func, wait, args) {
  4217. if (typeof func != 'function') {
  4218. throw new TypeError(FUNC_ERROR_TEXT);
  4219. }
  4220. return setTimeout(function() { func.apply(undefined, args); }, wait);
  4221. }
  4222. /**
  4223. * The base implementation of methods like `_.difference` without support
  4224. * for excluding multiple arrays or iteratee shorthands.
  4225. *
  4226. * @private
  4227. * @param {Array} array The array to inspect.
  4228. * @param {Array} values The values to exclude.
  4229. * @param {Function} [iteratee] The iteratee invoked per element.
  4230. * @param {Function} [comparator] The comparator invoked per element.
  4231. * @returns {Array} Returns the new array of filtered values.
  4232. */
  4233. function baseDifference(array, values, iteratee, comparator) {
  4234. var index = -1,
  4235. includes = arrayIncludes,
  4236. isCommon = true,
  4237. length = array.length,
  4238. result = [],
  4239. valuesLength = values.length;
  4240. if (!length) {
  4241. return result;
  4242. }
  4243. if (iteratee) {
  4244. values = arrayMap(values, baseUnary(iteratee));
  4245. }
  4246. if (comparator) {
  4247. includes = arrayIncludesWith;
  4248. isCommon = false;
  4249. }
  4250. else if (values.length >= LARGE_ARRAY_SIZE) {
  4251. includes = cacheHas;
  4252. isCommon = false;
  4253. values = new SetCache(values);
  4254. }
  4255. outer:
  4256. while (++index < length) {
  4257. var value = array[index],
  4258. computed = iteratee == null ? value : iteratee(value);
  4259. value = (comparator || value !== 0) ? value : 0;
  4260. if (isCommon && computed === computed) {
  4261. var valuesIndex = valuesLength;
  4262. while (valuesIndex--) {
  4263. if (values[valuesIndex] === computed) {
  4264. continue outer;
  4265. }
  4266. }
  4267. result.push(value);
  4268. }
  4269. else if (!includes(values, computed, comparator)) {
  4270. result.push(value);
  4271. }
  4272. }
  4273. return result;
  4274. }
  4275. /**
  4276. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4277. *
  4278. * @private
  4279. * @param {Array|Object} collection The collection to iterate over.
  4280. * @param {Function} iteratee The function invoked per iteration.
  4281. * @returns {Array|Object} Returns `collection`.
  4282. */
  4283. var baseEach = createBaseEach(baseForOwn);
  4284. /**
  4285. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  4286. *
  4287. * @private
  4288. * @param {Array|Object} collection The collection to iterate over.
  4289. * @param {Function} iteratee The function invoked per iteration.
  4290. * @returns {Array|Object} Returns `collection`.
  4291. */
  4292. var baseEachRight = createBaseEach(baseForOwnRight, true);
  4293. /**
  4294. * The base implementation of `_.every` without support for iteratee shorthands.
  4295. *
  4296. * @private
  4297. * @param {Array|Object} collection The collection to iterate over.
  4298. * @param {Function} predicate The function invoked per iteration.
  4299. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  4300. * else `false`
  4301. */
  4302. function baseEvery(collection, predicate) {
  4303. var result = true;
  4304. baseEach(collection, function(value, index, collection) {
  4305. result = !!predicate(value, index, collection);
  4306. return result;
  4307. });
  4308. return result;
  4309. }
  4310. /**
  4311. * The base implementation of methods like `_.max` and `_.min` which accepts a
  4312. * `comparator` to determine the extremum value.
  4313. *
  4314. * @private
  4315. * @param {Array} array The array to iterate over.
  4316. * @param {Function} iteratee The iteratee invoked per iteration.
  4317. * @param {Function} comparator The comparator used to compare values.
  4318. * @returns {*} Returns the extremum value.
  4319. */
  4320. function baseExtremum(array, iteratee, comparator) {
  4321. var index = -1,
  4322. length = array.length;
  4323. while (++index < length) {
  4324. var value = array[index],
  4325. current = iteratee(value);
  4326. if (current != null && (computed === undefined
  4327. ? (current === current && !isSymbol(current))
  4328. : comparator(current, computed)
  4329. )) {
  4330. var computed = current,
  4331. result = value;
  4332. }
  4333. }
  4334. return result;
  4335. }
  4336. /**
  4337. * The base implementation of `_.fill` without an iteratee call guard.
  4338. *
  4339. * @private
  4340. * @param {Array} array The array to fill.
  4341. * @param {*} value The value to fill `array` with.
  4342. * @param {number} [start=0] The start position.
  4343. * @param {number} [end=array.length] The end position.
  4344. * @returns {Array} Returns `array`.
  4345. */
  4346. function baseFill(array, value, start, end) {
  4347. var length = array.length;
  4348. start = toInteger(start);
  4349. if (start < 0) {
  4350. start = -start > length ? 0 : (length + start);
  4351. }
  4352. end = (end === undefined || end > length) ? length : toInteger(end);
  4353. if (end < 0) {
  4354. end += length;
  4355. }
  4356. end = start > end ? 0 : toLength(end);
  4357. while (start < end) {
  4358. array[start++] = value;
  4359. }
  4360. return array;
  4361. }
  4362. /**
  4363. * The base implementation of `_.filter` without support for iteratee shorthands.
  4364. *
  4365. * @private
  4366. * @param {Array|Object} collection The collection to iterate over.
  4367. * @param {Function} predicate The function invoked per iteration.
  4368. * @returns {Array} Returns the new filtered array.
  4369. */
  4370. function baseFilter(collection, predicate) {
  4371. var result = [];
  4372. baseEach(collection, function(value, index, collection) {
  4373. if (predicate(value, index, collection)) {
  4374. result.push(value);
  4375. }
  4376. });
  4377. return result;
  4378. }
  4379. /**
  4380. * The base implementation of `_.flatten` with support for restricting flattening.
  4381. *
  4382. * @private
  4383. * @param {Array} array The array to flatten.
  4384. * @param {number} depth The maximum recursion depth.
  4385. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4386. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4387. * @param {Array} [result=[]] The initial result value.
  4388. * @returns {Array} Returns the new flattened array.
  4389. */
  4390. function baseFlatten(array, depth, predicate, isStrict, result) {
  4391. var index = -1,
  4392. length = array.length;
  4393. predicate || (predicate = isFlattenable);
  4394. result || (result = []);
  4395. while (++index < length) {
  4396. var value = array[index];
  4397. if (depth > 0 && predicate(value)) {
  4398. if (depth > 1) {
  4399. // Recursively flatten arrays (susceptible to call stack limits).
  4400. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4401. } else {
  4402. arrayPush(result, value);
  4403. }
  4404. } else if (!isStrict) {
  4405. result[result.length] = value;
  4406. }
  4407. }
  4408. return result;
  4409. }
  4410. /**
  4411. * The base implementation of `baseForOwn` which iterates over `object`
  4412. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4413. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4414. *
  4415. * @private
  4416. * @param {Object} object The object to iterate over.
  4417. * @param {Function} iteratee The function invoked per iteration.
  4418. * @param {Function} keysFunc The function to get the keys of `object`.
  4419. * @returns {Object} Returns `object`.
  4420. */
  4421. var baseFor = createBaseFor();
  4422. /**
  4423. * This function is like `baseFor` except that it iterates over properties
  4424. * in the opposite order.
  4425. *
  4426. * @private
  4427. * @param {Object} object The object to iterate over.
  4428. * @param {Function} iteratee The function invoked per iteration.
  4429. * @param {Function} keysFunc The function to get the keys of `object`.
  4430. * @returns {Object} Returns `object`.
  4431. */
  4432. var baseForRight = createBaseFor(true);
  4433. /**
  4434. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4435. *
  4436. * @private
  4437. * @param {Object} object The object to iterate over.
  4438. * @param {Function} iteratee The function invoked per iteration.
  4439. * @returns {Object} Returns `object`.
  4440. */
  4441. function baseForOwn(object, iteratee) {
  4442. return object && baseFor(object, iteratee, keys);
  4443. }
  4444. /**
  4445. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4446. *
  4447. * @private
  4448. * @param {Object} object The object to iterate over.
  4449. * @param {Function} iteratee The function invoked per iteration.
  4450. * @returns {Object} Returns `object`.
  4451. */
  4452. function baseForOwnRight(object, iteratee) {
  4453. return object && baseForRight(object, iteratee, keys);
  4454. }
  4455. /**
  4456. * The base implementation of `_.functions` which creates an array of
  4457. * `object` function property names filtered from `props`.
  4458. *
  4459. * @private
  4460. * @param {Object} object The object to inspect.
  4461. * @param {Array} props The property names to filter.
  4462. * @returns {Array} Returns the function names.
  4463. */
  4464. function baseFunctions(object, props) {
  4465. return arrayFilter(props, function(key) {
  4466. return isFunction(object[key]);
  4467. });
  4468. }
  4469. /**
  4470. * The base implementation of `_.get` without support for default values.
  4471. *
  4472. * @private
  4473. * @param {Object} object The object to query.
  4474. * @param {Array|string} path The path of the property to get.
  4475. * @returns {*} Returns the resolved value.
  4476. */
  4477. function baseGet(object, path) {
  4478. path = castPath(path, object);
  4479. var index = 0,
  4480. length = path.length;
  4481. while (object != null && index < length) {
  4482. object = object[toKey(path[index++])];
  4483. }
  4484. return (index && index == length) ? object : undefined;
  4485. }
  4486. /**
  4487. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4488. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4489. * symbols of `object`.
  4490. *
  4491. * @private
  4492. * @param {Object} object The object to query.
  4493. * @param {Function} keysFunc The function to get the keys of `object`.
  4494. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4495. * @returns {Array} Returns the array of property names and symbols.
  4496. */
  4497. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4498. var result = keysFunc(object);
  4499. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4500. }
  4501. /**
  4502. * The base implementation of `getTag` without fallbacks for buggy environments.
  4503. *
  4504. * @private
  4505. * @param {*} value The value to query.
  4506. * @returns {string} Returns the `toStringTag`.
  4507. */
  4508. function baseGetTag(value) {
  4509. if (value == null) {
  4510. return value === undefined ? undefinedTag : nullTag;
  4511. }
  4512. return (symToStringTag && symToStringTag in Object(value))
  4513. ? getRawTag(value)
  4514. : objectToString(value);
  4515. }
  4516. /**
  4517. * The base implementation of `_.gt` which doesn't coerce arguments.
  4518. *
  4519. * @private
  4520. * @param {*} value The value to compare.
  4521. * @param {*} other The other value to compare.
  4522. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4523. * else `false`.
  4524. */
  4525. function baseGt(value, other) {
  4526. return value > other;
  4527. }
  4528. /**
  4529. * The base implementation of `_.has` without support for deep paths.
  4530. *
  4531. * @private
  4532. * @param {Object} [object] The object to query.
  4533. * @param {Array|string} key The key to check.
  4534. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4535. */
  4536. function baseHas(object, key) {
  4537. return object != null && hasOwnProperty.call(object, key);
  4538. }
  4539. /**
  4540. * The base implementation of `_.hasIn` without support for deep paths.
  4541. *
  4542. * @private
  4543. * @param {Object} [object] The object to query.
  4544. * @param {Array|string} key The key to check.
  4545. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4546. */
  4547. function baseHasIn(object, key) {
  4548. return object != null && key in Object(object);
  4549. }
  4550. /**
  4551. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4552. *
  4553. * @private
  4554. * @param {number} number The number to check.
  4555. * @param {number} start The start of the range.
  4556. * @param {number} end The end of the range.
  4557. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4558. */
  4559. function baseInRange(number, start, end) {
  4560. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4561. }
  4562. /**
  4563. * The base implementation of methods like `_.intersection`, without support
  4564. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4565. *
  4566. * @private
  4567. * @param {Array} arrays The arrays to inspect.
  4568. * @param {Function} [iteratee] The iteratee invoked per element.
  4569. * @param {Function} [comparator] The comparator invoked per element.
  4570. * @returns {Array} Returns the new array of shared values.
  4571. */
  4572. function baseIntersection(arrays, iteratee, comparator) {
  4573. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4574. length = arrays[0].length,
  4575. othLength = arrays.length,
  4576. othIndex = othLength,
  4577. caches = Array(othLength),
  4578. maxLength = Infinity,
  4579. result = [];
  4580. while (othIndex--) {
  4581. var array = arrays[othIndex];
  4582. if (othIndex && iteratee) {
  4583. array = arrayMap(array, baseUnary(iteratee));
  4584. }
  4585. maxLength = nativeMin(array.length, maxLength);
  4586. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4587. ? new SetCache(othIndex && array)
  4588. : undefined;
  4589. }
  4590. array = arrays[0];
  4591. var index = -1,
  4592. seen = caches[0];
  4593. outer:
  4594. while (++index < length && result.length < maxLength) {
  4595. var value = array[index],
  4596. computed = iteratee ? iteratee(value) : value;
  4597. value = (comparator || value !== 0) ? value : 0;
  4598. if (!(seen
  4599. ? cacheHas(seen, computed)
  4600. : includes(result, computed, comparator)
  4601. )) {
  4602. othIndex = othLength;
  4603. while (--othIndex) {
  4604. var cache = caches[othIndex];
  4605. if (!(cache
  4606. ? cacheHas(cache, computed)
  4607. : includes(arrays[othIndex], computed, comparator))
  4608. ) {
  4609. continue outer;
  4610. }
  4611. }
  4612. if (seen) {
  4613. seen.push(computed);
  4614. }
  4615. result.push(value);
  4616. }
  4617. }
  4618. return result;
  4619. }
  4620. /**
  4621. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4622. * `object` with values transformed by `iteratee` and set by `setter`.
  4623. *
  4624. * @private
  4625. * @param {Object} object The object to iterate over.
  4626. * @param {Function} setter The function to set `accumulator` values.
  4627. * @param {Function} iteratee The iteratee to transform values.
  4628. * @param {Object} accumulator The initial inverted object.
  4629. * @returns {Function} Returns `accumulator`.
  4630. */
  4631. function baseInverter(object, setter, iteratee, accumulator) {
  4632. baseForOwn(object, function(value, key, object) {
  4633. setter(accumulator, iteratee(value), key, object);
  4634. });
  4635. return accumulator;
  4636. }
  4637. /**
  4638. * The base implementation of `_.invoke` without support for individual
  4639. * method arguments.
  4640. *
  4641. * @private
  4642. * @param {Object} object The object to query.
  4643. * @param {Array|string} path The path of the method to invoke.
  4644. * @param {Array} args The arguments to invoke the method with.
  4645. * @returns {*} Returns the result of the invoked method.
  4646. */
  4647. function baseInvoke(object, path, args) {
  4648. path = castPath(path, object);
  4649. object = parent(object, path);
  4650. var func = object == null ? object : object[toKey(last(path))];
  4651. return func == null ? undefined : apply(func, object, args);
  4652. }
  4653. /**
  4654. * The base implementation of `_.isArguments`.
  4655. *
  4656. * @private
  4657. * @param {*} value The value to check.
  4658. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4659. */
  4660. function baseIsArguments(value) {
  4661. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4662. }
  4663. /**
  4664. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4665. *
  4666. * @private
  4667. * @param {*} value The value to check.
  4668. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4669. */
  4670. function baseIsArrayBuffer(value) {
  4671. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4672. }
  4673. /**
  4674. * The base implementation of `_.isDate` without Node.js optimizations.
  4675. *
  4676. * @private
  4677. * @param {*} value The value to check.
  4678. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4679. */
  4680. function baseIsDate(value) {
  4681. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4682. }
  4683. /**
  4684. * The base implementation of `_.isEqual` which supports partial comparisons
  4685. * and tracks traversed objects.
  4686. *
  4687. * @private
  4688. * @param {*} value The value to compare.
  4689. * @param {*} other The other value to compare.
  4690. * @param {boolean} bitmask The bitmask flags.
  4691. * 1 - Unordered comparison
  4692. * 2 - Partial comparison
  4693. * @param {Function} [customizer] The function to customize comparisons.
  4694. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4695. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4696. */
  4697. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4698. if (value === other) {
  4699. return true;
  4700. }
  4701. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4702. return value !== value && other !== other;
  4703. }
  4704. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4705. }
  4706. /**
  4707. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4708. * deep comparisons and tracks traversed objects enabling objects with circular
  4709. * references to be compared.
  4710. *
  4711. * @private
  4712. * @param {Object} object The object to compare.
  4713. * @param {Object} other The other object to compare.
  4714. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4715. * @param {Function} customizer The function to customize comparisons.
  4716. * @param {Function} equalFunc The function to determine equivalents of values.
  4717. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4718. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4719. */
  4720. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4721. var objIsArr = isArray(object),
  4722. othIsArr = isArray(other),
  4723. objTag = objIsArr ? arrayTag : getTag(object),
  4724. othTag = othIsArr ? arrayTag : getTag(other);
  4725. objTag = objTag == argsTag ? objectTag : objTag;
  4726. othTag = othTag == argsTag ? objectTag : othTag;
  4727. var objIsObj = objTag == objectTag,
  4728. othIsObj = othTag == objectTag,
  4729. isSameTag = objTag == othTag;
  4730. if (isSameTag && isBuffer(object)) {
  4731. if (!isBuffer(other)) {
  4732. return false;
  4733. }
  4734. objIsArr = true;
  4735. objIsObj = false;
  4736. }
  4737. if (isSameTag && !objIsObj) {
  4738. stack || (stack = new Stack);
  4739. return (objIsArr || isTypedArray(object))
  4740. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4741. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4742. }
  4743. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4744. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4745. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4746. if (objIsWrapped || othIsWrapped) {
  4747. var objUnwrapped = objIsWrapped ? object.value() : object,
  4748. othUnwrapped = othIsWrapped ? other.value() : other;
  4749. stack || (stack = new Stack);
  4750. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4751. }
  4752. }
  4753. if (!isSameTag) {
  4754. return false;
  4755. }
  4756. stack || (stack = new Stack);
  4757. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4758. }
  4759. /**
  4760. * The base implementation of `_.isMap` without Node.js optimizations.
  4761. *
  4762. * @private
  4763. * @param {*} value The value to check.
  4764. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4765. */
  4766. function baseIsMap(value) {
  4767. return isObjectLike(value) && getTag(value) == mapTag;
  4768. }
  4769. /**
  4770. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4771. *
  4772. * @private
  4773. * @param {Object} object The object to inspect.
  4774. * @param {Object} source The object of property values to match.
  4775. * @param {Array} matchData The property names, values, and compare flags to match.
  4776. * @param {Function} [customizer] The function to customize comparisons.
  4777. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4778. */
  4779. function baseIsMatch(object, source, matchData, customizer) {
  4780. var index = matchData.length,
  4781. length = index,
  4782. noCustomizer = !customizer;
  4783. if (object == null) {
  4784. return !length;
  4785. }
  4786. object = Object(object);
  4787. while (index--) {
  4788. var data = matchData[index];
  4789. if ((noCustomizer && data[2])
  4790. ? data[1] !== object[data[0]]
  4791. : !(data[0] in object)
  4792. ) {
  4793. return false;
  4794. }
  4795. }
  4796. while (++index < length) {
  4797. data = matchData[index];
  4798. var key = data[0],
  4799. objValue = object[key],
  4800. srcValue = data[1];
  4801. if (noCustomizer && data[2]) {
  4802. if (objValue === undefined && !(key in object)) {
  4803. return false;
  4804. }
  4805. } else {
  4806. var stack = new Stack;
  4807. if (customizer) {
  4808. var result = customizer(objValue, srcValue, key, object, source, stack);
  4809. }
  4810. if (!(result === undefined
  4811. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4812. : result
  4813. )) {
  4814. return false;
  4815. }
  4816. }
  4817. }
  4818. return true;
  4819. }
  4820. /**
  4821. * The base implementation of `_.isNative` without bad shim checks.
  4822. *
  4823. * @private
  4824. * @param {*} value The value to check.
  4825. * @returns {boolean} Returns `true` if `value` is a native function,
  4826. * else `false`.
  4827. */
  4828. function baseIsNative(value) {
  4829. if (!isObject(value) || isMasked(value)) {
  4830. return false;
  4831. }
  4832. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4833. return pattern.test(toSource(value));
  4834. }
  4835. /**
  4836. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4837. *
  4838. * @private
  4839. * @param {*} value The value to check.
  4840. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4841. */
  4842. function baseIsRegExp(value) {
  4843. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4844. }
  4845. /**
  4846. * The base implementation of `_.isSet` without Node.js optimizations.
  4847. *
  4848. * @private
  4849. * @param {*} value The value to check.
  4850. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4851. */
  4852. function baseIsSet(value) {
  4853. return isObjectLike(value) && getTag(value) == setTag;
  4854. }
  4855. /**
  4856. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4857. *
  4858. * @private
  4859. * @param {*} value The value to check.
  4860. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4861. */
  4862. function baseIsTypedArray(value) {
  4863. return isObjectLike(value) &&
  4864. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4865. }
  4866. /**
  4867. * The base implementation of `_.iteratee`.
  4868. *
  4869. * @private
  4870. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4871. * @returns {Function} Returns the iteratee.
  4872. */
  4873. function baseIteratee(value) {
  4874. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4875. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4876. if (typeof value == 'function') {
  4877. return value;
  4878. }
  4879. if (value == null) {
  4880. return identity;
  4881. }
  4882. if (typeof value == 'object') {
  4883. return isArray(value)
  4884. ? baseMatchesProperty(value[0], value[1])
  4885. : baseMatches(value);
  4886. }
  4887. return property(value);
  4888. }
  4889. /**
  4890. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4891. *
  4892. * @private
  4893. * @param {Object} object The object to query.
  4894. * @returns {Array} Returns the array of property names.
  4895. */
  4896. function baseKeys(object) {
  4897. if (!isPrototype(object)) {
  4898. return nativeKeys(object);
  4899. }
  4900. var result = [];
  4901. for (var key in Object(object)) {
  4902. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4903. result.push(key);
  4904. }
  4905. }
  4906. return result;
  4907. }
  4908. /**
  4909. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4910. *
  4911. * @private
  4912. * @param {Object} object The object to query.
  4913. * @returns {Array} Returns the array of property names.
  4914. */
  4915. function baseKeysIn(object) {
  4916. if (!isObject(object)) {
  4917. return nativeKeysIn(object);
  4918. }
  4919. var isProto = isPrototype(object),
  4920. result = [];
  4921. for (var key in object) {
  4922. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4923. result.push(key);
  4924. }
  4925. }
  4926. return result;
  4927. }
  4928. /**
  4929. * The base implementation of `_.lt` which doesn't coerce arguments.
  4930. *
  4931. * @private
  4932. * @param {*} value The value to compare.
  4933. * @param {*} other The other value to compare.
  4934. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4935. * else `false`.
  4936. */
  4937. function baseLt(value, other) {
  4938. return value < other;
  4939. }
  4940. /**
  4941. * The base implementation of `_.map` without support for iteratee shorthands.
  4942. *
  4943. * @private
  4944. * @param {Array|Object} collection The collection to iterate over.
  4945. * @param {Function} iteratee The function invoked per iteration.
  4946. * @returns {Array} Returns the new mapped array.
  4947. */
  4948. function baseMap(collection, iteratee) {
  4949. var index = -1,
  4950. result = isArrayLike(collection) ? Array(collection.length) : [];
  4951. baseEach(collection, function(value, key, collection) {
  4952. result[++index] = iteratee(value, key, collection);
  4953. });
  4954. return result;
  4955. }
  4956. /**
  4957. * The base implementation of `_.matches` which doesn't clone `source`.
  4958. *
  4959. * @private
  4960. * @param {Object} source The object of property values to match.
  4961. * @returns {Function} Returns the new spec function.
  4962. */
  4963. function baseMatches(source) {
  4964. var matchData = getMatchData(source);
  4965. if (matchData.length == 1 && matchData[0][2]) {
  4966. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4967. }
  4968. return function(object) {
  4969. return object === source || baseIsMatch(object, source, matchData);
  4970. };
  4971. }
  4972. /**
  4973. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4974. *
  4975. * @private
  4976. * @param {string} path The path of the property to get.
  4977. * @param {*} srcValue The value to match.
  4978. * @returns {Function} Returns the new spec function.
  4979. */
  4980. function baseMatchesProperty(path, srcValue) {
  4981. if (isKey(path) && isStrictComparable(srcValue)) {
  4982. return matchesStrictComparable(toKey(path), srcValue);
  4983. }
  4984. return function(object) {
  4985. var objValue = get(object, path);
  4986. return (objValue === undefined && objValue === srcValue)
  4987. ? hasIn(object, path)
  4988. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4989. };
  4990. }
  4991. /**
  4992. * The base implementation of `_.merge` without support for multiple sources.
  4993. *
  4994. * @private
  4995. * @param {Object} object The destination object.
  4996. * @param {Object} source The source object.
  4997. * @param {number} srcIndex The index of `source`.
  4998. * @param {Function} [customizer] The function to customize merged values.
  4999. * @param {Object} [stack] Tracks traversed source values and their merged
  5000. * counterparts.
  5001. */
  5002. function baseMerge(object, source, srcIndex, customizer, stack) {
  5003. if (object === source) {
  5004. return;
  5005. }
  5006. baseFor(source, function(srcValue, key) {
  5007. stack || (stack = new Stack);
  5008. if (isObject(srcValue)) {
  5009. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  5010. }
  5011. else {
  5012. var newValue = customizer
  5013. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  5014. : undefined;
  5015. if (newValue === undefined) {
  5016. newValue = srcValue;
  5017. }
  5018. assignMergeValue(object, key, newValue);
  5019. }
  5020. }, keysIn);
  5021. }
  5022. /**
  5023. * A specialized version of `baseMerge` for arrays and objects which performs
  5024. * deep merges and tracks traversed objects enabling objects with circular
  5025. * references to be merged.
  5026. *
  5027. * @private
  5028. * @param {Object} object The destination object.
  5029. * @param {Object} source The source object.
  5030. * @param {string} key The key of the value to merge.
  5031. * @param {number} srcIndex The index of `source`.
  5032. * @param {Function} mergeFunc The function to merge values.
  5033. * @param {Function} [customizer] The function to customize assigned values.
  5034. * @param {Object} [stack] Tracks traversed source values and their merged
  5035. * counterparts.
  5036. */
  5037. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  5038. var objValue = safeGet(object, key),
  5039. srcValue = safeGet(source, key),
  5040. stacked = stack.get(srcValue);
  5041. if (stacked) {
  5042. assignMergeValue(object, key, stacked);
  5043. return;
  5044. }
  5045. var newValue = customizer
  5046. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  5047. : undefined;
  5048. var isCommon = newValue === undefined;
  5049. if (isCommon) {
  5050. var isArr = isArray(srcValue),
  5051. isBuff = !isArr && isBuffer(srcValue),
  5052. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  5053. newValue = srcValue;
  5054. if (isArr || isBuff || isTyped) {
  5055. if (isArray(objValue)) {
  5056. newValue = objValue;
  5057. }
  5058. else if (isArrayLikeObject(objValue)) {
  5059. newValue = copyArray(objValue);
  5060. }
  5061. else if (isBuff) {
  5062. isCommon = false;
  5063. newValue = cloneBuffer(srcValue, true);
  5064. }
  5065. else if (isTyped) {
  5066. isCommon = false;
  5067. newValue = cloneTypedArray(srcValue, true);
  5068. }
  5069. else {
  5070. newValue = [];
  5071. }
  5072. }
  5073. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  5074. newValue = objValue;
  5075. if (isArguments(objValue)) {
  5076. newValue = toPlainObject(objValue);
  5077. }
  5078. else if (!isObject(objValue) || isFunction(objValue)) {
  5079. newValue = initCloneObject(srcValue);
  5080. }
  5081. }
  5082. else {
  5083. isCommon = false;
  5084. }
  5085. }
  5086. if (isCommon) {
  5087. // Recursively merge objects and arrays (susceptible to call stack limits).
  5088. stack.set(srcValue, newValue);
  5089. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  5090. stack['delete'](srcValue);
  5091. }
  5092. assignMergeValue(object, key, newValue);
  5093. }
  5094. /**
  5095. * The base implementation of `_.nth` which doesn't coerce arguments.
  5096. *
  5097. * @private
  5098. * @param {Array} array The array to query.
  5099. * @param {number} n The index of the element to return.
  5100. * @returns {*} Returns the nth element of `array`.
  5101. */
  5102. function baseNth(array, n) {
  5103. var length = array.length;
  5104. if (!length) {
  5105. return;
  5106. }
  5107. n += n < 0 ? length : 0;
  5108. return isIndex(n, length) ? array[n] : undefined;
  5109. }
  5110. /**
  5111. * The base implementation of `_.orderBy` without param guards.
  5112. *
  5113. * @private
  5114. * @param {Array|Object} collection The collection to iterate over.
  5115. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  5116. * @param {string[]} orders The sort orders of `iteratees`.
  5117. * @returns {Array} Returns the new sorted array.
  5118. */
  5119. function baseOrderBy(collection, iteratees, orders) {
  5120. if (iteratees.length) {
  5121. iteratees = arrayMap(iteratees, function(iteratee) {
  5122. if (isArray(iteratee)) {
  5123. return function(value) {
  5124. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  5125. }
  5126. }
  5127. return iteratee;
  5128. });
  5129. } else {
  5130. iteratees = [identity];
  5131. }
  5132. var index = -1;
  5133. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5134. var result = baseMap(collection, function(value, key, collection) {
  5135. var criteria = arrayMap(iteratees, function(iteratee) {
  5136. return iteratee(value);
  5137. });
  5138. return { 'criteria': criteria, 'index': ++index, 'value': value };
  5139. });
  5140. return baseSortBy(result, function(object, other) {
  5141. return compareMultiple(object, other, orders);
  5142. });
  5143. }
  5144. /**
  5145. * The base implementation of `_.pick` without support for individual
  5146. * property identifiers.
  5147. *
  5148. * @private
  5149. * @param {Object} object The source object.
  5150. * @param {string[]} paths The property paths to pick.
  5151. * @returns {Object} Returns the new object.
  5152. */
  5153. function basePick(object, paths) {
  5154. return basePickBy(object, paths, function(value, path) {
  5155. return hasIn(object, path);
  5156. });
  5157. }
  5158. /**
  5159. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5160. *
  5161. * @private
  5162. * @param {Object} object The source object.
  5163. * @param {string[]} paths The property paths to pick.
  5164. * @param {Function} predicate The function invoked per property.
  5165. * @returns {Object} Returns the new object.
  5166. */
  5167. function basePickBy(object, paths, predicate) {
  5168. var index = -1,
  5169. length = paths.length,
  5170. result = {};
  5171. while (++index < length) {
  5172. var path = paths[index],
  5173. value = baseGet(object, path);
  5174. if (predicate(value, path)) {
  5175. baseSet(result, castPath(path, object), value);
  5176. }
  5177. }
  5178. return result;
  5179. }
  5180. /**
  5181. * A specialized version of `baseProperty` which supports deep paths.
  5182. *
  5183. * @private
  5184. * @param {Array|string} path The path of the property to get.
  5185. * @returns {Function} Returns the new accessor function.
  5186. */
  5187. function basePropertyDeep(path) {
  5188. return function(object) {
  5189. return baseGet(object, path);
  5190. };
  5191. }
  5192. /**
  5193. * The base implementation of `_.pullAllBy` without support for iteratee
  5194. * shorthands.
  5195. *
  5196. * @private
  5197. * @param {Array} array The array to modify.
  5198. * @param {Array} values The values to remove.
  5199. * @param {Function} [iteratee] The iteratee invoked per element.
  5200. * @param {Function} [comparator] The comparator invoked per element.
  5201. * @returns {Array} Returns `array`.
  5202. */
  5203. function basePullAll(array, values, iteratee, comparator) {
  5204. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  5205. index = -1,
  5206. length = values.length,
  5207. seen = array;
  5208. if (array === values) {
  5209. values = copyArray(values);
  5210. }
  5211. if (iteratee) {
  5212. seen = arrayMap(array, baseUnary(iteratee));
  5213. }
  5214. while (++index < length) {
  5215. var fromIndex = 0,
  5216. value = values[index],
  5217. computed = iteratee ? iteratee(value) : value;
  5218. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  5219. if (seen !== array) {
  5220. splice.call(seen, fromIndex, 1);
  5221. }
  5222. splice.call(array, fromIndex, 1);
  5223. }
  5224. }
  5225. return array;
  5226. }
  5227. /**
  5228. * The base implementation of `_.pullAt` without support for individual
  5229. * indexes or capturing the removed elements.
  5230. *
  5231. * @private
  5232. * @param {Array} array The array to modify.
  5233. * @param {number[]} indexes The indexes of elements to remove.
  5234. * @returns {Array} Returns `array`.
  5235. */
  5236. function basePullAt(array, indexes) {
  5237. var length = array ? indexes.length : 0,
  5238. lastIndex = length - 1;
  5239. while (length--) {
  5240. var index = indexes[length];
  5241. if (length == lastIndex || index !== previous) {
  5242. var previous = index;
  5243. if (isIndex(index)) {
  5244. splice.call(array, index, 1);
  5245. } else {
  5246. baseUnset(array, index);
  5247. }
  5248. }
  5249. }
  5250. return array;
  5251. }
  5252. /**
  5253. * The base implementation of `_.random` without support for returning
  5254. * floating-point numbers.
  5255. *
  5256. * @private
  5257. * @param {number} lower The lower bound.
  5258. * @param {number} upper The upper bound.
  5259. * @returns {number} Returns the random number.
  5260. */
  5261. function baseRandom(lower, upper) {
  5262. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  5263. }
  5264. /**
  5265. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  5266. * coerce arguments.
  5267. *
  5268. * @private
  5269. * @param {number} start The start of the range.
  5270. * @param {number} end The end of the range.
  5271. * @param {number} step The value to increment or decrement by.
  5272. * @param {boolean} [fromRight] Specify iterating from right to left.
  5273. * @returns {Array} Returns the range of numbers.
  5274. */
  5275. function baseRange(start, end, step, fromRight) {
  5276. var index = -1,
  5277. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  5278. result = Array(length);
  5279. while (length--) {
  5280. result[fromRight ? length : ++index] = start;
  5281. start += step;
  5282. }
  5283. return result;
  5284. }
  5285. /**
  5286. * The base implementation of `_.repeat` which doesn't coerce arguments.
  5287. *
  5288. * @private
  5289. * @param {string} string The string to repeat.
  5290. * @param {number} n The number of times to repeat the string.
  5291. * @returns {string} Returns the repeated string.
  5292. */
  5293. function baseRepeat(string, n) {
  5294. var result = '';
  5295. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  5296. return result;
  5297. }
  5298. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  5299. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  5300. do {
  5301. if (n % 2) {
  5302. result += string;
  5303. }
  5304. n = nativeFloor(n / 2);
  5305. if (n) {
  5306. string += string;
  5307. }
  5308. } while (n);
  5309. return result;
  5310. }
  5311. /**
  5312. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  5313. *
  5314. * @private
  5315. * @param {Function} func The function to apply a rest parameter to.
  5316. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5317. * @returns {Function} Returns the new function.
  5318. */
  5319. function baseRest(func, start) {
  5320. return setToString(overRest(func, start, identity), func + '');
  5321. }
  5322. /**
  5323. * The base implementation of `_.sample`.
  5324. *
  5325. * @private
  5326. * @param {Array|Object} collection The collection to sample.
  5327. * @returns {*} Returns the random element.
  5328. */
  5329. function baseSample(collection) {
  5330. return arraySample(values(collection));
  5331. }
  5332. /**
  5333. * The base implementation of `_.sampleSize` without param guards.
  5334. *
  5335. * @private
  5336. * @param {Array|Object} collection The collection to sample.
  5337. * @param {number} n The number of elements to sample.
  5338. * @returns {Array} Returns the random elements.
  5339. */
  5340. function baseSampleSize(collection, n) {
  5341. var array = values(collection);
  5342. return shuffleSelf(array, baseClamp(n, 0, array.length));
  5343. }
  5344. /**
  5345. * The base implementation of `_.set`.
  5346. *
  5347. * @private
  5348. * @param {Object} object The object to modify.
  5349. * @param {Array|string} path The path of the property to set.
  5350. * @param {*} value The value to set.
  5351. * @param {Function} [customizer] The function to customize path creation.
  5352. * @returns {Object} Returns `object`.
  5353. */
  5354. function baseSet(object, path, value, customizer) {
  5355. if (!isObject(object)) {
  5356. return object;
  5357. }
  5358. path = castPath(path, object);
  5359. var index = -1,
  5360. length = path.length,
  5361. lastIndex = length - 1,
  5362. nested = object;
  5363. while (nested != null && ++index < length) {
  5364. var key = toKey(path[index]),
  5365. newValue = value;
  5366. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  5367. return object;
  5368. }
  5369. if (index != lastIndex) {
  5370. var objValue = nested[key];
  5371. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5372. if (newValue === undefined) {
  5373. newValue = isObject(objValue)
  5374. ? objValue
  5375. : (isIndex(path[index + 1]) ? [] : {});
  5376. }
  5377. }
  5378. assignValue(nested, key, newValue);
  5379. nested = nested[key];
  5380. }
  5381. return object;
  5382. }
  5383. /**
  5384. * The base implementation of `setData` without support for hot loop shorting.
  5385. *
  5386. * @private
  5387. * @param {Function} func The function to associate metadata with.
  5388. * @param {*} data The metadata.
  5389. * @returns {Function} Returns `func`.
  5390. */
  5391. var baseSetData = !metaMap ? identity : function(func, data) {
  5392. metaMap.set(func, data);
  5393. return func;
  5394. };
  5395. /**
  5396. * The base implementation of `setToString` without support for hot loop shorting.
  5397. *
  5398. * @private
  5399. * @param {Function} func The function to modify.
  5400. * @param {Function} string The `toString` result.
  5401. * @returns {Function} Returns `func`.
  5402. */
  5403. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5404. return defineProperty(func, 'toString', {
  5405. 'configurable': true,
  5406. 'enumerable': false,
  5407. 'value': constant(string),
  5408. 'writable': true
  5409. });
  5410. };
  5411. /**
  5412. * The base implementation of `_.shuffle`.
  5413. *
  5414. * @private
  5415. * @param {Array|Object} collection The collection to shuffle.
  5416. * @returns {Array} Returns the new shuffled array.
  5417. */
  5418. function baseShuffle(collection) {
  5419. return shuffleSelf(values(collection));
  5420. }
  5421. /**
  5422. * The base implementation of `_.slice` without an iteratee call guard.
  5423. *
  5424. * @private
  5425. * @param {Array} array The array to slice.
  5426. * @param {number} [start=0] The start position.
  5427. * @param {number} [end=array.length] The end position.
  5428. * @returns {Array} Returns the slice of `array`.
  5429. */
  5430. function baseSlice(array, start, end) {
  5431. var index = -1,
  5432. length = array.length;
  5433. if (start < 0) {
  5434. start = -start > length ? 0 : (length + start);
  5435. }
  5436. end = end > length ? length : end;
  5437. if (end < 0) {
  5438. end += length;
  5439. }
  5440. length = start > end ? 0 : ((end - start) >>> 0);
  5441. start >>>= 0;
  5442. var result = Array(length);
  5443. while (++index < length) {
  5444. result[index] = array[index + start];
  5445. }
  5446. return result;
  5447. }
  5448. /**
  5449. * The base implementation of `_.some` without support for iteratee shorthands.
  5450. *
  5451. * @private
  5452. * @param {Array|Object} collection The collection to iterate over.
  5453. * @param {Function} predicate The function invoked per iteration.
  5454. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5455. * else `false`.
  5456. */
  5457. function baseSome(collection, predicate) {
  5458. var result;
  5459. baseEach(collection, function(value, index, collection) {
  5460. result = predicate(value, index, collection);
  5461. return !result;
  5462. });
  5463. return !!result;
  5464. }
  5465. /**
  5466. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5467. * performs a binary search of `array` to determine the index at which `value`
  5468. * should be inserted into `array` in order to maintain its sort order.
  5469. *
  5470. * @private
  5471. * @param {Array} array The sorted array to inspect.
  5472. * @param {*} value The value to evaluate.
  5473. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5474. * @returns {number} Returns the index at which `value` should be inserted
  5475. * into `array`.
  5476. */
  5477. function baseSortedIndex(array, value, retHighest) {
  5478. var low = 0,
  5479. high = array == null ? low : array.length;
  5480. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5481. while (low < high) {
  5482. var mid = (low + high) >>> 1,
  5483. computed = array[mid];
  5484. if (computed !== null && !isSymbol(computed) &&
  5485. (retHighest ? (computed <= value) : (computed < value))) {
  5486. low = mid + 1;
  5487. } else {
  5488. high = mid;
  5489. }
  5490. }
  5491. return high;
  5492. }
  5493. return baseSortedIndexBy(array, value, identity, retHighest);
  5494. }
  5495. /**
  5496. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5497. * which invokes `iteratee` for `value` and each element of `array` to compute
  5498. * their sort ranking. The iteratee is invoked with one argument; (value).
  5499. *
  5500. * @private
  5501. * @param {Array} array The sorted array to inspect.
  5502. * @param {*} value The value to evaluate.
  5503. * @param {Function} iteratee The iteratee invoked per element.
  5504. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5505. * @returns {number} Returns the index at which `value` should be inserted
  5506. * into `array`.
  5507. */
  5508. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5509. var low = 0,
  5510. high = array == null ? 0 : array.length;
  5511. if (high === 0) {
  5512. return 0;
  5513. }
  5514. value = iteratee(value);
  5515. var valIsNaN = value !== value,
  5516. valIsNull = value === null,
  5517. valIsSymbol = isSymbol(value),
  5518. valIsUndefined = value === undefined;
  5519. while (low < high) {
  5520. var mid = nativeFloor((low + high) / 2),
  5521. computed = iteratee(array[mid]),
  5522. othIsDefined = computed !== undefined,
  5523. othIsNull = computed === null,
  5524. othIsReflexive = computed === computed,
  5525. othIsSymbol = isSymbol(computed);
  5526. if (valIsNaN) {
  5527. var setLow = retHighest || othIsReflexive;
  5528. } else if (valIsUndefined) {
  5529. setLow = othIsReflexive && (retHighest || othIsDefined);
  5530. } else if (valIsNull) {
  5531. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5532. } else if (valIsSymbol) {
  5533. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5534. } else if (othIsNull || othIsSymbol) {
  5535. setLow = false;
  5536. } else {
  5537. setLow = retHighest ? (computed <= value) : (computed < value);
  5538. }
  5539. if (setLow) {
  5540. low = mid + 1;
  5541. } else {
  5542. high = mid;
  5543. }
  5544. }
  5545. return nativeMin(high, MAX_ARRAY_INDEX);
  5546. }
  5547. /**
  5548. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5549. * support for iteratee shorthands.
  5550. *
  5551. * @private
  5552. * @param {Array} array The array to inspect.
  5553. * @param {Function} [iteratee] The iteratee invoked per element.
  5554. * @returns {Array} Returns the new duplicate free array.
  5555. */
  5556. function baseSortedUniq(array, iteratee) {
  5557. var index = -1,
  5558. length = array.length,
  5559. resIndex = 0,
  5560. result = [];
  5561. while (++index < length) {
  5562. var value = array[index],
  5563. computed = iteratee ? iteratee(value) : value;
  5564. if (!index || !eq(computed, seen)) {
  5565. var seen = computed;
  5566. result[resIndex++] = value === 0 ? 0 : value;
  5567. }
  5568. }
  5569. return result;
  5570. }
  5571. /**
  5572. * The base implementation of `_.toNumber` which doesn't ensure correct
  5573. * conversions of binary, hexadecimal, or octal string values.
  5574. *
  5575. * @private
  5576. * @param {*} value The value to process.
  5577. * @returns {number} Returns the number.
  5578. */
  5579. function baseToNumber(value) {
  5580. if (typeof value == 'number') {
  5581. return value;
  5582. }
  5583. if (isSymbol(value)) {
  5584. return NAN;
  5585. }
  5586. return +value;
  5587. }
  5588. /**
  5589. * The base implementation of `_.toString` which doesn't convert nullish
  5590. * values to empty strings.
  5591. *
  5592. * @private
  5593. * @param {*} value The value to process.
  5594. * @returns {string} Returns the string.
  5595. */
  5596. function baseToString(value) {
  5597. // Exit early for strings to avoid a performance hit in some environments.
  5598. if (typeof value == 'string') {
  5599. return value;
  5600. }
  5601. if (isArray(value)) {
  5602. // Recursively convert values (susceptible to call stack limits).
  5603. return arrayMap(value, baseToString) + '';
  5604. }
  5605. if (isSymbol(value)) {
  5606. return symbolToString ? symbolToString.call(value) : '';
  5607. }
  5608. var result = (value + '');
  5609. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5610. }
  5611. /**
  5612. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5613. *
  5614. * @private
  5615. * @param {Array} array The array to inspect.
  5616. * @param {Function} [iteratee] The iteratee invoked per element.
  5617. * @param {Function} [comparator] The comparator invoked per element.
  5618. * @returns {Array} Returns the new duplicate free array.
  5619. */
  5620. function baseUniq(array, iteratee, comparator) {
  5621. var index = -1,
  5622. includes = arrayIncludes,
  5623. length = array.length,
  5624. isCommon = true,
  5625. result = [],
  5626. seen = result;
  5627. if (comparator) {
  5628. isCommon = false;
  5629. includes = arrayIncludesWith;
  5630. }
  5631. else if (length >= LARGE_ARRAY_SIZE) {
  5632. var set = iteratee ? null : createSet(array);
  5633. if (set) {
  5634. return setToArray(set);
  5635. }
  5636. isCommon = false;
  5637. includes = cacheHas;
  5638. seen = new SetCache;
  5639. }
  5640. else {
  5641. seen = iteratee ? [] : result;
  5642. }
  5643. outer:
  5644. while (++index < length) {
  5645. var value = array[index],
  5646. computed = iteratee ? iteratee(value) : value;
  5647. value = (comparator || value !== 0) ? value : 0;
  5648. if (isCommon && computed === computed) {
  5649. var seenIndex = seen.length;
  5650. while (seenIndex--) {
  5651. if (seen[seenIndex] === computed) {
  5652. continue outer;
  5653. }
  5654. }
  5655. if (iteratee) {
  5656. seen.push(computed);
  5657. }
  5658. result.push(value);
  5659. }
  5660. else if (!includes(seen, computed, comparator)) {
  5661. if (seen !== result) {
  5662. seen.push(computed);
  5663. }
  5664. result.push(value);
  5665. }
  5666. }
  5667. return result;
  5668. }
  5669. /**
  5670. * The base implementation of `_.unset`.
  5671. *
  5672. * @private
  5673. * @param {Object} object The object to modify.
  5674. * @param {Array|string} path The property path to unset.
  5675. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5676. */
  5677. function baseUnset(object, path) {
  5678. path = castPath(path, object);
  5679. object = parent(object, path);
  5680. return object == null || delete object[toKey(last(path))];
  5681. }
  5682. /**
  5683. * The base implementation of `_.update`.
  5684. *
  5685. * @private
  5686. * @param {Object} object The object to modify.
  5687. * @param {Array|string} path The path of the property to update.
  5688. * @param {Function} updater The function to produce the updated value.
  5689. * @param {Function} [customizer] The function to customize path creation.
  5690. * @returns {Object} Returns `object`.
  5691. */
  5692. function baseUpdate(object, path, updater, customizer) {
  5693. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5694. }
  5695. /**
  5696. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5697. * without support for iteratee shorthands.
  5698. *
  5699. * @private
  5700. * @param {Array} array The array to query.
  5701. * @param {Function} predicate The function invoked per iteration.
  5702. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5703. * @param {boolean} [fromRight] Specify iterating from right to left.
  5704. * @returns {Array} Returns the slice of `array`.
  5705. */
  5706. function baseWhile(array, predicate, isDrop, fromRight) {
  5707. var length = array.length,
  5708. index = fromRight ? length : -1;
  5709. while ((fromRight ? index-- : ++index < length) &&
  5710. predicate(array[index], index, array)) {}
  5711. return isDrop
  5712. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5713. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5714. }
  5715. /**
  5716. * The base implementation of `wrapperValue` which returns the result of
  5717. * performing a sequence of actions on the unwrapped `value`, where each
  5718. * successive action is supplied the return value of the previous.
  5719. *
  5720. * @private
  5721. * @param {*} value The unwrapped value.
  5722. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5723. * @returns {*} Returns the resolved value.
  5724. */
  5725. function baseWrapperValue(value, actions) {
  5726. var result = value;
  5727. if (result instanceof LazyWrapper) {
  5728. result = result.value();
  5729. }
  5730. return arrayReduce(actions, function(result, action) {
  5731. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5732. }, result);
  5733. }
  5734. /**
  5735. * The base implementation of methods like `_.xor`, without support for
  5736. * iteratee shorthands, that accepts an array of arrays to inspect.
  5737. *
  5738. * @private
  5739. * @param {Array} arrays The arrays to inspect.
  5740. * @param {Function} [iteratee] The iteratee invoked per element.
  5741. * @param {Function} [comparator] The comparator invoked per element.
  5742. * @returns {Array} Returns the new array of values.
  5743. */
  5744. function baseXor(arrays, iteratee, comparator) {
  5745. var length = arrays.length;
  5746. if (length < 2) {
  5747. return length ? baseUniq(arrays[0]) : [];
  5748. }
  5749. var index = -1,
  5750. result = Array(length);
  5751. while (++index < length) {
  5752. var array = arrays[index],
  5753. othIndex = -1;
  5754. while (++othIndex < length) {
  5755. if (othIndex != index) {
  5756. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5757. }
  5758. }
  5759. }
  5760. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5761. }
  5762. /**
  5763. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5764. *
  5765. * @private
  5766. * @param {Array} props The property identifiers.
  5767. * @param {Array} values The property values.
  5768. * @param {Function} assignFunc The function to assign values.
  5769. * @returns {Object} Returns the new object.
  5770. */
  5771. function baseZipObject(props, values, assignFunc) {
  5772. var index = -1,
  5773. length = props.length,
  5774. valsLength = values.length,
  5775. result = {};
  5776. while (++index < length) {
  5777. var value = index < valsLength ? values[index] : undefined;
  5778. assignFunc(result, props[index], value);
  5779. }
  5780. return result;
  5781. }
  5782. /**
  5783. * Casts `value` to an empty array if it's not an array like object.
  5784. *
  5785. * @private
  5786. * @param {*} value The value to inspect.
  5787. * @returns {Array|Object} Returns the cast array-like object.
  5788. */
  5789. function castArrayLikeObject(value) {
  5790. return isArrayLikeObject(value) ? value : [];
  5791. }
  5792. /**
  5793. * Casts `value` to `identity` if it's not a function.
  5794. *
  5795. * @private
  5796. * @param {*} value The value to inspect.
  5797. * @returns {Function} Returns cast function.
  5798. */
  5799. function castFunction(value) {
  5800. return typeof value == 'function' ? value : identity;
  5801. }
  5802. /**
  5803. * Casts `value` to a path array if it's not one.
  5804. *
  5805. * @private
  5806. * @param {*} value The value to inspect.
  5807. * @param {Object} [object] The object to query keys on.
  5808. * @returns {Array} Returns the cast property path array.
  5809. */
  5810. function castPath(value, object) {
  5811. if (isArray(value)) {
  5812. return value;
  5813. }
  5814. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5815. }
  5816. /**
  5817. * A `baseRest` alias which can be replaced with `identity` by module
  5818. * replacement plugins.
  5819. *
  5820. * @private
  5821. * @type {Function}
  5822. * @param {Function} func The function to apply a rest parameter to.
  5823. * @returns {Function} Returns the new function.
  5824. */
  5825. var castRest = baseRest;
  5826. /**
  5827. * Casts `array` to a slice if it's needed.
  5828. *
  5829. * @private
  5830. * @param {Array} array The array to inspect.
  5831. * @param {number} start The start position.
  5832. * @param {number} [end=array.length] The end position.
  5833. * @returns {Array} Returns the cast slice.
  5834. */
  5835. function castSlice(array, start, end) {
  5836. var length = array.length;
  5837. end = end === undefined ? length : end;
  5838. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5839. }
  5840. /**
  5841. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5842. *
  5843. * @private
  5844. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5845. */
  5846. var clearTimeout = ctxClearTimeout || function(id) {
  5847. return root.clearTimeout(id);
  5848. };
  5849. /**
  5850. * Creates a clone of `buffer`.
  5851. *
  5852. * @private
  5853. * @param {Buffer} buffer The buffer to clone.
  5854. * @param {boolean} [isDeep] Specify a deep clone.
  5855. * @returns {Buffer} Returns the cloned buffer.
  5856. */
  5857. function cloneBuffer(buffer, isDeep) {
  5858. if (isDeep) {
  5859. return buffer.slice();
  5860. }
  5861. var length = buffer.length,
  5862. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5863. buffer.copy(result);
  5864. return result;
  5865. }
  5866. /**
  5867. * Creates a clone of `arrayBuffer`.
  5868. *
  5869. * @private
  5870. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5871. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5872. */
  5873. function cloneArrayBuffer(arrayBuffer) {
  5874. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5875. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5876. return result;
  5877. }
  5878. /**
  5879. * Creates a clone of `dataView`.
  5880. *
  5881. * @private
  5882. * @param {Object} dataView The data view to clone.
  5883. * @param {boolean} [isDeep] Specify a deep clone.
  5884. * @returns {Object} Returns the cloned data view.
  5885. */
  5886. function cloneDataView(dataView, isDeep) {
  5887. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5888. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5889. }
  5890. /**
  5891. * Creates a clone of `regexp`.
  5892. *
  5893. * @private
  5894. * @param {Object} regexp The regexp to clone.
  5895. * @returns {Object} Returns the cloned regexp.
  5896. */
  5897. function cloneRegExp(regexp) {
  5898. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5899. result.lastIndex = regexp.lastIndex;
  5900. return result;
  5901. }
  5902. /**
  5903. * Creates a clone of the `symbol` object.
  5904. *
  5905. * @private
  5906. * @param {Object} symbol The symbol object to clone.
  5907. * @returns {Object} Returns the cloned symbol object.
  5908. */
  5909. function cloneSymbol(symbol) {
  5910. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5911. }
  5912. /**
  5913. * Creates a clone of `typedArray`.
  5914. *
  5915. * @private
  5916. * @param {Object} typedArray The typed array to clone.
  5917. * @param {boolean} [isDeep] Specify a deep clone.
  5918. * @returns {Object} Returns the cloned typed array.
  5919. */
  5920. function cloneTypedArray(typedArray, isDeep) {
  5921. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5922. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5923. }
  5924. /**
  5925. * Compares values to sort them in ascending order.
  5926. *
  5927. * @private
  5928. * @param {*} value The value to compare.
  5929. * @param {*} other The other value to compare.
  5930. * @returns {number} Returns the sort order indicator for `value`.
  5931. */
  5932. function compareAscending(value, other) {
  5933. if (value !== other) {
  5934. var valIsDefined = value !== undefined,
  5935. valIsNull = value === null,
  5936. valIsReflexive = value === value,
  5937. valIsSymbol = isSymbol(value);
  5938. var othIsDefined = other !== undefined,
  5939. othIsNull = other === null,
  5940. othIsReflexive = other === other,
  5941. othIsSymbol = isSymbol(other);
  5942. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5943. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5944. (valIsNull && othIsDefined && othIsReflexive) ||
  5945. (!valIsDefined && othIsReflexive) ||
  5946. !valIsReflexive) {
  5947. return 1;
  5948. }
  5949. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5950. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5951. (othIsNull && valIsDefined && valIsReflexive) ||
  5952. (!othIsDefined && valIsReflexive) ||
  5953. !othIsReflexive) {
  5954. return -1;
  5955. }
  5956. }
  5957. return 0;
  5958. }
  5959. /**
  5960. * Used by `_.orderBy` to compare multiple properties of a value to another
  5961. * and stable sort them.
  5962. *
  5963. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5964. * specify an order of "desc" for descending or "asc" for ascending sort order
  5965. * of corresponding values.
  5966. *
  5967. * @private
  5968. * @param {Object} object The object to compare.
  5969. * @param {Object} other The other object to compare.
  5970. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5971. * @returns {number} Returns the sort order indicator for `object`.
  5972. */
  5973. function compareMultiple(object, other, orders) {
  5974. var index = -1,
  5975. objCriteria = object.criteria,
  5976. othCriteria = other.criteria,
  5977. length = objCriteria.length,
  5978. ordersLength = orders.length;
  5979. while (++index < length) {
  5980. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5981. if (result) {
  5982. if (index >= ordersLength) {
  5983. return result;
  5984. }
  5985. var order = orders[index];
  5986. return result * (order == 'desc' ? -1 : 1);
  5987. }
  5988. }
  5989. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5990. // that causes it, under certain circumstances, to provide the same value for
  5991. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5992. // for more details.
  5993. //
  5994. // This also ensures a stable sort in V8 and other engines.
  5995. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5996. return object.index - other.index;
  5997. }
  5998. /**
  5999. * Creates an array that is the composition of partially applied arguments,
  6000. * placeholders, and provided arguments into a single array of arguments.
  6001. *
  6002. * @private
  6003. * @param {Array} args The provided arguments.
  6004. * @param {Array} partials The arguments to prepend to those provided.
  6005. * @param {Array} holders The `partials` placeholder indexes.
  6006. * @params {boolean} [isCurried] Specify composing for a curried function.
  6007. * @returns {Array} Returns the new array of composed arguments.
  6008. */
  6009. function composeArgs(args, partials, holders, isCurried) {
  6010. var argsIndex = -1,
  6011. argsLength = args.length,
  6012. holdersLength = holders.length,
  6013. leftIndex = -1,
  6014. leftLength = partials.length,
  6015. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6016. result = Array(leftLength + rangeLength),
  6017. isUncurried = !isCurried;
  6018. while (++leftIndex < leftLength) {
  6019. result[leftIndex] = partials[leftIndex];
  6020. }
  6021. while (++argsIndex < holdersLength) {
  6022. if (isUncurried || argsIndex < argsLength) {
  6023. result[holders[argsIndex]] = args[argsIndex];
  6024. }
  6025. }
  6026. while (rangeLength--) {
  6027. result[leftIndex++] = args[argsIndex++];
  6028. }
  6029. return result;
  6030. }
  6031. /**
  6032. * This function is like `composeArgs` except that the arguments composition
  6033. * is tailored for `_.partialRight`.
  6034. *
  6035. * @private
  6036. * @param {Array} args The provided arguments.
  6037. * @param {Array} partials The arguments to append to those provided.
  6038. * @param {Array} holders The `partials` placeholder indexes.
  6039. * @params {boolean} [isCurried] Specify composing for a curried function.
  6040. * @returns {Array} Returns the new array of composed arguments.
  6041. */
  6042. function composeArgsRight(args, partials, holders, isCurried) {
  6043. var argsIndex = -1,
  6044. argsLength = args.length,
  6045. holdersIndex = -1,
  6046. holdersLength = holders.length,
  6047. rightIndex = -1,
  6048. rightLength = partials.length,
  6049. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6050. result = Array(rangeLength + rightLength),
  6051. isUncurried = !isCurried;
  6052. while (++argsIndex < rangeLength) {
  6053. result[argsIndex] = args[argsIndex];
  6054. }
  6055. var offset = argsIndex;
  6056. while (++rightIndex < rightLength) {
  6057. result[offset + rightIndex] = partials[rightIndex];
  6058. }
  6059. while (++holdersIndex < holdersLength) {
  6060. if (isUncurried || argsIndex < argsLength) {
  6061. result[offset + holders[holdersIndex]] = args[argsIndex++];
  6062. }
  6063. }
  6064. return result;
  6065. }
  6066. /**
  6067. * Copies the values of `source` to `array`.
  6068. *
  6069. * @private
  6070. * @param {Array} source The array to copy values from.
  6071. * @param {Array} [array=[]] The array to copy values to.
  6072. * @returns {Array} Returns `array`.
  6073. */
  6074. function copyArray(source, array) {
  6075. var index = -1,
  6076. length = source.length;
  6077. array || (array = Array(length));
  6078. while (++index < length) {
  6079. array[index] = source[index];
  6080. }
  6081. return array;
  6082. }
  6083. /**
  6084. * Copies properties of `source` to `object`.
  6085. *
  6086. * @private
  6087. * @param {Object} source The object to copy properties from.
  6088. * @param {Array} props The property identifiers to copy.
  6089. * @param {Object} [object={}] The object to copy properties to.
  6090. * @param {Function} [customizer] The function to customize copied values.
  6091. * @returns {Object} Returns `object`.
  6092. */
  6093. function copyObject(source, props, object, customizer) {
  6094. var isNew = !object;
  6095. object || (object = {});
  6096. var index = -1,
  6097. length = props.length;
  6098. while (++index < length) {
  6099. var key = props[index];
  6100. var newValue = customizer
  6101. ? customizer(object[key], source[key], key, object, source)
  6102. : undefined;
  6103. if (newValue === undefined) {
  6104. newValue = source[key];
  6105. }
  6106. if (isNew) {
  6107. baseAssignValue(object, key, newValue);
  6108. } else {
  6109. assignValue(object, key, newValue);
  6110. }
  6111. }
  6112. return object;
  6113. }
  6114. /**
  6115. * Copies own symbols of `source` to `object`.
  6116. *
  6117. * @private
  6118. * @param {Object} source The object to copy symbols from.
  6119. * @param {Object} [object={}] The object to copy symbols to.
  6120. * @returns {Object} Returns `object`.
  6121. */
  6122. function copySymbols(source, object) {
  6123. return copyObject(source, getSymbols(source), object);
  6124. }
  6125. /**
  6126. * Copies own and inherited symbols of `source` to `object`.
  6127. *
  6128. * @private
  6129. * @param {Object} source The object to copy symbols from.
  6130. * @param {Object} [object={}] The object to copy symbols to.
  6131. * @returns {Object} Returns `object`.
  6132. */
  6133. function copySymbolsIn(source, object) {
  6134. return copyObject(source, getSymbolsIn(source), object);
  6135. }
  6136. /**
  6137. * Creates a function like `_.groupBy`.
  6138. *
  6139. * @private
  6140. * @param {Function} setter The function to set accumulator values.
  6141. * @param {Function} [initializer] The accumulator object initializer.
  6142. * @returns {Function} Returns the new aggregator function.
  6143. */
  6144. function createAggregator(setter, initializer) {
  6145. return function(collection, iteratee) {
  6146. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  6147. accumulator = initializer ? initializer() : {};
  6148. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  6149. };
  6150. }
  6151. /**
  6152. * Creates a function like `_.assign`.
  6153. *
  6154. * @private
  6155. * @param {Function} assigner The function to assign values.
  6156. * @returns {Function} Returns the new assigner function.
  6157. */
  6158. function createAssigner(assigner) {
  6159. return baseRest(function(object, sources) {
  6160. var index = -1,
  6161. length = sources.length,
  6162. customizer = length > 1 ? sources[length - 1] : undefined,
  6163. guard = length > 2 ? sources[2] : undefined;
  6164. customizer = (assigner.length > 3 && typeof customizer == 'function')
  6165. ? (length--, customizer)
  6166. : undefined;
  6167. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  6168. customizer = length < 3 ? undefined : customizer;
  6169. length = 1;
  6170. }
  6171. object = Object(object);
  6172. while (++index < length) {
  6173. var source = sources[index];
  6174. if (source) {
  6175. assigner(object, source, index, customizer);
  6176. }
  6177. }
  6178. return object;
  6179. });
  6180. }
  6181. /**
  6182. * Creates a `baseEach` or `baseEachRight` function.
  6183. *
  6184. * @private
  6185. * @param {Function} eachFunc The function to iterate over a collection.
  6186. * @param {boolean} [fromRight] Specify iterating from right to left.
  6187. * @returns {Function} Returns the new base function.
  6188. */
  6189. function createBaseEach(eachFunc, fromRight) {
  6190. return function(collection, iteratee) {
  6191. if (collection == null) {
  6192. return collection;
  6193. }
  6194. if (!isArrayLike(collection)) {
  6195. return eachFunc(collection, iteratee);
  6196. }
  6197. var length = collection.length,
  6198. index = fromRight ? length : -1,
  6199. iterable = Object(collection);
  6200. while ((fromRight ? index-- : ++index < length)) {
  6201. if (iteratee(iterable[index], index, iterable) === false) {
  6202. break;
  6203. }
  6204. }
  6205. return collection;
  6206. };
  6207. }
  6208. /**
  6209. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  6210. *
  6211. * @private
  6212. * @param {boolean} [fromRight] Specify iterating from right to left.
  6213. * @returns {Function} Returns the new base function.
  6214. */
  6215. function createBaseFor(fromRight) {
  6216. return function(object, iteratee, keysFunc) {
  6217. var index = -1,
  6218. iterable = Object(object),
  6219. props = keysFunc(object),
  6220. length = props.length;
  6221. while (length--) {
  6222. var key = props[fromRight ? length : ++index];
  6223. if (iteratee(iterable[key], key, iterable) === false) {
  6224. break;
  6225. }
  6226. }
  6227. return object;
  6228. };
  6229. }
  6230. /**
  6231. * Creates a function that wraps `func` to invoke it with the optional `this`
  6232. * binding of `thisArg`.
  6233. *
  6234. * @private
  6235. * @param {Function} func The function to wrap.
  6236. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6237. * @param {*} [thisArg] The `this` binding of `func`.
  6238. * @returns {Function} Returns the new wrapped function.
  6239. */
  6240. function createBind(func, bitmask, thisArg) {
  6241. var isBind = bitmask & WRAP_BIND_FLAG,
  6242. Ctor = createCtor(func);
  6243. function wrapper() {
  6244. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6245. return fn.apply(isBind ? thisArg : this, arguments);
  6246. }
  6247. return wrapper;
  6248. }
  6249. /**
  6250. * Creates a function like `_.lowerFirst`.
  6251. *
  6252. * @private
  6253. * @param {string} methodName The name of the `String` case method to use.
  6254. * @returns {Function} Returns the new case function.
  6255. */
  6256. function createCaseFirst(methodName) {
  6257. return function(string) {
  6258. string = toString(string);
  6259. var strSymbols = hasUnicode(string)
  6260. ? stringToArray(string)
  6261. : undefined;
  6262. var chr = strSymbols
  6263. ? strSymbols[0]
  6264. : string.charAt(0);
  6265. var trailing = strSymbols
  6266. ? castSlice(strSymbols, 1).join('')
  6267. : string.slice(1);
  6268. return chr[methodName]() + trailing;
  6269. };
  6270. }
  6271. /**
  6272. * Creates a function like `_.camelCase`.
  6273. *
  6274. * @private
  6275. * @param {Function} callback The function to combine each word.
  6276. * @returns {Function} Returns the new compounder function.
  6277. */
  6278. function createCompounder(callback) {
  6279. return function(string) {
  6280. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  6281. };
  6282. }
  6283. /**
  6284. * Creates a function that produces an instance of `Ctor` regardless of
  6285. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  6286. *
  6287. * @private
  6288. * @param {Function} Ctor The constructor to wrap.
  6289. * @returns {Function} Returns the new wrapped function.
  6290. */
  6291. function createCtor(Ctor) {
  6292. return function() {
  6293. // Use a `switch` statement to work with class constructors. See
  6294. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  6295. // for more details.
  6296. var args = arguments;
  6297. switch (args.length) {
  6298. case 0: return new Ctor;
  6299. case 1: return new Ctor(args[0]);
  6300. case 2: return new Ctor(args[0], args[1]);
  6301. case 3: return new Ctor(args[0], args[1], args[2]);
  6302. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  6303. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  6304. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  6305. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  6306. }
  6307. var thisBinding = baseCreate(Ctor.prototype),
  6308. result = Ctor.apply(thisBinding, args);
  6309. // Mimic the constructor's `return` behavior.
  6310. // See https://es5.github.io/#x13.2.2 for more details.
  6311. return isObject(result) ? result : thisBinding;
  6312. };
  6313. }
  6314. /**
  6315. * Creates a function that wraps `func` to enable currying.
  6316. *
  6317. * @private
  6318. * @param {Function} func The function to wrap.
  6319. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6320. * @param {number} arity The arity of `func`.
  6321. * @returns {Function} Returns the new wrapped function.
  6322. */
  6323. function createCurry(func, bitmask, arity) {
  6324. var Ctor = createCtor(func);
  6325. function wrapper() {
  6326. var length = arguments.length,
  6327. args = Array(length),
  6328. index = length,
  6329. placeholder = getHolder(wrapper);
  6330. while (index--) {
  6331. args[index] = arguments[index];
  6332. }
  6333. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  6334. ? []
  6335. : replaceHolders(args, placeholder);
  6336. length -= holders.length;
  6337. if (length < arity) {
  6338. return createRecurry(
  6339. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  6340. args, holders, undefined, undefined, arity - length);
  6341. }
  6342. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6343. return apply(fn, this, args);
  6344. }
  6345. return wrapper;
  6346. }
  6347. /**
  6348. * Creates a `_.find` or `_.findLast` function.
  6349. *
  6350. * @private
  6351. * @param {Function} findIndexFunc The function to find the collection index.
  6352. * @returns {Function} Returns the new find function.
  6353. */
  6354. function createFind(findIndexFunc) {
  6355. return function(collection, predicate, fromIndex) {
  6356. var iterable = Object(collection);
  6357. if (!isArrayLike(collection)) {
  6358. var iteratee = getIteratee(predicate, 3);
  6359. collection = keys(collection);
  6360. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  6361. }
  6362. var index = findIndexFunc(collection, predicate, fromIndex);
  6363. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  6364. };
  6365. }
  6366. /**
  6367. * Creates a `_.flow` or `_.flowRight` function.
  6368. *
  6369. * @private
  6370. * @param {boolean} [fromRight] Specify iterating from right to left.
  6371. * @returns {Function} Returns the new flow function.
  6372. */
  6373. function createFlow(fromRight) {
  6374. return flatRest(function(funcs) {
  6375. var length = funcs.length,
  6376. index = length,
  6377. prereq = LodashWrapper.prototype.thru;
  6378. if (fromRight) {
  6379. funcs.reverse();
  6380. }
  6381. while (index--) {
  6382. var func = funcs[index];
  6383. if (typeof func != 'function') {
  6384. throw new TypeError(FUNC_ERROR_TEXT);
  6385. }
  6386. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6387. var wrapper = new LodashWrapper([], true);
  6388. }
  6389. }
  6390. index = wrapper ? index : length;
  6391. while (++index < length) {
  6392. func = funcs[index];
  6393. var funcName = getFuncName(func),
  6394. data = funcName == 'wrapper' ? getData(func) : undefined;
  6395. if (data && isLaziable(data[0]) &&
  6396. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6397. !data[4].length && data[9] == 1
  6398. ) {
  6399. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6400. } else {
  6401. wrapper = (func.length == 1 && isLaziable(func))
  6402. ? wrapper[funcName]()
  6403. : wrapper.thru(func);
  6404. }
  6405. }
  6406. return function() {
  6407. var args = arguments,
  6408. value = args[0];
  6409. if (wrapper && args.length == 1 && isArray(value)) {
  6410. return wrapper.plant(value).value();
  6411. }
  6412. var index = 0,
  6413. result = length ? funcs[index].apply(this, args) : value;
  6414. while (++index < length) {
  6415. result = funcs[index].call(this, result);
  6416. }
  6417. return result;
  6418. };
  6419. });
  6420. }
  6421. /**
  6422. * Creates a function that wraps `func` to invoke it with optional `this`
  6423. * binding of `thisArg`, partial application, and currying.
  6424. *
  6425. * @private
  6426. * @param {Function|string} func The function or method name to wrap.
  6427. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6428. * @param {*} [thisArg] The `this` binding of `func`.
  6429. * @param {Array} [partials] The arguments to prepend to those provided to
  6430. * the new function.
  6431. * @param {Array} [holders] The `partials` placeholder indexes.
  6432. * @param {Array} [partialsRight] The arguments to append to those provided
  6433. * to the new function.
  6434. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6435. * @param {Array} [argPos] The argument positions of the new function.
  6436. * @param {number} [ary] The arity cap of `func`.
  6437. * @param {number} [arity] The arity of `func`.
  6438. * @returns {Function} Returns the new wrapped function.
  6439. */
  6440. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6441. var isAry = bitmask & WRAP_ARY_FLAG,
  6442. isBind = bitmask & WRAP_BIND_FLAG,
  6443. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6444. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6445. isFlip = bitmask & WRAP_FLIP_FLAG,
  6446. Ctor = isBindKey ? undefined : createCtor(func);
  6447. function wrapper() {
  6448. var length = arguments.length,
  6449. args = Array(length),
  6450. index = length;
  6451. while (index--) {
  6452. args[index] = arguments[index];
  6453. }
  6454. if (isCurried) {
  6455. var placeholder = getHolder(wrapper),
  6456. holdersCount = countHolders(args, placeholder);
  6457. }
  6458. if (partials) {
  6459. args = composeArgs(args, partials, holders, isCurried);
  6460. }
  6461. if (partialsRight) {
  6462. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6463. }
  6464. length -= holdersCount;
  6465. if (isCurried && length < arity) {
  6466. var newHolders = replaceHolders(args, placeholder);
  6467. return createRecurry(
  6468. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6469. args, newHolders, argPos, ary, arity - length
  6470. );
  6471. }
  6472. var thisBinding = isBind ? thisArg : this,
  6473. fn = isBindKey ? thisBinding[func] : func;
  6474. length = args.length;
  6475. if (argPos) {
  6476. args = reorder(args, argPos);
  6477. } else if (isFlip && length > 1) {
  6478. args.reverse();
  6479. }
  6480. if (isAry && ary < length) {
  6481. args.length = ary;
  6482. }
  6483. if (this && this !== root && this instanceof wrapper) {
  6484. fn = Ctor || createCtor(fn);
  6485. }
  6486. return fn.apply(thisBinding, args);
  6487. }
  6488. return wrapper;
  6489. }
  6490. /**
  6491. * Creates a function like `_.invertBy`.
  6492. *
  6493. * @private
  6494. * @param {Function} setter The function to set accumulator values.
  6495. * @param {Function} toIteratee The function to resolve iteratees.
  6496. * @returns {Function} Returns the new inverter function.
  6497. */
  6498. function createInverter(setter, toIteratee) {
  6499. return function(object, iteratee) {
  6500. return baseInverter(object, setter, toIteratee(iteratee), {});
  6501. };
  6502. }
  6503. /**
  6504. * Creates a function that performs a mathematical operation on two values.
  6505. *
  6506. * @private
  6507. * @param {Function} operator The function to perform the operation.
  6508. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6509. * @returns {Function} Returns the new mathematical operation function.
  6510. */
  6511. function createMathOperation(operator, defaultValue) {
  6512. return function(value, other) {
  6513. var result;
  6514. if (value === undefined && other === undefined) {
  6515. return defaultValue;
  6516. }
  6517. if (value !== undefined) {
  6518. result = value;
  6519. }
  6520. if (other !== undefined) {
  6521. if (result === undefined) {
  6522. return other;
  6523. }
  6524. if (typeof value == 'string' || typeof other == 'string') {
  6525. value = baseToString(value);
  6526. other = baseToString(other);
  6527. } else {
  6528. value = baseToNumber(value);
  6529. other = baseToNumber(other);
  6530. }
  6531. result = operator(value, other);
  6532. }
  6533. return result;
  6534. };
  6535. }
  6536. /**
  6537. * Creates a function like `_.over`.
  6538. *
  6539. * @private
  6540. * @param {Function} arrayFunc The function to iterate over iteratees.
  6541. * @returns {Function} Returns the new over function.
  6542. */
  6543. function createOver(arrayFunc) {
  6544. return flatRest(function(iteratees) {
  6545. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6546. return baseRest(function(args) {
  6547. var thisArg = this;
  6548. return arrayFunc(iteratees, function(iteratee) {
  6549. return apply(iteratee, thisArg, args);
  6550. });
  6551. });
  6552. });
  6553. }
  6554. /**
  6555. * Creates the padding for `string` based on `length`. The `chars` string
  6556. * is truncated if the number of characters exceeds `length`.
  6557. *
  6558. * @private
  6559. * @param {number} length The padding length.
  6560. * @param {string} [chars=' '] The string used as padding.
  6561. * @returns {string} Returns the padding for `string`.
  6562. */
  6563. function createPadding(length, chars) {
  6564. chars = chars === undefined ? ' ' : baseToString(chars);
  6565. var charsLength = chars.length;
  6566. if (charsLength < 2) {
  6567. return charsLength ? baseRepeat(chars, length) : chars;
  6568. }
  6569. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6570. return hasUnicode(chars)
  6571. ? castSlice(stringToArray(result), 0, length).join('')
  6572. : result.slice(0, length);
  6573. }
  6574. /**
  6575. * Creates a function that wraps `func` to invoke it with the `this` binding
  6576. * of `thisArg` and `partials` prepended to the arguments it receives.
  6577. *
  6578. * @private
  6579. * @param {Function} func The function to wrap.
  6580. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6581. * @param {*} thisArg The `this` binding of `func`.
  6582. * @param {Array} partials The arguments to prepend to those provided to
  6583. * the new function.
  6584. * @returns {Function} Returns the new wrapped function.
  6585. */
  6586. function createPartial(func, bitmask, thisArg, partials) {
  6587. var isBind = bitmask & WRAP_BIND_FLAG,
  6588. Ctor = createCtor(func);
  6589. function wrapper() {
  6590. var argsIndex = -1,
  6591. argsLength = arguments.length,
  6592. leftIndex = -1,
  6593. leftLength = partials.length,
  6594. args = Array(leftLength + argsLength),
  6595. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6596. while (++leftIndex < leftLength) {
  6597. args[leftIndex] = partials[leftIndex];
  6598. }
  6599. while (argsLength--) {
  6600. args[leftIndex++] = arguments[++argsIndex];
  6601. }
  6602. return apply(fn, isBind ? thisArg : this, args);
  6603. }
  6604. return wrapper;
  6605. }
  6606. /**
  6607. * Creates a `_.range` or `_.rangeRight` function.
  6608. *
  6609. * @private
  6610. * @param {boolean} [fromRight] Specify iterating from right to left.
  6611. * @returns {Function} Returns the new range function.
  6612. */
  6613. function createRange(fromRight) {
  6614. return function(start, end, step) {
  6615. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6616. end = step = undefined;
  6617. }
  6618. // Ensure the sign of `-0` is preserved.
  6619. start = toFinite(start);
  6620. if (end === undefined) {
  6621. end = start;
  6622. start = 0;
  6623. } else {
  6624. end = toFinite(end);
  6625. }
  6626. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6627. return baseRange(start, end, step, fromRight);
  6628. };
  6629. }
  6630. /**
  6631. * Creates a function that performs a relational operation on two values.
  6632. *
  6633. * @private
  6634. * @param {Function} operator The function to perform the operation.
  6635. * @returns {Function} Returns the new relational operation function.
  6636. */
  6637. function createRelationalOperation(operator) {
  6638. return function(value, other) {
  6639. if (!(typeof value == 'string' && typeof other == 'string')) {
  6640. value = toNumber(value);
  6641. other = toNumber(other);
  6642. }
  6643. return operator(value, other);
  6644. };
  6645. }
  6646. /**
  6647. * Creates a function that wraps `func` to continue currying.
  6648. *
  6649. * @private
  6650. * @param {Function} func The function to wrap.
  6651. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6652. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6653. * @param {*} placeholder The placeholder value.
  6654. * @param {*} [thisArg] The `this` binding of `func`.
  6655. * @param {Array} [partials] The arguments to prepend to those provided to
  6656. * the new function.
  6657. * @param {Array} [holders] The `partials` placeholder indexes.
  6658. * @param {Array} [argPos] The argument positions of the new function.
  6659. * @param {number} [ary] The arity cap of `func`.
  6660. * @param {number} [arity] The arity of `func`.
  6661. * @returns {Function} Returns the new wrapped function.
  6662. */
  6663. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6664. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6665. newHolders = isCurry ? holders : undefined,
  6666. newHoldersRight = isCurry ? undefined : holders,
  6667. newPartials = isCurry ? partials : undefined,
  6668. newPartialsRight = isCurry ? undefined : partials;
  6669. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6670. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6671. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6672. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6673. }
  6674. var newData = [
  6675. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6676. newHoldersRight, argPos, ary, arity
  6677. ];
  6678. var result = wrapFunc.apply(undefined, newData);
  6679. if (isLaziable(func)) {
  6680. setData(result, newData);
  6681. }
  6682. result.placeholder = placeholder;
  6683. return setWrapToString(result, func, bitmask);
  6684. }
  6685. /**
  6686. * Creates a function like `_.round`.
  6687. *
  6688. * @private
  6689. * @param {string} methodName The name of the `Math` method to use when rounding.
  6690. * @returns {Function} Returns the new round function.
  6691. */
  6692. function createRound(methodName) {
  6693. var func = Math[methodName];
  6694. return function(number, precision) {
  6695. number = toNumber(number);
  6696. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6697. if (precision && nativeIsFinite(number)) {
  6698. // Shift with exponential notation to avoid floating-point issues.
  6699. // See [MDN](https://mdn.io/round#Examples) for more details.
  6700. var pair = (toString(number) + 'e').split('e'),
  6701. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6702. pair = (toString(value) + 'e').split('e');
  6703. return +(pair[0] + 'e' + (+pair[1] - precision));
  6704. }
  6705. return func(number);
  6706. };
  6707. }
  6708. /**
  6709. * Creates a set object of `values`.
  6710. *
  6711. * @private
  6712. * @param {Array} values The values to add to the set.
  6713. * @returns {Object} Returns the new set.
  6714. */
  6715. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6716. return new Set(values);
  6717. };
  6718. /**
  6719. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6720. *
  6721. * @private
  6722. * @param {Function} keysFunc The function to get the keys of a given object.
  6723. * @returns {Function} Returns the new pairs function.
  6724. */
  6725. function createToPairs(keysFunc) {
  6726. return function(object) {
  6727. var tag = getTag(object);
  6728. if (tag == mapTag) {
  6729. return mapToArray(object);
  6730. }
  6731. if (tag == setTag) {
  6732. return setToPairs(object);
  6733. }
  6734. return baseToPairs(object, keysFunc(object));
  6735. };
  6736. }
  6737. /**
  6738. * Creates a function that either curries or invokes `func` with optional
  6739. * `this` binding and partially applied arguments.
  6740. *
  6741. * @private
  6742. * @param {Function|string} func The function or method name to wrap.
  6743. * @param {number} bitmask The bitmask flags.
  6744. * 1 - `_.bind`
  6745. * 2 - `_.bindKey`
  6746. * 4 - `_.curry` or `_.curryRight` of a bound function
  6747. * 8 - `_.curry`
  6748. * 16 - `_.curryRight`
  6749. * 32 - `_.partial`
  6750. * 64 - `_.partialRight`
  6751. * 128 - `_.rearg`
  6752. * 256 - `_.ary`
  6753. * 512 - `_.flip`
  6754. * @param {*} [thisArg] The `this` binding of `func`.
  6755. * @param {Array} [partials] The arguments to be partially applied.
  6756. * @param {Array} [holders] The `partials` placeholder indexes.
  6757. * @param {Array} [argPos] The argument positions of the new function.
  6758. * @param {number} [ary] The arity cap of `func`.
  6759. * @param {number} [arity] The arity of `func`.
  6760. * @returns {Function} Returns the new wrapped function.
  6761. */
  6762. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6763. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6764. if (!isBindKey && typeof func != 'function') {
  6765. throw new TypeError(FUNC_ERROR_TEXT);
  6766. }
  6767. var length = partials ? partials.length : 0;
  6768. if (!length) {
  6769. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6770. partials = holders = undefined;
  6771. }
  6772. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6773. arity = arity === undefined ? arity : toInteger(arity);
  6774. length -= holders ? holders.length : 0;
  6775. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6776. var partialsRight = partials,
  6777. holdersRight = holders;
  6778. partials = holders = undefined;
  6779. }
  6780. var data = isBindKey ? undefined : getData(func);
  6781. var newData = [
  6782. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6783. argPos, ary, arity
  6784. ];
  6785. if (data) {
  6786. mergeData(newData, data);
  6787. }
  6788. func = newData[0];
  6789. bitmask = newData[1];
  6790. thisArg = newData[2];
  6791. partials = newData[3];
  6792. holders = newData[4];
  6793. arity = newData[9] = newData[9] === undefined
  6794. ? (isBindKey ? 0 : func.length)
  6795. : nativeMax(newData[9] - length, 0);
  6796. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6797. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6798. }
  6799. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6800. var result = createBind(func, bitmask, thisArg);
  6801. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6802. result = createCurry(func, bitmask, arity);
  6803. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6804. result = createPartial(func, bitmask, thisArg, partials);
  6805. } else {
  6806. result = createHybrid.apply(undefined, newData);
  6807. }
  6808. var setter = data ? baseSetData : setData;
  6809. return setWrapToString(setter(result, newData), func, bitmask);
  6810. }
  6811. /**
  6812. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6813. * of source objects to the destination object for all destination properties
  6814. * that resolve to `undefined`.
  6815. *
  6816. * @private
  6817. * @param {*} objValue The destination value.
  6818. * @param {*} srcValue The source value.
  6819. * @param {string} key The key of the property to assign.
  6820. * @param {Object} object The parent object of `objValue`.
  6821. * @returns {*} Returns the value to assign.
  6822. */
  6823. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6824. if (objValue === undefined ||
  6825. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6826. return srcValue;
  6827. }
  6828. return objValue;
  6829. }
  6830. /**
  6831. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6832. * objects into destination objects that are passed thru.
  6833. *
  6834. * @private
  6835. * @param {*} objValue The destination value.
  6836. * @param {*} srcValue The source value.
  6837. * @param {string} key The key of the property to merge.
  6838. * @param {Object} object The parent object of `objValue`.
  6839. * @param {Object} source The parent object of `srcValue`.
  6840. * @param {Object} [stack] Tracks traversed source values and their merged
  6841. * counterparts.
  6842. * @returns {*} Returns the value to assign.
  6843. */
  6844. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6845. if (isObject(objValue) && isObject(srcValue)) {
  6846. // Recursively merge objects and arrays (susceptible to call stack limits).
  6847. stack.set(srcValue, objValue);
  6848. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6849. stack['delete'](srcValue);
  6850. }
  6851. return objValue;
  6852. }
  6853. /**
  6854. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6855. * objects.
  6856. *
  6857. * @private
  6858. * @param {*} value The value to inspect.
  6859. * @param {string} key The key of the property to inspect.
  6860. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6861. */
  6862. function customOmitClone(value) {
  6863. return isPlainObject(value) ? undefined : value;
  6864. }
  6865. /**
  6866. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6867. * partial deep comparisons.
  6868. *
  6869. * @private
  6870. * @param {Array} array The array to compare.
  6871. * @param {Array} other The other array to compare.
  6872. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6873. * @param {Function} customizer The function to customize comparisons.
  6874. * @param {Function} equalFunc The function to determine equivalents of values.
  6875. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6876. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6877. */
  6878. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6879. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6880. arrLength = array.length,
  6881. othLength = other.length;
  6882. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6883. return false;
  6884. }
  6885. // Check that cyclic values are equal.
  6886. var arrStacked = stack.get(array);
  6887. var othStacked = stack.get(other);
  6888. if (arrStacked && othStacked) {
  6889. return arrStacked == other && othStacked == array;
  6890. }
  6891. var index = -1,
  6892. result = true,
  6893. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6894. stack.set(array, other);
  6895. stack.set(other, array);
  6896. // Ignore non-index properties.
  6897. while (++index < arrLength) {
  6898. var arrValue = array[index],
  6899. othValue = other[index];
  6900. if (customizer) {
  6901. var compared = isPartial
  6902. ? customizer(othValue, arrValue, index, other, array, stack)
  6903. : customizer(arrValue, othValue, index, array, other, stack);
  6904. }
  6905. if (compared !== undefined) {
  6906. if (compared) {
  6907. continue;
  6908. }
  6909. result = false;
  6910. break;
  6911. }
  6912. // Recursively compare arrays (susceptible to call stack limits).
  6913. if (seen) {
  6914. if (!arraySome(other, function(othValue, othIndex) {
  6915. if (!cacheHas(seen, othIndex) &&
  6916. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6917. return seen.push(othIndex);
  6918. }
  6919. })) {
  6920. result = false;
  6921. break;
  6922. }
  6923. } else if (!(
  6924. arrValue === othValue ||
  6925. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6926. )) {
  6927. result = false;
  6928. break;
  6929. }
  6930. }
  6931. stack['delete'](array);
  6932. stack['delete'](other);
  6933. return result;
  6934. }
  6935. /**
  6936. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6937. * the same `toStringTag`.
  6938. *
  6939. * **Note:** This function only supports comparing values with tags of
  6940. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6941. *
  6942. * @private
  6943. * @param {Object} object The object to compare.
  6944. * @param {Object} other The other object to compare.
  6945. * @param {string} tag The `toStringTag` of the objects to compare.
  6946. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6947. * @param {Function} customizer The function to customize comparisons.
  6948. * @param {Function} equalFunc The function to determine equivalents of values.
  6949. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6950. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6951. */
  6952. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6953. switch (tag) {
  6954. case dataViewTag:
  6955. if ((object.byteLength != other.byteLength) ||
  6956. (object.byteOffset != other.byteOffset)) {
  6957. return false;
  6958. }
  6959. object = object.buffer;
  6960. other = other.buffer;
  6961. case arrayBufferTag:
  6962. if ((object.byteLength != other.byteLength) ||
  6963. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6964. return false;
  6965. }
  6966. return true;
  6967. case boolTag:
  6968. case dateTag:
  6969. case numberTag:
  6970. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6971. // Invalid dates are coerced to `NaN`.
  6972. return eq(+object, +other);
  6973. case errorTag:
  6974. return object.name == other.name && object.message == other.message;
  6975. case regexpTag:
  6976. case stringTag:
  6977. // Coerce regexes to strings and treat strings, primitives and objects,
  6978. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6979. // for more details.
  6980. return object == (other + '');
  6981. case mapTag:
  6982. var convert = mapToArray;
  6983. case setTag:
  6984. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6985. convert || (convert = setToArray);
  6986. if (object.size != other.size && !isPartial) {
  6987. return false;
  6988. }
  6989. // Assume cyclic values are equal.
  6990. var stacked = stack.get(object);
  6991. if (stacked) {
  6992. return stacked == other;
  6993. }
  6994. bitmask |= COMPARE_UNORDERED_FLAG;
  6995. // Recursively compare objects (susceptible to call stack limits).
  6996. stack.set(object, other);
  6997. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6998. stack['delete'](object);
  6999. return result;
  7000. case symbolTag:
  7001. if (symbolValueOf) {
  7002. return symbolValueOf.call(object) == symbolValueOf.call(other);
  7003. }
  7004. }
  7005. return false;
  7006. }
  7007. /**
  7008. * A specialized version of `baseIsEqualDeep` for objects with support for
  7009. * partial deep comparisons.
  7010. *
  7011. * @private
  7012. * @param {Object} object The object to compare.
  7013. * @param {Object} other The other object to compare.
  7014. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7015. * @param {Function} customizer The function to customize comparisons.
  7016. * @param {Function} equalFunc The function to determine equivalents of values.
  7017. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7018. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7019. */
  7020. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  7021. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7022. objProps = getAllKeys(object),
  7023. objLength = objProps.length,
  7024. othProps = getAllKeys(other),
  7025. othLength = othProps.length;
  7026. if (objLength != othLength && !isPartial) {
  7027. return false;
  7028. }
  7029. var index = objLength;
  7030. while (index--) {
  7031. var key = objProps[index];
  7032. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7033. return false;
  7034. }
  7035. }
  7036. // Check that cyclic values are equal.
  7037. var objStacked = stack.get(object);
  7038. var othStacked = stack.get(other);
  7039. if (objStacked && othStacked) {
  7040. return objStacked == other && othStacked == object;
  7041. }
  7042. var result = true;
  7043. stack.set(object, other);
  7044. stack.set(other, object);
  7045. var skipCtor = isPartial;
  7046. while (++index < objLength) {
  7047. key = objProps[index];
  7048. var objValue = object[key],
  7049. othValue = other[key];
  7050. if (customizer) {
  7051. var compared = isPartial
  7052. ? customizer(othValue, objValue, key, other, object, stack)
  7053. : customizer(objValue, othValue, key, object, other, stack);
  7054. }
  7055. // Recursively compare objects (susceptible to call stack limits).
  7056. if (!(compared === undefined
  7057. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  7058. : compared
  7059. )) {
  7060. result = false;
  7061. break;
  7062. }
  7063. skipCtor || (skipCtor = key == 'constructor');
  7064. }
  7065. if (result && !skipCtor) {
  7066. var objCtor = object.constructor,
  7067. othCtor = other.constructor;
  7068. // Non `Object` object instances with different constructors are not equal.
  7069. if (objCtor != othCtor &&
  7070. ('constructor' in object && 'constructor' in other) &&
  7071. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  7072. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7073. result = false;
  7074. }
  7075. }
  7076. stack['delete'](object);
  7077. stack['delete'](other);
  7078. return result;
  7079. }
  7080. /**
  7081. * A specialized version of `baseRest` which flattens the rest array.
  7082. *
  7083. * @private
  7084. * @param {Function} func The function to apply a rest parameter to.
  7085. * @returns {Function} Returns the new function.
  7086. */
  7087. function flatRest(func) {
  7088. return setToString(overRest(func, undefined, flatten), func + '');
  7089. }
  7090. /**
  7091. * Creates an array of own enumerable property names and symbols of `object`.
  7092. *
  7093. * @private
  7094. * @param {Object} object The object to query.
  7095. * @returns {Array} Returns the array of property names and symbols.
  7096. */
  7097. function getAllKeys(object) {
  7098. return baseGetAllKeys(object, keys, getSymbols);
  7099. }
  7100. /**
  7101. * Creates an array of own and inherited enumerable property names and
  7102. * symbols of `object`.
  7103. *
  7104. * @private
  7105. * @param {Object} object The object to query.
  7106. * @returns {Array} Returns the array of property names and symbols.
  7107. */
  7108. function getAllKeysIn(object) {
  7109. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  7110. }
  7111. /**
  7112. * Gets metadata for `func`.
  7113. *
  7114. * @private
  7115. * @param {Function} func The function to query.
  7116. * @returns {*} Returns the metadata for `func`.
  7117. */
  7118. var getData = !metaMap ? noop : function(func) {
  7119. return metaMap.get(func);
  7120. };
  7121. /**
  7122. * Gets the name of `func`.
  7123. *
  7124. * @private
  7125. * @param {Function} func The function to query.
  7126. * @returns {string} Returns the function name.
  7127. */
  7128. function getFuncName(func) {
  7129. var result = (func.name + ''),
  7130. array = realNames[result],
  7131. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  7132. while (length--) {
  7133. var data = array[length],
  7134. otherFunc = data.func;
  7135. if (otherFunc == null || otherFunc == func) {
  7136. return data.name;
  7137. }
  7138. }
  7139. return result;
  7140. }
  7141. /**
  7142. * Gets the argument placeholder value for `func`.
  7143. *
  7144. * @private
  7145. * @param {Function} func The function to inspect.
  7146. * @returns {*} Returns the placeholder value.
  7147. */
  7148. function getHolder(func) {
  7149. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  7150. return object.placeholder;
  7151. }
  7152. /**
  7153. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  7154. * this function returns the custom method, otherwise it returns `baseIteratee`.
  7155. * If arguments are provided, the chosen function is invoked with them and
  7156. * its result is returned.
  7157. *
  7158. * @private
  7159. * @param {*} [value] The value to convert to an iteratee.
  7160. * @param {number} [arity] The arity of the created iteratee.
  7161. * @returns {Function} Returns the chosen function or its result.
  7162. */
  7163. function getIteratee() {
  7164. var result = lodash.iteratee || iteratee;
  7165. result = result === iteratee ? baseIteratee : result;
  7166. return arguments.length ? result(arguments[0], arguments[1]) : result;
  7167. }
  7168. /**
  7169. * Gets the data for `map`.
  7170. *
  7171. * @private
  7172. * @param {Object} map The map to query.
  7173. * @param {string} key The reference key.
  7174. * @returns {*} Returns the map data.
  7175. */
  7176. function getMapData(map, key) {
  7177. var data = map.__data__;
  7178. return isKeyable(key)
  7179. ? data[typeof key == 'string' ? 'string' : 'hash']
  7180. : data.map;
  7181. }
  7182. /**
  7183. * Gets the property names, values, and compare flags of `object`.
  7184. *
  7185. * @private
  7186. * @param {Object} object The object to query.
  7187. * @returns {Array} Returns the match data of `object`.
  7188. */
  7189. function getMatchData(object) {
  7190. var result = keys(object),
  7191. length = result.length;
  7192. while (length--) {
  7193. var key = result[length],
  7194. value = object[key];
  7195. result[length] = [key, value, isStrictComparable(value)];
  7196. }
  7197. return result;
  7198. }
  7199. /**
  7200. * Gets the native function at `key` of `object`.
  7201. *
  7202. * @private
  7203. * @param {Object} object The object to query.
  7204. * @param {string} key The key of the method to get.
  7205. * @returns {*} Returns the function if it's native, else `undefined`.
  7206. */
  7207. function getNative(object, key) {
  7208. var value = getValue(object, key);
  7209. return baseIsNative(value) ? value : undefined;
  7210. }
  7211. /**
  7212. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7213. *
  7214. * @private
  7215. * @param {*} value The value to query.
  7216. * @returns {string} Returns the raw `toStringTag`.
  7217. */
  7218. function getRawTag(value) {
  7219. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7220. tag = value[symToStringTag];
  7221. try {
  7222. value[symToStringTag] = undefined;
  7223. var unmasked = true;
  7224. } catch (e) {}
  7225. var result = nativeObjectToString.call(value);
  7226. if (unmasked) {
  7227. if (isOwn) {
  7228. value[symToStringTag] = tag;
  7229. } else {
  7230. delete value[symToStringTag];
  7231. }
  7232. }
  7233. return result;
  7234. }
  7235. /**
  7236. * Creates an array of the own enumerable symbols of `object`.
  7237. *
  7238. * @private
  7239. * @param {Object} object The object to query.
  7240. * @returns {Array} Returns the array of symbols.
  7241. */
  7242. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  7243. if (object == null) {
  7244. return [];
  7245. }
  7246. object = Object(object);
  7247. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  7248. return propertyIsEnumerable.call(object, symbol);
  7249. });
  7250. };
  7251. /**
  7252. * Creates an array of the own and inherited enumerable symbols of `object`.
  7253. *
  7254. * @private
  7255. * @param {Object} object The object to query.
  7256. * @returns {Array} Returns the array of symbols.
  7257. */
  7258. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  7259. var result = [];
  7260. while (object) {
  7261. arrayPush(result, getSymbols(object));
  7262. object = getPrototype(object);
  7263. }
  7264. return result;
  7265. };
  7266. /**
  7267. * Gets the `toStringTag` of `value`.
  7268. *
  7269. * @private
  7270. * @param {*} value The value to query.
  7271. * @returns {string} Returns the `toStringTag`.
  7272. */
  7273. var getTag = baseGetTag;
  7274. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  7275. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  7276. (Map && getTag(new Map) != mapTag) ||
  7277. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  7278. (Set && getTag(new Set) != setTag) ||
  7279. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  7280. getTag = function(value) {
  7281. var result = baseGetTag(value),
  7282. Ctor = result == objectTag ? value.constructor : undefined,
  7283. ctorString = Ctor ? toSource(Ctor) : '';
  7284. if (ctorString) {
  7285. switch (ctorString) {
  7286. case dataViewCtorString: return dataViewTag;
  7287. case mapCtorString: return mapTag;
  7288. case promiseCtorString: return promiseTag;
  7289. case setCtorString: return setTag;
  7290. case weakMapCtorString: return weakMapTag;
  7291. }
  7292. }
  7293. return result;
  7294. };
  7295. }
  7296. /**
  7297. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  7298. *
  7299. * @private
  7300. * @param {number} start The start of the view.
  7301. * @param {number} end The end of the view.
  7302. * @param {Array} transforms The transformations to apply to the view.
  7303. * @returns {Object} Returns an object containing the `start` and `end`
  7304. * positions of the view.
  7305. */
  7306. function getView(start, end, transforms) {
  7307. var index = -1,
  7308. length = transforms.length;
  7309. while (++index < length) {
  7310. var data = transforms[index],
  7311. size = data.size;
  7312. switch (data.type) {
  7313. case 'drop': start += size; break;
  7314. case 'dropRight': end -= size; break;
  7315. case 'take': end = nativeMin(end, start + size); break;
  7316. case 'takeRight': start = nativeMax(start, end - size); break;
  7317. }
  7318. }
  7319. return { 'start': start, 'end': end };
  7320. }
  7321. /**
  7322. * Extracts wrapper details from the `source` body comment.
  7323. *
  7324. * @private
  7325. * @param {string} source The source to inspect.
  7326. * @returns {Array} Returns the wrapper details.
  7327. */
  7328. function getWrapDetails(source) {
  7329. var match = source.match(reWrapDetails);
  7330. return match ? match[1].split(reSplitDetails) : [];
  7331. }
  7332. /**
  7333. * Checks if `path` exists on `object`.
  7334. *
  7335. * @private
  7336. * @param {Object} object The object to query.
  7337. * @param {Array|string} path The path to check.
  7338. * @param {Function} hasFunc The function to check properties.
  7339. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7340. */
  7341. function hasPath(object, path, hasFunc) {
  7342. path = castPath(path, object);
  7343. var index = -1,
  7344. length = path.length,
  7345. result = false;
  7346. while (++index < length) {
  7347. var key = toKey(path[index]);
  7348. if (!(result = object != null && hasFunc(object, key))) {
  7349. break;
  7350. }
  7351. object = object[key];
  7352. }
  7353. if (result || ++index != length) {
  7354. return result;
  7355. }
  7356. length = object == null ? 0 : object.length;
  7357. return !!length && isLength(length) && isIndex(key, length) &&
  7358. (isArray(object) || isArguments(object));
  7359. }
  7360. /**
  7361. * Initializes an array clone.
  7362. *
  7363. * @private
  7364. * @param {Array} array The array to clone.
  7365. * @returns {Array} Returns the initialized clone.
  7366. */
  7367. function initCloneArray(array) {
  7368. var length = array.length,
  7369. result = new array.constructor(length);
  7370. // Add properties assigned by `RegExp#exec`.
  7371. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7372. result.index = array.index;
  7373. result.input = array.input;
  7374. }
  7375. return result;
  7376. }
  7377. /**
  7378. * Initializes an object clone.
  7379. *
  7380. * @private
  7381. * @param {Object} object The object to clone.
  7382. * @returns {Object} Returns the initialized clone.
  7383. */
  7384. function initCloneObject(object) {
  7385. return (typeof object.constructor == 'function' && !isPrototype(object))
  7386. ? baseCreate(getPrototype(object))
  7387. : {};
  7388. }
  7389. /**
  7390. * Initializes an object clone based on its `toStringTag`.
  7391. *
  7392. * **Note:** This function only supports cloning values with tags of
  7393. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7394. *
  7395. * @private
  7396. * @param {Object} object The object to clone.
  7397. * @param {string} tag The `toStringTag` of the object to clone.
  7398. * @param {boolean} [isDeep] Specify a deep clone.
  7399. * @returns {Object} Returns the initialized clone.
  7400. */
  7401. function initCloneByTag(object, tag, isDeep) {
  7402. var Ctor = object.constructor;
  7403. switch (tag) {
  7404. case arrayBufferTag:
  7405. return cloneArrayBuffer(object);
  7406. case boolTag:
  7407. case dateTag:
  7408. return new Ctor(+object);
  7409. case dataViewTag:
  7410. return cloneDataView(object, isDeep);
  7411. case float32Tag: case float64Tag:
  7412. case int8Tag: case int16Tag: case int32Tag:
  7413. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7414. return cloneTypedArray(object, isDeep);
  7415. case mapTag:
  7416. return new Ctor;
  7417. case numberTag:
  7418. case stringTag:
  7419. return new Ctor(object);
  7420. case regexpTag:
  7421. return cloneRegExp(object);
  7422. case setTag:
  7423. return new Ctor;
  7424. case symbolTag:
  7425. return cloneSymbol(object);
  7426. }
  7427. }
  7428. /**
  7429. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7430. *
  7431. * @private
  7432. * @param {string} source The source to modify.
  7433. * @returns {Array} details The details to insert.
  7434. * @returns {string} Returns the modified source.
  7435. */
  7436. function insertWrapDetails(source, details) {
  7437. var length = details.length;
  7438. if (!length) {
  7439. return source;
  7440. }
  7441. var lastIndex = length - 1;
  7442. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7443. details = details.join(length > 2 ? ', ' : ' ');
  7444. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7445. }
  7446. /**
  7447. * Checks if `value` is a flattenable `arguments` object or array.
  7448. *
  7449. * @private
  7450. * @param {*} value The value to check.
  7451. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7452. */
  7453. function isFlattenable(value) {
  7454. return isArray(value) || isArguments(value) ||
  7455. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7456. }
  7457. /**
  7458. * Checks if `value` is a valid array-like index.
  7459. *
  7460. * @private
  7461. * @param {*} value The value to check.
  7462. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7463. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7464. */
  7465. function isIndex(value, length) {
  7466. var type = typeof value;
  7467. length = length == null ? MAX_SAFE_INTEGER : length;
  7468. return !!length &&
  7469. (type == 'number' ||
  7470. (type != 'symbol' && reIsUint.test(value))) &&
  7471. (value > -1 && value % 1 == 0 && value < length);
  7472. }
  7473. /**
  7474. * Checks if the given arguments are from an iteratee call.
  7475. *
  7476. * @private
  7477. * @param {*} value The potential iteratee value argument.
  7478. * @param {*} index The potential iteratee index or key argument.
  7479. * @param {*} object The potential iteratee object argument.
  7480. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7481. * else `false`.
  7482. */
  7483. function isIterateeCall(value, index, object) {
  7484. if (!isObject(object)) {
  7485. return false;
  7486. }
  7487. var type = typeof index;
  7488. if (type == 'number'
  7489. ? (isArrayLike(object) && isIndex(index, object.length))
  7490. : (type == 'string' && index in object)
  7491. ) {
  7492. return eq(object[index], value);
  7493. }
  7494. return false;
  7495. }
  7496. /**
  7497. * Checks if `value` is a property name and not a property path.
  7498. *
  7499. * @private
  7500. * @param {*} value The value to check.
  7501. * @param {Object} [object] The object to query keys on.
  7502. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7503. */
  7504. function isKey(value, object) {
  7505. if (isArray(value)) {
  7506. return false;
  7507. }
  7508. var type = typeof value;
  7509. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7510. value == null || isSymbol(value)) {
  7511. return true;
  7512. }
  7513. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7514. (object != null && value in Object(object));
  7515. }
  7516. /**
  7517. * Checks if `value` is suitable for use as unique object key.
  7518. *
  7519. * @private
  7520. * @param {*} value The value to check.
  7521. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7522. */
  7523. function isKeyable(value) {
  7524. var type = typeof value;
  7525. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7526. ? (value !== '__proto__')
  7527. : (value === null);
  7528. }
  7529. /**
  7530. * Checks if `func` has a lazy counterpart.
  7531. *
  7532. * @private
  7533. * @param {Function} func The function to check.
  7534. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7535. * else `false`.
  7536. */
  7537. function isLaziable(func) {
  7538. var funcName = getFuncName(func),
  7539. other = lodash[funcName];
  7540. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7541. return false;
  7542. }
  7543. if (func === other) {
  7544. return true;
  7545. }
  7546. var data = getData(other);
  7547. return !!data && func === data[0];
  7548. }
  7549. /**
  7550. * Checks if `func` has its source masked.
  7551. *
  7552. * @private
  7553. * @param {Function} func The function to check.
  7554. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7555. */
  7556. function isMasked(func) {
  7557. return !!maskSrcKey && (maskSrcKey in func);
  7558. }
  7559. /**
  7560. * Checks if `func` is capable of being masked.
  7561. *
  7562. * @private
  7563. * @param {*} value The value to check.
  7564. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7565. */
  7566. var isMaskable = coreJsData ? isFunction : stubFalse;
  7567. /**
  7568. * Checks if `value` is likely a prototype object.
  7569. *
  7570. * @private
  7571. * @param {*} value The value to check.
  7572. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7573. */
  7574. function isPrototype(value) {
  7575. var Ctor = value && value.constructor,
  7576. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7577. return value === proto;
  7578. }
  7579. /**
  7580. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7581. *
  7582. * @private
  7583. * @param {*} value The value to check.
  7584. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7585. * equality comparisons, else `false`.
  7586. */
  7587. function isStrictComparable(value) {
  7588. return value === value && !isObject(value);
  7589. }
  7590. /**
  7591. * A specialized version of `matchesProperty` for source values suitable
  7592. * for strict equality comparisons, i.e. `===`.
  7593. *
  7594. * @private
  7595. * @param {string} key The key of the property to get.
  7596. * @param {*} srcValue The value to match.
  7597. * @returns {Function} Returns the new spec function.
  7598. */
  7599. function matchesStrictComparable(key, srcValue) {
  7600. return function(object) {
  7601. if (object == null) {
  7602. return false;
  7603. }
  7604. return object[key] === srcValue &&
  7605. (srcValue !== undefined || (key in Object(object)));
  7606. };
  7607. }
  7608. /**
  7609. * A specialized version of `_.memoize` which clears the memoized function's
  7610. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7611. *
  7612. * @private
  7613. * @param {Function} func The function to have its output memoized.
  7614. * @returns {Function} Returns the new memoized function.
  7615. */
  7616. function memoizeCapped(func) {
  7617. var result = memoize(func, function(key) {
  7618. if (cache.size === MAX_MEMOIZE_SIZE) {
  7619. cache.clear();
  7620. }
  7621. return key;
  7622. });
  7623. var cache = result.cache;
  7624. return result;
  7625. }
  7626. /**
  7627. * Merges the function metadata of `source` into `data`.
  7628. *
  7629. * Merging metadata reduces the number of wrappers used to invoke a function.
  7630. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7631. * may be applied regardless of execution order. Methods like `_.ary` and
  7632. * `_.rearg` modify function arguments, making the order in which they are
  7633. * executed important, preventing the merging of metadata. However, we make
  7634. * an exception for a safe combined case where curried functions have `_.ary`
  7635. * and or `_.rearg` applied.
  7636. *
  7637. * @private
  7638. * @param {Array} data The destination metadata.
  7639. * @param {Array} source The source metadata.
  7640. * @returns {Array} Returns `data`.
  7641. */
  7642. function mergeData(data, source) {
  7643. var bitmask = data[1],
  7644. srcBitmask = source[1],
  7645. newBitmask = bitmask | srcBitmask,
  7646. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7647. var isCombo =
  7648. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7649. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7650. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7651. // Exit early if metadata can't be merged.
  7652. if (!(isCommon || isCombo)) {
  7653. return data;
  7654. }
  7655. // Use source `thisArg` if available.
  7656. if (srcBitmask & WRAP_BIND_FLAG) {
  7657. data[2] = source[2];
  7658. // Set when currying a bound function.
  7659. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7660. }
  7661. // Compose partial arguments.
  7662. var value = source[3];
  7663. if (value) {
  7664. var partials = data[3];
  7665. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7666. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7667. }
  7668. // Compose partial right arguments.
  7669. value = source[5];
  7670. if (value) {
  7671. partials = data[5];
  7672. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7673. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7674. }
  7675. // Use source `argPos` if available.
  7676. value = source[7];
  7677. if (value) {
  7678. data[7] = value;
  7679. }
  7680. // Use source `ary` if it's smaller.
  7681. if (srcBitmask & WRAP_ARY_FLAG) {
  7682. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7683. }
  7684. // Use source `arity` if one is not provided.
  7685. if (data[9] == null) {
  7686. data[9] = source[9];
  7687. }
  7688. // Use source `func` and merge bitmasks.
  7689. data[0] = source[0];
  7690. data[1] = newBitmask;
  7691. return data;
  7692. }
  7693. /**
  7694. * This function is like
  7695. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7696. * except that it includes inherited enumerable properties.
  7697. *
  7698. * @private
  7699. * @param {Object} object The object to query.
  7700. * @returns {Array} Returns the array of property names.
  7701. */
  7702. function nativeKeysIn(object) {
  7703. var result = [];
  7704. if (object != null) {
  7705. for (var key in Object(object)) {
  7706. result.push(key);
  7707. }
  7708. }
  7709. return result;
  7710. }
  7711. /**
  7712. * Converts `value` to a string using `Object.prototype.toString`.
  7713. *
  7714. * @private
  7715. * @param {*} value The value to convert.
  7716. * @returns {string} Returns the converted string.
  7717. */
  7718. function objectToString(value) {
  7719. return nativeObjectToString.call(value);
  7720. }
  7721. /**
  7722. * A specialized version of `baseRest` which transforms the rest array.
  7723. *
  7724. * @private
  7725. * @param {Function} func The function to apply a rest parameter to.
  7726. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7727. * @param {Function} transform The rest array transform.
  7728. * @returns {Function} Returns the new function.
  7729. */
  7730. function overRest(func, start, transform) {
  7731. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7732. return function() {
  7733. var args = arguments,
  7734. index = -1,
  7735. length = nativeMax(args.length - start, 0),
  7736. array = Array(length);
  7737. while (++index < length) {
  7738. array[index] = args[start + index];
  7739. }
  7740. index = -1;
  7741. var otherArgs = Array(start + 1);
  7742. while (++index < start) {
  7743. otherArgs[index] = args[index];
  7744. }
  7745. otherArgs[start] = transform(array);
  7746. return apply(func, this, otherArgs);
  7747. };
  7748. }
  7749. /**
  7750. * Gets the parent value at `path` of `object`.
  7751. *
  7752. * @private
  7753. * @param {Object} object The object to query.
  7754. * @param {Array} path The path to get the parent value of.
  7755. * @returns {*} Returns the parent value.
  7756. */
  7757. function parent(object, path) {
  7758. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7759. }
  7760. /**
  7761. * Reorder `array` according to the specified indexes where the element at
  7762. * the first index is assigned as the first element, the element at
  7763. * the second index is assigned as the second element, and so on.
  7764. *
  7765. * @private
  7766. * @param {Array} array The array to reorder.
  7767. * @param {Array} indexes The arranged array indexes.
  7768. * @returns {Array} Returns `array`.
  7769. */
  7770. function reorder(array, indexes) {
  7771. var arrLength = array.length,
  7772. length = nativeMin(indexes.length, arrLength),
  7773. oldArray = copyArray(array);
  7774. while (length--) {
  7775. var index = indexes[length];
  7776. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7777. }
  7778. return array;
  7779. }
  7780. /**
  7781. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7782. *
  7783. * @private
  7784. * @param {Object} object The object to query.
  7785. * @param {string} key The key of the property to get.
  7786. * @returns {*} Returns the property value.
  7787. */
  7788. function safeGet(object, key) {
  7789. if (key === 'constructor' && typeof object[key] === 'function') {
  7790. return;
  7791. }
  7792. if (key == '__proto__') {
  7793. return;
  7794. }
  7795. return object[key];
  7796. }
  7797. /**
  7798. * Sets metadata for `func`.
  7799. *
  7800. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7801. * period of time, it will trip its breaker and transition to an identity
  7802. * function to avoid garbage collection pauses in V8. See
  7803. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7804. * for more details.
  7805. *
  7806. * @private
  7807. * @param {Function} func The function to associate metadata with.
  7808. * @param {*} data The metadata.
  7809. * @returns {Function} Returns `func`.
  7810. */
  7811. var setData = shortOut(baseSetData);
  7812. /**
  7813. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7814. *
  7815. * @private
  7816. * @param {Function} func The function to delay.
  7817. * @param {number} wait The number of milliseconds to delay invocation.
  7818. * @returns {number|Object} Returns the timer id or timeout object.
  7819. */
  7820. var setTimeout = ctxSetTimeout || function(func, wait) {
  7821. return root.setTimeout(func, wait);
  7822. };
  7823. /**
  7824. * Sets the `toString` method of `func` to return `string`.
  7825. *
  7826. * @private
  7827. * @param {Function} func The function to modify.
  7828. * @param {Function} string The `toString` result.
  7829. * @returns {Function} Returns `func`.
  7830. */
  7831. var setToString = shortOut(baseSetToString);
  7832. /**
  7833. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7834. * with wrapper details in a comment at the top of the source body.
  7835. *
  7836. * @private
  7837. * @param {Function} wrapper The function to modify.
  7838. * @param {Function} reference The reference function.
  7839. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7840. * @returns {Function} Returns `wrapper`.
  7841. */
  7842. function setWrapToString(wrapper, reference, bitmask) {
  7843. var source = (reference + '');
  7844. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7845. }
  7846. /**
  7847. * Creates a function that'll short out and invoke `identity` instead
  7848. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7849. * milliseconds.
  7850. *
  7851. * @private
  7852. * @param {Function} func The function to restrict.
  7853. * @returns {Function} Returns the new shortable function.
  7854. */
  7855. function shortOut(func) {
  7856. var count = 0,
  7857. lastCalled = 0;
  7858. return function() {
  7859. var stamp = nativeNow(),
  7860. remaining = HOT_SPAN - (stamp - lastCalled);
  7861. lastCalled = stamp;
  7862. if (remaining > 0) {
  7863. if (++count >= HOT_COUNT) {
  7864. return arguments[0];
  7865. }
  7866. } else {
  7867. count = 0;
  7868. }
  7869. return func.apply(undefined, arguments);
  7870. };
  7871. }
  7872. /**
  7873. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7874. *
  7875. * @private
  7876. * @param {Array} array The array to shuffle.
  7877. * @param {number} [size=array.length] The size of `array`.
  7878. * @returns {Array} Returns `array`.
  7879. */
  7880. function shuffleSelf(array, size) {
  7881. var index = -1,
  7882. length = array.length,
  7883. lastIndex = length - 1;
  7884. size = size === undefined ? length : size;
  7885. while (++index < size) {
  7886. var rand = baseRandom(index, lastIndex),
  7887. value = array[rand];
  7888. array[rand] = array[index];
  7889. array[index] = value;
  7890. }
  7891. array.length = size;
  7892. return array;
  7893. }
  7894. /**
  7895. * Converts `string` to a property path array.
  7896. *
  7897. * @private
  7898. * @param {string} string The string to convert.
  7899. * @returns {Array} Returns the property path array.
  7900. */
  7901. var stringToPath = memoizeCapped(function(string) {
  7902. var result = [];
  7903. if (string.charCodeAt(0) === 46 /* . */) {
  7904. result.push('');
  7905. }
  7906. string.replace(rePropName, function(match, number, quote, subString) {
  7907. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7908. });
  7909. return result;
  7910. });
  7911. /**
  7912. * Converts `value` to a string key if it's not a string or symbol.
  7913. *
  7914. * @private
  7915. * @param {*} value The value to inspect.
  7916. * @returns {string|symbol} Returns the key.
  7917. */
  7918. function toKey(value) {
  7919. if (typeof value == 'string' || isSymbol(value)) {
  7920. return value;
  7921. }
  7922. var result = (value + '');
  7923. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7924. }
  7925. /**
  7926. * Converts `func` to its source code.
  7927. *
  7928. * @private
  7929. * @param {Function} func The function to convert.
  7930. * @returns {string} Returns the source code.
  7931. */
  7932. function toSource(func) {
  7933. if (func != null) {
  7934. try {
  7935. return funcToString.call(func);
  7936. } catch (e) {}
  7937. try {
  7938. return (func + '');
  7939. } catch (e) {}
  7940. }
  7941. return '';
  7942. }
  7943. /**
  7944. * Updates wrapper `details` based on `bitmask` flags.
  7945. *
  7946. * @private
  7947. * @returns {Array} details The details to modify.
  7948. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7949. * @returns {Array} Returns `details`.
  7950. */
  7951. function updateWrapDetails(details, bitmask) {
  7952. arrayEach(wrapFlags, function(pair) {
  7953. var value = '_.' + pair[0];
  7954. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7955. details.push(value);
  7956. }
  7957. });
  7958. return details.sort();
  7959. }
  7960. /**
  7961. * Creates a clone of `wrapper`.
  7962. *
  7963. * @private
  7964. * @param {Object} wrapper The wrapper to clone.
  7965. * @returns {Object} Returns the cloned wrapper.
  7966. */
  7967. function wrapperClone(wrapper) {
  7968. if (wrapper instanceof LazyWrapper) {
  7969. return wrapper.clone();
  7970. }
  7971. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7972. result.__actions__ = copyArray(wrapper.__actions__);
  7973. result.__index__ = wrapper.__index__;
  7974. result.__values__ = wrapper.__values__;
  7975. return result;
  7976. }
  7977. /*------------------------------------------------------------------------*/
  7978. /**
  7979. * Creates an array of elements split into groups the length of `size`.
  7980. * If `array` can't be split evenly, the final chunk will be the remaining
  7981. * elements.
  7982. *
  7983. * @static
  7984. * @memberOf _
  7985. * @since 3.0.0
  7986. * @category Array
  7987. * @param {Array} array The array to process.
  7988. * @param {number} [size=1] The length of each chunk
  7989. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7990. * @returns {Array} Returns the new array of chunks.
  7991. * @example
  7992. *
  7993. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7994. * // => [['a', 'b'], ['c', 'd']]
  7995. *
  7996. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7997. * // => [['a', 'b', 'c'], ['d']]
  7998. */
  7999. function chunk(array, size, guard) {
  8000. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  8001. size = 1;
  8002. } else {
  8003. size = nativeMax(toInteger(size), 0);
  8004. }
  8005. var length = array == null ? 0 : array.length;
  8006. if (!length || size < 1) {
  8007. return [];
  8008. }
  8009. var index = 0,
  8010. resIndex = 0,
  8011. result = Array(nativeCeil(length / size));
  8012. while (index < length) {
  8013. result[resIndex++] = baseSlice(array, index, (index += size));
  8014. }
  8015. return result;
  8016. }
  8017. /**
  8018. * Creates an array with all falsey values removed. The values `false`, `null`,
  8019. * `0`, `""`, `undefined`, and `NaN` are falsey.
  8020. *
  8021. * @static
  8022. * @memberOf _
  8023. * @since 0.1.0
  8024. * @category Array
  8025. * @param {Array} array The array to compact.
  8026. * @returns {Array} Returns the new array of filtered values.
  8027. * @example
  8028. *
  8029. * _.compact([0, 1, false, 2, '', 3]);
  8030. * // => [1, 2, 3]
  8031. */
  8032. function compact(array) {
  8033. var index = -1,
  8034. length = array == null ? 0 : array.length,
  8035. resIndex = 0,
  8036. result = [];
  8037. while (++index < length) {
  8038. var value = array[index];
  8039. if (value) {
  8040. result[resIndex++] = value;
  8041. }
  8042. }
  8043. return result;
  8044. }
  8045. /**
  8046. * Creates a new array concatenating `array` with any additional arrays
  8047. * and/or values.
  8048. *
  8049. * @static
  8050. * @memberOf _
  8051. * @since 4.0.0
  8052. * @category Array
  8053. * @param {Array} array The array to concatenate.
  8054. * @param {...*} [values] The values to concatenate.
  8055. * @returns {Array} Returns the new concatenated array.
  8056. * @example
  8057. *
  8058. * var array = [1];
  8059. * var other = _.concat(array, 2, [3], [[4]]);
  8060. *
  8061. * console.log(other);
  8062. * // => [1, 2, 3, [4]]
  8063. *
  8064. * console.log(array);
  8065. * // => [1]
  8066. */
  8067. function concat() {
  8068. var length = arguments.length;
  8069. if (!length) {
  8070. return [];
  8071. }
  8072. var args = Array(length - 1),
  8073. array = arguments[0],
  8074. index = length;
  8075. while (index--) {
  8076. args[index - 1] = arguments[index];
  8077. }
  8078. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  8079. }
  8080. /**
  8081. * Creates an array of `array` values not included in the other given arrays
  8082. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8083. * for equality comparisons. The order and references of result values are
  8084. * determined by the first array.
  8085. *
  8086. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  8087. *
  8088. * @static
  8089. * @memberOf _
  8090. * @since 0.1.0
  8091. * @category Array
  8092. * @param {Array} array The array to inspect.
  8093. * @param {...Array} [values] The values to exclude.
  8094. * @returns {Array} Returns the new array of filtered values.
  8095. * @see _.without, _.xor
  8096. * @example
  8097. *
  8098. * _.difference([2, 1], [2, 3]);
  8099. * // => [1]
  8100. */
  8101. var difference = baseRest(function(array, values) {
  8102. return isArrayLikeObject(array)
  8103. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  8104. : [];
  8105. });
  8106. /**
  8107. * This method is like `_.difference` except that it accepts `iteratee` which
  8108. * is invoked for each element of `array` and `values` to generate the criterion
  8109. * by which they're compared. The order and references of result values are
  8110. * determined by the first array. The iteratee is invoked with one argument:
  8111. * (value).
  8112. *
  8113. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  8114. *
  8115. * @static
  8116. * @memberOf _
  8117. * @since 4.0.0
  8118. * @category Array
  8119. * @param {Array} array The array to inspect.
  8120. * @param {...Array} [values] The values to exclude.
  8121. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8122. * @returns {Array} Returns the new array of filtered values.
  8123. * @example
  8124. *
  8125. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8126. * // => [1.2]
  8127. *
  8128. * // The `_.property` iteratee shorthand.
  8129. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  8130. * // => [{ 'x': 2 }]
  8131. */
  8132. var differenceBy = baseRest(function(array, values) {
  8133. var iteratee = last(values);
  8134. if (isArrayLikeObject(iteratee)) {
  8135. iteratee = undefined;
  8136. }
  8137. return isArrayLikeObject(array)
  8138. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  8139. : [];
  8140. });
  8141. /**
  8142. * This method is like `_.difference` except that it accepts `comparator`
  8143. * which is invoked to compare elements of `array` to `values`. The order and
  8144. * references of result values are determined by the first array. The comparator
  8145. * is invoked with two arguments: (arrVal, othVal).
  8146. *
  8147. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  8148. *
  8149. * @static
  8150. * @memberOf _
  8151. * @since 4.0.0
  8152. * @category Array
  8153. * @param {Array} array The array to inspect.
  8154. * @param {...Array} [values] The values to exclude.
  8155. * @param {Function} [comparator] The comparator invoked per element.
  8156. * @returns {Array} Returns the new array of filtered values.
  8157. * @example
  8158. *
  8159. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8160. *
  8161. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  8162. * // => [{ 'x': 2, 'y': 1 }]
  8163. */
  8164. var differenceWith = baseRest(function(array, values) {
  8165. var comparator = last(values);
  8166. if (isArrayLikeObject(comparator)) {
  8167. comparator = undefined;
  8168. }
  8169. return isArrayLikeObject(array)
  8170. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  8171. : [];
  8172. });
  8173. /**
  8174. * Creates a slice of `array` with `n` elements dropped from the beginning.
  8175. *
  8176. * @static
  8177. * @memberOf _
  8178. * @since 0.5.0
  8179. * @category Array
  8180. * @param {Array} array The array to query.
  8181. * @param {number} [n=1] The number of elements to drop.
  8182. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8183. * @returns {Array} Returns the slice of `array`.
  8184. * @example
  8185. *
  8186. * _.drop([1, 2, 3]);
  8187. * // => [2, 3]
  8188. *
  8189. * _.drop([1, 2, 3], 2);
  8190. * // => [3]
  8191. *
  8192. * _.drop([1, 2, 3], 5);
  8193. * // => []
  8194. *
  8195. * _.drop([1, 2, 3], 0);
  8196. * // => [1, 2, 3]
  8197. */
  8198. function drop(array, n, guard) {
  8199. var length = array == null ? 0 : array.length;
  8200. if (!length) {
  8201. return [];
  8202. }
  8203. n = (guard || n === undefined) ? 1 : toInteger(n);
  8204. return baseSlice(array, n < 0 ? 0 : n, length);
  8205. }
  8206. /**
  8207. * Creates a slice of `array` with `n` elements dropped from the end.
  8208. *
  8209. * @static
  8210. * @memberOf _
  8211. * @since 3.0.0
  8212. * @category Array
  8213. * @param {Array} array The array to query.
  8214. * @param {number} [n=1] The number of elements to drop.
  8215. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8216. * @returns {Array} Returns the slice of `array`.
  8217. * @example
  8218. *
  8219. * _.dropRight([1, 2, 3]);
  8220. * // => [1, 2]
  8221. *
  8222. * _.dropRight([1, 2, 3], 2);
  8223. * // => [1]
  8224. *
  8225. * _.dropRight([1, 2, 3], 5);
  8226. * // => []
  8227. *
  8228. * _.dropRight([1, 2, 3], 0);
  8229. * // => [1, 2, 3]
  8230. */
  8231. function dropRight(array, n, guard) {
  8232. var length = array == null ? 0 : array.length;
  8233. if (!length) {
  8234. return [];
  8235. }
  8236. n = (guard || n === undefined) ? 1 : toInteger(n);
  8237. n = length - n;
  8238. return baseSlice(array, 0, n < 0 ? 0 : n);
  8239. }
  8240. /**
  8241. * Creates a slice of `array` excluding elements dropped from the end.
  8242. * Elements are dropped until `predicate` returns falsey. The predicate is
  8243. * invoked with three arguments: (value, index, array).
  8244. *
  8245. * @static
  8246. * @memberOf _
  8247. * @since 3.0.0
  8248. * @category Array
  8249. * @param {Array} array The array to query.
  8250. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8251. * @returns {Array} Returns the slice of `array`.
  8252. * @example
  8253. *
  8254. * var users = [
  8255. * { 'user': 'barney', 'active': true },
  8256. * { 'user': 'fred', 'active': false },
  8257. * { 'user': 'pebbles', 'active': false }
  8258. * ];
  8259. *
  8260. * _.dropRightWhile(users, function(o) { return !o.active; });
  8261. * // => objects for ['barney']
  8262. *
  8263. * // The `_.matches` iteratee shorthand.
  8264. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  8265. * // => objects for ['barney', 'fred']
  8266. *
  8267. * // The `_.matchesProperty` iteratee shorthand.
  8268. * _.dropRightWhile(users, ['active', false]);
  8269. * // => objects for ['barney']
  8270. *
  8271. * // The `_.property` iteratee shorthand.
  8272. * _.dropRightWhile(users, 'active');
  8273. * // => objects for ['barney', 'fred', 'pebbles']
  8274. */
  8275. function dropRightWhile(array, predicate) {
  8276. return (array && array.length)
  8277. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  8278. : [];
  8279. }
  8280. /**
  8281. * Creates a slice of `array` excluding elements dropped from the beginning.
  8282. * Elements are dropped until `predicate` returns falsey. The predicate is
  8283. * invoked with three arguments: (value, index, array).
  8284. *
  8285. * @static
  8286. * @memberOf _
  8287. * @since 3.0.0
  8288. * @category Array
  8289. * @param {Array} array The array to query.
  8290. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8291. * @returns {Array} Returns the slice of `array`.
  8292. * @example
  8293. *
  8294. * var users = [
  8295. * { 'user': 'barney', 'active': false },
  8296. * { 'user': 'fred', 'active': false },
  8297. * { 'user': 'pebbles', 'active': true }
  8298. * ];
  8299. *
  8300. * _.dropWhile(users, function(o) { return !o.active; });
  8301. * // => objects for ['pebbles']
  8302. *
  8303. * // The `_.matches` iteratee shorthand.
  8304. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  8305. * // => objects for ['fred', 'pebbles']
  8306. *
  8307. * // The `_.matchesProperty` iteratee shorthand.
  8308. * _.dropWhile(users, ['active', false]);
  8309. * // => objects for ['pebbles']
  8310. *
  8311. * // The `_.property` iteratee shorthand.
  8312. * _.dropWhile(users, 'active');
  8313. * // => objects for ['barney', 'fred', 'pebbles']
  8314. */
  8315. function dropWhile(array, predicate) {
  8316. return (array && array.length)
  8317. ? baseWhile(array, getIteratee(predicate, 3), true)
  8318. : [];
  8319. }
  8320. /**
  8321. * Fills elements of `array` with `value` from `start` up to, but not
  8322. * including, `end`.
  8323. *
  8324. * **Note:** This method mutates `array`.
  8325. *
  8326. * @static
  8327. * @memberOf _
  8328. * @since 3.2.0
  8329. * @category Array
  8330. * @param {Array} array The array to fill.
  8331. * @param {*} value The value to fill `array` with.
  8332. * @param {number} [start=0] The start position.
  8333. * @param {number} [end=array.length] The end position.
  8334. * @returns {Array} Returns `array`.
  8335. * @example
  8336. *
  8337. * var array = [1, 2, 3];
  8338. *
  8339. * _.fill(array, 'a');
  8340. * console.log(array);
  8341. * // => ['a', 'a', 'a']
  8342. *
  8343. * _.fill(Array(3), 2);
  8344. * // => [2, 2, 2]
  8345. *
  8346. * _.fill([4, 6, 8, 10], '*', 1, 3);
  8347. * // => [4, '*', '*', 10]
  8348. */
  8349. function fill(array, value, start, end) {
  8350. var length = array == null ? 0 : array.length;
  8351. if (!length) {
  8352. return [];
  8353. }
  8354. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  8355. start = 0;
  8356. end = length;
  8357. }
  8358. return baseFill(array, value, start, end);
  8359. }
  8360. /**
  8361. * This method is like `_.find` except that it returns the index of the first
  8362. * element `predicate` returns truthy for instead of the element itself.
  8363. *
  8364. * @static
  8365. * @memberOf _
  8366. * @since 1.1.0
  8367. * @category Array
  8368. * @param {Array} array The array to inspect.
  8369. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8370. * @param {number} [fromIndex=0] The index to search from.
  8371. * @returns {number} Returns the index of the found element, else `-1`.
  8372. * @example
  8373. *
  8374. * var users = [
  8375. * { 'user': 'barney', 'active': false },
  8376. * { 'user': 'fred', 'active': false },
  8377. * { 'user': 'pebbles', 'active': true }
  8378. * ];
  8379. *
  8380. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8381. * // => 0
  8382. *
  8383. * // The `_.matches` iteratee shorthand.
  8384. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8385. * // => 1
  8386. *
  8387. * // The `_.matchesProperty` iteratee shorthand.
  8388. * _.findIndex(users, ['active', false]);
  8389. * // => 0
  8390. *
  8391. * // The `_.property` iteratee shorthand.
  8392. * _.findIndex(users, 'active');
  8393. * // => 2
  8394. */
  8395. function findIndex(array, predicate, fromIndex) {
  8396. var length = array == null ? 0 : array.length;
  8397. if (!length) {
  8398. return -1;
  8399. }
  8400. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8401. if (index < 0) {
  8402. index = nativeMax(length + index, 0);
  8403. }
  8404. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8405. }
  8406. /**
  8407. * This method is like `_.findIndex` except that it iterates over elements
  8408. * of `collection` from right to left.
  8409. *
  8410. * @static
  8411. * @memberOf _
  8412. * @since 2.0.0
  8413. * @category Array
  8414. * @param {Array} array The array to inspect.
  8415. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8416. * @param {number} [fromIndex=array.length-1] The index to search from.
  8417. * @returns {number} Returns the index of the found element, else `-1`.
  8418. * @example
  8419. *
  8420. * var users = [
  8421. * { 'user': 'barney', 'active': true },
  8422. * { 'user': 'fred', 'active': false },
  8423. * { 'user': 'pebbles', 'active': false }
  8424. * ];
  8425. *
  8426. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8427. * // => 2
  8428. *
  8429. * // The `_.matches` iteratee shorthand.
  8430. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8431. * // => 0
  8432. *
  8433. * // The `_.matchesProperty` iteratee shorthand.
  8434. * _.findLastIndex(users, ['active', false]);
  8435. * // => 2
  8436. *
  8437. * // The `_.property` iteratee shorthand.
  8438. * _.findLastIndex(users, 'active');
  8439. * // => 0
  8440. */
  8441. function findLastIndex(array, predicate, fromIndex) {
  8442. var length = array == null ? 0 : array.length;
  8443. if (!length) {
  8444. return -1;
  8445. }
  8446. var index = length - 1;
  8447. if (fromIndex !== undefined) {
  8448. index = toInteger(fromIndex);
  8449. index = fromIndex < 0
  8450. ? nativeMax(length + index, 0)
  8451. : nativeMin(index, length - 1);
  8452. }
  8453. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8454. }
  8455. /**
  8456. * Flattens `array` a single level deep.
  8457. *
  8458. * @static
  8459. * @memberOf _
  8460. * @since 0.1.0
  8461. * @category Array
  8462. * @param {Array} array The array to flatten.
  8463. * @returns {Array} Returns the new flattened array.
  8464. * @example
  8465. *
  8466. * _.flatten([1, [2, [3, [4]], 5]]);
  8467. * // => [1, 2, [3, [4]], 5]
  8468. */
  8469. function flatten(array) {
  8470. var length = array == null ? 0 : array.length;
  8471. return length ? baseFlatten(array, 1) : [];
  8472. }
  8473. /**
  8474. * Recursively flattens `array`.
  8475. *
  8476. * @static
  8477. * @memberOf _
  8478. * @since 3.0.0
  8479. * @category Array
  8480. * @param {Array} array The array to flatten.
  8481. * @returns {Array} Returns the new flattened array.
  8482. * @example
  8483. *
  8484. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8485. * // => [1, 2, 3, 4, 5]
  8486. */
  8487. function flattenDeep(array) {
  8488. var length = array == null ? 0 : array.length;
  8489. return length ? baseFlatten(array, INFINITY) : [];
  8490. }
  8491. /**
  8492. * Recursively flatten `array` up to `depth` times.
  8493. *
  8494. * @static
  8495. * @memberOf _
  8496. * @since 4.4.0
  8497. * @category Array
  8498. * @param {Array} array The array to flatten.
  8499. * @param {number} [depth=1] The maximum recursion depth.
  8500. * @returns {Array} Returns the new flattened array.
  8501. * @example
  8502. *
  8503. * var array = [1, [2, [3, [4]], 5]];
  8504. *
  8505. * _.flattenDepth(array, 1);
  8506. * // => [1, 2, [3, [4]], 5]
  8507. *
  8508. * _.flattenDepth(array, 2);
  8509. * // => [1, 2, 3, [4], 5]
  8510. */
  8511. function flattenDepth(array, depth) {
  8512. var length = array == null ? 0 : array.length;
  8513. if (!length) {
  8514. return [];
  8515. }
  8516. depth = depth === undefined ? 1 : toInteger(depth);
  8517. return baseFlatten(array, depth);
  8518. }
  8519. /**
  8520. * The inverse of `_.toPairs`; this method returns an object composed
  8521. * from key-value `pairs`.
  8522. *
  8523. * @static
  8524. * @memberOf _
  8525. * @since 4.0.0
  8526. * @category Array
  8527. * @param {Array} pairs The key-value pairs.
  8528. * @returns {Object} Returns the new object.
  8529. * @example
  8530. *
  8531. * _.fromPairs([['a', 1], ['b', 2]]);
  8532. * // => { 'a': 1, 'b': 2 }
  8533. */
  8534. function fromPairs(pairs) {
  8535. var index = -1,
  8536. length = pairs == null ? 0 : pairs.length,
  8537. result = {};
  8538. while (++index < length) {
  8539. var pair = pairs[index];
  8540. result[pair[0]] = pair[1];
  8541. }
  8542. return result;
  8543. }
  8544. /**
  8545. * Gets the first element of `array`.
  8546. *
  8547. * @static
  8548. * @memberOf _
  8549. * @since 0.1.0
  8550. * @alias first
  8551. * @category Array
  8552. * @param {Array} array The array to query.
  8553. * @returns {*} Returns the first element of `array`.
  8554. * @example
  8555. *
  8556. * _.head([1, 2, 3]);
  8557. * // => 1
  8558. *
  8559. * _.head([]);
  8560. * // => undefined
  8561. */
  8562. function head(array) {
  8563. return (array && array.length) ? array[0] : undefined;
  8564. }
  8565. /**
  8566. * Gets the index at which the first occurrence of `value` is found in `array`
  8567. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8568. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8569. * offset from the end of `array`.
  8570. *
  8571. * @static
  8572. * @memberOf _
  8573. * @since 0.1.0
  8574. * @category Array
  8575. * @param {Array} array The array to inspect.
  8576. * @param {*} value The value to search for.
  8577. * @param {number} [fromIndex=0] The index to search from.
  8578. * @returns {number} Returns the index of the matched value, else `-1`.
  8579. * @example
  8580. *
  8581. * _.indexOf([1, 2, 1, 2], 2);
  8582. * // => 1
  8583. *
  8584. * // Search from the `fromIndex`.
  8585. * _.indexOf([1, 2, 1, 2], 2, 2);
  8586. * // => 3
  8587. */
  8588. function indexOf(array, value, fromIndex) {
  8589. var length = array == null ? 0 : array.length;
  8590. if (!length) {
  8591. return -1;
  8592. }
  8593. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8594. if (index < 0) {
  8595. index = nativeMax(length + index, 0);
  8596. }
  8597. return baseIndexOf(array, value, index);
  8598. }
  8599. /**
  8600. * Gets all but the last element of `array`.
  8601. *
  8602. * @static
  8603. * @memberOf _
  8604. * @since 0.1.0
  8605. * @category Array
  8606. * @param {Array} array The array to query.
  8607. * @returns {Array} Returns the slice of `array`.
  8608. * @example
  8609. *
  8610. * _.initial([1, 2, 3]);
  8611. * // => [1, 2]
  8612. */
  8613. function initial(array) {
  8614. var length = array == null ? 0 : array.length;
  8615. return length ? baseSlice(array, 0, -1) : [];
  8616. }
  8617. /**
  8618. * Creates an array of unique values that are included in all given arrays
  8619. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8620. * for equality comparisons. The order and references of result values are
  8621. * determined by the first array.
  8622. *
  8623. * @static
  8624. * @memberOf _
  8625. * @since 0.1.0
  8626. * @category Array
  8627. * @param {...Array} [arrays] The arrays to inspect.
  8628. * @returns {Array} Returns the new array of intersecting values.
  8629. * @example
  8630. *
  8631. * _.intersection([2, 1], [2, 3]);
  8632. * // => [2]
  8633. */
  8634. var intersection = baseRest(function(arrays) {
  8635. var mapped = arrayMap(arrays, castArrayLikeObject);
  8636. return (mapped.length && mapped[0] === arrays[0])
  8637. ? baseIntersection(mapped)
  8638. : [];
  8639. });
  8640. /**
  8641. * This method is like `_.intersection` except that it accepts `iteratee`
  8642. * which is invoked for each element of each `arrays` to generate the criterion
  8643. * by which they're compared. The order and references of result values are
  8644. * determined by the first array. The iteratee is invoked with one argument:
  8645. * (value).
  8646. *
  8647. * @static
  8648. * @memberOf _
  8649. * @since 4.0.0
  8650. * @category Array
  8651. * @param {...Array} [arrays] The arrays to inspect.
  8652. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8653. * @returns {Array} Returns the new array of intersecting values.
  8654. * @example
  8655. *
  8656. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8657. * // => [2.1]
  8658. *
  8659. * // The `_.property` iteratee shorthand.
  8660. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8661. * // => [{ 'x': 1 }]
  8662. */
  8663. var intersectionBy = baseRest(function(arrays) {
  8664. var iteratee = last(arrays),
  8665. mapped = arrayMap(arrays, castArrayLikeObject);
  8666. if (iteratee === last(mapped)) {
  8667. iteratee = undefined;
  8668. } else {
  8669. mapped.pop();
  8670. }
  8671. return (mapped.length && mapped[0] === arrays[0])
  8672. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8673. : [];
  8674. });
  8675. /**
  8676. * This method is like `_.intersection` except that it accepts `comparator`
  8677. * which is invoked to compare elements of `arrays`. The order and references
  8678. * of result values are determined by the first array. The comparator is
  8679. * invoked with two arguments: (arrVal, othVal).
  8680. *
  8681. * @static
  8682. * @memberOf _
  8683. * @since 4.0.0
  8684. * @category Array
  8685. * @param {...Array} [arrays] The arrays to inspect.
  8686. * @param {Function} [comparator] The comparator invoked per element.
  8687. * @returns {Array} Returns the new array of intersecting values.
  8688. * @example
  8689. *
  8690. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8691. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8692. *
  8693. * _.intersectionWith(objects, others, _.isEqual);
  8694. * // => [{ 'x': 1, 'y': 2 }]
  8695. */
  8696. var intersectionWith = baseRest(function(arrays) {
  8697. var comparator = last(arrays),
  8698. mapped = arrayMap(arrays, castArrayLikeObject);
  8699. comparator = typeof comparator == 'function' ? comparator : undefined;
  8700. if (comparator) {
  8701. mapped.pop();
  8702. }
  8703. return (mapped.length && mapped[0] === arrays[0])
  8704. ? baseIntersection(mapped, undefined, comparator)
  8705. : [];
  8706. });
  8707. /**
  8708. * Converts all elements in `array` into a string separated by `separator`.
  8709. *
  8710. * @static
  8711. * @memberOf _
  8712. * @since 4.0.0
  8713. * @category Array
  8714. * @param {Array} array The array to convert.
  8715. * @param {string} [separator=','] The element separator.
  8716. * @returns {string} Returns the joined string.
  8717. * @example
  8718. *
  8719. * _.join(['a', 'b', 'c'], '~');
  8720. * // => 'a~b~c'
  8721. */
  8722. function join(array, separator) {
  8723. return array == null ? '' : nativeJoin.call(array, separator);
  8724. }
  8725. /**
  8726. * Gets the last element of `array`.
  8727. *
  8728. * @static
  8729. * @memberOf _
  8730. * @since 0.1.0
  8731. * @category Array
  8732. * @param {Array} array The array to query.
  8733. * @returns {*} Returns the last element of `array`.
  8734. * @example
  8735. *
  8736. * _.last([1, 2, 3]);
  8737. * // => 3
  8738. */
  8739. function last(array) {
  8740. var length = array == null ? 0 : array.length;
  8741. return length ? array[length - 1] : undefined;
  8742. }
  8743. /**
  8744. * This method is like `_.indexOf` except that it iterates over elements of
  8745. * `array` from right to left.
  8746. *
  8747. * @static
  8748. * @memberOf _
  8749. * @since 0.1.0
  8750. * @category Array
  8751. * @param {Array} array The array to inspect.
  8752. * @param {*} value The value to search for.
  8753. * @param {number} [fromIndex=array.length-1] The index to search from.
  8754. * @returns {number} Returns the index of the matched value, else `-1`.
  8755. * @example
  8756. *
  8757. * _.lastIndexOf([1, 2, 1, 2], 2);
  8758. * // => 3
  8759. *
  8760. * // Search from the `fromIndex`.
  8761. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8762. * // => 1
  8763. */
  8764. function lastIndexOf(array, value, fromIndex) {
  8765. var length = array == null ? 0 : array.length;
  8766. if (!length) {
  8767. return -1;
  8768. }
  8769. var index = length;
  8770. if (fromIndex !== undefined) {
  8771. index = toInteger(fromIndex);
  8772. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8773. }
  8774. return value === value
  8775. ? strictLastIndexOf(array, value, index)
  8776. : baseFindIndex(array, baseIsNaN, index, true);
  8777. }
  8778. /**
  8779. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8780. * element from the end is returned.
  8781. *
  8782. * @static
  8783. * @memberOf _
  8784. * @since 4.11.0
  8785. * @category Array
  8786. * @param {Array} array The array to query.
  8787. * @param {number} [n=0] The index of the element to return.
  8788. * @returns {*} Returns the nth element of `array`.
  8789. * @example
  8790. *
  8791. * var array = ['a', 'b', 'c', 'd'];
  8792. *
  8793. * _.nth(array, 1);
  8794. * // => 'b'
  8795. *
  8796. * _.nth(array, -2);
  8797. * // => 'c';
  8798. */
  8799. function nth(array, n) {
  8800. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8801. }
  8802. /**
  8803. * Removes all given values from `array` using
  8804. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8805. * for equality comparisons.
  8806. *
  8807. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8808. * to remove elements from an array by predicate.
  8809. *
  8810. * @static
  8811. * @memberOf _
  8812. * @since 2.0.0
  8813. * @category Array
  8814. * @param {Array} array The array to modify.
  8815. * @param {...*} [values] The values to remove.
  8816. * @returns {Array} Returns `array`.
  8817. * @example
  8818. *
  8819. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8820. *
  8821. * _.pull(array, 'a', 'c');
  8822. * console.log(array);
  8823. * // => ['b', 'b']
  8824. */
  8825. var pull = baseRest(pullAll);
  8826. /**
  8827. * This method is like `_.pull` except that it accepts an array of values to remove.
  8828. *
  8829. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8830. *
  8831. * @static
  8832. * @memberOf _
  8833. * @since 4.0.0
  8834. * @category Array
  8835. * @param {Array} array The array to modify.
  8836. * @param {Array} values The values to remove.
  8837. * @returns {Array} Returns `array`.
  8838. * @example
  8839. *
  8840. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8841. *
  8842. * _.pullAll(array, ['a', 'c']);
  8843. * console.log(array);
  8844. * // => ['b', 'b']
  8845. */
  8846. function pullAll(array, values) {
  8847. return (array && array.length && values && values.length)
  8848. ? basePullAll(array, values)
  8849. : array;
  8850. }
  8851. /**
  8852. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8853. * invoked for each element of `array` and `values` to generate the criterion
  8854. * by which they're compared. The iteratee is invoked with one argument: (value).
  8855. *
  8856. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8857. *
  8858. * @static
  8859. * @memberOf _
  8860. * @since 4.0.0
  8861. * @category Array
  8862. * @param {Array} array The array to modify.
  8863. * @param {Array} values The values to remove.
  8864. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8865. * @returns {Array} Returns `array`.
  8866. * @example
  8867. *
  8868. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8869. *
  8870. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8871. * console.log(array);
  8872. * // => [{ 'x': 2 }]
  8873. */
  8874. function pullAllBy(array, values, iteratee) {
  8875. return (array && array.length && values && values.length)
  8876. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8877. : array;
  8878. }
  8879. /**
  8880. * This method is like `_.pullAll` except that it accepts `comparator` which
  8881. * is invoked to compare elements of `array` to `values`. The comparator is
  8882. * invoked with two arguments: (arrVal, othVal).
  8883. *
  8884. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8885. *
  8886. * @static
  8887. * @memberOf _
  8888. * @since 4.6.0
  8889. * @category Array
  8890. * @param {Array} array The array to modify.
  8891. * @param {Array} values The values to remove.
  8892. * @param {Function} [comparator] The comparator invoked per element.
  8893. * @returns {Array} Returns `array`.
  8894. * @example
  8895. *
  8896. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8897. *
  8898. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8899. * console.log(array);
  8900. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8901. */
  8902. function pullAllWith(array, values, comparator) {
  8903. return (array && array.length && values && values.length)
  8904. ? basePullAll(array, values, undefined, comparator)
  8905. : array;
  8906. }
  8907. /**
  8908. * Removes elements from `array` corresponding to `indexes` and returns an
  8909. * array of removed elements.
  8910. *
  8911. * **Note:** Unlike `_.at`, this method mutates `array`.
  8912. *
  8913. * @static
  8914. * @memberOf _
  8915. * @since 3.0.0
  8916. * @category Array
  8917. * @param {Array} array The array to modify.
  8918. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8919. * @returns {Array} Returns the new array of removed elements.
  8920. * @example
  8921. *
  8922. * var array = ['a', 'b', 'c', 'd'];
  8923. * var pulled = _.pullAt(array, [1, 3]);
  8924. *
  8925. * console.log(array);
  8926. * // => ['a', 'c']
  8927. *
  8928. * console.log(pulled);
  8929. * // => ['b', 'd']
  8930. */
  8931. var pullAt = flatRest(function(array, indexes) {
  8932. var length = array == null ? 0 : array.length,
  8933. result = baseAt(array, indexes);
  8934. basePullAt(array, arrayMap(indexes, function(index) {
  8935. return isIndex(index, length) ? +index : index;
  8936. }).sort(compareAscending));
  8937. return result;
  8938. });
  8939. /**
  8940. * Removes all elements from `array` that `predicate` returns truthy for
  8941. * and returns an array of the removed elements. The predicate is invoked
  8942. * with three arguments: (value, index, array).
  8943. *
  8944. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8945. * to pull elements from an array by value.
  8946. *
  8947. * @static
  8948. * @memberOf _
  8949. * @since 2.0.0
  8950. * @category Array
  8951. * @param {Array} array The array to modify.
  8952. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8953. * @returns {Array} Returns the new array of removed elements.
  8954. * @example
  8955. *
  8956. * var array = [1, 2, 3, 4];
  8957. * var evens = _.remove(array, function(n) {
  8958. * return n % 2 == 0;
  8959. * });
  8960. *
  8961. * console.log(array);
  8962. * // => [1, 3]
  8963. *
  8964. * console.log(evens);
  8965. * // => [2, 4]
  8966. */
  8967. function remove(array, predicate) {
  8968. var result = [];
  8969. if (!(array && array.length)) {
  8970. return result;
  8971. }
  8972. var index = -1,
  8973. indexes = [],
  8974. length = array.length;
  8975. predicate = getIteratee(predicate, 3);
  8976. while (++index < length) {
  8977. var value = array[index];
  8978. if (predicate(value, index, array)) {
  8979. result.push(value);
  8980. indexes.push(index);
  8981. }
  8982. }
  8983. basePullAt(array, indexes);
  8984. return result;
  8985. }
  8986. /**
  8987. * Reverses `array` so that the first element becomes the last, the second
  8988. * element becomes the second to last, and so on.
  8989. *
  8990. * **Note:** This method mutates `array` and is based on
  8991. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8992. *
  8993. * @static
  8994. * @memberOf _
  8995. * @since 4.0.0
  8996. * @category Array
  8997. * @param {Array} array The array to modify.
  8998. * @returns {Array} Returns `array`.
  8999. * @example
  9000. *
  9001. * var array = [1, 2, 3];
  9002. *
  9003. * _.reverse(array);
  9004. * // => [3, 2, 1]
  9005. *
  9006. * console.log(array);
  9007. * // => [3, 2, 1]
  9008. */
  9009. function reverse(array) {
  9010. return array == null ? array : nativeReverse.call(array);
  9011. }
  9012. /**
  9013. * Creates a slice of `array` from `start` up to, but not including, `end`.
  9014. *
  9015. * **Note:** This method is used instead of
  9016. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  9017. * returned.
  9018. *
  9019. * @static
  9020. * @memberOf _
  9021. * @since 3.0.0
  9022. * @category Array
  9023. * @param {Array} array The array to slice.
  9024. * @param {number} [start=0] The start position.
  9025. * @param {number} [end=array.length] The end position.
  9026. * @returns {Array} Returns the slice of `array`.
  9027. */
  9028. function slice(array, start, end) {
  9029. var length = array == null ? 0 : array.length;
  9030. if (!length) {
  9031. return [];
  9032. }
  9033. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  9034. start = 0;
  9035. end = length;
  9036. }
  9037. else {
  9038. start = start == null ? 0 : toInteger(start);
  9039. end = end === undefined ? length : toInteger(end);
  9040. }
  9041. return baseSlice(array, start, end);
  9042. }
  9043. /**
  9044. * Uses a binary search to determine the lowest index at which `value`
  9045. * should be inserted into `array` in order to maintain its sort order.
  9046. *
  9047. * @static
  9048. * @memberOf _
  9049. * @since 0.1.0
  9050. * @category Array
  9051. * @param {Array} array The sorted array to inspect.
  9052. * @param {*} value The value to evaluate.
  9053. * @returns {number} Returns the index at which `value` should be inserted
  9054. * into `array`.
  9055. * @example
  9056. *
  9057. * _.sortedIndex([30, 50], 40);
  9058. * // => 1
  9059. */
  9060. function sortedIndex(array, value) {
  9061. return baseSortedIndex(array, value);
  9062. }
  9063. /**
  9064. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  9065. * which is invoked for `value` and each element of `array` to compute their
  9066. * sort ranking. The iteratee is invoked with one argument: (value).
  9067. *
  9068. * @static
  9069. * @memberOf _
  9070. * @since 4.0.0
  9071. * @category Array
  9072. * @param {Array} array The sorted array to inspect.
  9073. * @param {*} value The value to evaluate.
  9074. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9075. * @returns {number} Returns the index at which `value` should be inserted
  9076. * into `array`.
  9077. * @example
  9078. *
  9079. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9080. *
  9081. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9082. * // => 0
  9083. *
  9084. * // The `_.property` iteratee shorthand.
  9085. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  9086. * // => 0
  9087. */
  9088. function sortedIndexBy(array, value, iteratee) {
  9089. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  9090. }
  9091. /**
  9092. * This method is like `_.indexOf` except that it performs a binary
  9093. * search on a sorted `array`.
  9094. *
  9095. * @static
  9096. * @memberOf _
  9097. * @since 4.0.0
  9098. * @category Array
  9099. * @param {Array} array The array to inspect.
  9100. * @param {*} value The value to search for.
  9101. * @returns {number} Returns the index of the matched value, else `-1`.
  9102. * @example
  9103. *
  9104. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  9105. * // => 1
  9106. */
  9107. function sortedIndexOf(array, value) {
  9108. var length = array == null ? 0 : array.length;
  9109. if (length) {
  9110. var index = baseSortedIndex(array, value);
  9111. if (index < length && eq(array[index], value)) {
  9112. return index;
  9113. }
  9114. }
  9115. return -1;
  9116. }
  9117. /**
  9118. * This method is like `_.sortedIndex` except that it returns the highest
  9119. * index at which `value` should be inserted into `array` in order to
  9120. * maintain its sort order.
  9121. *
  9122. * @static
  9123. * @memberOf _
  9124. * @since 3.0.0
  9125. * @category Array
  9126. * @param {Array} array The sorted array to inspect.
  9127. * @param {*} value The value to evaluate.
  9128. * @returns {number} Returns the index at which `value` should be inserted
  9129. * into `array`.
  9130. * @example
  9131. *
  9132. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  9133. * // => 4
  9134. */
  9135. function sortedLastIndex(array, value) {
  9136. return baseSortedIndex(array, value, true);
  9137. }
  9138. /**
  9139. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  9140. * which is invoked for `value` and each element of `array` to compute their
  9141. * sort ranking. The iteratee is invoked with one argument: (value).
  9142. *
  9143. * @static
  9144. * @memberOf _
  9145. * @since 4.0.0
  9146. * @category Array
  9147. * @param {Array} array The sorted array to inspect.
  9148. * @param {*} value The value to evaluate.
  9149. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9150. * @returns {number} Returns the index at which `value` should be inserted
  9151. * into `array`.
  9152. * @example
  9153. *
  9154. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9155. *
  9156. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9157. * // => 1
  9158. *
  9159. * // The `_.property` iteratee shorthand.
  9160. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  9161. * // => 1
  9162. */
  9163. function sortedLastIndexBy(array, value, iteratee) {
  9164. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  9165. }
  9166. /**
  9167. * This method is like `_.lastIndexOf` except that it performs a binary
  9168. * search on a sorted `array`.
  9169. *
  9170. * @static
  9171. * @memberOf _
  9172. * @since 4.0.0
  9173. * @category Array
  9174. * @param {Array} array The array to inspect.
  9175. * @param {*} value The value to search for.
  9176. * @returns {number} Returns the index of the matched value, else `-1`.
  9177. * @example
  9178. *
  9179. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  9180. * // => 3
  9181. */
  9182. function sortedLastIndexOf(array, value) {
  9183. var length = array == null ? 0 : array.length;
  9184. if (length) {
  9185. var index = baseSortedIndex(array, value, true) - 1;
  9186. if (eq(array[index], value)) {
  9187. return index;
  9188. }
  9189. }
  9190. return -1;
  9191. }
  9192. /**
  9193. * This method is like `_.uniq` except that it's designed and optimized
  9194. * for sorted arrays.
  9195. *
  9196. * @static
  9197. * @memberOf _
  9198. * @since 4.0.0
  9199. * @category Array
  9200. * @param {Array} array The array to inspect.
  9201. * @returns {Array} Returns the new duplicate free array.
  9202. * @example
  9203. *
  9204. * _.sortedUniq([1, 1, 2]);
  9205. * // => [1, 2]
  9206. */
  9207. function sortedUniq(array) {
  9208. return (array && array.length)
  9209. ? baseSortedUniq(array)
  9210. : [];
  9211. }
  9212. /**
  9213. * This method is like `_.uniqBy` except that it's designed and optimized
  9214. * for sorted arrays.
  9215. *
  9216. * @static
  9217. * @memberOf _
  9218. * @since 4.0.0
  9219. * @category Array
  9220. * @param {Array} array The array to inspect.
  9221. * @param {Function} [iteratee] The iteratee invoked per element.
  9222. * @returns {Array} Returns the new duplicate free array.
  9223. * @example
  9224. *
  9225. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  9226. * // => [1.1, 2.3]
  9227. */
  9228. function sortedUniqBy(array, iteratee) {
  9229. return (array && array.length)
  9230. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  9231. : [];
  9232. }
  9233. /**
  9234. * Gets all but the first element of `array`.
  9235. *
  9236. * @static
  9237. * @memberOf _
  9238. * @since 4.0.0
  9239. * @category Array
  9240. * @param {Array} array The array to query.
  9241. * @returns {Array} Returns the slice of `array`.
  9242. * @example
  9243. *
  9244. * _.tail([1, 2, 3]);
  9245. * // => [2, 3]
  9246. */
  9247. function tail(array) {
  9248. var length = array == null ? 0 : array.length;
  9249. return length ? baseSlice(array, 1, length) : [];
  9250. }
  9251. /**
  9252. * Creates a slice of `array` with `n` elements taken from the beginning.
  9253. *
  9254. * @static
  9255. * @memberOf _
  9256. * @since 0.1.0
  9257. * @category Array
  9258. * @param {Array} array The array to query.
  9259. * @param {number} [n=1] The number of elements to take.
  9260. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9261. * @returns {Array} Returns the slice of `array`.
  9262. * @example
  9263. *
  9264. * _.take([1, 2, 3]);
  9265. * // => [1]
  9266. *
  9267. * _.take([1, 2, 3], 2);
  9268. * // => [1, 2]
  9269. *
  9270. * _.take([1, 2, 3], 5);
  9271. * // => [1, 2, 3]
  9272. *
  9273. * _.take([1, 2, 3], 0);
  9274. * // => []
  9275. */
  9276. function take(array, n, guard) {
  9277. if (!(array && array.length)) {
  9278. return [];
  9279. }
  9280. n = (guard || n === undefined) ? 1 : toInteger(n);
  9281. return baseSlice(array, 0, n < 0 ? 0 : n);
  9282. }
  9283. /**
  9284. * Creates a slice of `array` with `n` elements taken from the end.
  9285. *
  9286. * @static
  9287. * @memberOf _
  9288. * @since 3.0.0
  9289. * @category Array
  9290. * @param {Array} array The array to query.
  9291. * @param {number} [n=1] The number of elements to take.
  9292. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9293. * @returns {Array} Returns the slice of `array`.
  9294. * @example
  9295. *
  9296. * _.takeRight([1, 2, 3]);
  9297. * // => [3]
  9298. *
  9299. * _.takeRight([1, 2, 3], 2);
  9300. * // => [2, 3]
  9301. *
  9302. * _.takeRight([1, 2, 3], 5);
  9303. * // => [1, 2, 3]
  9304. *
  9305. * _.takeRight([1, 2, 3], 0);
  9306. * // => []
  9307. */
  9308. function takeRight(array, n, guard) {
  9309. var length = array == null ? 0 : array.length;
  9310. if (!length) {
  9311. return [];
  9312. }
  9313. n = (guard || n === undefined) ? 1 : toInteger(n);
  9314. n = length - n;
  9315. return baseSlice(array, n < 0 ? 0 : n, length);
  9316. }
  9317. /**
  9318. * Creates a slice of `array` with elements taken from the end. Elements are
  9319. * taken until `predicate` returns falsey. The predicate is invoked with
  9320. * three arguments: (value, index, array).
  9321. *
  9322. * @static
  9323. * @memberOf _
  9324. * @since 3.0.0
  9325. * @category Array
  9326. * @param {Array} array The array to query.
  9327. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9328. * @returns {Array} Returns the slice of `array`.
  9329. * @example
  9330. *
  9331. * var users = [
  9332. * { 'user': 'barney', 'active': true },
  9333. * { 'user': 'fred', 'active': false },
  9334. * { 'user': 'pebbles', 'active': false }
  9335. * ];
  9336. *
  9337. * _.takeRightWhile(users, function(o) { return !o.active; });
  9338. * // => objects for ['fred', 'pebbles']
  9339. *
  9340. * // The `_.matches` iteratee shorthand.
  9341. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  9342. * // => objects for ['pebbles']
  9343. *
  9344. * // The `_.matchesProperty` iteratee shorthand.
  9345. * _.takeRightWhile(users, ['active', false]);
  9346. * // => objects for ['fred', 'pebbles']
  9347. *
  9348. * // The `_.property` iteratee shorthand.
  9349. * _.takeRightWhile(users, 'active');
  9350. * // => []
  9351. */
  9352. function takeRightWhile(array, predicate) {
  9353. return (array && array.length)
  9354. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  9355. : [];
  9356. }
  9357. /**
  9358. * Creates a slice of `array` with elements taken from the beginning. Elements
  9359. * are taken until `predicate` returns falsey. The predicate is invoked with
  9360. * three arguments: (value, index, array).
  9361. *
  9362. * @static
  9363. * @memberOf _
  9364. * @since 3.0.0
  9365. * @category Array
  9366. * @param {Array} array The array to query.
  9367. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9368. * @returns {Array} Returns the slice of `array`.
  9369. * @example
  9370. *
  9371. * var users = [
  9372. * { 'user': 'barney', 'active': false },
  9373. * { 'user': 'fred', 'active': false },
  9374. * { 'user': 'pebbles', 'active': true }
  9375. * ];
  9376. *
  9377. * _.takeWhile(users, function(o) { return !o.active; });
  9378. * // => objects for ['barney', 'fred']
  9379. *
  9380. * // The `_.matches` iteratee shorthand.
  9381. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9382. * // => objects for ['barney']
  9383. *
  9384. * // The `_.matchesProperty` iteratee shorthand.
  9385. * _.takeWhile(users, ['active', false]);
  9386. * // => objects for ['barney', 'fred']
  9387. *
  9388. * // The `_.property` iteratee shorthand.
  9389. * _.takeWhile(users, 'active');
  9390. * // => []
  9391. */
  9392. function takeWhile(array, predicate) {
  9393. return (array && array.length)
  9394. ? baseWhile(array, getIteratee(predicate, 3))
  9395. : [];
  9396. }
  9397. /**
  9398. * Creates an array of unique values, in order, from all given arrays using
  9399. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9400. * for equality comparisons.
  9401. *
  9402. * @static
  9403. * @memberOf _
  9404. * @since 0.1.0
  9405. * @category Array
  9406. * @param {...Array} [arrays] The arrays to inspect.
  9407. * @returns {Array} Returns the new array of combined values.
  9408. * @example
  9409. *
  9410. * _.union([2], [1, 2]);
  9411. * // => [2, 1]
  9412. */
  9413. var union = baseRest(function(arrays) {
  9414. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9415. });
  9416. /**
  9417. * This method is like `_.union` except that it accepts `iteratee` which is
  9418. * invoked for each element of each `arrays` to generate the criterion by
  9419. * which uniqueness is computed. Result values are chosen from the first
  9420. * array in which the value occurs. The iteratee is invoked with one argument:
  9421. * (value).
  9422. *
  9423. * @static
  9424. * @memberOf _
  9425. * @since 4.0.0
  9426. * @category Array
  9427. * @param {...Array} [arrays] The arrays to inspect.
  9428. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9429. * @returns {Array} Returns the new array of combined values.
  9430. * @example
  9431. *
  9432. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9433. * // => [2.1, 1.2]
  9434. *
  9435. * // The `_.property` iteratee shorthand.
  9436. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9437. * // => [{ 'x': 1 }, { 'x': 2 }]
  9438. */
  9439. var unionBy = baseRest(function(arrays) {
  9440. var iteratee = last(arrays);
  9441. if (isArrayLikeObject(iteratee)) {
  9442. iteratee = undefined;
  9443. }
  9444. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9445. });
  9446. /**
  9447. * This method is like `_.union` except that it accepts `comparator` which
  9448. * is invoked to compare elements of `arrays`. Result values are chosen from
  9449. * the first array in which the value occurs. The comparator is invoked
  9450. * with two arguments: (arrVal, othVal).
  9451. *
  9452. * @static
  9453. * @memberOf _
  9454. * @since 4.0.0
  9455. * @category Array
  9456. * @param {...Array} [arrays] The arrays to inspect.
  9457. * @param {Function} [comparator] The comparator invoked per element.
  9458. * @returns {Array} Returns the new array of combined values.
  9459. * @example
  9460. *
  9461. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9462. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9463. *
  9464. * _.unionWith(objects, others, _.isEqual);
  9465. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9466. */
  9467. var unionWith = baseRest(function(arrays) {
  9468. var comparator = last(arrays);
  9469. comparator = typeof comparator == 'function' ? comparator : undefined;
  9470. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9471. });
  9472. /**
  9473. * Creates a duplicate-free version of an array, using
  9474. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9475. * for equality comparisons, in which only the first occurrence of each element
  9476. * is kept. The order of result values is determined by the order they occur
  9477. * in the array.
  9478. *
  9479. * @static
  9480. * @memberOf _
  9481. * @since 0.1.0
  9482. * @category Array
  9483. * @param {Array} array The array to inspect.
  9484. * @returns {Array} Returns the new duplicate free array.
  9485. * @example
  9486. *
  9487. * _.uniq([2, 1, 2]);
  9488. * // => [2, 1]
  9489. */
  9490. function uniq(array) {
  9491. return (array && array.length) ? baseUniq(array) : [];
  9492. }
  9493. /**
  9494. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9495. * invoked for each element in `array` to generate the criterion by which
  9496. * uniqueness is computed. The order of result values is determined by the
  9497. * order they occur in the array. The iteratee is invoked with one argument:
  9498. * (value).
  9499. *
  9500. * @static
  9501. * @memberOf _
  9502. * @since 4.0.0
  9503. * @category Array
  9504. * @param {Array} array The array to inspect.
  9505. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9506. * @returns {Array} Returns the new duplicate free array.
  9507. * @example
  9508. *
  9509. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9510. * // => [2.1, 1.2]
  9511. *
  9512. * // The `_.property` iteratee shorthand.
  9513. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9514. * // => [{ 'x': 1 }, { 'x': 2 }]
  9515. */
  9516. function uniqBy(array, iteratee) {
  9517. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9518. }
  9519. /**
  9520. * This method is like `_.uniq` except that it accepts `comparator` which
  9521. * is invoked to compare elements of `array`. The order of result values is
  9522. * determined by the order they occur in the array.The comparator is invoked
  9523. * with two arguments: (arrVal, othVal).
  9524. *
  9525. * @static
  9526. * @memberOf _
  9527. * @since 4.0.0
  9528. * @category Array
  9529. * @param {Array} array The array to inspect.
  9530. * @param {Function} [comparator] The comparator invoked per element.
  9531. * @returns {Array} Returns the new duplicate free array.
  9532. * @example
  9533. *
  9534. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9535. *
  9536. * _.uniqWith(objects, _.isEqual);
  9537. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9538. */
  9539. function uniqWith(array, comparator) {
  9540. comparator = typeof comparator == 'function' ? comparator : undefined;
  9541. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9542. }
  9543. /**
  9544. * This method is like `_.zip` except that it accepts an array of grouped
  9545. * elements and creates an array regrouping the elements to their pre-zip
  9546. * configuration.
  9547. *
  9548. * @static
  9549. * @memberOf _
  9550. * @since 1.2.0
  9551. * @category Array
  9552. * @param {Array} array The array of grouped elements to process.
  9553. * @returns {Array} Returns the new array of regrouped elements.
  9554. * @example
  9555. *
  9556. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9557. * // => [['a', 1, true], ['b', 2, false]]
  9558. *
  9559. * _.unzip(zipped);
  9560. * // => [['a', 'b'], [1, 2], [true, false]]
  9561. */
  9562. function unzip(array) {
  9563. if (!(array && array.length)) {
  9564. return [];
  9565. }
  9566. var length = 0;
  9567. array = arrayFilter(array, function(group) {
  9568. if (isArrayLikeObject(group)) {
  9569. length = nativeMax(group.length, length);
  9570. return true;
  9571. }
  9572. });
  9573. return baseTimes(length, function(index) {
  9574. return arrayMap(array, baseProperty(index));
  9575. });
  9576. }
  9577. /**
  9578. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9579. * how regrouped values should be combined. The iteratee is invoked with the
  9580. * elements of each group: (...group).
  9581. *
  9582. * @static
  9583. * @memberOf _
  9584. * @since 3.8.0
  9585. * @category Array
  9586. * @param {Array} array The array of grouped elements to process.
  9587. * @param {Function} [iteratee=_.identity] The function to combine
  9588. * regrouped values.
  9589. * @returns {Array} Returns the new array of regrouped elements.
  9590. * @example
  9591. *
  9592. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9593. * // => [[1, 10, 100], [2, 20, 200]]
  9594. *
  9595. * _.unzipWith(zipped, _.add);
  9596. * // => [3, 30, 300]
  9597. */
  9598. function unzipWith(array, iteratee) {
  9599. if (!(array && array.length)) {
  9600. return [];
  9601. }
  9602. var result = unzip(array);
  9603. if (iteratee == null) {
  9604. return result;
  9605. }
  9606. return arrayMap(result, function(group) {
  9607. return apply(iteratee, undefined, group);
  9608. });
  9609. }
  9610. /**
  9611. * Creates an array excluding all given values using
  9612. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9613. * for equality comparisons.
  9614. *
  9615. * **Note:** Unlike `_.pull`, this method returns a new array.
  9616. *
  9617. * @static
  9618. * @memberOf _
  9619. * @since 0.1.0
  9620. * @category Array
  9621. * @param {Array} array The array to inspect.
  9622. * @param {...*} [values] The values to exclude.
  9623. * @returns {Array} Returns the new array of filtered values.
  9624. * @see _.difference, _.xor
  9625. * @example
  9626. *
  9627. * _.without([2, 1, 2, 3], 1, 2);
  9628. * // => [3]
  9629. */
  9630. var without = baseRest(function(array, values) {
  9631. return isArrayLikeObject(array)
  9632. ? baseDifference(array, values)
  9633. : [];
  9634. });
  9635. /**
  9636. * Creates an array of unique values that is the
  9637. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9638. * of the given arrays. The order of result values is determined by the order
  9639. * they occur in the arrays.
  9640. *
  9641. * @static
  9642. * @memberOf _
  9643. * @since 2.4.0
  9644. * @category Array
  9645. * @param {...Array} [arrays] The arrays to inspect.
  9646. * @returns {Array} Returns the new array of filtered values.
  9647. * @see _.difference, _.without
  9648. * @example
  9649. *
  9650. * _.xor([2, 1], [2, 3]);
  9651. * // => [1, 3]
  9652. */
  9653. var xor = baseRest(function(arrays) {
  9654. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9655. });
  9656. /**
  9657. * This method is like `_.xor` except that it accepts `iteratee` which is
  9658. * invoked for each element of each `arrays` to generate the criterion by
  9659. * which by which they're compared. The order of result values is determined
  9660. * by the order they occur in the arrays. The iteratee is invoked with one
  9661. * argument: (value).
  9662. *
  9663. * @static
  9664. * @memberOf _
  9665. * @since 4.0.0
  9666. * @category Array
  9667. * @param {...Array} [arrays] The arrays to inspect.
  9668. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9669. * @returns {Array} Returns the new array of filtered values.
  9670. * @example
  9671. *
  9672. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9673. * // => [1.2, 3.4]
  9674. *
  9675. * // The `_.property` iteratee shorthand.
  9676. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9677. * // => [{ 'x': 2 }]
  9678. */
  9679. var xorBy = baseRest(function(arrays) {
  9680. var iteratee = last(arrays);
  9681. if (isArrayLikeObject(iteratee)) {
  9682. iteratee = undefined;
  9683. }
  9684. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9685. });
  9686. /**
  9687. * This method is like `_.xor` except that it accepts `comparator` which is
  9688. * invoked to compare elements of `arrays`. The order of result values is
  9689. * determined by the order they occur in the arrays. The comparator is invoked
  9690. * with two arguments: (arrVal, othVal).
  9691. *
  9692. * @static
  9693. * @memberOf _
  9694. * @since 4.0.0
  9695. * @category Array
  9696. * @param {...Array} [arrays] The arrays to inspect.
  9697. * @param {Function} [comparator] The comparator invoked per element.
  9698. * @returns {Array} Returns the new array of filtered values.
  9699. * @example
  9700. *
  9701. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9702. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9703. *
  9704. * _.xorWith(objects, others, _.isEqual);
  9705. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9706. */
  9707. var xorWith = baseRest(function(arrays) {
  9708. var comparator = last(arrays);
  9709. comparator = typeof comparator == 'function' ? comparator : undefined;
  9710. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9711. });
  9712. /**
  9713. * Creates an array of grouped elements, the first of which contains the
  9714. * first elements of the given arrays, the second of which contains the
  9715. * second elements of the given arrays, and so on.
  9716. *
  9717. * @static
  9718. * @memberOf _
  9719. * @since 0.1.0
  9720. * @category Array
  9721. * @param {...Array} [arrays] The arrays to process.
  9722. * @returns {Array} Returns the new array of grouped elements.
  9723. * @example
  9724. *
  9725. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9726. * // => [['a', 1, true], ['b', 2, false]]
  9727. */
  9728. var zip = baseRest(unzip);
  9729. /**
  9730. * This method is like `_.fromPairs` except that it accepts two arrays,
  9731. * one of property identifiers and one of corresponding values.
  9732. *
  9733. * @static
  9734. * @memberOf _
  9735. * @since 0.4.0
  9736. * @category Array
  9737. * @param {Array} [props=[]] The property identifiers.
  9738. * @param {Array} [values=[]] The property values.
  9739. * @returns {Object} Returns the new object.
  9740. * @example
  9741. *
  9742. * _.zipObject(['a', 'b'], [1, 2]);
  9743. * // => { 'a': 1, 'b': 2 }
  9744. */
  9745. function zipObject(props, values) {
  9746. return baseZipObject(props || [], values || [], assignValue);
  9747. }
  9748. /**
  9749. * This method is like `_.zipObject` except that it supports property paths.
  9750. *
  9751. * @static
  9752. * @memberOf _
  9753. * @since 4.1.0
  9754. * @category Array
  9755. * @param {Array} [props=[]] The property identifiers.
  9756. * @param {Array} [values=[]] The property values.
  9757. * @returns {Object} Returns the new object.
  9758. * @example
  9759. *
  9760. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9761. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9762. */
  9763. function zipObjectDeep(props, values) {
  9764. return baseZipObject(props || [], values || [], baseSet);
  9765. }
  9766. /**
  9767. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9768. * how grouped values should be combined. The iteratee is invoked with the
  9769. * elements of each group: (...group).
  9770. *
  9771. * @static
  9772. * @memberOf _
  9773. * @since 3.8.0
  9774. * @category Array
  9775. * @param {...Array} [arrays] The arrays to process.
  9776. * @param {Function} [iteratee=_.identity] The function to combine
  9777. * grouped values.
  9778. * @returns {Array} Returns the new array of grouped elements.
  9779. * @example
  9780. *
  9781. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9782. * return a + b + c;
  9783. * });
  9784. * // => [111, 222]
  9785. */
  9786. var zipWith = baseRest(function(arrays) {
  9787. var length = arrays.length,
  9788. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9789. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9790. return unzipWith(arrays, iteratee);
  9791. });
  9792. /*------------------------------------------------------------------------*/
  9793. /**
  9794. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9795. * chain sequences enabled. The result of such sequences must be unwrapped
  9796. * with `_#value`.
  9797. *
  9798. * @static
  9799. * @memberOf _
  9800. * @since 1.3.0
  9801. * @category Seq
  9802. * @param {*} value The value to wrap.
  9803. * @returns {Object} Returns the new `lodash` wrapper instance.
  9804. * @example
  9805. *
  9806. * var users = [
  9807. * { 'user': 'barney', 'age': 36 },
  9808. * { 'user': 'fred', 'age': 40 },
  9809. * { 'user': 'pebbles', 'age': 1 }
  9810. * ];
  9811. *
  9812. * var youngest = _
  9813. * .chain(users)
  9814. * .sortBy('age')
  9815. * .map(function(o) {
  9816. * return o.user + ' is ' + o.age;
  9817. * })
  9818. * .head()
  9819. * .value();
  9820. * // => 'pebbles is 1'
  9821. */
  9822. function chain(value) {
  9823. var result = lodash(value);
  9824. result.__chain__ = true;
  9825. return result;
  9826. }
  9827. /**
  9828. * This method invokes `interceptor` and returns `value`. The interceptor
  9829. * is invoked with one argument; (value). The purpose of this method is to
  9830. * "tap into" a method chain sequence in order to modify intermediate results.
  9831. *
  9832. * @static
  9833. * @memberOf _
  9834. * @since 0.1.0
  9835. * @category Seq
  9836. * @param {*} value The value to provide to `interceptor`.
  9837. * @param {Function} interceptor The function to invoke.
  9838. * @returns {*} Returns `value`.
  9839. * @example
  9840. *
  9841. * _([1, 2, 3])
  9842. * .tap(function(array) {
  9843. * // Mutate input array.
  9844. * array.pop();
  9845. * })
  9846. * .reverse()
  9847. * .value();
  9848. * // => [2, 1]
  9849. */
  9850. function tap(value, interceptor) {
  9851. interceptor(value);
  9852. return value;
  9853. }
  9854. /**
  9855. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9856. * The purpose of this method is to "pass thru" values replacing intermediate
  9857. * results in a method chain sequence.
  9858. *
  9859. * @static
  9860. * @memberOf _
  9861. * @since 3.0.0
  9862. * @category Seq
  9863. * @param {*} value The value to provide to `interceptor`.
  9864. * @param {Function} interceptor The function to invoke.
  9865. * @returns {*} Returns the result of `interceptor`.
  9866. * @example
  9867. *
  9868. * _(' abc ')
  9869. * .chain()
  9870. * .trim()
  9871. * .thru(function(value) {
  9872. * return [value];
  9873. * })
  9874. * .value();
  9875. * // => ['abc']
  9876. */
  9877. function thru(value, interceptor) {
  9878. return interceptor(value);
  9879. }
  9880. /**
  9881. * This method is the wrapper version of `_.at`.
  9882. *
  9883. * @name at
  9884. * @memberOf _
  9885. * @since 1.0.0
  9886. * @category Seq
  9887. * @param {...(string|string[])} [paths] The property paths to pick.
  9888. * @returns {Object} Returns the new `lodash` wrapper instance.
  9889. * @example
  9890. *
  9891. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9892. *
  9893. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9894. * // => [3, 4]
  9895. */
  9896. var wrapperAt = flatRest(function(paths) {
  9897. var length = paths.length,
  9898. start = length ? paths[0] : 0,
  9899. value = this.__wrapped__,
  9900. interceptor = function(object) { return baseAt(object, paths); };
  9901. if (length > 1 || this.__actions__.length ||
  9902. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9903. return this.thru(interceptor);
  9904. }
  9905. value = value.slice(start, +start + (length ? 1 : 0));
  9906. value.__actions__.push({
  9907. 'func': thru,
  9908. 'args': [interceptor],
  9909. 'thisArg': undefined
  9910. });
  9911. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9912. if (length && !array.length) {
  9913. array.push(undefined);
  9914. }
  9915. return array;
  9916. });
  9917. });
  9918. /**
  9919. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9920. *
  9921. * @name chain
  9922. * @memberOf _
  9923. * @since 0.1.0
  9924. * @category Seq
  9925. * @returns {Object} Returns the new `lodash` wrapper instance.
  9926. * @example
  9927. *
  9928. * var users = [
  9929. * { 'user': 'barney', 'age': 36 },
  9930. * { 'user': 'fred', 'age': 40 }
  9931. * ];
  9932. *
  9933. * // A sequence without explicit chaining.
  9934. * _(users).head();
  9935. * // => { 'user': 'barney', 'age': 36 }
  9936. *
  9937. * // A sequence with explicit chaining.
  9938. * _(users)
  9939. * .chain()
  9940. * .head()
  9941. * .pick('user')
  9942. * .value();
  9943. * // => { 'user': 'barney' }
  9944. */
  9945. function wrapperChain() {
  9946. return chain(this);
  9947. }
  9948. /**
  9949. * Executes the chain sequence and returns the wrapped result.
  9950. *
  9951. * @name commit
  9952. * @memberOf _
  9953. * @since 3.2.0
  9954. * @category Seq
  9955. * @returns {Object} Returns the new `lodash` wrapper instance.
  9956. * @example
  9957. *
  9958. * var array = [1, 2];
  9959. * var wrapped = _(array).push(3);
  9960. *
  9961. * console.log(array);
  9962. * // => [1, 2]
  9963. *
  9964. * wrapped = wrapped.commit();
  9965. * console.log(array);
  9966. * // => [1, 2, 3]
  9967. *
  9968. * wrapped.last();
  9969. * // => 3
  9970. *
  9971. * console.log(array);
  9972. * // => [1, 2, 3]
  9973. */
  9974. function wrapperCommit() {
  9975. return new LodashWrapper(this.value(), this.__chain__);
  9976. }
  9977. /**
  9978. * Gets the next value on a wrapped object following the
  9979. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9980. *
  9981. * @name next
  9982. * @memberOf _
  9983. * @since 4.0.0
  9984. * @category Seq
  9985. * @returns {Object} Returns the next iterator value.
  9986. * @example
  9987. *
  9988. * var wrapped = _([1, 2]);
  9989. *
  9990. * wrapped.next();
  9991. * // => { 'done': false, 'value': 1 }
  9992. *
  9993. * wrapped.next();
  9994. * // => { 'done': false, 'value': 2 }
  9995. *
  9996. * wrapped.next();
  9997. * // => { 'done': true, 'value': undefined }
  9998. */
  9999. function wrapperNext() {
  10000. if (this.__values__ === undefined) {
  10001. this.__values__ = toArray(this.value());
  10002. }
  10003. var done = this.__index__ >= this.__values__.length,
  10004. value = done ? undefined : this.__values__[this.__index__++];
  10005. return { 'done': done, 'value': value };
  10006. }
  10007. /**
  10008. * Enables the wrapper to be iterable.
  10009. *
  10010. * @name Symbol.iterator
  10011. * @memberOf _
  10012. * @since 4.0.0
  10013. * @category Seq
  10014. * @returns {Object} Returns the wrapper object.
  10015. * @example
  10016. *
  10017. * var wrapped = _([1, 2]);
  10018. *
  10019. * wrapped[Symbol.iterator]() === wrapped;
  10020. * // => true
  10021. *
  10022. * Array.from(wrapped);
  10023. * // => [1, 2]
  10024. */
  10025. function wrapperToIterator() {
  10026. return this;
  10027. }
  10028. /**
  10029. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  10030. *
  10031. * @name plant
  10032. * @memberOf _
  10033. * @since 3.2.0
  10034. * @category Seq
  10035. * @param {*} value The value to plant.
  10036. * @returns {Object} Returns the new `lodash` wrapper instance.
  10037. * @example
  10038. *
  10039. * function square(n) {
  10040. * return n * n;
  10041. * }
  10042. *
  10043. * var wrapped = _([1, 2]).map(square);
  10044. * var other = wrapped.plant([3, 4]);
  10045. *
  10046. * other.value();
  10047. * // => [9, 16]
  10048. *
  10049. * wrapped.value();
  10050. * // => [1, 4]
  10051. */
  10052. function wrapperPlant(value) {
  10053. var result,
  10054. parent = this;
  10055. while (parent instanceof baseLodash) {
  10056. var clone = wrapperClone(parent);
  10057. clone.__index__ = 0;
  10058. clone.__values__ = undefined;
  10059. if (result) {
  10060. previous.__wrapped__ = clone;
  10061. } else {
  10062. result = clone;
  10063. }
  10064. var previous = clone;
  10065. parent = parent.__wrapped__;
  10066. }
  10067. previous.__wrapped__ = value;
  10068. return result;
  10069. }
  10070. /**
  10071. * This method is the wrapper version of `_.reverse`.
  10072. *
  10073. * **Note:** This method mutates the wrapped array.
  10074. *
  10075. * @name reverse
  10076. * @memberOf _
  10077. * @since 0.1.0
  10078. * @category Seq
  10079. * @returns {Object} Returns the new `lodash` wrapper instance.
  10080. * @example
  10081. *
  10082. * var array = [1, 2, 3];
  10083. *
  10084. * _(array).reverse().value()
  10085. * // => [3, 2, 1]
  10086. *
  10087. * console.log(array);
  10088. * // => [3, 2, 1]
  10089. */
  10090. function wrapperReverse() {
  10091. var value = this.__wrapped__;
  10092. if (value instanceof LazyWrapper) {
  10093. var wrapped = value;
  10094. if (this.__actions__.length) {
  10095. wrapped = new LazyWrapper(this);
  10096. }
  10097. wrapped = wrapped.reverse();
  10098. wrapped.__actions__.push({
  10099. 'func': thru,
  10100. 'args': [reverse],
  10101. 'thisArg': undefined
  10102. });
  10103. return new LodashWrapper(wrapped, this.__chain__);
  10104. }
  10105. return this.thru(reverse);
  10106. }
  10107. /**
  10108. * Executes the chain sequence to resolve the unwrapped value.
  10109. *
  10110. * @name value
  10111. * @memberOf _
  10112. * @since 0.1.0
  10113. * @alias toJSON, valueOf
  10114. * @category Seq
  10115. * @returns {*} Returns the resolved unwrapped value.
  10116. * @example
  10117. *
  10118. * _([1, 2, 3]).value();
  10119. * // => [1, 2, 3]
  10120. */
  10121. function wrapperValue() {
  10122. return baseWrapperValue(this.__wrapped__, this.__actions__);
  10123. }
  10124. /*------------------------------------------------------------------------*/
  10125. /**
  10126. * Creates an object composed of keys generated from the results of running
  10127. * each element of `collection` thru `iteratee`. The corresponding value of
  10128. * each key is the number of times the key was returned by `iteratee`. The
  10129. * iteratee is invoked with one argument: (value).
  10130. *
  10131. * @static
  10132. * @memberOf _
  10133. * @since 0.5.0
  10134. * @category Collection
  10135. * @param {Array|Object} collection The collection to iterate over.
  10136. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10137. * @returns {Object} Returns the composed aggregate object.
  10138. * @example
  10139. *
  10140. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  10141. * // => { '4': 1, '6': 2 }
  10142. *
  10143. * // The `_.property` iteratee shorthand.
  10144. * _.countBy(['one', 'two', 'three'], 'length');
  10145. * // => { '3': 2, '5': 1 }
  10146. */
  10147. var countBy = createAggregator(function(result, value, key) {
  10148. if (hasOwnProperty.call(result, key)) {
  10149. ++result[key];
  10150. } else {
  10151. baseAssignValue(result, key, 1);
  10152. }
  10153. });
  10154. /**
  10155. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  10156. * Iteration is stopped once `predicate` returns falsey. The predicate is
  10157. * invoked with three arguments: (value, index|key, collection).
  10158. *
  10159. * **Note:** This method returns `true` for
  10160. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  10161. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  10162. * elements of empty collections.
  10163. *
  10164. * @static
  10165. * @memberOf _
  10166. * @since 0.1.0
  10167. * @category Collection
  10168. * @param {Array|Object} collection The collection to iterate over.
  10169. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10170. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10171. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  10172. * else `false`.
  10173. * @example
  10174. *
  10175. * _.every([true, 1, null, 'yes'], Boolean);
  10176. * // => false
  10177. *
  10178. * var users = [
  10179. * { 'user': 'barney', 'age': 36, 'active': false },
  10180. * { 'user': 'fred', 'age': 40, 'active': false }
  10181. * ];
  10182. *
  10183. * // The `_.matches` iteratee shorthand.
  10184. * _.every(users, { 'user': 'barney', 'active': false });
  10185. * // => false
  10186. *
  10187. * // The `_.matchesProperty` iteratee shorthand.
  10188. * _.every(users, ['active', false]);
  10189. * // => true
  10190. *
  10191. * // The `_.property` iteratee shorthand.
  10192. * _.every(users, 'active');
  10193. * // => false
  10194. */
  10195. function every(collection, predicate, guard) {
  10196. var func = isArray(collection) ? arrayEvery : baseEvery;
  10197. if (guard && isIterateeCall(collection, predicate, guard)) {
  10198. predicate = undefined;
  10199. }
  10200. return func(collection, getIteratee(predicate, 3));
  10201. }
  10202. /**
  10203. * Iterates over elements of `collection`, returning an array of all elements
  10204. * `predicate` returns truthy for. The predicate is invoked with three
  10205. * arguments: (value, index|key, collection).
  10206. *
  10207. * **Note:** Unlike `_.remove`, this method returns a new array.
  10208. *
  10209. * @static
  10210. * @memberOf _
  10211. * @since 0.1.0
  10212. * @category Collection
  10213. * @param {Array|Object} collection The collection to iterate over.
  10214. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10215. * @returns {Array} Returns the new filtered array.
  10216. * @see _.reject
  10217. * @example
  10218. *
  10219. * var users = [
  10220. * { 'user': 'barney', 'age': 36, 'active': true },
  10221. * { 'user': 'fred', 'age': 40, 'active': false }
  10222. * ];
  10223. *
  10224. * _.filter(users, function(o) { return !o.active; });
  10225. * // => objects for ['fred']
  10226. *
  10227. * // The `_.matches` iteratee shorthand.
  10228. * _.filter(users, { 'age': 36, 'active': true });
  10229. * // => objects for ['barney']
  10230. *
  10231. * // The `_.matchesProperty` iteratee shorthand.
  10232. * _.filter(users, ['active', false]);
  10233. * // => objects for ['fred']
  10234. *
  10235. * // The `_.property` iteratee shorthand.
  10236. * _.filter(users, 'active');
  10237. * // => objects for ['barney']
  10238. *
  10239. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  10240. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  10241. * // => objects for ['fred', 'barney']
  10242. */
  10243. function filter(collection, predicate) {
  10244. var func = isArray(collection) ? arrayFilter : baseFilter;
  10245. return func(collection, getIteratee(predicate, 3));
  10246. }
  10247. /**
  10248. * Iterates over elements of `collection`, returning the first element
  10249. * `predicate` returns truthy for. The predicate is invoked with three
  10250. * arguments: (value, index|key, collection).
  10251. *
  10252. * @static
  10253. * @memberOf _
  10254. * @since 0.1.0
  10255. * @category Collection
  10256. * @param {Array|Object} collection The collection to inspect.
  10257. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10258. * @param {number} [fromIndex=0] The index to search from.
  10259. * @returns {*} Returns the matched element, else `undefined`.
  10260. * @example
  10261. *
  10262. * var users = [
  10263. * { 'user': 'barney', 'age': 36, 'active': true },
  10264. * { 'user': 'fred', 'age': 40, 'active': false },
  10265. * { 'user': 'pebbles', 'age': 1, 'active': true }
  10266. * ];
  10267. *
  10268. * _.find(users, function(o) { return o.age < 40; });
  10269. * // => object for 'barney'
  10270. *
  10271. * // The `_.matches` iteratee shorthand.
  10272. * _.find(users, { 'age': 1, 'active': true });
  10273. * // => object for 'pebbles'
  10274. *
  10275. * // The `_.matchesProperty` iteratee shorthand.
  10276. * _.find(users, ['active', false]);
  10277. * // => object for 'fred'
  10278. *
  10279. * // The `_.property` iteratee shorthand.
  10280. * _.find(users, 'active');
  10281. * // => object for 'barney'
  10282. */
  10283. var find = createFind(findIndex);
  10284. /**
  10285. * This method is like `_.find` except that it iterates over elements of
  10286. * `collection` from right to left.
  10287. *
  10288. * @static
  10289. * @memberOf _
  10290. * @since 2.0.0
  10291. * @category Collection
  10292. * @param {Array|Object} collection The collection to inspect.
  10293. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10294. * @param {number} [fromIndex=collection.length-1] The index to search from.
  10295. * @returns {*} Returns the matched element, else `undefined`.
  10296. * @example
  10297. *
  10298. * _.findLast([1, 2, 3, 4], function(n) {
  10299. * return n % 2 == 1;
  10300. * });
  10301. * // => 3
  10302. */
  10303. var findLast = createFind(findLastIndex);
  10304. /**
  10305. * Creates a flattened array of values by running each element in `collection`
  10306. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  10307. * with three arguments: (value, index|key, collection).
  10308. *
  10309. * @static
  10310. * @memberOf _
  10311. * @since 4.0.0
  10312. * @category Collection
  10313. * @param {Array|Object} collection The collection to iterate over.
  10314. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10315. * @returns {Array} Returns the new flattened array.
  10316. * @example
  10317. *
  10318. * function duplicate(n) {
  10319. * return [n, n];
  10320. * }
  10321. *
  10322. * _.flatMap([1, 2], duplicate);
  10323. * // => [1, 1, 2, 2]
  10324. */
  10325. function flatMap(collection, iteratee) {
  10326. return baseFlatten(map(collection, iteratee), 1);
  10327. }
  10328. /**
  10329. * This method is like `_.flatMap` except that it recursively flattens the
  10330. * mapped results.
  10331. *
  10332. * @static
  10333. * @memberOf _
  10334. * @since 4.7.0
  10335. * @category Collection
  10336. * @param {Array|Object} collection The collection to iterate over.
  10337. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10338. * @returns {Array} Returns the new flattened array.
  10339. * @example
  10340. *
  10341. * function duplicate(n) {
  10342. * return [[[n, n]]];
  10343. * }
  10344. *
  10345. * _.flatMapDeep([1, 2], duplicate);
  10346. * // => [1, 1, 2, 2]
  10347. */
  10348. function flatMapDeep(collection, iteratee) {
  10349. return baseFlatten(map(collection, iteratee), INFINITY);
  10350. }
  10351. /**
  10352. * This method is like `_.flatMap` except that it recursively flattens the
  10353. * mapped results up to `depth` times.
  10354. *
  10355. * @static
  10356. * @memberOf _
  10357. * @since 4.7.0
  10358. * @category Collection
  10359. * @param {Array|Object} collection The collection to iterate over.
  10360. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10361. * @param {number} [depth=1] The maximum recursion depth.
  10362. * @returns {Array} Returns the new flattened array.
  10363. * @example
  10364. *
  10365. * function duplicate(n) {
  10366. * return [[[n, n]]];
  10367. * }
  10368. *
  10369. * _.flatMapDepth([1, 2], duplicate, 2);
  10370. * // => [[1, 1], [2, 2]]
  10371. */
  10372. function flatMapDepth(collection, iteratee, depth) {
  10373. depth = depth === undefined ? 1 : toInteger(depth);
  10374. return baseFlatten(map(collection, iteratee), depth);
  10375. }
  10376. /**
  10377. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10378. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10379. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10380. *
  10381. * **Note:** As with other "Collections" methods, objects with a "length"
  10382. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10383. * or `_.forOwn` for object iteration.
  10384. *
  10385. * @static
  10386. * @memberOf _
  10387. * @since 0.1.0
  10388. * @alias each
  10389. * @category Collection
  10390. * @param {Array|Object} collection The collection to iterate over.
  10391. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10392. * @returns {Array|Object} Returns `collection`.
  10393. * @see _.forEachRight
  10394. * @example
  10395. *
  10396. * _.forEach([1, 2], function(value) {
  10397. * console.log(value);
  10398. * });
  10399. * // => Logs `1` then `2`.
  10400. *
  10401. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10402. * console.log(key);
  10403. * });
  10404. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10405. */
  10406. function forEach(collection, iteratee) {
  10407. var func = isArray(collection) ? arrayEach : baseEach;
  10408. return func(collection, getIteratee(iteratee, 3));
  10409. }
  10410. /**
  10411. * This method is like `_.forEach` except that it iterates over elements of
  10412. * `collection` from right to left.
  10413. *
  10414. * @static
  10415. * @memberOf _
  10416. * @since 2.0.0
  10417. * @alias eachRight
  10418. * @category Collection
  10419. * @param {Array|Object} collection The collection to iterate over.
  10420. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10421. * @returns {Array|Object} Returns `collection`.
  10422. * @see _.forEach
  10423. * @example
  10424. *
  10425. * _.forEachRight([1, 2], function(value) {
  10426. * console.log(value);
  10427. * });
  10428. * // => Logs `2` then `1`.
  10429. */
  10430. function forEachRight(collection, iteratee) {
  10431. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10432. return func(collection, getIteratee(iteratee, 3));
  10433. }
  10434. /**
  10435. * Creates an object composed of keys generated from the results of running
  10436. * each element of `collection` thru `iteratee`. The order of grouped values
  10437. * is determined by the order they occur in `collection`. The corresponding
  10438. * value of each key is an array of elements responsible for generating the
  10439. * key. The iteratee is invoked with one argument: (value).
  10440. *
  10441. * @static
  10442. * @memberOf _
  10443. * @since 0.1.0
  10444. * @category Collection
  10445. * @param {Array|Object} collection The collection to iterate over.
  10446. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10447. * @returns {Object} Returns the composed aggregate object.
  10448. * @example
  10449. *
  10450. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10451. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10452. *
  10453. * // The `_.property` iteratee shorthand.
  10454. * _.groupBy(['one', 'two', 'three'], 'length');
  10455. * // => { '3': ['one', 'two'], '5': ['three'] }
  10456. */
  10457. var groupBy = createAggregator(function(result, value, key) {
  10458. if (hasOwnProperty.call(result, key)) {
  10459. result[key].push(value);
  10460. } else {
  10461. baseAssignValue(result, key, [value]);
  10462. }
  10463. });
  10464. /**
  10465. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10466. * checked for a substring of `value`, otherwise
  10467. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10468. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10469. * the offset from the end of `collection`.
  10470. *
  10471. * @static
  10472. * @memberOf _
  10473. * @since 0.1.0
  10474. * @category Collection
  10475. * @param {Array|Object|string} collection The collection to inspect.
  10476. * @param {*} value The value to search for.
  10477. * @param {number} [fromIndex=0] The index to search from.
  10478. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10479. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10480. * @example
  10481. *
  10482. * _.includes([1, 2, 3], 1);
  10483. * // => true
  10484. *
  10485. * _.includes([1, 2, 3], 1, 2);
  10486. * // => false
  10487. *
  10488. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10489. * // => true
  10490. *
  10491. * _.includes('abcd', 'bc');
  10492. * // => true
  10493. */
  10494. function includes(collection, value, fromIndex, guard) {
  10495. collection = isArrayLike(collection) ? collection : values(collection);
  10496. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10497. var length = collection.length;
  10498. if (fromIndex < 0) {
  10499. fromIndex = nativeMax(length + fromIndex, 0);
  10500. }
  10501. return isString(collection)
  10502. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10503. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10504. }
  10505. /**
  10506. * Invokes the method at `path` of each element in `collection`, returning
  10507. * an array of the results of each invoked method. Any additional arguments
  10508. * are provided to each invoked method. If `path` is a function, it's invoked
  10509. * for, and `this` bound to, each element in `collection`.
  10510. *
  10511. * @static
  10512. * @memberOf _
  10513. * @since 4.0.0
  10514. * @category Collection
  10515. * @param {Array|Object} collection The collection to iterate over.
  10516. * @param {Array|Function|string} path The path of the method to invoke or
  10517. * the function invoked per iteration.
  10518. * @param {...*} [args] The arguments to invoke each method with.
  10519. * @returns {Array} Returns the array of results.
  10520. * @example
  10521. *
  10522. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10523. * // => [[1, 5, 7], [1, 2, 3]]
  10524. *
  10525. * _.invokeMap([123, 456], String.prototype.split, '');
  10526. * // => [['1', '2', '3'], ['4', '5', '6']]
  10527. */
  10528. var invokeMap = baseRest(function(collection, path, args) {
  10529. var index = -1,
  10530. isFunc = typeof path == 'function',
  10531. result = isArrayLike(collection) ? Array(collection.length) : [];
  10532. baseEach(collection, function(value) {
  10533. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10534. });
  10535. return result;
  10536. });
  10537. /**
  10538. * Creates an object composed of keys generated from the results of running
  10539. * each element of `collection` thru `iteratee`. The corresponding value of
  10540. * each key is the last element responsible for generating the key. The
  10541. * iteratee is invoked with one argument: (value).
  10542. *
  10543. * @static
  10544. * @memberOf _
  10545. * @since 4.0.0
  10546. * @category Collection
  10547. * @param {Array|Object} collection The collection to iterate over.
  10548. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10549. * @returns {Object} Returns the composed aggregate object.
  10550. * @example
  10551. *
  10552. * var array = [
  10553. * { 'dir': 'left', 'code': 97 },
  10554. * { 'dir': 'right', 'code': 100 }
  10555. * ];
  10556. *
  10557. * _.keyBy(array, function(o) {
  10558. * return String.fromCharCode(o.code);
  10559. * });
  10560. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10561. *
  10562. * _.keyBy(array, 'dir');
  10563. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10564. */
  10565. var keyBy = createAggregator(function(result, value, key) {
  10566. baseAssignValue(result, key, value);
  10567. });
  10568. /**
  10569. * Creates an array of values by running each element in `collection` thru
  10570. * `iteratee`. The iteratee is invoked with three arguments:
  10571. * (value, index|key, collection).
  10572. *
  10573. * Many lodash methods are guarded to work as iteratees for methods like
  10574. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10575. *
  10576. * The guarded methods are:
  10577. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10578. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10579. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10580. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10581. *
  10582. * @static
  10583. * @memberOf _
  10584. * @since 0.1.0
  10585. * @category Collection
  10586. * @param {Array|Object} collection The collection to iterate over.
  10587. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10588. * @returns {Array} Returns the new mapped array.
  10589. * @example
  10590. *
  10591. * function square(n) {
  10592. * return n * n;
  10593. * }
  10594. *
  10595. * _.map([4, 8], square);
  10596. * // => [16, 64]
  10597. *
  10598. * _.map({ 'a': 4, 'b': 8 }, square);
  10599. * // => [16, 64] (iteration order is not guaranteed)
  10600. *
  10601. * var users = [
  10602. * { 'user': 'barney' },
  10603. * { 'user': 'fred' }
  10604. * ];
  10605. *
  10606. * // The `_.property` iteratee shorthand.
  10607. * _.map(users, 'user');
  10608. * // => ['barney', 'fred']
  10609. */
  10610. function map(collection, iteratee) {
  10611. var func = isArray(collection) ? arrayMap : baseMap;
  10612. return func(collection, getIteratee(iteratee, 3));
  10613. }
  10614. /**
  10615. * This method is like `_.sortBy` except that it allows specifying the sort
  10616. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10617. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10618. * descending or "asc" for ascending sort order of corresponding values.
  10619. *
  10620. * @static
  10621. * @memberOf _
  10622. * @since 4.0.0
  10623. * @category Collection
  10624. * @param {Array|Object} collection The collection to iterate over.
  10625. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10626. * The iteratees to sort by.
  10627. * @param {string[]} [orders] The sort orders of `iteratees`.
  10628. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10629. * @returns {Array} Returns the new sorted array.
  10630. * @example
  10631. *
  10632. * var users = [
  10633. * { 'user': 'fred', 'age': 48 },
  10634. * { 'user': 'barney', 'age': 34 },
  10635. * { 'user': 'fred', 'age': 40 },
  10636. * { 'user': 'barney', 'age': 36 }
  10637. * ];
  10638. *
  10639. * // Sort by `user` in ascending order and by `age` in descending order.
  10640. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10641. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10642. */
  10643. function orderBy(collection, iteratees, orders, guard) {
  10644. if (collection == null) {
  10645. return [];
  10646. }
  10647. if (!isArray(iteratees)) {
  10648. iteratees = iteratees == null ? [] : [iteratees];
  10649. }
  10650. orders = guard ? undefined : orders;
  10651. if (!isArray(orders)) {
  10652. orders = orders == null ? [] : [orders];
  10653. }
  10654. return baseOrderBy(collection, iteratees, orders);
  10655. }
  10656. /**
  10657. * Creates an array of elements split into two groups, the first of which
  10658. * contains elements `predicate` returns truthy for, the second of which
  10659. * contains elements `predicate` returns falsey for. The predicate is
  10660. * invoked with one argument: (value).
  10661. *
  10662. * @static
  10663. * @memberOf _
  10664. * @since 3.0.0
  10665. * @category Collection
  10666. * @param {Array|Object} collection The collection to iterate over.
  10667. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10668. * @returns {Array} Returns the array of grouped elements.
  10669. * @example
  10670. *
  10671. * var users = [
  10672. * { 'user': 'barney', 'age': 36, 'active': false },
  10673. * { 'user': 'fred', 'age': 40, 'active': true },
  10674. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10675. * ];
  10676. *
  10677. * _.partition(users, function(o) { return o.active; });
  10678. * // => objects for [['fred'], ['barney', 'pebbles']]
  10679. *
  10680. * // The `_.matches` iteratee shorthand.
  10681. * _.partition(users, { 'age': 1, 'active': false });
  10682. * // => objects for [['pebbles'], ['barney', 'fred']]
  10683. *
  10684. * // The `_.matchesProperty` iteratee shorthand.
  10685. * _.partition(users, ['active', false]);
  10686. * // => objects for [['barney', 'pebbles'], ['fred']]
  10687. *
  10688. * // The `_.property` iteratee shorthand.
  10689. * _.partition(users, 'active');
  10690. * // => objects for [['fred'], ['barney', 'pebbles']]
  10691. */
  10692. var partition = createAggregator(function(result, value, key) {
  10693. result[key ? 0 : 1].push(value);
  10694. }, function() { return [[], []]; });
  10695. /**
  10696. * Reduces `collection` to a value which is the accumulated result of running
  10697. * each element in `collection` thru `iteratee`, where each successive
  10698. * invocation is supplied the return value of the previous. If `accumulator`
  10699. * is not given, the first element of `collection` is used as the initial
  10700. * value. The iteratee is invoked with four arguments:
  10701. * (accumulator, value, index|key, collection).
  10702. *
  10703. * Many lodash methods are guarded to work as iteratees for methods like
  10704. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10705. *
  10706. * The guarded methods are:
  10707. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10708. * and `sortBy`
  10709. *
  10710. * @static
  10711. * @memberOf _
  10712. * @since 0.1.0
  10713. * @category Collection
  10714. * @param {Array|Object} collection The collection to iterate over.
  10715. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10716. * @param {*} [accumulator] The initial value.
  10717. * @returns {*} Returns the accumulated value.
  10718. * @see _.reduceRight
  10719. * @example
  10720. *
  10721. * _.reduce([1, 2], function(sum, n) {
  10722. * return sum + n;
  10723. * }, 0);
  10724. * // => 3
  10725. *
  10726. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10727. * (result[value] || (result[value] = [])).push(key);
  10728. * return result;
  10729. * }, {});
  10730. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10731. */
  10732. function reduce(collection, iteratee, accumulator) {
  10733. var func = isArray(collection) ? arrayReduce : baseReduce,
  10734. initAccum = arguments.length < 3;
  10735. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10736. }
  10737. /**
  10738. * This method is like `_.reduce` except that it iterates over elements of
  10739. * `collection` from right to left.
  10740. *
  10741. * @static
  10742. * @memberOf _
  10743. * @since 0.1.0
  10744. * @category Collection
  10745. * @param {Array|Object} collection The collection to iterate over.
  10746. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10747. * @param {*} [accumulator] The initial value.
  10748. * @returns {*} Returns the accumulated value.
  10749. * @see _.reduce
  10750. * @example
  10751. *
  10752. * var array = [[0, 1], [2, 3], [4, 5]];
  10753. *
  10754. * _.reduceRight(array, function(flattened, other) {
  10755. * return flattened.concat(other);
  10756. * }, []);
  10757. * // => [4, 5, 2, 3, 0, 1]
  10758. */
  10759. function reduceRight(collection, iteratee, accumulator) {
  10760. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10761. initAccum = arguments.length < 3;
  10762. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10763. }
  10764. /**
  10765. * The opposite of `_.filter`; this method returns the elements of `collection`
  10766. * that `predicate` does **not** return truthy for.
  10767. *
  10768. * @static
  10769. * @memberOf _
  10770. * @since 0.1.0
  10771. * @category Collection
  10772. * @param {Array|Object} collection The collection to iterate over.
  10773. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10774. * @returns {Array} Returns the new filtered array.
  10775. * @see _.filter
  10776. * @example
  10777. *
  10778. * var users = [
  10779. * { 'user': 'barney', 'age': 36, 'active': false },
  10780. * { 'user': 'fred', 'age': 40, 'active': true }
  10781. * ];
  10782. *
  10783. * _.reject(users, function(o) { return !o.active; });
  10784. * // => objects for ['fred']
  10785. *
  10786. * // The `_.matches` iteratee shorthand.
  10787. * _.reject(users, { 'age': 40, 'active': true });
  10788. * // => objects for ['barney']
  10789. *
  10790. * // The `_.matchesProperty` iteratee shorthand.
  10791. * _.reject(users, ['active', false]);
  10792. * // => objects for ['fred']
  10793. *
  10794. * // The `_.property` iteratee shorthand.
  10795. * _.reject(users, 'active');
  10796. * // => objects for ['barney']
  10797. */
  10798. function reject(collection, predicate) {
  10799. var func = isArray(collection) ? arrayFilter : baseFilter;
  10800. return func(collection, negate(getIteratee(predicate, 3)));
  10801. }
  10802. /**
  10803. * Gets a random element from `collection`.
  10804. *
  10805. * @static
  10806. * @memberOf _
  10807. * @since 2.0.0
  10808. * @category Collection
  10809. * @param {Array|Object} collection The collection to sample.
  10810. * @returns {*} Returns the random element.
  10811. * @example
  10812. *
  10813. * _.sample([1, 2, 3, 4]);
  10814. * // => 2
  10815. */
  10816. function sample(collection) {
  10817. var func = isArray(collection) ? arraySample : baseSample;
  10818. return func(collection);
  10819. }
  10820. /**
  10821. * Gets `n` random elements at unique keys from `collection` up to the
  10822. * size of `collection`.
  10823. *
  10824. * @static
  10825. * @memberOf _
  10826. * @since 4.0.0
  10827. * @category Collection
  10828. * @param {Array|Object} collection The collection to sample.
  10829. * @param {number} [n=1] The number of elements to sample.
  10830. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10831. * @returns {Array} Returns the random elements.
  10832. * @example
  10833. *
  10834. * _.sampleSize([1, 2, 3], 2);
  10835. * // => [3, 1]
  10836. *
  10837. * _.sampleSize([1, 2, 3], 4);
  10838. * // => [2, 3, 1]
  10839. */
  10840. function sampleSize(collection, n, guard) {
  10841. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10842. n = 1;
  10843. } else {
  10844. n = toInteger(n);
  10845. }
  10846. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10847. return func(collection, n);
  10848. }
  10849. /**
  10850. * Creates an array of shuffled values, using a version of the
  10851. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10852. *
  10853. * @static
  10854. * @memberOf _
  10855. * @since 0.1.0
  10856. * @category Collection
  10857. * @param {Array|Object} collection The collection to shuffle.
  10858. * @returns {Array} Returns the new shuffled array.
  10859. * @example
  10860. *
  10861. * _.shuffle([1, 2, 3, 4]);
  10862. * // => [4, 1, 3, 2]
  10863. */
  10864. function shuffle(collection) {
  10865. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10866. return func(collection);
  10867. }
  10868. /**
  10869. * Gets the size of `collection` by returning its length for array-like
  10870. * values or the number of own enumerable string keyed properties for objects.
  10871. *
  10872. * @static
  10873. * @memberOf _
  10874. * @since 0.1.0
  10875. * @category Collection
  10876. * @param {Array|Object|string} collection The collection to inspect.
  10877. * @returns {number} Returns the collection size.
  10878. * @example
  10879. *
  10880. * _.size([1, 2, 3]);
  10881. * // => 3
  10882. *
  10883. * _.size({ 'a': 1, 'b': 2 });
  10884. * // => 2
  10885. *
  10886. * _.size('pebbles');
  10887. * // => 7
  10888. */
  10889. function size(collection) {
  10890. if (collection == null) {
  10891. return 0;
  10892. }
  10893. if (isArrayLike(collection)) {
  10894. return isString(collection) ? stringSize(collection) : collection.length;
  10895. }
  10896. var tag = getTag(collection);
  10897. if (tag == mapTag || tag == setTag) {
  10898. return collection.size;
  10899. }
  10900. return baseKeys(collection).length;
  10901. }
  10902. /**
  10903. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10904. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10905. * invoked with three arguments: (value, index|key, collection).
  10906. *
  10907. * @static
  10908. * @memberOf _
  10909. * @since 0.1.0
  10910. * @category Collection
  10911. * @param {Array|Object} collection The collection to iterate over.
  10912. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10913. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10914. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10915. * else `false`.
  10916. * @example
  10917. *
  10918. * _.some([null, 0, 'yes', false], Boolean);
  10919. * // => true
  10920. *
  10921. * var users = [
  10922. * { 'user': 'barney', 'active': true },
  10923. * { 'user': 'fred', 'active': false }
  10924. * ];
  10925. *
  10926. * // The `_.matches` iteratee shorthand.
  10927. * _.some(users, { 'user': 'barney', 'active': false });
  10928. * // => false
  10929. *
  10930. * // The `_.matchesProperty` iteratee shorthand.
  10931. * _.some(users, ['active', false]);
  10932. * // => true
  10933. *
  10934. * // The `_.property` iteratee shorthand.
  10935. * _.some(users, 'active');
  10936. * // => true
  10937. */
  10938. function some(collection, predicate, guard) {
  10939. var func = isArray(collection) ? arraySome : baseSome;
  10940. if (guard && isIterateeCall(collection, predicate, guard)) {
  10941. predicate = undefined;
  10942. }
  10943. return func(collection, getIteratee(predicate, 3));
  10944. }
  10945. /**
  10946. * Creates an array of elements, sorted in ascending order by the results of
  10947. * running each element in a collection thru each iteratee. This method
  10948. * performs a stable sort, that is, it preserves the original sort order of
  10949. * equal elements. The iteratees are invoked with one argument: (value).
  10950. *
  10951. * @static
  10952. * @memberOf _
  10953. * @since 0.1.0
  10954. * @category Collection
  10955. * @param {Array|Object} collection The collection to iterate over.
  10956. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10957. * The iteratees to sort by.
  10958. * @returns {Array} Returns the new sorted array.
  10959. * @example
  10960. *
  10961. * var users = [
  10962. * { 'user': 'fred', 'age': 48 },
  10963. * { 'user': 'barney', 'age': 36 },
  10964. * { 'user': 'fred', 'age': 30 },
  10965. * { 'user': 'barney', 'age': 34 }
  10966. * ];
  10967. *
  10968. * _.sortBy(users, [function(o) { return o.user; }]);
  10969. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10970. *
  10971. * _.sortBy(users, ['user', 'age']);
  10972. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10973. */
  10974. var sortBy = baseRest(function(collection, iteratees) {
  10975. if (collection == null) {
  10976. return [];
  10977. }
  10978. var length = iteratees.length;
  10979. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10980. iteratees = [];
  10981. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10982. iteratees = [iteratees[0]];
  10983. }
  10984. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10985. });
  10986. /*------------------------------------------------------------------------*/
  10987. /**
  10988. * Gets the timestamp of the number of milliseconds that have elapsed since
  10989. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10990. *
  10991. * @static
  10992. * @memberOf _
  10993. * @since 2.4.0
  10994. * @category Date
  10995. * @returns {number} Returns the timestamp.
  10996. * @example
  10997. *
  10998. * _.defer(function(stamp) {
  10999. * console.log(_.now() - stamp);
  11000. * }, _.now());
  11001. * // => Logs the number of milliseconds it took for the deferred invocation.
  11002. */
  11003. var now = ctxNow || function() {
  11004. return root.Date.now();
  11005. };
  11006. /*------------------------------------------------------------------------*/
  11007. /**
  11008. * The opposite of `_.before`; this method creates a function that invokes
  11009. * `func` once it's called `n` or more times.
  11010. *
  11011. * @static
  11012. * @memberOf _
  11013. * @since 0.1.0
  11014. * @category Function
  11015. * @param {number} n The number of calls before `func` is invoked.
  11016. * @param {Function} func The function to restrict.
  11017. * @returns {Function} Returns the new restricted function.
  11018. * @example
  11019. *
  11020. * var saves = ['profile', 'settings'];
  11021. *
  11022. * var done = _.after(saves.length, function() {
  11023. * console.log('done saving!');
  11024. * });
  11025. *
  11026. * _.forEach(saves, function(type) {
  11027. * asyncSave({ 'type': type, 'complete': done });
  11028. * });
  11029. * // => Logs 'done saving!' after the two async saves have completed.
  11030. */
  11031. function after(n, func) {
  11032. if (typeof func != 'function') {
  11033. throw new TypeError(FUNC_ERROR_TEXT);
  11034. }
  11035. n = toInteger(n);
  11036. return function() {
  11037. if (--n < 1) {
  11038. return func.apply(this, arguments);
  11039. }
  11040. };
  11041. }
  11042. /**
  11043. * Creates a function that invokes `func`, with up to `n` arguments,
  11044. * ignoring any additional arguments.
  11045. *
  11046. * @static
  11047. * @memberOf _
  11048. * @since 3.0.0
  11049. * @category Function
  11050. * @param {Function} func The function to cap arguments for.
  11051. * @param {number} [n=func.length] The arity cap.
  11052. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11053. * @returns {Function} Returns the new capped function.
  11054. * @example
  11055. *
  11056. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  11057. * // => [6, 8, 10]
  11058. */
  11059. function ary(func, n, guard) {
  11060. n = guard ? undefined : n;
  11061. n = (func && n == null) ? func.length : n;
  11062. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  11063. }
  11064. /**
  11065. * Creates a function that invokes `func`, with the `this` binding and arguments
  11066. * of the created function, while it's called less than `n` times. Subsequent
  11067. * calls to the created function return the result of the last `func` invocation.
  11068. *
  11069. * @static
  11070. * @memberOf _
  11071. * @since 3.0.0
  11072. * @category Function
  11073. * @param {number} n The number of calls at which `func` is no longer invoked.
  11074. * @param {Function} func The function to restrict.
  11075. * @returns {Function} Returns the new restricted function.
  11076. * @example
  11077. *
  11078. * jQuery(element).on('click', _.before(5, addContactToList));
  11079. * // => Allows adding up to 4 contacts to the list.
  11080. */
  11081. function before(n, func) {
  11082. var result;
  11083. if (typeof func != 'function') {
  11084. throw new TypeError(FUNC_ERROR_TEXT);
  11085. }
  11086. n = toInteger(n);
  11087. return function() {
  11088. if (--n > 0) {
  11089. result = func.apply(this, arguments);
  11090. }
  11091. if (n <= 1) {
  11092. func = undefined;
  11093. }
  11094. return result;
  11095. };
  11096. }
  11097. /**
  11098. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  11099. * and `partials` prepended to the arguments it receives.
  11100. *
  11101. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  11102. * may be used as a placeholder for partially applied arguments.
  11103. *
  11104. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  11105. * property of bound functions.
  11106. *
  11107. * @static
  11108. * @memberOf _
  11109. * @since 0.1.0
  11110. * @category Function
  11111. * @param {Function} func The function to bind.
  11112. * @param {*} thisArg The `this` binding of `func`.
  11113. * @param {...*} [partials] The arguments to be partially applied.
  11114. * @returns {Function} Returns the new bound function.
  11115. * @example
  11116. *
  11117. * function greet(greeting, punctuation) {
  11118. * return greeting + ' ' + this.user + punctuation;
  11119. * }
  11120. *
  11121. * var object = { 'user': 'fred' };
  11122. *
  11123. * var bound = _.bind(greet, object, 'hi');
  11124. * bound('!');
  11125. * // => 'hi fred!'
  11126. *
  11127. * // Bound with placeholders.
  11128. * var bound = _.bind(greet, object, _, '!');
  11129. * bound('hi');
  11130. * // => 'hi fred!'
  11131. */
  11132. var bind = baseRest(function(func, thisArg, partials) {
  11133. var bitmask = WRAP_BIND_FLAG;
  11134. if (partials.length) {
  11135. var holders = replaceHolders(partials, getHolder(bind));
  11136. bitmask |= WRAP_PARTIAL_FLAG;
  11137. }
  11138. return createWrap(func, bitmask, thisArg, partials, holders);
  11139. });
  11140. /**
  11141. * Creates a function that invokes the method at `object[key]` with `partials`
  11142. * prepended to the arguments it receives.
  11143. *
  11144. * This method differs from `_.bind` by allowing bound functions to reference
  11145. * methods that may be redefined or don't yet exist. See
  11146. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  11147. * for more details.
  11148. *
  11149. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  11150. * builds, may be used as a placeholder for partially applied arguments.
  11151. *
  11152. * @static
  11153. * @memberOf _
  11154. * @since 0.10.0
  11155. * @category Function
  11156. * @param {Object} object The object to invoke the method on.
  11157. * @param {string} key The key of the method.
  11158. * @param {...*} [partials] The arguments to be partially applied.
  11159. * @returns {Function} Returns the new bound function.
  11160. * @example
  11161. *
  11162. * var object = {
  11163. * 'user': 'fred',
  11164. * 'greet': function(greeting, punctuation) {
  11165. * return greeting + ' ' + this.user + punctuation;
  11166. * }
  11167. * };
  11168. *
  11169. * var bound = _.bindKey(object, 'greet', 'hi');
  11170. * bound('!');
  11171. * // => 'hi fred!'
  11172. *
  11173. * object.greet = function(greeting, punctuation) {
  11174. * return greeting + 'ya ' + this.user + punctuation;
  11175. * };
  11176. *
  11177. * bound('!');
  11178. * // => 'hiya fred!'
  11179. *
  11180. * // Bound with placeholders.
  11181. * var bound = _.bindKey(object, 'greet', _, '!');
  11182. * bound('hi');
  11183. * // => 'hiya fred!'
  11184. */
  11185. var bindKey = baseRest(function(object, key, partials) {
  11186. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  11187. if (partials.length) {
  11188. var holders = replaceHolders(partials, getHolder(bindKey));
  11189. bitmask |= WRAP_PARTIAL_FLAG;
  11190. }
  11191. return createWrap(key, bitmask, object, partials, holders);
  11192. });
  11193. /**
  11194. * Creates a function that accepts arguments of `func` and either invokes
  11195. * `func` returning its result, if at least `arity` number of arguments have
  11196. * been provided, or returns a function that accepts the remaining `func`
  11197. * arguments, and so on. The arity of `func` may be specified if `func.length`
  11198. * is not sufficient.
  11199. *
  11200. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  11201. * may be used as a placeholder for provided arguments.
  11202. *
  11203. * **Note:** This method doesn't set the "length" property of curried functions.
  11204. *
  11205. * @static
  11206. * @memberOf _
  11207. * @since 2.0.0
  11208. * @category Function
  11209. * @param {Function} func The function to curry.
  11210. * @param {number} [arity=func.length] The arity of `func`.
  11211. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11212. * @returns {Function} Returns the new curried function.
  11213. * @example
  11214. *
  11215. * var abc = function(a, b, c) {
  11216. * return [a, b, c];
  11217. * };
  11218. *
  11219. * var curried = _.curry(abc);
  11220. *
  11221. * curried(1)(2)(3);
  11222. * // => [1, 2, 3]
  11223. *
  11224. * curried(1, 2)(3);
  11225. * // => [1, 2, 3]
  11226. *
  11227. * curried(1, 2, 3);
  11228. * // => [1, 2, 3]
  11229. *
  11230. * // Curried with placeholders.
  11231. * curried(1)(_, 3)(2);
  11232. * // => [1, 2, 3]
  11233. */
  11234. function curry(func, arity, guard) {
  11235. arity = guard ? undefined : arity;
  11236. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11237. result.placeholder = curry.placeholder;
  11238. return result;
  11239. }
  11240. /**
  11241. * This method is like `_.curry` except that arguments are applied to `func`
  11242. * in the manner of `_.partialRight` instead of `_.partial`.
  11243. *
  11244. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  11245. * builds, may be used as a placeholder for provided arguments.
  11246. *
  11247. * **Note:** This method doesn't set the "length" property of curried functions.
  11248. *
  11249. * @static
  11250. * @memberOf _
  11251. * @since 3.0.0
  11252. * @category Function
  11253. * @param {Function} func The function to curry.
  11254. * @param {number} [arity=func.length] The arity of `func`.
  11255. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11256. * @returns {Function} Returns the new curried function.
  11257. * @example
  11258. *
  11259. * var abc = function(a, b, c) {
  11260. * return [a, b, c];
  11261. * };
  11262. *
  11263. * var curried = _.curryRight(abc);
  11264. *
  11265. * curried(3)(2)(1);
  11266. * // => [1, 2, 3]
  11267. *
  11268. * curried(2, 3)(1);
  11269. * // => [1, 2, 3]
  11270. *
  11271. * curried(1, 2, 3);
  11272. * // => [1, 2, 3]
  11273. *
  11274. * // Curried with placeholders.
  11275. * curried(3)(1, _)(2);
  11276. * // => [1, 2, 3]
  11277. */
  11278. function curryRight(func, arity, guard) {
  11279. arity = guard ? undefined : arity;
  11280. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11281. result.placeholder = curryRight.placeholder;
  11282. return result;
  11283. }
  11284. /**
  11285. * Creates a debounced function that delays invoking `func` until after `wait`
  11286. * milliseconds have elapsed since the last time the debounced function was
  11287. * invoked. The debounced function comes with a `cancel` method to cancel
  11288. * delayed `func` invocations and a `flush` method to immediately invoke them.
  11289. * Provide `options` to indicate whether `func` should be invoked on the
  11290. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  11291. * with the last arguments provided to the debounced function. Subsequent
  11292. * calls to the debounced function return the result of the last `func`
  11293. * invocation.
  11294. *
  11295. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11296. * invoked on the trailing edge of the timeout only if the debounced function
  11297. * is invoked more than once during the `wait` timeout.
  11298. *
  11299. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11300. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11301. *
  11302. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11303. * for details over the differences between `_.debounce` and `_.throttle`.
  11304. *
  11305. * @static
  11306. * @memberOf _
  11307. * @since 0.1.0
  11308. * @category Function
  11309. * @param {Function} func The function to debounce.
  11310. * @param {number} [wait=0] The number of milliseconds to delay.
  11311. * @param {Object} [options={}] The options object.
  11312. * @param {boolean} [options.leading=false]
  11313. * Specify invoking on the leading edge of the timeout.
  11314. * @param {number} [options.maxWait]
  11315. * The maximum time `func` is allowed to be delayed before it's invoked.
  11316. * @param {boolean} [options.trailing=true]
  11317. * Specify invoking on the trailing edge of the timeout.
  11318. * @returns {Function} Returns the new debounced function.
  11319. * @example
  11320. *
  11321. * // Avoid costly calculations while the window size is in flux.
  11322. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  11323. *
  11324. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  11325. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  11326. * 'leading': true,
  11327. * 'trailing': false
  11328. * }));
  11329. *
  11330. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  11331. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  11332. * var source = new EventSource('/stream');
  11333. * jQuery(source).on('message', debounced);
  11334. *
  11335. * // Cancel the trailing debounced invocation.
  11336. * jQuery(window).on('popstate', debounced.cancel);
  11337. */
  11338. function debounce(func, wait, options) {
  11339. var lastArgs,
  11340. lastThis,
  11341. maxWait,
  11342. result,
  11343. timerId,
  11344. lastCallTime,
  11345. lastInvokeTime = 0,
  11346. leading = false,
  11347. maxing = false,
  11348. trailing = true;
  11349. if (typeof func != 'function') {
  11350. throw new TypeError(FUNC_ERROR_TEXT);
  11351. }
  11352. wait = toNumber(wait) || 0;
  11353. if (isObject(options)) {
  11354. leading = !!options.leading;
  11355. maxing = 'maxWait' in options;
  11356. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  11357. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11358. }
  11359. function invokeFunc(time) {
  11360. var args = lastArgs,
  11361. thisArg = lastThis;
  11362. lastArgs = lastThis = undefined;
  11363. lastInvokeTime = time;
  11364. result = func.apply(thisArg, args);
  11365. return result;
  11366. }
  11367. function leadingEdge(time) {
  11368. // Reset any `maxWait` timer.
  11369. lastInvokeTime = time;
  11370. // Start the timer for the trailing edge.
  11371. timerId = setTimeout(timerExpired, wait);
  11372. // Invoke the leading edge.
  11373. return leading ? invokeFunc(time) : result;
  11374. }
  11375. function remainingWait(time) {
  11376. var timeSinceLastCall = time - lastCallTime,
  11377. timeSinceLastInvoke = time - lastInvokeTime,
  11378. timeWaiting = wait - timeSinceLastCall;
  11379. return maxing
  11380. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11381. : timeWaiting;
  11382. }
  11383. function shouldInvoke(time) {
  11384. var timeSinceLastCall = time - lastCallTime,
  11385. timeSinceLastInvoke = time - lastInvokeTime;
  11386. // Either this is the first call, activity has stopped and we're at the
  11387. // trailing edge, the system time has gone backwards and we're treating
  11388. // it as the trailing edge, or we've hit the `maxWait` limit.
  11389. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11390. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11391. }
  11392. function timerExpired() {
  11393. var time = now();
  11394. if (shouldInvoke(time)) {
  11395. return trailingEdge(time);
  11396. }
  11397. // Restart the timer.
  11398. timerId = setTimeout(timerExpired, remainingWait(time));
  11399. }
  11400. function trailingEdge(time) {
  11401. timerId = undefined;
  11402. // Only invoke if we have `lastArgs` which means `func` has been
  11403. // debounced at least once.
  11404. if (trailing && lastArgs) {
  11405. return invokeFunc(time);
  11406. }
  11407. lastArgs = lastThis = undefined;
  11408. return result;
  11409. }
  11410. function cancel() {
  11411. if (timerId !== undefined) {
  11412. clearTimeout(timerId);
  11413. }
  11414. lastInvokeTime = 0;
  11415. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11416. }
  11417. function flush() {
  11418. return timerId === undefined ? result : trailingEdge(now());
  11419. }
  11420. function debounced() {
  11421. var time = now(),
  11422. isInvoking = shouldInvoke(time);
  11423. lastArgs = arguments;
  11424. lastThis = this;
  11425. lastCallTime = time;
  11426. if (isInvoking) {
  11427. if (timerId === undefined) {
  11428. return leadingEdge(lastCallTime);
  11429. }
  11430. if (maxing) {
  11431. // Handle invocations in a tight loop.
  11432. clearTimeout(timerId);
  11433. timerId = setTimeout(timerExpired, wait);
  11434. return invokeFunc(lastCallTime);
  11435. }
  11436. }
  11437. if (timerId === undefined) {
  11438. timerId = setTimeout(timerExpired, wait);
  11439. }
  11440. return result;
  11441. }
  11442. debounced.cancel = cancel;
  11443. debounced.flush = flush;
  11444. return debounced;
  11445. }
  11446. /**
  11447. * Defers invoking the `func` until the current call stack has cleared. Any
  11448. * additional arguments are provided to `func` when it's invoked.
  11449. *
  11450. * @static
  11451. * @memberOf _
  11452. * @since 0.1.0
  11453. * @category Function
  11454. * @param {Function} func The function to defer.
  11455. * @param {...*} [args] The arguments to invoke `func` with.
  11456. * @returns {number} Returns the timer id.
  11457. * @example
  11458. *
  11459. * _.defer(function(text) {
  11460. * console.log(text);
  11461. * }, 'deferred');
  11462. * // => Logs 'deferred' after one millisecond.
  11463. */
  11464. var defer = baseRest(function(func, args) {
  11465. return baseDelay(func, 1, args);
  11466. });
  11467. /**
  11468. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11469. * 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 delay.
  11476. * @param {number} wait The number of milliseconds to delay invocation.
  11477. * @param {...*} [args] The arguments to invoke `func` with.
  11478. * @returns {number} Returns the timer id.
  11479. * @example
  11480. *
  11481. * _.delay(function(text) {
  11482. * console.log(text);
  11483. * }, 1000, 'later');
  11484. * // => Logs 'later' after one second.
  11485. */
  11486. var delay = baseRest(function(func, wait, args) {
  11487. return baseDelay(func, toNumber(wait) || 0, args);
  11488. });
  11489. /**
  11490. * Creates a function that invokes `func` with arguments reversed.
  11491. *
  11492. * @static
  11493. * @memberOf _
  11494. * @since 4.0.0
  11495. * @category Function
  11496. * @param {Function} func The function to flip arguments for.
  11497. * @returns {Function} Returns the new flipped function.
  11498. * @example
  11499. *
  11500. * var flipped = _.flip(function() {
  11501. * return _.toArray(arguments);
  11502. * });
  11503. *
  11504. * flipped('a', 'b', 'c', 'd');
  11505. * // => ['d', 'c', 'b', 'a']
  11506. */
  11507. function flip(func) {
  11508. return createWrap(func, WRAP_FLIP_FLAG);
  11509. }
  11510. /**
  11511. * Creates a function that memoizes the result of `func`. If `resolver` is
  11512. * provided, it determines the cache key for storing the result based on the
  11513. * arguments provided to the memoized function. By default, the first argument
  11514. * provided to the memoized function is used as the map cache key. The `func`
  11515. * is invoked with the `this` binding of the memoized function.
  11516. *
  11517. * **Note:** The cache is exposed as the `cache` property on the memoized
  11518. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11519. * constructor with one whose instances implement the
  11520. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11521. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11522. *
  11523. * @static
  11524. * @memberOf _
  11525. * @since 0.1.0
  11526. * @category Function
  11527. * @param {Function} func The function to have its output memoized.
  11528. * @param {Function} [resolver] The function to resolve the cache key.
  11529. * @returns {Function} Returns the new memoized function.
  11530. * @example
  11531. *
  11532. * var object = { 'a': 1, 'b': 2 };
  11533. * var other = { 'c': 3, 'd': 4 };
  11534. *
  11535. * var values = _.memoize(_.values);
  11536. * values(object);
  11537. * // => [1, 2]
  11538. *
  11539. * values(other);
  11540. * // => [3, 4]
  11541. *
  11542. * object.a = 2;
  11543. * values(object);
  11544. * // => [1, 2]
  11545. *
  11546. * // Modify the result cache.
  11547. * values.cache.set(object, ['a', 'b']);
  11548. * values(object);
  11549. * // => ['a', 'b']
  11550. *
  11551. * // Replace `_.memoize.Cache`.
  11552. * _.memoize.Cache = WeakMap;
  11553. */
  11554. function memoize(func, resolver) {
  11555. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11556. throw new TypeError(FUNC_ERROR_TEXT);
  11557. }
  11558. var memoized = function() {
  11559. var args = arguments,
  11560. key = resolver ? resolver.apply(this, args) : args[0],
  11561. cache = memoized.cache;
  11562. if (cache.has(key)) {
  11563. return cache.get(key);
  11564. }
  11565. var result = func.apply(this, args);
  11566. memoized.cache = cache.set(key, result) || cache;
  11567. return result;
  11568. };
  11569. memoized.cache = new (memoize.Cache || MapCache);
  11570. return memoized;
  11571. }
  11572. // Expose `MapCache`.
  11573. memoize.Cache = MapCache;
  11574. /**
  11575. * Creates a function that negates the result of the predicate `func`. The
  11576. * `func` predicate is invoked with the `this` binding and arguments of the
  11577. * created function.
  11578. *
  11579. * @static
  11580. * @memberOf _
  11581. * @since 3.0.0
  11582. * @category Function
  11583. * @param {Function} predicate The predicate to negate.
  11584. * @returns {Function} Returns the new negated function.
  11585. * @example
  11586. *
  11587. * function isEven(n) {
  11588. * return n % 2 == 0;
  11589. * }
  11590. *
  11591. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11592. * // => [1, 3, 5]
  11593. */
  11594. function negate(predicate) {
  11595. if (typeof predicate != 'function') {
  11596. throw new TypeError(FUNC_ERROR_TEXT);
  11597. }
  11598. return function() {
  11599. var args = arguments;
  11600. switch (args.length) {
  11601. case 0: return !predicate.call(this);
  11602. case 1: return !predicate.call(this, args[0]);
  11603. case 2: return !predicate.call(this, args[0], args[1]);
  11604. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11605. }
  11606. return !predicate.apply(this, args);
  11607. };
  11608. }
  11609. /**
  11610. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11611. * to the function return the value of the first invocation. The `func` is
  11612. * invoked with the `this` binding and arguments of the created function.
  11613. *
  11614. * @static
  11615. * @memberOf _
  11616. * @since 0.1.0
  11617. * @category Function
  11618. * @param {Function} func The function to restrict.
  11619. * @returns {Function} Returns the new restricted function.
  11620. * @example
  11621. *
  11622. * var initialize = _.once(createApplication);
  11623. * initialize();
  11624. * initialize();
  11625. * // => `createApplication` is invoked once
  11626. */
  11627. function once(func) {
  11628. return before(2, func);
  11629. }
  11630. /**
  11631. * Creates a function that invokes `func` with its arguments transformed.
  11632. *
  11633. * @static
  11634. * @since 4.0.0
  11635. * @memberOf _
  11636. * @category Function
  11637. * @param {Function} func The function to wrap.
  11638. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11639. * The argument transforms.
  11640. * @returns {Function} Returns the new function.
  11641. * @example
  11642. *
  11643. * function doubled(n) {
  11644. * return n * 2;
  11645. * }
  11646. *
  11647. * function square(n) {
  11648. * return n * n;
  11649. * }
  11650. *
  11651. * var func = _.overArgs(function(x, y) {
  11652. * return [x, y];
  11653. * }, [square, doubled]);
  11654. *
  11655. * func(9, 3);
  11656. * // => [81, 6]
  11657. *
  11658. * func(10, 5);
  11659. * // => [100, 10]
  11660. */
  11661. var overArgs = castRest(function(func, transforms) {
  11662. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11663. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11664. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11665. var funcsLength = transforms.length;
  11666. return baseRest(function(args) {
  11667. var index = -1,
  11668. length = nativeMin(args.length, funcsLength);
  11669. while (++index < length) {
  11670. args[index] = transforms[index].call(this, args[index]);
  11671. }
  11672. return apply(func, this, args);
  11673. });
  11674. });
  11675. /**
  11676. * Creates a function that invokes `func` with `partials` prepended to the
  11677. * arguments it receives. This method is like `_.bind` except it does **not**
  11678. * alter the `this` binding.
  11679. *
  11680. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11681. * builds, may be used as a placeholder for partially applied arguments.
  11682. *
  11683. * **Note:** This method doesn't set the "length" property of partially
  11684. * applied functions.
  11685. *
  11686. * @static
  11687. * @memberOf _
  11688. * @since 0.2.0
  11689. * @category Function
  11690. * @param {Function} func The function to partially apply arguments to.
  11691. * @param {...*} [partials] The arguments to be partially applied.
  11692. * @returns {Function} Returns the new partially applied function.
  11693. * @example
  11694. *
  11695. * function greet(greeting, name) {
  11696. * return greeting + ' ' + name;
  11697. * }
  11698. *
  11699. * var sayHelloTo = _.partial(greet, 'hello');
  11700. * sayHelloTo('fred');
  11701. * // => 'hello fred'
  11702. *
  11703. * // Partially applied with placeholders.
  11704. * var greetFred = _.partial(greet, _, 'fred');
  11705. * greetFred('hi');
  11706. * // => 'hi fred'
  11707. */
  11708. var partial = baseRest(function(func, partials) {
  11709. var holders = replaceHolders(partials, getHolder(partial));
  11710. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11711. });
  11712. /**
  11713. * This method is like `_.partial` except that partially applied arguments
  11714. * are appended to the arguments it receives.
  11715. *
  11716. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11717. * builds, may be used as a placeholder for partially applied arguments.
  11718. *
  11719. * **Note:** This method doesn't set the "length" property of partially
  11720. * applied functions.
  11721. *
  11722. * @static
  11723. * @memberOf _
  11724. * @since 1.0.0
  11725. * @category Function
  11726. * @param {Function} func The function to partially apply arguments to.
  11727. * @param {...*} [partials] The arguments to be partially applied.
  11728. * @returns {Function} Returns the new partially applied function.
  11729. * @example
  11730. *
  11731. * function greet(greeting, name) {
  11732. * return greeting + ' ' + name;
  11733. * }
  11734. *
  11735. * var greetFred = _.partialRight(greet, 'fred');
  11736. * greetFred('hi');
  11737. * // => 'hi fred'
  11738. *
  11739. * // Partially applied with placeholders.
  11740. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11741. * sayHelloTo('fred');
  11742. * // => 'hello fred'
  11743. */
  11744. var partialRight = baseRest(function(func, partials) {
  11745. var holders = replaceHolders(partials, getHolder(partialRight));
  11746. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11747. });
  11748. /**
  11749. * Creates a function that invokes `func` with arguments arranged according
  11750. * to the specified `indexes` where the argument value at the first index is
  11751. * provided as the first argument, the argument value at the second index is
  11752. * provided as the second argument, and so on.
  11753. *
  11754. * @static
  11755. * @memberOf _
  11756. * @since 3.0.0
  11757. * @category Function
  11758. * @param {Function} func The function to rearrange arguments for.
  11759. * @param {...(number|number[])} indexes The arranged argument indexes.
  11760. * @returns {Function} Returns the new function.
  11761. * @example
  11762. *
  11763. * var rearged = _.rearg(function(a, b, c) {
  11764. * return [a, b, c];
  11765. * }, [2, 0, 1]);
  11766. *
  11767. * rearged('b', 'c', 'a')
  11768. * // => ['a', 'b', 'c']
  11769. */
  11770. var rearg = flatRest(function(func, indexes) {
  11771. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11772. });
  11773. /**
  11774. * Creates a function that invokes `func` with the `this` binding of the
  11775. * created function and arguments from `start` and beyond provided as
  11776. * an array.
  11777. *
  11778. * **Note:** This method is based on the
  11779. * [rest parameter](https://mdn.io/rest_parameters).
  11780. *
  11781. * @static
  11782. * @memberOf _
  11783. * @since 4.0.0
  11784. * @category Function
  11785. * @param {Function} func The function to apply a rest parameter to.
  11786. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11787. * @returns {Function} Returns the new function.
  11788. * @example
  11789. *
  11790. * var say = _.rest(function(what, names) {
  11791. * return what + ' ' + _.initial(names).join(', ') +
  11792. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11793. * });
  11794. *
  11795. * say('hello', 'fred', 'barney', 'pebbles');
  11796. * // => 'hello fred, barney, & pebbles'
  11797. */
  11798. function rest(func, start) {
  11799. if (typeof func != 'function') {
  11800. throw new TypeError(FUNC_ERROR_TEXT);
  11801. }
  11802. start = start === undefined ? start : toInteger(start);
  11803. return baseRest(func, start);
  11804. }
  11805. /**
  11806. * Creates a function that invokes `func` with the `this` binding of the
  11807. * create function and an array of arguments much like
  11808. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11809. *
  11810. * **Note:** This method is based on the
  11811. * [spread operator](https://mdn.io/spread_operator).
  11812. *
  11813. * @static
  11814. * @memberOf _
  11815. * @since 3.2.0
  11816. * @category Function
  11817. * @param {Function} func The function to spread arguments over.
  11818. * @param {number} [start=0] The start position of the spread.
  11819. * @returns {Function} Returns the new function.
  11820. * @example
  11821. *
  11822. * var say = _.spread(function(who, what) {
  11823. * return who + ' says ' + what;
  11824. * });
  11825. *
  11826. * say(['fred', 'hello']);
  11827. * // => 'fred says hello'
  11828. *
  11829. * var numbers = Promise.all([
  11830. * Promise.resolve(40),
  11831. * Promise.resolve(36)
  11832. * ]);
  11833. *
  11834. * numbers.then(_.spread(function(x, y) {
  11835. * return x + y;
  11836. * }));
  11837. * // => a Promise of 76
  11838. */
  11839. function spread(func, start) {
  11840. if (typeof func != 'function') {
  11841. throw new TypeError(FUNC_ERROR_TEXT);
  11842. }
  11843. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11844. return baseRest(function(args) {
  11845. var array = args[start],
  11846. otherArgs = castSlice(args, 0, start);
  11847. if (array) {
  11848. arrayPush(otherArgs, array);
  11849. }
  11850. return apply(func, this, otherArgs);
  11851. });
  11852. }
  11853. /**
  11854. * Creates a throttled function that only invokes `func` at most once per
  11855. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11856. * method to cancel delayed `func` invocations and a `flush` method to
  11857. * immediately invoke them. Provide `options` to indicate whether `func`
  11858. * should be invoked on the leading and/or trailing edge of the `wait`
  11859. * timeout. The `func` is invoked with the last arguments provided to the
  11860. * throttled function. Subsequent calls to the throttled function return the
  11861. * result of the last `func` invocation.
  11862. *
  11863. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11864. * invoked on the trailing edge of the timeout only if the throttled function
  11865. * is invoked more than once during the `wait` timeout.
  11866. *
  11867. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11868. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11869. *
  11870. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11871. * for details over the differences between `_.throttle` and `_.debounce`.
  11872. *
  11873. * @static
  11874. * @memberOf _
  11875. * @since 0.1.0
  11876. * @category Function
  11877. * @param {Function} func The function to throttle.
  11878. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11879. * @param {Object} [options={}] The options object.
  11880. * @param {boolean} [options.leading=true]
  11881. * Specify invoking on the leading edge of the timeout.
  11882. * @param {boolean} [options.trailing=true]
  11883. * Specify invoking on the trailing edge of the timeout.
  11884. * @returns {Function} Returns the new throttled function.
  11885. * @example
  11886. *
  11887. * // Avoid excessively updating the position while scrolling.
  11888. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11889. *
  11890. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11891. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11892. * jQuery(element).on('click', throttled);
  11893. *
  11894. * // Cancel the trailing throttled invocation.
  11895. * jQuery(window).on('popstate', throttled.cancel);
  11896. */
  11897. function throttle(func, wait, options) {
  11898. var leading = true,
  11899. trailing = true;
  11900. if (typeof func != 'function') {
  11901. throw new TypeError(FUNC_ERROR_TEXT);
  11902. }
  11903. if (isObject(options)) {
  11904. leading = 'leading' in options ? !!options.leading : leading;
  11905. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11906. }
  11907. return debounce(func, wait, {
  11908. 'leading': leading,
  11909. 'maxWait': wait,
  11910. 'trailing': trailing
  11911. });
  11912. }
  11913. /**
  11914. * Creates a function that accepts up to one argument, ignoring any
  11915. * additional arguments.
  11916. *
  11917. * @static
  11918. * @memberOf _
  11919. * @since 4.0.0
  11920. * @category Function
  11921. * @param {Function} func The function to cap arguments for.
  11922. * @returns {Function} Returns the new capped function.
  11923. * @example
  11924. *
  11925. * _.map(['6', '8', '10'], _.unary(parseInt));
  11926. * // => [6, 8, 10]
  11927. */
  11928. function unary(func) {
  11929. return ary(func, 1);
  11930. }
  11931. /**
  11932. * Creates a function that provides `value` to `wrapper` as its first
  11933. * argument. Any additional arguments provided to the function are appended
  11934. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11935. * binding of the created function.
  11936. *
  11937. * @static
  11938. * @memberOf _
  11939. * @since 0.1.0
  11940. * @category Function
  11941. * @param {*} value The value to wrap.
  11942. * @param {Function} [wrapper=identity] The wrapper function.
  11943. * @returns {Function} Returns the new function.
  11944. * @example
  11945. *
  11946. * var p = _.wrap(_.escape, function(func, text) {
  11947. * return '<p>' + func(text) + '</p>';
  11948. * });
  11949. *
  11950. * p('fred, barney, & pebbles');
  11951. * // => '<p>fred, barney, &amp; pebbles</p>'
  11952. */
  11953. function wrap(value, wrapper) {
  11954. return partial(castFunction(wrapper), value);
  11955. }
  11956. /*------------------------------------------------------------------------*/
  11957. /**
  11958. * Casts `value` as an array if it's not one.
  11959. *
  11960. * @static
  11961. * @memberOf _
  11962. * @since 4.4.0
  11963. * @category Lang
  11964. * @param {*} value The value to inspect.
  11965. * @returns {Array} Returns the cast array.
  11966. * @example
  11967. *
  11968. * _.castArray(1);
  11969. * // => [1]
  11970. *
  11971. * _.castArray({ 'a': 1 });
  11972. * // => [{ 'a': 1 }]
  11973. *
  11974. * _.castArray('abc');
  11975. * // => ['abc']
  11976. *
  11977. * _.castArray(null);
  11978. * // => [null]
  11979. *
  11980. * _.castArray(undefined);
  11981. * // => [undefined]
  11982. *
  11983. * _.castArray();
  11984. * // => []
  11985. *
  11986. * var array = [1, 2, 3];
  11987. * console.log(_.castArray(array) === array);
  11988. * // => true
  11989. */
  11990. function castArray() {
  11991. if (!arguments.length) {
  11992. return [];
  11993. }
  11994. var value = arguments[0];
  11995. return isArray(value) ? value : [value];
  11996. }
  11997. /**
  11998. * Creates a shallow clone of `value`.
  11999. *
  12000. * **Note:** This method is loosely based on the
  12001. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  12002. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  12003. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  12004. * arrays. The own enumerable properties of `arguments` objects are cloned
  12005. * as plain objects. An empty object is returned for uncloneable values such
  12006. * as error objects, functions, DOM nodes, and WeakMaps.
  12007. *
  12008. * @static
  12009. * @memberOf _
  12010. * @since 0.1.0
  12011. * @category Lang
  12012. * @param {*} value The value to clone.
  12013. * @returns {*} Returns the cloned value.
  12014. * @see _.cloneDeep
  12015. * @example
  12016. *
  12017. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12018. *
  12019. * var shallow = _.clone(objects);
  12020. * console.log(shallow[0] === objects[0]);
  12021. * // => true
  12022. */
  12023. function clone(value) {
  12024. return baseClone(value, CLONE_SYMBOLS_FLAG);
  12025. }
  12026. /**
  12027. * This method is like `_.clone` except that it accepts `customizer` which
  12028. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  12029. * cloning is handled by the method instead. The `customizer` is invoked with
  12030. * up to four arguments; (value [, index|key, object, stack]).
  12031. *
  12032. * @static
  12033. * @memberOf _
  12034. * @since 4.0.0
  12035. * @category Lang
  12036. * @param {*} value The value to clone.
  12037. * @param {Function} [customizer] The function to customize cloning.
  12038. * @returns {*} Returns the cloned value.
  12039. * @see _.cloneDeepWith
  12040. * @example
  12041. *
  12042. * function customizer(value) {
  12043. * if (_.isElement(value)) {
  12044. * return value.cloneNode(false);
  12045. * }
  12046. * }
  12047. *
  12048. * var el = _.cloneWith(document.body, customizer);
  12049. *
  12050. * console.log(el === document.body);
  12051. * // => false
  12052. * console.log(el.nodeName);
  12053. * // => 'BODY'
  12054. * console.log(el.childNodes.length);
  12055. * // => 0
  12056. */
  12057. function cloneWith(value, customizer) {
  12058. customizer = typeof customizer == 'function' ? customizer : undefined;
  12059. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  12060. }
  12061. /**
  12062. * This method is like `_.clone` except that it recursively clones `value`.
  12063. *
  12064. * @static
  12065. * @memberOf _
  12066. * @since 1.0.0
  12067. * @category Lang
  12068. * @param {*} value The value to recursively clone.
  12069. * @returns {*} Returns the deep cloned value.
  12070. * @see _.clone
  12071. * @example
  12072. *
  12073. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12074. *
  12075. * var deep = _.cloneDeep(objects);
  12076. * console.log(deep[0] === objects[0]);
  12077. * // => false
  12078. */
  12079. function cloneDeep(value) {
  12080. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  12081. }
  12082. /**
  12083. * This method is like `_.cloneWith` except that it recursively clones `value`.
  12084. *
  12085. * @static
  12086. * @memberOf _
  12087. * @since 4.0.0
  12088. * @category Lang
  12089. * @param {*} value The value to recursively clone.
  12090. * @param {Function} [customizer] The function to customize cloning.
  12091. * @returns {*} Returns the deep cloned value.
  12092. * @see _.cloneWith
  12093. * @example
  12094. *
  12095. * function customizer(value) {
  12096. * if (_.isElement(value)) {
  12097. * return value.cloneNode(true);
  12098. * }
  12099. * }
  12100. *
  12101. * var el = _.cloneDeepWith(document.body, customizer);
  12102. *
  12103. * console.log(el === document.body);
  12104. * // => false
  12105. * console.log(el.nodeName);
  12106. * // => 'BODY'
  12107. * console.log(el.childNodes.length);
  12108. * // => 20
  12109. */
  12110. function cloneDeepWith(value, customizer) {
  12111. customizer = typeof customizer == 'function' ? customizer : undefined;
  12112. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  12113. }
  12114. /**
  12115. * Checks if `object` conforms to `source` by invoking the predicate
  12116. * properties of `source` with the corresponding property values of `object`.
  12117. *
  12118. * **Note:** This method is equivalent to `_.conforms` when `source` is
  12119. * partially applied.
  12120. *
  12121. * @static
  12122. * @memberOf _
  12123. * @since 4.14.0
  12124. * @category Lang
  12125. * @param {Object} object The object to inspect.
  12126. * @param {Object} source The object of property predicates to conform to.
  12127. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  12128. * @example
  12129. *
  12130. * var object = { 'a': 1, 'b': 2 };
  12131. *
  12132. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  12133. * // => true
  12134. *
  12135. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  12136. * // => false
  12137. */
  12138. function conformsTo(object, source) {
  12139. return source == null || baseConformsTo(object, source, keys(source));
  12140. }
  12141. /**
  12142. * Performs a
  12143. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12144. * comparison between two values to determine if they are equivalent.
  12145. *
  12146. * @static
  12147. * @memberOf _
  12148. * @since 4.0.0
  12149. * @category Lang
  12150. * @param {*} value The value to compare.
  12151. * @param {*} other The other value to compare.
  12152. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12153. * @example
  12154. *
  12155. * var object = { 'a': 1 };
  12156. * var other = { 'a': 1 };
  12157. *
  12158. * _.eq(object, object);
  12159. * // => true
  12160. *
  12161. * _.eq(object, other);
  12162. * // => false
  12163. *
  12164. * _.eq('a', 'a');
  12165. * // => true
  12166. *
  12167. * _.eq('a', Object('a'));
  12168. * // => false
  12169. *
  12170. * _.eq(NaN, NaN);
  12171. * // => true
  12172. */
  12173. function eq(value, other) {
  12174. return value === other || (value !== value && other !== other);
  12175. }
  12176. /**
  12177. * Checks if `value` is greater than `other`.
  12178. *
  12179. * @static
  12180. * @memberOf _
  12181. * @since 3.9.0
  12182. * @category Lang
  12183. * @param {*} value The value to compare.
  12184. * @param {*} other The other value to compare.
  12185. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  12186. * else `false`.
  12187. * @see _.lt
  12188. * @example
  12189. *
  12190. * _.gt(3, 1);
  12191. * // => true
  12192. *
  12193. * _.gt(3, 3);
  12194. * // => false
  12195. *
  12196. * _.gt(1, 3);
  12197. * // => false
  12198. */
  12199. var gt = createRelationalOperation(baseGt);
  12200. /**
  12201. * Checks if `value` is greater than or equal to `other`.
  12202. *
  12203. * @static
  12204. * @memberOf _
  12205. * @since 3.9.0
  12206. * @category Lang
  12207. * @param {*} value The value to compare.
  12208. * @param {*} other The other value to compare.
  12209. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  12210. * `other`, else `false`.
  12211. * @see _.lte
  12212. * @example
  12213. *
  12214. * _.gte(3, 1);
  12215. * // => true
  12216. *
  12217. * _.gte(3, 3);
  12218. * // => true
  12219. *
  12220. * _.gte(1, 3);
  12221. * // => false
  12222. */
  12223. var gte = createRelationalOperation(function(value, other) {
  12224. return value >= other;
  12225. });
  12226. /**
  12227. * Checks if `value` is likely an `arguments` object.
  12228. *
  12229. * @static
  12230. * @memberOf _
  12231. * @since 0.1.0
  12232. * @category Lang
  12233. * @param {*} value The value to check.
  12234. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  12235. * else `false`.
  12236. * @example
  12237. *
  12238. * _.isArguments(function() { return arguments; }());
  12239. * // => true
  12240. *
  12241. * _.isArguments([1, 2, 3]);
  12242. * // => false
  12243. */
  12244. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  12245. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  12246. !propertyIsEnumerable.call(value, 'callee');
  12247. };
  12248. /**
  12249. * Checks if `value` is classified as an `Array` object.
  12250. *
  12251. * @static
  12252. * @memberOf _
  12253. * @since 0.1.0
  12254. * @category Lang
  12255. * @param {*} value The value to check.
  12256. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12257. * @example
  12258. *
  12259. * _.isArray([1, 2, 3]);
  12260. * // => true
  12261. *
  12262. * _.isArray(document.body.children);
  12263. * // => false
  12264. *
  12265. * _.isArray('abc');
  12266. * // => false
  12267. *
  12268. * _.isArray(_.noop);
  12269. * // => false
  12270. */
  12271. var isArray = Array.isArray;
  12272. /**
  12273. * Checks if `value` is classified as an `ArrayBuffer` object.
  12274. *
  12275. * @static
  12276. * @memberOf _
  12277. * @since 4.3.0
  12278. * @category Lang
  12279. * @param {*} value The value to check.
  12280. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  12281. * @example
  12282. *
  12283. * _.isArrayBuffer(new ArrayBuffer(2));
  12284. * // => true
  12285. *
  12286. * _.isArrayBuffer(new Array(2));
  12287. * // => false
  12288. */
  12289. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  12290. /**
  12291. * Checks if `value` is array-like. A value is considered array-like if it's
  12292. * not a function and has a `value.length` that's an integer greater than or
  12293. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  12294. *
  12295. * @static
  12296. * @memberOf _
  12297. * @since 4.0.0
  12298. * @category Lang
  12299. * @param {*} value The value to check.
  12300. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  12301. * @example
  12302. *
  12303. * _.isArrayLike([1, 2, 3]);
  12304. * // => true
  12305. *
  12306. * _.isArrayLike(document.body.children);
  12307. * // => true
  12308. *
  12309. * _.isArrayLike('abc');
  12310. * // => true
  12311. *
  12312. * _.isArrayLike(_.noop);
  12313. * // => false
  12314. */
  12315. function isArrayLike(value) {
  12316. return value != null && isLength(value.length) && !isFunction(value);
  12317. }
  12318. /**
  12319. * This method is like `_.isArrayLike` except that it also checks if `value`
  12320. * is an object.
  12321. *
  12322. * @static
  12323. * @memberOf _
  12324. * @since 4.0.0
  12325. * @category Lang
  12326. * @param {*} value The value to check.
  12327. * @returns {boolean} Returns `true` if `value` is an array-like object,
  12328. * else `false`.
  12329. * @example
  12330. *
  12331. * _.isArrayLikeObject([1, 2, 3]);
  12332. * // => true
  12333. *
  12334. * _.isArrayLikeObject(document.body.children);
  12335. * // => true
  12336. *
  12337. * _.isArrayLikeObject('abc');
  12338. * // => false
  12339. *
  12340. * _.isArrayLikeObject(_.noop);
  12341. * // => false
  12342. */
  12343. function isArrayLikeObject(value) {
  12344. return isObjectLike(value) && isArrayLike(value);
  12345. }
  12346. /**
  12347. * Checks if `value` is classified as a boolean primitive or object.
  12348. *
  12349. * @static
  12350. * @memberOf _
  12351. * @since 0.1.0
  12352. * @category Lang
  12353. * @param {*} value The value to check.
  12354. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  12355. * @example
  12356. *
  12357. * _.isBoolean(false);
  12358. * // => true
  12359. *
  12360. * _.isBoolean(null);
  12361. * // => false
  12362. */
  12363. function isBoolean(value) {
  12364. return value === true || value === false ||
  12365. (isObjectLike(value) && baseGetTag(value) == boolTag);
  12366. }
  12367. /**
  12368. * Checks if `value` is a buffer.
  12369. *
  12370. * @static
  12371. * @memberOf _
  12372. * @since 4.3.0
  12373. * @category Lang
  12374. * @param {*} value The value to check.
  12375. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12376. * @example
  12377. *
  12378. * _.isBuffer(new Buffer(2));
  12379. * // => true
  12380. *
  12381. * _.isBuffer(new Uint8Array(2));
  12382. * // => false
  12383. */
  12384. var isBuffer = nativeIsBuffer || stubFalse;
  12385. /**
  12386. * Checks if `value` is classified as a `Date` object.
  12387. *
  12388. * @static
  12389. * @memberOf _
  12390. * @since 0.1.0
  12391. * @category Lang
  12392. * @param {*} value The value to check.
  12393. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12394. * @example
  12395. *
  12396. * _.isDate(new Date);
  12397. * // => true
  12398. *
  12399. * _.isDate('Mon April 23 2012');
  12400. * // => false
  12401. */
  12402. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12403. /**
  12404. * Checks if `value` is likely a DOM element.
  12405. *
  12406. * @static
  12407. * @memberOf _
  12408. * @since 0.1.0
  12409. * @category Lang
  12410. * @param {*} value The value to check.
  12411. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12412. * @example
  12413. *
  12414. * _.isElement(document.body);
  12415. * // => true
  12416. *
  12417. * _.isElement('<body>');
  12418. * // => false
  12419. */
  12420. function isElement(value) {
  12421. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12422. }
  12423. /**
  12424. * Checks if `value` is an empty object, collection, map, or set.
  12425. *
  12426. * Objects are considered empty if they have no own enumerable string keyed
  12427. * properties.
  12428. *
  12429. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12430. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12431. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12432. *
  12433. * @static
  12434. * @memberOf _
  12435. * @since 0.1.0
  12436. * @category Lang
  12437. * @param {*} value The value to check.
  12438. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12439. * @example
  12440. *
  12441. * _.isEmpty(null);
  12442. * // => true
  12443. *
  12444. * _.isEmpty(true);
  12445. * // => true
  12446. *
  12447. * _.isEmpty(1);
  12448. * // => true
  12449. *
  12450. * _.isEmpty([1, 2, 3]);
  12451. * // => false
  12452. *
  12453. * _.isEmpty({ 'a': 1 });
  12454. * // => false
  12455. */
  12456. function isEmpty(value) {
  12457. if (value == null) {
  12458. return true;
  12459. }
  12460. if (isArrayLike(value) &&
  12461. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12462. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12463. return !value.length;
  12464. }
  12465. var tag = getTag(value);
  12466. if (tag == mapTag || tag == setTag) {
  12467. return !value.size;
  12468. }
  12469. if (isPrototype(value)) {
  12470. return !baseKeys(value).length;
  12471. }
  12472. for (var key in value) {
  12473. if (hasOwnProperty.call(value, key)) {
  12474. return false;
  12475. }
  12476. }
  12477. return true;
  12478. }
  12479. /**
  12480. * Performs a deep comparison between two values to determine if they are
  12481. * equivalent.
  12482. *
  12483. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12484. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12485. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12486. * by their own, not inherited, enumerable properties. Functions and DOM
  12487. * nodes are compared by strict equality, i.e. `===`.
  12488. *
  12489. * @static
  12490. * @memberOf _
  12491. * @since 0.1.0
  12492. * @category Lang
  12493. * @param {*} value The value to compare.
  12494. * @param {*} other The other value to compare.
  12495. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12496. * @example
  12497. *
  12498. * var object = { 'a': 1 };
  12499. * var other = { 'a': 1 };
  12500. *
  12501. * _.isEqual(object, other);
  12502. * // => true
  12503. *
  12504. * object === other;
  12505. * // => false
  12506. */
  12507. function isEqual(value, other) {
  12508. return baseIsEqual(value, other);
  12509. }
  12510. /**
  12511. * This method is like `_.isEqual` except that it accepts `customizer` which
  12512. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12513. * are handled by the method instead. The `customizer` is invoked with up to
  12514. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12515. *
  12516. * @static
  12517. * @memberOf _
  12518. * @since 4.0.0
  12519. * @category Lang
  12520. * @param {*} value The value to compare.
  12521. * @param {*} other The other value to compare.
  12522. * @param {Function} [customizer] The function to customize comparisons.
  12523. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12524. * @example
  12525. *
  12526. * function isGreeting(value) {
  12527. * return /^h(?:i|ello)$/.test(value);
  12528. * }
  12529. *
  12530. * function customizer(objValue, othValue) {
  12531. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12532. * return true;
  12533. * }
  12534. * }
  12535. *
  12536. * var array = ['hello', 'goodbye'];
  12537. * var other = ['hi', 'goodbye'];
  12538. *
  12539. * _.isEqualWith(array, other, customizer);
  12540. * // => true
  12541. */
  12542. function isEqualWith(value, other, customizer) {
  12543. customizer = typeof customizer == 'function' ? customizer : undefined;
  12544. var result = customizer ? customizer(value, other) : undefined;
  12545. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12546. }
  12547. /**
  12548. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12549. * `SyntaxError`, `TypeError`, or `URIError` object.
  12550. *
  12551. * @static
  12552. * @memberOf _
  12553. * @since 3.0.0
  12554. * @category Lang
  12555. * @param {*} value The value to check.
  12556. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12557. * @example
  12558. *
  12559. * _.isError(new Error);
  12560. * // => true
  12561. *
  12562. * _.isError(Error);
  12563. * // => false
  12564. */
  12565. function isError(value) {
  12566. if (!isObjectLike(value)) {
  12567. return false;
  12568. }
  12569. var tag = baseGetTag(value);
  12570. return tag == errorTag || tag == domExcTag ||
  12571. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12572. }
  12573. /**
  12574. * Checks if `value` is a finite primitive number.
  12575. *
  12576. * **Note:** This method is based on
  12577. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12578. *
  12579. * @static
  12580. * @memberOf _
  12581. * @since 0.1.0
  12582. * @category Lang
  12583. * @param {*} value The value to check.
  12584. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12585. * @example
  12586. *
  12587. * _.isFinite(3);
  12588. * // => true
  12589. *
  12590. * _.isFinite(Number.MIN_VALUE);
  12591. * // => true
  12592. *
  12593. * _.isFinite(Infinity);
  12594. * // => false
  12595. *
  12596. * _.isFinite('3');
  12597. * // => false
  12598. */
  12599. function isFinite(value) {
  12600. return typeof value == 'number' && nativeIsFinite(value);
  12601. }
  12602. /**
  12603. * Checks if `value` is classified as a `Function` object.
  12604. *
  12605. * @static
  12606. * @memberOf _
  12607. * @since 0.1.0
  12608. * @category Lang
  12609. * @param {*} value The value to check.
  12610. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12611. * @example
  12612. *
  12613. * _.isFunction(_);
  12614. * // => true
  12615. *
  12616. * _.isFunction(/abc/);
  12617. * // => false
  12618. */
  12619. function isFunction(value) {
  12620. if (!isObject(value)) {
  12621. return false;
  12622. }
  12623. // The use of `Object#toString` avoids issues with the `typeof` operator
  12624. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12625. var tag = baseGetTag(value);
  12626. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12627. }
  12628. /**
  12629. * Checks if `value` is an integer.
  12630. *
  12631. * **Note:** This method is based on
  12632. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12633. *
  12634. * @static
  12635. * @memberOf _
  12636. * @since 4.0.0
  12637. * @category Lang
  12638. * @param {*} value The value to check.
  12639. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12640. * @example
  12641. *
  12642. * _.isInteger(3);
  12643. * // => true
  12644. *
  12645. * _.isInteger(Number.MIN_VALUE);
  12646. * // => false
  12647. *
  12648. * _.isInteger(Infinity);
  12649. * // => false
  12650. *
  12651. * _.isInteger('3');
  12652. * // => false
  12653. */
  12654. function isInteger(value) {
  12655. return typeof value == 'number' && value == toInteger(value);
  12656. }
  12657. /**
  12658. * Checks if `value` is a valid array-like length.
  12659. *
  12660. * **Note:** This method is loosely based on
  12661. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12662. *
  12663. * @static
  12664. * @memberOf _
  12665. * @since 4.0.0
  12666. * @category Lang
  12667. * @param {*} value The value to check.
  12668. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12669. * @example
  12670. *
  12671. * _.isLength(3);
  12672. * // => true
  12673. *
  12674. * _.isLength(Number.MIN_VALUE);
  12675. * // => false
  12676. *
  12677. * _.isLength(Infinity);
  12678. * // => false
  12679. *
  12680. * _.isLength('3');
  12681. * // => false
  12682. */
  12683. function isLength(value) {
  12684. return typeof value == 'number' &&
  12685. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12686. }
  12687. /**
  12688. * Checks if `value` is the
  12689. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12690. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12691. *
  12692. * @static
  12693. * @memberOf _
  12694. * @since 0.1.0
  12695. * @category Lang
  12696. * @param {*} value The value to check.
  12697. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12698. * @example
  12699. *
  12700. * _.isObject({});
  12701. * // => true
  12702. *
  12703. * _.isObject([1, 2, 3]);
  12704. * // => true
  12705. *
  12706. * _.isObject(_.noop);
  12707. * // => true
  12708. *
  12709. * _.isObject(null);
  12710. * // => false
  12711. */
  12712. function isObject(value) {
  12713. var type = typeof value;
  12714. return value != null && (type == 'object' || type == 'function');
  12715. }
  12716. /**
  12717. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12718. * and has a `typeof` result of "object".
  12719. *
  12720. * @static
  12721. * @memberOf _
  12722. * @since 4.0.0
  12723. * @category Lang
  12724. * @param {*} value The value to check.
  12725. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12726. * @example
  12727. *
  12728. * _.isObjectLike({});
  12729. * // => true
  12730. *
  12731. * _.isObjectLike([1, 2, 3]);
  12732. * // => true
  12733. *
  12734. * _.isObjectLike(_.noop);
  12735. * // => false
  12736. *
  12737. * _.isObjectLike(null);
  12738. * // => false
  12739. */
  12740. function isObjectLike(value) {
  12741. return value != null && typeof value == 'object';
  12742. }
  12743. /**
  12744. * Checks if `value` is classified as a `Map` object.
  12745. *
  12746. * @static
  12747. * @memberOf _
  12748. * @since 4.3.0
  12749. * @category Lang
  12750. * @param {*} value The value to check.
  12751. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12752. * @example
  12753. *
  12754. * _.isMap(new Map);
  12755. * // => true
  12756. *
  12757. * _.isMap(new WeakMap);
  12758. * // => false
  12759. */
  12760. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12761. /**
  12762. * Performs a partial deep comparison between `object` and `source` to
  12763. * determine if `object` contains equivalent property values.
  12764. *
  12765. * **Note:** This method is equivalent to `_.matches` when `source` is
  12766. * partially applied.
  12767. *
  12768. * Partial comparisons will match empty array and empty object `source`
  12769. * values against any array or object value, respectively. See `_.isEqual`
  12770. * for a list of supported value comparisons.
  12771. *
  12772. * @static
  12773. * @memberOf _
  12774. * @since 3.0.0
  12775. * @category Lang
  12776. * @param {Object} object The object to inspect.
  12777. * @param {Object} source The object of property values to match.
  12778. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12779. * @example
  12780. *
  12781. * var object = { 'a': 1, 'b': 2 };
  12782. *
  12783. * _.isMatch(object, { 'b': 2 });
  12784. * // => true
  12785. *
  12786. * _.isMatch(object, { 'b': 1 });
  12787. * // => false
  12788. */
  12789. function isMatch(object, source) {
  12790. return object === source || baseIsMatch(object, source, getMatchData(source));
  12791. }
  12792. /**
  12793. * This method is like `_.isMatch` except that it accepts `customizer` which
  12794. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12795. * are handled by the method instead. The `customizer` is invoked with five
  12796. * arguments: (objValue, srcValue, index|key, object, source).
  12797. *
  12798. * @static
  12799. * @memberOf _
  12800. * @since 4.0.0
  12801. * @category Lang
  12802. * @param {Object} object The object to inspect.
  12803. * @param {Object} source The object of property values to match.
  12804. * @param {Function} [customizer] The function to customize comparisons.
  12805. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12806. * @example
  12807. *
  12808. * function isGreeting(value) {
  12809. * return /^h(?:i|ello)$/.test(value);
  12810. * }
  12811. *
  12812. * function customizer(objValue, srcValue) {
  12813. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12814. * return true;
  12815. * }
  12816. * }
  12817. *
  12818. * var object = { 'greeting': 'hello' };
  12819. * var source = { 'greeting': 'hi' };
  12820. *
  12821. * _.isMatchWith(object, source, customizer);
  12822. * // => true
  12823. */
  12824. function isMatchWith(object, source, customizer) {
  12825. customizer = typeof customizer == 'function' ? customizer : undefined;
  12826. return baseIsMatch(object, source, getMatchData(source), customizer);
  12827. }
  12828. /**
  12829. * Checks if `value` is `NaN`.
  12830. *
  12831. * **Note:** This method is based on
  12832. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12833. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12834. * `undefined` and other non-number values.
  12835. *
  12836. * @static
  12837. * @memberOf _
  12838. * @since 0.1.0
  12839. * @category Lang
  12840. * @param {*} value The value to check.
  12841. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12842. * @example
  12843. *
  12844. * _.isNaN(NaN);
  12845. * // => true
  12846. *
  12847. * _.isNaN(new Number(NaN));
  12848. * // => true
  12849. *
  12850. * isNaN(undefined);
  12851. * // => true
  12852. *
  12853. * _.isNaN(undefined);
  12854. * // => false
  12855. */
  12856. function isNaN(value) {
  12857. // An `NaN` primitive is the only value that is not equal to itself.
  12858. // Perform the `toStringTag` check first to avoid errors with some
  12859. // ActiveX objects in IE.
  12860. return isNumber(value) && value != +value;
  12861. }
  12862. /**
  12863. * Checks if `value` is a pristine native function.
  12864. *
  12865. * **Note:** This method can't reliably detect native functions in the presence
  12866. * of the core-js package because core-js circumvents this kind of detection.
  12867. * Despite multiple requests, the core-js maintainer has made it clear: any
  12868. * attempt to fix the detection will be obstructed. As a result, we're left
  12869. * with little choice but to throw an error. Unfortunately, this also affects
  12870. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12871. * which rely on core-js.
  12872. *
  12873. * @static
  12874. * @memberOf _
  12875. * @since 3.0.0
  12876. * @category Lang
  12877. * @param {*} value The value to check.
  12878. * @returns {boolean} Returns `true` if `value` is a native function,
  12879. * else `false`.
  12880. * @example
  12881. *
  12882. * _.isNative(Array.prototype.push);
  12883. * // => true
  12884. *
  12885. * _.isNative(_);
  12886. * // => false
  12887. */
  12888. function isNative(value) {
  12889. if (isMaskable(value)) {
  12890. throw new Error(CORE_ERROR_TEXT);
  12891. }
  12892. return baseIsNative(value);
  12893. }
  12894. /**
  12895. * Checks if `value` is `null`.
  12896. *
  12897. * @static
  12898. * @memberOf _
  12899. * @since 0.1.0
  12900. * @category Lang
  12901. * @param {*} value The value to check.
  12902. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12903. * @example
  12904. *
  12905. * _.isNull(null);
  12906. * // => true
  12907. *
  12908. * _.isNull(void 0);
  12909. * // => false
  12910. */
  12911. function isNull(value) {
  12912. return value === null;
  12913. }
  12914. /**
  12915. * Checks if `value` is `null` or `undefined`.
  12916. *
  12917. * @static
  12918. * @memberOf _
  12919. * @since 4.0.0
  12920. * @category Lang
  12921. * @param {*} value The value to check.
  12922. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12923. * @example
  12924. *
  12925. * _.isNil(null);
  12926. * // => true
  12927. *
  12928. * _.isNil(void 0);
  12929. * // => true
  12930. *
  12931. * _.isNil(NaN);
  12932. * // => false
  12933. */
  12934. function isNil(value) {
  12935. return value == null;
  12936. }
  12937. /**
  12938. * Checks if `value` is classified as a `Number` primitive or object.
  12939. *
  12940. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12941. * classified as numbers, use the `_.isFinite` method.
  12942. *
  12943. * @static
  12944. * @memberOf _
  12945. * @since 0.1.0
  12946. * @category Lang
  12947. * @param {*} value The value to check.
  12948. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12949. * @example
  12950. *
  12951. * _.isNumber(3);
  12952. * // => true
  12953. *
  12954. * _.isNumber(Number.MIN_VALUE);
  12955. * // => true
  12956. *
  12957. * _.isNumber(Infinity);
  12958. * // => true
  12959. *
  12960. * _.isNumber('3');
  12961. * // => false
  12962. */
  12963. function isNumber(value) {
  12964. return typeof value == 'number' ||
  12965. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12966. }
  12967. /**
  12968. * Checks if `value` is a plain object, that is, an object created by the
  12969. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12970. *
  12971. * @static
  12972. * @memberOf _
  12973. * @since 0.8.0
  12974. * @category Lang
  12975. * @param {*} value The value to check.
  12976. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12977. * @example
  12978. *
  12979. * function Foo() {
  12980. * this.a = 1;
  12981. * }
  12982. *
  12983. * _.isPlainObject(new Foo);
  12984. * // => false
  12985. *
  12986. * _.isPlainObject([1, 2, 3]);
  12987. * // => false
  12988. *
  12989. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12990. * // => true
  12991. *
  12992. * _.isPlainObject(Object.create(null));
  12993. * // => true
  12994. */
  12995. function isPlainObject(value) {
  12996. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12997. return false;
  12998. }
  12999. var proto = getPrototype(value);
  13000. if (proto === null) {
  13001. return true;
  13002. }
  13003. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  13004. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  13005. funcToString.call(Ctor) == objectCtorString;
  13006. }
  13007. /**
  13008. * Checks if `value` is classified as a `RegExp` object.
  13009. *
  13010. * @static
  13011. * @memberOf _
  13012. * @since 0.1.0
  13013. * @category Lang
  13014. * @param {*} value The value to check.
  13015. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  13016. * @example
  13017. *
  13018. * _.isRegExp(/abc/);
  13019. * // => true
  13020. *
  13021. * _.isRegExp('/abc/');
  13022. * // => false
  13023. */
  13024. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  13025. /**
  13026. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  13027. * double precision number which isn't the result of a rounded unsafe integer.
  13028. *
  13029. * **Note:** This method is based on
  13030. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  13031. *
  13032. * @static
  13033. * @memberOf _
  13034. * @since 4.0.0
  13035. * @category Lang
  13036. * @param {*} value The value to check.
  13037. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  13038. * @example
  13039. *
  13040. * _.isSafeInteger(3);
  13041. * // => true
  13042. *
  13043. * _.isSafeInteger(Number.MIN_VALUE);
  13044. * // => false
  13045. *
  13046. * _.isSafeInteger(Infinity);
  13047. * // => false
  13048. *
  13049. * _.isSafeInteger('3');
  13050. * // => false
  13051. */
  13052. function isSafeInteger(value) {
  13053. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  13054. }
  13055. /**
  13056. * Checks if `value` is classified as a `Set` object.
  13057. *
  13058. * @static
  13059. * @memberOf _
  13060. * @since 4.3.0
  13061. * @category Lang
  13062. * @param {*} value The value to check.
  13063. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  13064. * @example
  13065. *
  13066. * _.isSet(new Set);
  13067. * // => true
  13068. *
  13069. * _.isSet(new WeakSet);
  13070. * // => false
  13071. */
  13072. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  13073. /**
  13074. * Checks if `value` is classified as a `String` primitive or object.
  13075. *
  13076. * @static
  13077. * @since 0.1.0
  13078. * @memberOf _
  13079. * @category Lang
  13080. * @param {*} value The value to check.
  13081. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  13082. * @example
  13083. *
  13084. * _.isString('abc');
  13085. * // => true
  13086. *
  13087. * _.isString(1);
  13088. * // => false
  13089. */
  13090. function isString(value) {
  13091. return typeof value == 'string' ||
  13092. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  13093. }
  13094. /**
  13095. * Checks if `value` is classified as a `Symbol` primitive or object.
  13096. *
  13097. * @static
  13098. * @memberOf _
  13099. * @since 4.0.0
  13100. * @category Lang
  13101. * @param {*} value The value to check.
  13102. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13103. * @example
  13104. *
  13105. * _.isSymbol(Symbol.iterator);
  13106. * // => true
  13107. *
  13108. * _.isSymbol('abc');
  13109. * // => false
  13110. */
  13111. function isSymbol(value) {
  13112. return typeof value == 'symbol' ||
  13113. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  13114. }
  13115. /**
  13116. * Checks if `value` is classified as a typed array.
  13117. *
  13118. * @static
  13119. * @memberOf _
  13120. * @since 3.0.0
  13121. * @category Lang
  13122. * @param {*} value The value to check.
  13123. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  13124. * @example
  13125. *
  13126. * _.isTypedArray(new Uint8Array);
  13127. * // => true
  13128. *
  13129. * _.isTypedArray([]);
  13130. * // => false
  13131. */
  13132. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  13133. /**
  13134. * Checks if `value` is `undefined`.
  13135. *
  13136. * @static
  13137. * @since 0.1.0
  13138. * @memberOf _
  13139. * @category Lang
  13140. * @param {*} value The value to check.
  13141. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  13142. * @example
  13143. *
  13144. * _.isUndefined(void 0);
  13145. * // => true
  13146. *
  13147. * _.isUndefined(null);
  13148. * // => false
  13149. */
  13150. function isUndefined(value) {
  13151. return value === undefined;
  13152. }
  13153. /**
  13154. * Checks if `value` is classified as a `WeakMap` object.
  13155. *
  13156. * @static
  13157. * @memberOf _
  13158. * @since 4.3.0
  13159. * @category Lang
  13160. * @param {*} value The value to check.
  13161. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  13162. * @example
  13163. *
  13164. * _.isWeakMap(new WeakMap);
  13165. * // => true
  13166. *
  13167. * _.isWeakMap(new Map);
  13168. * // => false
  13169. */
  13170. function isWeakMap(value) {
  13171. return isObjectLike(value) && getTag(value) == weakMapTag;
  13172. }
  13173. /**
  13174. * Checks if `value` is classified as a `WeakSet` object.
  13175. *
  13176. * @static
  13177. * @memberOf _
  13178. * @since 4.3.0
  13179. * @category Lang
  13180. * @param {*} value The value to check.
  13181. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  13182. * @example
  13183. *
  13184. * _.isWeakSet(new WeakSet);
  13185. * // => true
  13186. *
  13187. * _.isWeakSet(new Set);
  13188. * // => false
  13189. */
  13190. function isWeakSet(value) {
  13191. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  13192. }
  13193. /**
  13194. * Checks if `value` is less than `other`.
  13195. *
  13196. * @static
  13197. * @memberOf _
  13198. * @since 3.9.0
  13199. * @category Lang
  13200. * @param {*} value The value to compare.
  13201. * @param {*} other The other value to compare.
  13202. * @returns {boolean} Returns `true` if `value` is less than `other`,
  13203. * else `false`.
  13204. * @see _.gt
  13205. * @example
  13206. *
  13207. * _.lt(1, 3);
  13208. * // => true
  13209. *
  13210. * _.lt(3, 3);
  13211. * // => false
  13212. *
  13213. * _.lt(3, 1);
  13214. * // => false
  13215. */
  13216. var lt = createRelationalOperation(baseLt);
  13217. /**
  13218. * Checks if `value` is less than or equal to `other`.
  13219. *
  13220. * @static
  13221. * @memberOf _
  13222. * @since 3.9.0
  13223. * @category Lang
  13224. * @param {*} value The value to compare.
  13225. * @param {*} other The other value to compare.
  13226. * @returns {boolean} Returns `true` if `value` is less than or equal to
  13227. * `other`, else `false`.
  13228. * @see _.gte
  13229. * @example
  13230. *
  13231. * _.lte(1, 3);
  13232. * // => true
  13233. *
  13234. * _.lte(3, 3);
  13235. * // => true
  13236. *
  13237. * _.lte(3, 1);
  13238. * // => false
  13239. */
  13240. var lte = createRelationalOperation(function(value, other) {
  13241. return value <= other;
  13242. });
  13243. /**
  13244. * Converts `value` to an array.
  13245. *
  13246. * @static
  13247. * @since 0.1.0
  13248. * @memberOf _
  13249. * @category Lang
  13250. * @param {*} value The value to convert.
  13251. * @returns {Array} Returns the converted array.
  13252. * @example
  13253. *
  13254. * _.toArray({ 'a': 1, 'b': 2 });
  13255. * // => [1, 2]
  13256. *
  13257. * _.toArray('abc');
  13258. * // => ['a', 'b', 'c']
  13259. *
  13260. * _.toArray(1);
  13261. * // => []
  13262. *
  13263. * _.toArray(null);
  13264. * // => []
  13265. */
  13266. function toArray(value) {
  13267. if (!value) {
  13268. return [];
  13269. }
  13270. if (isArrayLike(value)) {
  13271. return isString(value) ? stringToArray(value) : copyArray(value);
  13272. }
  13273. if (symIterator && value[symIterator]) {
  13274. return iteratorToArray(value[symIterator]());
  13275. }
  13276. var tag = getTag(value),
  13277. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  13278. return func(value);
  13279. }
  13280. /**
  13281. * Converts `value` to a finite number.
  13282. *
  13283. * @static
  13284. * @memberOf _
  13285. * @since 4.12.0
  13286. * @category Lang
  13287. * @param {*} value The value to convert.
  13288. * @returns {number} Returns the converted number.
  13289. * @example
  13290. *
  13291. * _.toFinite(3.2);
  13292. * // => 3.2
  13293. *
  13294. * _.toFinite(Number.MIN_VALUE);
  13295. * // => 5e-324
  13296. *
  13297. * _.toFinite(Infinity);
  13298. * // => 1.7976931348623157e+308
  13299. *
  13300. * _.toFinite('3.2');
  13301. * // => 3.2
  13302. */
  13303. function toFinite(value) {
  13304. if (!value) {
  13305. return value === 0 ? value : 0;
  13306. }
  13307. value = toNumber(value);
  13308. if (value === INFINITY || value === -INFINITY) {
  13309. var sign = (value < 0 ? -1 : 1);
  13310. return sign * MAX_INTEGER;
  13311. }
  13312. return value === value ? value : 0;
  13313. }
  13314. /**
  13315. * Converts `value` to an integer.
  13316. *
  13317. * **Note:** This method is loosely based on
  13318. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  13319. *
  13320. * @static
  13321. * @memberOf _
  13322. * @since 4.0.0
  13323. * @category Lang
  13324. * @param {*} value The value to convert.
  13325. * @returns {number} Returns the converted integer.
  13326. * @example
  13327. *
  13328. * _.toInteger(3.2);
  13329. * // => 3
  13330. *
  13331. * _.toInteger(Number.MIN_VALUE);
  13332. * // => 0
  13333. *
  13334. * _.toInteger(Infinity);
  13335. * // => 1.7976931348623157e+308
  13336. *
  13337. * _.toInteger('3.2');
  13338. * // => 3
  13339. */
  13340. function toInteger(value) {
  13341. var result = toFinite(value),
  13342. remainder = result % 1;
  13343. return result === result ? (remainder ? result - remainder : result) : 0;
  13344. }
  13345. /**
  13346. * Converts `value` to an integer suitable for use as the length of an
  13347. * array-like object.
  13348. *
  13349. * **Note:** This method is based on
  13350. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  13351. *
  13352. * @static
  13353. * @memberOf _
  13354. * @since 4.0.0
  13355. * @category Lang
  13356. * @param {*} value The value to convert.
  13357. * @returns {number} Returns the converted integer.
  13358. * @example
  13359. *
  13360. * _.toLength(3.2);
  13361. * // => 3
  13362. *
  13363. * _.toLength(Number.MIN_VALUE);
  13364. * // => 0
  13365. *
  13366. * _.toLength(Infinity);
  13367. * // => 4294967295
  13368. *
  13369. * _.toLength('3.2');
  13370. * // => 3
  13371. */
  13372. function toLength(value) {
  13373. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13374. }
  13375. /**
  13376. * Converts `value` to a number.
  13377. *
  13378. * @static
  13379. * @memberOf _
  13380. * @since 4.0.0
  13381. * @category Lang
  13382. * @param {*} value The value to process.
  13383. * @returns {number} Returns the number.
  13384. * @example
  13385. *
  13386. * _.toNumber(3.2);
  13387. * // => 3.2
  13388. *
  13389. * _.toNumber(Number.MIN_VALUE);
  13390. * // => 5e-324
  13391. *
  13392. * _.toNumber(Infinity);
  13393. * // => Infinity
  13394. *
  13395. * _.toNumber('3.2');
  13396. * // => 3.2
  13397. */
  13398. function toNumber(value) {
  13399. if (typeof value == 'number') {
  13400. return value;
  13401. }
  13402. if (isSymbol(value)) {
  13403. return NAN;
  13404. }
  13405. if (isObject(value)) {
  13406. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13407. value = isObject(other) ? (other + '') : other;
  13408. }
  13409. if (typeof value != 'string') {
  13410. return value === 0 ? value : +value;
  13411. }
  13412. value = baseTrim(value);
  13413. var isBinary = reIsBinary.test(value);
  13414. return (isBinary || reIsOctal.test(value))
  13415. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13416. : (reIsBadHex.test(value) ? NAN : +value);
  13417. }
  13418. /**
  13419. * Converts `value` to a plain object flattening inherited enumerable string
  13420. * keyed properties of `value` to own properties of the plain object.
  13421. *
  13422. * @static
  13423. * @memberOf _
  13424. * @since 3.0.0
  13425. * @category Lang
  13426. * @param {*} value The value to convert.
  13427. * @returns {Object} Returns the converted plain object.
  13428. * @example
  13429. *
  13430. * function Foo() {
  13431. * this.b = 2;
  13432. * }
  13433. *
  13434. * Foo.prototype.c = 3;
  13435. *
  13436. * _.assign({ 'a': 1 }, new Foo);
  13437. * // => { 'a': 1, 'b': 2 }
  13438. *
  13439. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13440. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13441. */
  13442. function toPlainObject(value) {
  13443. return copyObject(value, keysIn(value));
  13444. }
  13445. /**
  13446. * Converts `value` to a safe integer. A safe integer can be compared and
  13447. * represented correctly.
  13448. *
  13449. * @static
  13450. * @memberOf _
  13451. * @since 4.0.0
  13452. * @category Lang
  13453. * @param {*} value The value to convert.
  13454. * @returns {number} Returns the converted integer.
  13455. * @example
  13456. *
  13457. * _.toSafeInteger(3.2);
  13458. * // => 3
  13459. *
  13460. * _.toSafeInteger(Number.MIN_VALUE);
  13461. * // => 0
  13462. *
  13463. * _.toSafeInteger(Infinity);
  13464. * // => 9007199254740991
  13465. *
  13466. * _.toSafeInteger('3.2');
  13467. * // => 3
  13468. */
  13469. function toSafeInteger(value) {
  13470. return value
  13471. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13472. : (value === 0 ? value : 0);
  13473. }
  13474. /**
  13475. * Converts `value` to a string. An empty string is returned for `null`
  13476. * and `undefined` values. The sign of `-0` is preserved.
  13477. *
  13478. * @static
  13479. * @memberOf _
  13480. * @since 4.0.0
  13481. * @category Lang
  13482. * @param {*} value The value to convert.
  13483. * @returns {string} Returns the converted string.
  13484. * @example
  13485. *
  13486. * _.toString(null);
  13487. * // => ''
  13488. *
  13489. * _.toString(-0);
  13490. * // => '-0'
  13491. *
  13492. * _.toString([1, 2, 3]);
  13493. * // => '1,2,3'
  13494. */
  13495. function toString(value) {
  13496. return value == null ? '' : baseToString(value);
  13497. }
  13498. /*------------------------------------------------------------------------*/
  13499. /**
  13500. * Assigns own enumerable string keyed properties of source objects to the
  13501. * destination object. Source objects are applied from left to right.
  13502. * Subsequent sources overwrite property assignments of previous sources.
  13503. *
  13504. * **Note:** This method mutates `object` and is loosely based on
  13505. * [`Object.assign`](https://mdn.io/Object/assign).
  13506. *
  13507. * @static
  13508. * @memberOf _
  13509. * @since 0.10.0
  13510. * @category Object
  13511. * @param {Object} object The destination object.
  13512. * @param {...Object} [sources] The source objects.
  13513. * @returns {Object} Returns `object`.
  13514. * @see _.assignIn
  13515. * @example
  13516. *
  13517. * function Foo() {
  13518. * this.a = 1;
  13519. * }
  13520. *
  13521. * function Bar() {
  13522. * this.c = 3;
  13523. * }
  13524. *
  13525. * Foo.prototype.b = 2;
  13526. * Bar.prototype.d = 4;
  13527. *
  13528. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13529. * // => { 'a': 1, 'c': 3 }
  13530. */
  13531. var assign = createAssigner(function(object, source) {
  13532. if (isPrototype(source) || isArrayLike(source)) {
  13533. copyObject(source, keys(source), object);
  13534. return;
  13535. }
  13536. for (var key in source) {
  13537. if (hasOwnProperty.call(source, key)) {
  13538. assignValue(object, key, source[key]);
  13539. }
  13540. }
  13541. });
  13542. /**
  13543. * This method is like `_.assign` except that it iterates over own and
  13544. * inherited source properties.
  13545. *
  13546. * **Note:** This method mutates `object`.
  13547. *
  13548. * @static
  13549. * @memberOf _
  13550. * @since 4.0.0
  13551. * @alias extend
  13552. * @category Object
  13553. * @param {Object} object The destination object.
  13554. * @param {...Object} [sources] The source objects.
  13555. * @returns {Object} Returns `object`.
  13556. * @see _.assign
  13557. * @example
  13558. *
  13559. * function Foo() {
  13560. * this.a = 1;
  13561. * }
  13562. *
  13563. * function Bar() {
  13564. * this.c = 3;
  13565. * }
  13566. *
  13567. * Foo.prototype.b = 2;
  13568. * Bar.prototype.d = 4;
  13569. *
  13570. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13571. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13572. */
  13573. var assignIn = createAssigner(function(object, source) {
  13574. copyObject(source, keysIn(source), object);
  13575. });
  13576. /**
  13577. * This method is like `_.assignIn` except that it accepts `customizer`
  13578. * which is invoked to produce the assigned values. If `customizer` returns
  13579. * `undefined`, assignment is handled by the method instead. The `customizer`
  13580. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13581. *
  13582. * **Note:** This method mutates `object`.
  13583. *
  13584. * @static
  13585. * @memberOf _
  13586. * @since 4.0.0
  13587. * @alias extendWith
  13588. * @category Object
  13589. * @param {Object} object The destination object.
  13590. * @param {...Object} sources The source objects.
  13591. * @param {Function} [customizer] The function to customize assigned values.
  13592. * @returns {Object} Returns `object`.
  13593. * @see _.assignWith
  13594. * @example
  13595. *
  13596. * function customizer(objValue, srcValue) {
  13597. * return _.isUndefined(objValue) ? srcValue : objValue;
  13598. * }
  13599. *
  13600. * var defaults = _.partialRight(_.assignInWith, customizer);
  13601. *
  13602. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13603. * // => { 'a': 1, 'b': 2 }
  13604. */
  13605. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13606. copyObject(source, keysIn(source), object, customizer);
  13607. });
  13608. /**
  13609. * This method is like `_.assign` except that it accepts `customizer`
  13610. * which is invoked to produce the assigned values. If `customizer` returns
  13611. * `undefined`, assignment is handled by the method instead. The `customizer`
  13612. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13613. *
  13614. * **Note:** This method mutates `object`.
  13615. *
  13616. * @static
  13617. * @memberOf _
  13618. * @since 4.0.0
  13619. * @category Object
  13620. * @param {Object} object The destination object.
  13621. * @param {...Object} sources The source objects.
  13622. * @param {Function} [customizer] The function to customize assigned values.
  13623. * @returns {Object} Returns `object`.
  13624. * @see _.assignInWith
  13625. * @example
  13626. *
  13627. * function customizer(objValue, srcValue) {
  13628. * return _.isUndefined(objValue) ? srcValue : objValue;
  13629. * }
  13630. *
  13631. * var defaults = _.partialRight(_.assignWith, customizer);
  13632. *
  13633. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13634. * // => { 'a': 1, 'b': 2 }
  13635. */
  13636. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13637. copyObject(source, keys(source), object, customizer);
  13638. });
  13639. /**
  13640. * Creates an array of values corresponding to `paths` of `object`.
  13641. *
  13642. * @static
  13643. * @memberOf _
  13644. * @since 1.0.0
  13645. * @category Object
  13646. * @param {Object} object The object to iterate over.
  13647. * @param {...(string|string[])} [paths] The property paths to pick.
  13648. * @returns {Array} Returns the picked values.
  13649. * @example
  13650. *
  13651. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13652. *
  13653. * _.at(object, ['a[0].b.c', 'a[1]']);
  13654. * // => [3, 4]
  13655. */
  13656. var at = flatRest(baseAt);
  13657. /**
  13658. * Creates an object that inherits from the `prototype` object. If a
  13659. * `properties` object is given, its own enumerable string keyed properties
  13660. * are assigned to the created object.
  13661. *
  13662. * @static
  13663. * @memberOf _
  13664. * @since 2.3.0
  13665. * @category Object
  13666. * @param {Object} prototype The object to inherit from.
  13667. * @param {Object} [properties] The properties to assign to the object.
  13668. * @returns {Object} Returns the new object.
  13669. * @example
  13670. *
  13671. * function Shape() {
  13672. * this.x = 0;
  13673. * this.y = 0;
  13674. * }
  13675. *
  13676. * function Circle() {
  13677. * Shape.call(this);
  13678. * }
  13679. *
  13680. * Circle.prototype = _.create(Shape.prototype, {
  13681. * 'constructor': Circle
  13682. * });
  13683. *
  13684. * var circle = new Circle;
  13685. * circle instanceof Circle;
  13686. * // => true
  13687. *
  13688. * circle instanceof Shape;
  13689. * // => true
  13690. */
  13691. function create(prototype, properties) {
  13692. var result = baseCreate(prototype);
  13693. return properties == null ? result : baseAssign(result, properties);
  13694. }
  13695. /**
  13696. * Assigns own and inherited enumerable string keyed properties of source
  13697. * objects to the destination object for all destination properties that
  13698. * resolve to `undefined`. Source objects are applied from left to right.
  13699. * Once a property is set, additional values of the same property are ignored.
  13700. *
  13701. * **Note:** This method mutates `object`.
  13702. *
  13703. * @static
  13704. * @since 0.1.0
  13705. * @memberOf _
  13706. * @category Object
  13707. * @param {Object} object The destination object.
  13708. * @param {...Object} [sources] The source objects.
  13709. * @returns {Object} Returns `object`.
  13710. * @see _.defaultsDeep
  13711. * @example
  13712. *
  13713. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13714. * // => { 'a': 1, 'b': 2 }
  13715. */
  13716. var defaults = baseRest(function(object, sources) {
  13717. object = Object(object);
  13718. var index = -1;
  13719. var length = sources.length;
  13720. var guard = length > 2 ? sources[2] : undefined;
  13721. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13722. length = 1;
  13723. }
  13724. while (++index < length) {
  13725. var source = sources[index];
  13726. var props = keysIn(source);
  13727. var propsIndex = -1;
  13728. var propsLength = props.length;
  13729. while (++propsIndex < propsLength) {
  13730. var key = props[propsIndex];
  13731. var value = object[key];
  13732. if (value === undefined ||
  13733. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13734. object[key] = source[key];
  13735. }
  13736. }
  13737. }
  13738. return object;
  13739. });
  13740. /**
  13741. * This method is like `_.defaults` except that it recursively assigns
  13742. * default properties.
  13743. *
  13744. * **Note:** This method mutates `object`.
  13745. *
  13746. * @static
  13747. * @memberOf _
  13748. * @since 3.10.0
  13749. * @category Object
  13750. * @param {Object} object The destination object.
  13751. * @param {...Object} [sources] The source objects.
  13752. * @returns {Object} Returns `object`.
  13753. * @see _.defaults
  13754. * @example
  13755. *
  13756. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13757. * // => { 'a': { 'b': 2, 'c': 3 } }
  13758. */
  13759. var defaultsDeep = baseRest(function(args) {
  13760. args.push(undefined, customDefaultsMerge);
  13761. return apply(mergeWith, undefined, args);
  13762. });
  13763. /**
  13764. * This method is like `_.find` except that it returns the key of the first
  13765. * element `predicate` returns truthy for instead of the element itself.
  13766. *
  13767. * @static
  13768. * @memberOf _
  13769. * @since 1.1.0
  13770. * @category Object
  13771. * @param {Object} object The object to inspect.
  13772. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13773. * @returns {string|undefined} Returns the key of the matched element,
  13774. * else `undefined`.
  13775. * @example
  13776. *
  13777. * var users = {
  13778. * 'barney': { 'age': 36, 'active': true },
  13779. * 'fred': { 'age': 40, 'active': false },
  13780. * 'pebbles': { 'age': 1, 'active': true }
  13781. * };
  13782. *
  13783. * _.findKey(users, function(o) { return o.age < 40; });
  13784. * // => 'barney' (iteration order is not guaranteed)
  13785. *
  13786. * // The `_.matches` iteratee shorthand.
  13787. * _.findKey(users, { 'age': 1, 'active': true });
  13788. * // => 'pebbles'
  13789. *
  13790. * // The `_.matchesProperty` iteratee shorthand.
  13791. * _.findKey(users, ['active', false]);
  13792. * // => 'fred'
  13793. *
  13794. * // The `_.property` iteratee shorthand.
  13795. * _.findKey(users, 'active');
  13796. * // => 'barney'
  13797. */
  13798. function findKey(object, predicate) {
  13799. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13800. }
  13801. /**
  13802. * This method is like `_.findKey` except that it iterates over elements of
  13803. * a collection in the opposite order.
  13804. *
  13805. * @static
  13806. * @memberOf _
  13807. * @since 2.0.0
  13808. * @category Object
  13809. * @param {Object} object The object to inspect.
  13810. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13811. * @returns {string|undefined} Returns the key of the matched element,
  13812. * else `undefined`.
  13813. * @example
  13814. *
  13815. * var users = {
  13816. * 'barney': { 'age': 36, 'active': true },
  13817. * 'fred': { 'age': 40, 'active': false },
  13818. * 'pebbles': { 'age': 1, 'active': true }
  13819. * };
  13820. *
  13821. * _.findLastKey(users, function(o) { return o.age < 40; });
  13822. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13823. *
  13824. * // The `_.matches` iteratee shorthand.
  13825. * _.findLastKey(users, { 'age': 36, 'active': true });
  13826. * // => 'barney'
  13827. *
  13828. * // The `_.matchesProperty` iteratee shorthand.
  13829. * _.findLastKey(users, ['active', false]);
  13830. * // => 'fred'
  13831. *
  13832. * // The `_.property` iteratee shorthand.
  13833. * _.findLastKey(users, 'active');
  13834. * // => 'pebbles'
  13835. */
  13836. function findLastKey(object, predicate) {
  13837. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13838. }
  13839. /**
  13840. * Iterates over own and inherited enumerable string keyed properties of an
  13841. * object and invokes `iteratee` for each property. The iteratee is invoked
  13842. * with three arguments: (value, key, object). Iteratee functions may exit
  13843. * iteration early by explicitly returning `false`.
  13844. *
  13845. * @static
  13846. * @memberOf _
  13847. * @since 0.3.0
  13848. * @category Object
  13849. * @param {Object} object The object to iterate over.
  13850. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13851. * @returns {Object} Returns `object`.
  13852. * @see _.forInRight
  13853. * @example
  13854. *
  13855. * function Foo() {
  13856. * this.a = 1;
  13857. * this.b = 2;
  13858. * }
  13859. *
  13860. * Foo.prototype.c = 3;
  13861. *
  13862. * _.forIn(new Foo, function(value, key) {
  13863. * console.log(key);
  13864. * });
  13865. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13866. */
  13867. function forIn(object, iteratee) {
  13868. return object == null
  13869. ? object
  13870. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13871. }
  13872. /**
  13873. * This method is like `_.forIn` except that it iterates over properties of
  13874. * `object` in the opposite order.
  13875. *
  13876. * @static
  13877. * @memberOf _
  13878. * @since 2.0.0
  13879. * @category Object
  13880. * @param {Object} object The object to iterate over.
  13881. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13882. * @returns {Object} Returns `object`.
  13883. * @see _.forIn
  13884. * @example
  13885. *
  13886. * function Foo() {
  13887. * this.a = 1;
  13888. * this.b = 2;
  13889. * }
  13890. *
  13891. * Foo.prototype.c = 3;
  13892. *
  13893. * _.forInRight(new Foo, function(value, key) {
  13894. * console.log(key);
  13895. * });
  13896. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13897. */
  13898. function forInRight(object, iteratee) {
  13899. return object == null
  13900. ? object
  13901. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13902. }
  13903. /**
  13904. * Iterates over own enumerable string keyed properties of an object and
  13905. * invokes `iteratee` for each property. The iteratee is invoked with three
  13906. * arguments: (value, key, object). Iteratee functions may exit iteration
  13907. * early by explicitly returning `false`.
  13908. *
  13909. * @static
  13910. * @memberOf _
  13911. * @since 0.3.0
  13912. * @category Object
  13913. * @param {Object} object The object to iterate over.
  13914. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13915. * @returns {Object} Returns `object`.
  13916. * @see _.forOwnRight
  13917. * @example
  13918. *
  13919. * function Foo() {
  13920. * this.a = 1;
  13921. * this.b = 2;
  13922. * }
  13923. *
  13924. * Foo.prototype.c = 3;
  13925. *
  13926. * _.forOwn(new Foo, function(value, key) {
  13927. * console.log(key);
  13928. * });
  13929. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13930. */
  13931. function forOwn(object, iteratee) {
  13932. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13933. }
  13934. /**
  13935. * This method is like `_.forOwn` except that it iterates over properties of
  13936. * `object` in the opposite order.
  13937. *
  13938. * @static
  13939. * @memberOf _
  13940. * @since 2.0.0
  13941. * @category Object
  13942. * @param {Object} object The object to iterate over.
  13943. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13944. * @returns {Object} Returns `object`.
  13945. * @see _.forOwn
  13946. * @example
  13947. *
  13948. * function Foo() {
  13949. * this.a = 1;
  13950. * this.b = 2;
  13951. * }
  13952. *
  13953. * Foo.prototype.c = 3;
  13954. *
  13955. * _.forOwnRight(new Foo, function(value, key) {
  13956. * console.log(key);
  13957. * });
  13958. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13959. */
  13960. function forOwnRight(object, iteratee) {
  13961. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13962. }
  13963. /**
  13964. * Creates an array of function property names from own enumerable properties
  13965. * of `object`.
  13966. *
  13967. * @static
  13968. * @since 0.1.0
  13969. * @memberOf _
  13970. * @category Object
  13971. * @param {Object} object The object to inspect.
  13972. * @returns {Array} Returns the function names.
  13973. * @see _.functionsIn
  13974. * @example
  13975. *
  13976. * function Foo() {
  13977. * this.a = _.constant('a');
  13978. * this.b = _.constant('b');
  13979. * }
  13980. *
  13981. * Foo.prototype.c = _.constant('c');
  13982. *
  13983. * _.functions(new Foo);
  13984. * // => ['a', 'b']
  13985. */
  13986. function functions(object) {
  13987. return object == null ? [] : baseFunctions(object, keys(object));
  13988. }
  13989. /**
  13990. * Creates an array of function property names from own and inherited
  13991. * enumerable properties of `object`.
  13992. *
  13993. * @static
  13994. * @memberOf _
  13995. * @since 4.0.0
  13996. * @category Object
  13997. * @param {Object} object The object to inspect.
  13998. * @returns {Array} Returns the function names.
  13999. * @see _.functions
  14000. * @example
  14001. *
  14002. * function Foo() {
  14003. * this.a = _.constant('a');
  14004. * this.b = _.constant('b');
  14005. * }
  14006. *
  14007. * Foo.prototype.c = _.constant('c');
  14008. *
  14009. * _.functionsIn(new Foo);
  14010. * // => ['a', 'b', 'c']
  14011. */
  14012. function functionsIn(object) {
  14013. return object == null ? [] : baseFunctions(object, keysIn(object));
  14014. }
  14015. /**
  14016. * Gets the value at `path` of `object`. If the resolved value is
  14017. * `undefined`, the `defaultValue` is returned in its place.
  14018. *
  14019. * @static
  14020. * @memberOf _
  14021. * @since 3.7.0
  14022. * @category Object
  14023. * @param {Object} object The object to query.
  14024. * @param {Array|string} path The path of the property to get.
  14025. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14026. * @returns {*} Returns the resolved value.
  14027. * @example
  14028. *
  14029. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14030. *
  14031. * _.get(object, 'a[0].b.c');
  14032. * // => 3
  14033. *
  14034. * _.get(object, ['a', '0', 'b', 'c']);
  14035. * // => 3
  14036. *
  14037. * _.get(object, 'a.b.c', 'default');
  14038. * // => 'default'
  14039. */
  14040. function get(object, path, defaultValue) {
  14041. var result = object == null ? undefined : baseGet(object, path);
  14042. return result === undefined ? defaultValue : result;
  14043. }
  14044. /**
  14045. * Checks if `path` is a direct property of `object`.
  14046. *
  14047. * @static
  14048. * @since 0.1.0
  14049. * @memberOf _
  14050. * @category Object
  14051. * @param {Object} object The object to query.
  14052. * @param {Array|string} path The path to check.
  14053. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14054. * @example
  14055. *
  14056. * var object = { 'a': { 'b': 2 } };
  14057. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  14058. *
  14059. * _.has(object, 'a');
  14060. * // => true
  14061. *
  14062. * _.has(object, 'a.b');
  14063. * // => true
  14064. *
  14065. * _.has(object, ['a', 'b']);
  14066. * // => true
  14067. *
  14068. * _.has(other, 'a');
  14069. * // => false
  14070. */
  14071. function has(object, path) {
  14072. return object != null && hasPath(object, path, baseHas);
  14073. }
  14074. /**
  14075. * Checks if `path` is a direct or inherited property of `object`.
  14076. *
  14077. * @static
  14078. * @memberOf _
  14079. * @since 4.0.0
  14080. * @category Object
  14081. * @param {Object} object The object to query.
  14082. * @param {Array|string} path The path to check.
  14083. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14084. * @example
  14085. *
  14086. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  14087. *
  14088. * _.hasIn(object, 'a');
  14089. * // => true
  14090. *
  14091. * _.hasIn(object, 'a.b');
  14092. * // => true
  14093. *
  14094. * _.hasIn(object, ['a', 'b']);
  14095. * // => true
  14096. *
  14097. * _.hasIn(object, 'b');
  14098. * // => false
  14099. */
  14100. function hasIn(object, path) {
  14101. return object != null && hasPath(object, path, baseHasIn);
  14102. }
  14103. /**
  14104. * Creates an object composed of the inverted keys and values of `object`.
  14105. * If `object` contains duplicate values, subsequent values overwrite
  14106. * property assignments of previous values.
  14107. *
  14108. * @static
  14109. * @memberOf _
  14110. * @since 0.7.0
  14111. * @category Object
  14112. * @param {Object} object The object to invert.
  14113. * @returns {Object} Returns the new inverted object.
  14114. * @example
  14115. *
  14116. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14117. *
  14118. * _.invert(object);
  14119. * // => { '1': 'c', '2': 'b' }
  14120. */
  14121. var invert = createInverter(function(result, value, key) {
  14122. if (value != null &&
  14123. typeof value.toString != 'function') {
  14124. value = nativeObjectToString.call(value);
  14125. }
  14126. result[value] = key;
  14127. }, constant(identity));
  14128. /**
  14129. * This method is like `_.invert` except that the inverted object is generated
  14130. * from the results of running each element of `object` thru `iteratee`. The
  14131. * corresponding inverted value of each inverted key is an array of keys
  14132. * responsible for generating the inverted value. The iteratee is invoked
  14133. * with one argument: (value).
  14134. *
  14135. * @static
  14136. * @memberOf _
  14137. * @since 4.1.0
  14138. * @category Object
  14139. * @param {Object} object The object to invert.
  14140. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14141. * @returns {Object} Returns the new inverted object.
  14142. * @example
  14143. *
  14144. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14145. *
  14146. * _.invertBy(object);
  14147. * // => { '1': ['a', 'c'], '2': ['b'] }
  14148. *
  14149. * _.invertBy(object, function(value) {
  14150. * return 'group' + value;
  14151. * });
  14152. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  14153. */
  14154. var invertBy = createInverter(function(result, value, key) {
  14155. if (value != null &&
  14156. typeof value.toString != 'function') {
  14157. value = nativeObjectToString.call(value);
  14158. }
  14159. if (hasOwnProperty.call(result, value)) {
  14160. result[value].push(key);
  14161. } else {
  14162. result[value] = [key];
  14163. }
  14164. }, getIteratee);
  14165. /**
  14166. * Invokes the method at `path` of `object`.
  14167. *
  14168. * @static
  14169. * @memberOf _
  14170. * @since 4.0.0
  14171. * @category Object
  14172. * @param {Object} object The object to query.
  14173. * @param {Array|string} path The path of the method to invoke.
  14174. * @param {...*} [args] The arguments to invoke the method with.
  14175. * @returns {*} Returns the result of the invoked method.
  14176. * @example
  14177. *
  14178. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  14179. *
  14180. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  14181. * // => [2, 3]
  14182. */
  14183. var invoke = baseRest(baseInvoke);
  14184. /**
  14185. * Creates an array of the own enumerable property names of `object`.
  14186. *
  14187. * **Note:** Non-object values are coerced to objects. See the
  14188. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  14189. * for more details.
  14190. *
  14191. * @static
  14192. * @since 0.1.0
  14193. * @memberOf _
  14194. * @category Object
  14195. * @param {Object} object The object to query.
  14196. * @returns {Array} Returns the array of property names.
  14197. * @example
  14198. *
  14199. * function Foo() {
  14200. * this.a = 1;
  14201. * this.b = 2;
  14202. * }
  14203. *
  14204. * Foo.prototype.c = 3;
  14205. *
  14206. * _.keys(new Foo);
  14207. * // => ['a', 'b'] (iteration order is not guaranteed)
  14208. *
  14209. * _.keys('hi');
  14210. * // => ['0', '1']
  14211. */
  14212. function keys(object) {
  14213. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14214. }
  14215. /**
  14216. * Creates an array of the own and inherited enumerable property names of `object`.
  14217. *
  14218. * **Note:** Non-object values are coerced to objects.
  14219. *
  14220. * @static
  14221. * @memberOf _
  14222. * @since 3.0.0
  14223. * @category Object
  14224. * @param {Object} object The object to query.
  14225. * @returns {Array} Returns the array of property names.
  14226. * @example
  14227. *
  14228. * function Foo() {
  14229. * this.a = 1;
  14230. * this.b = 2;
  14231. * }
  14232. *
  14233. * Foo.prototype.c = 3;
  14234. *
  14235. * _.keysIn(new Foo);
  14236. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  14237. */
  14238. function keysIn(object) {
  14239. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  14240. }
  14241. /**
  14242. * The opposite of `_.mapValues`; this method creates an object with the
  14243. * same values as `object` and keys generated by running each own enumerable
  14244. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  14245. * with three arguments: (value, key, object).
  14246. *
  14247. * @static
  14248. * @memberOf _
  14249. * @since 3.8.0
  14250. * @category Object
  14251. * @param {Object} object The object to iterate over.
  14252. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14253. * @returns {Object} Returns the new mapped object.
  14254. * @see _.mapValues
  14255. * @example
  14256. *
  14257. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  14258. * return key + value;
  14259. * });
  14260. * // => { 'a1': 1, 'b2': 2 }
  14261. */
  14262. function mapKeys(object, iteratee) {
  14263. var result = {};
  14264. iteratee = getIteratee(iteratee, 3);
  14265. baseForOwn(object, function(value, key, object) {
  14266. baseAssignValue(result, iteratee(value, key, object), value);
  14267. });
  14268. return result;
  14269. }
  14270. /**
  14271. * Creates an object with the same keys as `object` and values generated
  14272. * by running each own enumerable string keyed property of `object` thru
  14273. * `iteratee`. The iteratee is invoked with three arguments:
  14274. * (value, key, object).
  14275. *
  14276. * @static
  14277. * @memberOf _
  14278. * @since 2.4.0
  14279. * @category Object
  14280. * @param {Object} object The object to iterate over.
  14281. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14282. * @returns {Object} Returns the new mapped object.
  14283. * @see _.mapKeys
  14284. * @example
  14285. *
  14286. * var users = {
  14287. * 'fred': { 'user': 'fred', 'age': 40 },
  14288. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  14289. * };
  14290. *
  14291. * _.mapValues(users, function(o) { return o.age; });
  14292. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14293. *
  14294. * // The `_.property` iteratee shorthand.
  14295. * _.mapValues(users, 'age');
  14296. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14297. */
  14298. function mapValues(object, iteratee) {
  14299. var result = {};
  14300. iteratee = getIteratee(iteratee, 3);
  14301. baseForOwn(object, function(value, key, object) {
  14302. baseAssignValue(result, key, iteratee(value, key, object));
  14303. });
  14304. return result;
  14305. }
  14306. /**
  14307. * This method is like `_.assign` except that it recursively merges own and
  14308. * inherited enumerable string keyed properties of source objects into the
  14309. * destination object. Source properties that resolve to `undefined` are
  14310. * skipped if a destination value exists. Array and plain object properties
  14311. * are merged recursively. Other objects and value types are overridden by
  14312. * assignment. Source objects are applied from left to right. Subsequent
  14313. * sources overwrite property assignments of previous sources.
  14314. *
  14315. * **Note:** This method mutates `object`.
  14316. *
  14317. * @static
  14318. * @memberOf _
  14319. * @since 0.5.0
  14320. * @category Object
  14321. * @param {Object} object The destination object.
  14322. * @param {...Object} [sources] The source objects.
  14323. * @returns {Object} Returns `object`.
  14324. * @example
  14325. *
  14326. * var object = {
  14327. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  14328. * };
  14329. *
  14330. * var other = {
  14331. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  14332. * };
  14333. *
  14334. * _.merge(object, other);
  14335. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  14336. */
  14337. var merge = createAssigner(function(object, source, srcIndex) {
  14338. baseMerge(object, source, srcIndex);
  14339. });
  14340. /**
  14341. * This method is like `_.merge` except that it accepts `customizer` which
  14342. * is invoked to produce the merged values of the destination and source
  14343. * properties. If `customizer` returns `undefined`, merging is handled by the
  14344. * method instead. The `customizer` is invoked with six arguments:
  14345. * (objValue, srcValue, key, object, source, stack).
  14346. *
  14347. * **Note:** This method mutates `object`.
  14348. *
  14349. * @static
  14350. * @memberOf _
  14351. * @since 4.0.0
  14352. * @category Object
  14353. * @param {Object} object The destination object.
  14354. * @param {...Object} sources The source objects.
  14355. * @param {Function} customizer The function to customize assigned values.
  14356. * @returns {Object} Returns `object`.
  14357. * @example
  14358. *
  14359. * function customizer(objValue, srcValue) {
  14360. * if (_.isArray(objValue)) {
  14361. * return objValue.concat(srcValue);
  14362. * }
  14363. * }
  14364. *
  14365. * var object = { 'a': [1], 'b': [2] };
  14366. * var other = { 'a': [3], 'b': [4] };
  14367. *
  14368. * _.mergeWith(object, other, customizer);
  14369. * // => { 'a': [1, 3], 'b': [2, 4] }
  14370. */
  14371. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14372. baseMerge(object, source, srcIndex, customizer);
  14373. });
  14374. /**
  14375. * The opposite of `_.pick`; this method creates an object composed of the
  14376. * own and inherited enumerable property paths of `object` that are not omitted.
  14377. *
  14378. * **Note:** This method is considerably slower than `_.pick`.
  14379. *
  14380. * @static
  14381. * @since 0.1.0
  14382. * @memberOf _
  14383. * @category Object
  14384. * @param {Object} object The source object.
  14385. * @param {...(string|string[])} [paths] The property paths to omit.
  14386. * @returns {Object} Returns the new object.
  14387. * @example
  14388. *
  14389. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14390. *
  14391. * _.omit(object, ['a', 'c']);
  14392. * // => { 'b': '2' }
  14393. */
  14394. var omit = flatRest(function(object, paths) {
  14395. var result = {};
  14396. if (object == null) {
  14397. return result;
  14398. }
  14399. var isDeep = false;
  14400. paths = arrayMap(paths, function(path) {
  14401. path = castPath(path, object);
  14402. isDeep || (isDeep = path.length > 1);
  14403. return path;
  14404. });
  14405. copyObject(object, getAllKeysIn(object), result);
  14406. if (isDeep) {
  14407. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14408. }
  14409. var length = paths.length;
  14410. while (length--) {
  14411. baseUnset(result, paths[length]);
  14412. }
  14413. return result;
  14414. });
  14415. /**
  14416. * The opposite of `_.pickBy`; this method creates an object composed of
  14417. * the own and inherited enumerable string keyed properties of `object` that
  14418. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14419. * arguments: (value, key).
  14420. *
  14421. * @static
  14422. * @memberOf _
  14423. * @since 4.0.0
  14424. * @category Object
  14425. * @param {Object} object The source object.
  14426. * @param {Function} [predicate=_.identity] The function invoked per property.
  14427. * @returns {Object} Returns the new object.
  14428. * @example
  14429. *
  14430. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14431. *
  14432. * _.omitBy(object, _.isNumber);
  14433. * // => { 'b': '2' }
  14434. */
  14435. function omitBy(object, predicate) {
  14436. return pickBy(object, negate(getIteratee(predicate)));
  14437. }
  14438. /**
  14439. * Creates an object composed of the picked `object` properties.
  14440. *
  14441. * @static
  14442. * @since 0.1.0
  14443. * @memberOf _
  14444. * @category Object
  14445. * @param {Object} object The source object.
  14446. * @param {...(string|string[])} [paths] The property paths to pick.
  14447. * @returns {Object} Returns the new object.
  14448. * @example
  14449. *
  14450. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14451. *
  14452. * _.pick(object, ['a', 'c']);
  14453. * // => { 'a': 1, 'c': 3 }
  14454. */
  14455. var pick = flatRest(function(object, paths) {
  14456. return object == null ? {} : basePick(object, paths);
  14457. });
  14458. /**
  14459. * Creates an object composed of the `object` properties `predicate` returns
  14460. * truthy for. The predicate is invoked with two arguments: (value, key).
  14461. *
  14462. * @static
  14463. * @memberOf _
  14464. * @since 4.0.0
  14465. * @category Object
  14466. * @param {Object} object The source object.
  14467. * @param {Function} [predicate=_.identity] The function invoked per property.
  14468. * @returns {Object} Returns the new object.
  14469. * @example
  14470. *
  14471. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14472. *
  14473. * _.pickBy(object, _.isNumber);
  14474. * // => { 'a': 1, 'c': 3 }
  14475. */
  14476. function pickBy(object, predicate) {
  14477. if (object == null) {
  14478. return {};
  14479. }
  14480. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14481. return [prop];
  14482. });
  14483. predicate = getIteratee(predicate);
  14484. return basePickBy(object, props, function(value, path) {
  14485. return predicate(value, path[0]);
  14486. });
  14487. }
  14488. /**
  14489. * This method is like `_.get` except that if the resolved value is a
  14490. * function it's invoked with the `this` binding of its parent object and
  14491. * its result is returned.
  14492. *
  14493. * @static
  14494. * @since 0.1.0
  14495. * @memberOf _
  14496. * @category Object
  14497. * @param {Object} object The object to query.
  14498. * @param {Array|string} path The path of the property to resolve.
  14499. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14500. * @returns {*} Returns the resolved value.
  14501. * @example
  14502. *
  14503. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14504. *
  14505. * _.result(object, 'a[0].b.c1');
  14506. * // => 3
  14507. *
  14508. * _.result(object, 'a[0].b.c2');
  14509. * // => 4
  14510. *
  14511. * _.result(object, 'a[0].b.c3', 'default');
  14512. * // => 'default'
  14513. *
  14514. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14515. * // => 'default'
  14516. */
  14517. function result(object, path, defaultValue) {
  14518. path = castPath(path, object);
  14519. var index = -1,
  14520. length = path.length;
  14521. // Ensure the loop is entered when path is empty.
  14522. if (!length) {
  14523. length = 1;
  14524. object = undefined;
  14525. }
  14526. while (++index < length) {
  14527. var value = object == null ? undefined : object[toKey(path[index])];
  14528. if (value === undefined) {
  14529. index = length;
  14530. value = defaultValue;
  14531. }
  14532. object = isFunction(value) ? value.call(object) : value;
  14533. }
  14534. return object;
  14535. }
  14536. /**
  14537. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14538. * it's created. Arrays are created for missing index properties while objects
  14539. * are created for all other missing properties. Use `_.setWith` to customize
  14540. * `path` creation.
  14541. *
  14542. * **Note:** This method mutates `object`.
  14543. *
  14544. * @static
  14545. * @memberOf _
  14546. * @since 3.7.0
  14547. * @category Object
  14548. * @param {Object} object The object to modify.
  14549. * @param {Array|string} path The path of the property to set.
  14550. * @param {*} value The value to set.
  14551. * @returns {Object} Returns `object`.
  14552. * @example
  14553. *
  14554. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14555. *
  14556. * _.set(object, 'a[0].b.c', 4);
  14557. * console.log(object.a[0].b.c);
  14558. * // => 4
  14559. *
  14560. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14561. * console.log(object.x[0].y.z);
  14562. * // => 5
  14563. */
  14564. function set(object, path, value) {
  14565. return object == null ? object : baseSet(object, path, value);
  14566. }
  14567. /**
  14568. * This method is like `_.set` except that it accepts `customizer` which is
  14569. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14570. * path creation is handled by the method instead. The `customizer` is invoked
  14571. * with three arguments: (nsValue, key, nsObject).
  14572. *
  14573. * **Note:** This method mutates `object`.
  14574. *
  14575. * @static
  14576. * @memberOf _
  14577. * @since 4.0.0
  14578. * @category Object
  14579. * @param {Object} object The object to modify.
  14580. * @param {Array|string} path The path of the property to set.
  14581. * @param {*} value The value to set.
  14582. * @param {Function} [customizer] The function to customize assigned values.
  14583. * @returns {Object} Returns `object`.
  14584. * @example
  14585. *
  14586. * var object = {};
  14587. *
  14588. * _.setWith(object, '[0][1]', 'a', Object);
  14589. * // => { '0': { '1': 'a' } }
  14590. */
  14591. function setWith(object, path, value, customizer) {
  14592. customizer = typeof customizer == 'function' ? customizer : undefined;
  14593. return object == null ? object : baseSet(object, path, value, customizer);
  14594. }
  14595. /**
  14596. * Creates an array of own enumerable string keyed-value pairs for `object`
  14597. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14598. * entries are returned.
  14599. *
  14600. * @static
  14601. * @memberOf _
  14602. * @since 4.0.0
  14603. * @alias entries
  14604. * @category Object
  14605. * @param {Object} object The object to query.
  14606. * @returns {Array} Returns the key-value pairs.
  14607. * @example
  14608. *
  14609. * function Foo() {
  14610. * this.a = 1;
  14611. * this.b = 2;
  14612. * }
  14613. *
  14614. * Foo.prototype.c = 3;
  14615. *
  14616. * _.toPairs(new Foo);
  14617. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14618. */
  14619. var toPairs = createToPairs(keys);
  14620. /**
  14621. * Creates an array of own and inherited enumerable string keyed-value pairs
  14622. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14623. * or set, its entries are returned.
  14624. *
  14625. * @static
  14626. * @memberOf _
  14627. * @since 4.0.0
  14628. * @alias entriesIn
  14629. * @category Object
  14630. * @param {Object} object The object to query.
  14631. * @returns {Array} Returns the key-value pairs.
  14632. * @example
  14633. *
  14634. * function Foo() {
  14635. * this.a = 1;
  14636. * this.b = 2;
  14637. * }
  14638. *
  14639. * Foo.prototype.c = 3;
  14640. *
  14641. * _.toPairsIn(new Foo);
  14642. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14643. */
  14644. var toPairsIn = createToPairs(keysIn);
  14645. /**
  14646. * An alternative to `_.reduce`; this method transforms `object` to a new
  14647. * `accumulator` object which is the result of running each of its own
  14648. * enumerable string keyed properties thru `iteratee`, with each invocation
  14649. * potentially mutating the `accumulator` object. If `accumulator` is not
  14650. * provided, a new object with the same `[[Prototype]]` will be used. The
  14651. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14652. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14653. *
  14654. * @static
  14655. * @memberOf _
  14656. * @since 1.3.0
  14657. * @category Object
  14658. * @param {Object} object The object to iterate over.
  14659. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14660. * @param {*} [accumulator] The custom accumulator value.
  14661. * @returns {*} Returns the accumulated value.
  14662. * @example
  14663. *
  14664. * _.transform([2, 3, 4], function(result, n) {
  14665. * result.push(n *= n);
  14666. * return n % 2 == 0;
  14667. * }, []);
  14668. * // => [4, 9]
  14669. *
  14670. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14671. * (result[value] || (result[value] = [])).push(key);
  14672. * }, {});
  14673. * // => { '1': ['a', 'c'], '2': ['b'] }
  14674. */
  14675. function transform(object, iteratee, accumulator) {
  14676. var isArr = isArray(object),
  14677. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14678. iteratee = getIteratee(iteratee, 4);
  14679. if (accumulator == null) {
  14680. var Ctor = object && object.constructor;
  14681. if (isArrLike) {
  14682. accumulator = isArr ? new Ctor : [];
  14683. }
  14684. else if (isObject(object)) {
  14685. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14686. }
  14687. else {
  14688. accumulator = {};
  14689. }
  14690. }
  14691. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14692. return iteratee(accumulator, value, index, object);
  14693. });
  14694. return accumulator;
  14695. }
  14696. /**
  14697. * Removes the property at `path` of `object`.
  14698. *
  14699. * **Note:** This method mutates `object`.
  14700. *
  14701. * @static
  14702. * @memberOf _
  14703. * @since 4.0.0
  14704. * @category Object
  14705. * @param {Object} object The object to modify.
  14706. * @param {Array|string} path The path of the property to unset.
  14707. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14708. * @example
  14709. *
  14710. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14711. * _.unset(object, 'a[0].b.c');
  14712. * // => true
  14713. *
  14714. * console.log(object);
  14715. * // => { 'a': [{ 'b': {} }] };
  14716. *
  14717. * _.unset(object, ['a', '0', 'b', 'c']);
  14718. * // => true
  14719. *
  14720. * console.log(object);
  14721. * // => { 'a': [{ 'b': {} }] };
  14722. */
  14723. function unset(object, path) {
  14724. return object == null ? true : baseUnset(object, path);
  14725. }
  14726. /**
  14727. * This method is like `_.set` except that accepts `updater` to produce the
  14728. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14729. * is invoked with one argument: (value).
  14730. *
  14731. * **Note:** This method mutates `object`.
  14732. *
  14733. * @static
  14734. * @memberOf _
  14735. * @since 4.6.0
  14736. * @category Object
  14737. * @param {Object} object The object to modify.
  14738. * @param {Array|string} path The path of the property to set.
  14739. * @param {Function} updater The function to produce the updated value.
  14740. * @returns {Object} Returns `object`.
  14741. * @example
  14742. *
  14743. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14744. *
  14745. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14746. * console.log(object.a[0].b.c);
  14747. * // => 9
  14748. *
  14749. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14750. * console.log(object.x[0].y.z);
  14751. * // => 0
  14752. */
  14753. function update(object, path, updater) {
  14754. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14755. }
  14756. /**
  14757. * This method is like `_.update` except that it accepts `customizer` which is
  14758. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14759. * path creation is handled by the method instead. The `customizer` is invoked
  14760. * with three arguments: (nsValue, key, nsObject).
  14761. *
  14762. * **Note:** This method mutates `object`.
  14763. *
  14764. * @static
  14765. * @memberOf _
  14766. * @since 4.6.0
  14767. * @category Object
  14768. * @param {Object} object The object to modify.
  14769. * @param {Array|string} path The path of the property to set.
  14770. * @param {Function} updater The function to produce the updated value.
  14771. * @param {Function} [customizer] The function to customize assigned values.
  14772. * @returns {Object} Returns `object`.
  14773. * @example
  14774. *
  14775. * var object = {};
  14776. *
  14777. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14778. * // => { '0': { '1': 'a' } }
  14779. */
  14780. function updateWith(object, path, updater, customizer) {
  14781. customizer = typeof customizer == 'function' ? customizer : undefined;
  14782. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14783. }
  14784. /**
  14785. * Creates an array of the own enumerable string keyed property values of `object`.
  14786. *
  14787. * **Note:** Non-object values are coerced to objects.
  14788. *
  14789. * @static
  14790. * @since 0.1.0
  14791. * @memberOf _
  14792. * @category Object
  14793. * @param {Object} object The object to query.
  14794. * @returns {Array} Returns the array of property values.
  14795. * @example
  14796. *
  14797. * function Foo() {
  14798. * this.a = 1;
  14799. * this.b = 2;
  14800. * }
  14801. *
  14802. * Foo.prototype.c = 3;
  14803. *
  14804. * _.values(new Foo);
  14805. * // => [1, 2] (iteration order is not guaranteed)
  14806. *
  14807. * _.values('hi');
  14808. * // => ['h', 'i']
  14809. */
  14810. function values(object) {
  14811. return object == null ? [] : baseValues(object, keys(object));
  14812. }
  14813. /**
  14814. * Creates an array of the own and inherited enumerable string keyed property
  14815. * values of `object`.
  14816. *
  14817. * **Note:** Non-object values are coerced to objects.
  14818. *
  14819. * @static
  14820. * @memberOf _
  14821. * @since 3.0.0
  14822. * @category Object
  14823. * @param {Object} object The object to query.
  14824. * @returns {Array} Returns the array of property values.
  14825. * @example
  14826. *
  14827. * function Foo() {
  14828. * this.a = 1;
  14829. * this.b = 2;
  14830. * }
  14831. *
  14832. * Foo.prototype.c = 3;
  14833. *
  14834. * _.valuesIn(new Foo);
  14835. * // => [1, 2, 3] (iteration order is not guaranteed)
  14836. */
  14837. function valuesIn(object) {
  14838. return object == null ? [] : baseValues(object, keysIn(object));
  14839. }
  14840. /*------------------------------------------------------------------------*/
  14841. /**
  14842. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14843. *
  14844. * @static
  14845. * @memberOf _
  14846. * @since 4.0.0
  14847. * @category Number
  14848. * @param {number} number The number to clamp.
  14849. * @param {number} [lower] The lower bound.
  14850. * @param {number} upper The upper bound.
  14851. * @returns {number} Returns the clamped number.
  14852. * @example
  14853. *
  14854. * _.clamp(-10, -5, 5);
  14855. * // => -5
  14856. *
  14857. * _.clamp(10, -5, 5);
  14858. * // => 5
  14859. */
  14860. function clamp(number, lower, upper) {
  14861. if (upper === undefined) {
  14862. upper = lower;
  14863. lower = undefined;
  14864. }
  14865. if (upper !== undefined) {
  14866. upper = toNumber(upper);
  14867. upper = upper === upper ? upper : 0;
  14868. }
  14869. if (lower !== undefined) {
  14870. lower = toNumber(lower);
  14871. lower = lower === lower ? lower : 0;
  14872. }
  14873. return baseClamp(toNumber(number), lower, upper);
  14874. }
  14875. /**
  14876. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14877. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14878. * If `start` is greater than `end` the params are swapped to support
  14879. * negative ranges.
  14880. *
  14881. * @static
  14882. * @memberOf _
  14883. * @since 3.3.0
  14884. * @category Number
  14885. * @param {number} number The number to check.
  14886. * @param {number} [start=0] The start of the range.
  14887. * @param {number} end The end of the range.
  14888. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14889. * @see _.range, _.rangeRight
  14890. * @example
  14891. *
  14892. * _.inRange(3, 2, 4);
  14893. * // => true
  14894. *
  14895. * _.inRange(4, 8);
  14896. * // => true
  14897. *
  14898. * _.inRange(4, 2);
  14899. * // => false
  14900. *
  14901. * _.inRange(2, 2);
  14902. * // => false
  14903. *
  14904. * _.inRange(1.2, 2);
  14905. * // => true
  14906. *
  14907. * _.inRange(5.2, 4);
  14908. * // => false
  14909. *
  14910. * _.inRange(-3, -2, -6);
  14911. * // => true
  14912. */
  14913. function inRange(number, start, end) {
  14914. start = toFinite(start);
  14915. if (end === undefined) {
  14916. end = start;
  14917. start = 0;
  14918. } else {
  14919. end = toFinite(end);
  14920. }
  14921. number = toNumber(number);
  14922. return baseInRange(number, start, end);
  14923. }
  14924. /**
  14925. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14926. * If only one argument is provided a number between `0` and the given number
  14927. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14928. * floats, a floating-point number is returned instead of an integer.
  14929. *
  14930. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14931. * floating-point values which can produce unexpected results.
  14932. *
  14933. * @static
  14934. * @memberOf _
  14935. * @since 0.7.0
  14936. * @category Number
  14937. * @param {number} [lower=0] The lower bound.
  14938. * @param {number} [upper=1] The upper bound.
  14939. * @param {boolean} [floating] Specify returning a floating-point number.
  14940. * @returns {number} Returns the random number.
  14941. * @example
  14942. *
  14943. * _.random(0, 5);
  14944. * // => an integer between 0 and 5
  14945. *
  14946. * _.random(5);
  14947. * // => also an integer between 0 and 5
  14948. *
  14949. * _.random(5, true);
  14950. * // => a floating-point number between 0 and 5
  14951. *
  14952. * _.random(1.2, 5.2);
  14953. * // => a floating-point number between 1.2 and 5.2
  14954. */
  14955. function random(lower, upper, floating) {
  14956. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14957. upper = floating = undefined;
  14958. }
  14959. if (floating === undefined) {
  14960. if (typeof upper == 'boolean') {
  14961. floating = upper;
  14962. upper = undefined;
  14963. }
  14964. else if (typeof lower == 'boolean') {
  14965. floating = lower;
  14966. lower = undefined;
  14967. }
  14968. }
  14969. if (lower === undefined && upper === undefined) {
  14970. lower = 0;
  14971. upper = 1;
  14972. }
  14973. else {
  14974. lower = toFinite(lower);
  14975. if (upper === undefined) {
  14976. upper = lower;
  14977. lower = 0;
  14978. } else {
  14979. upper = toFinite(upper);
  14980. }
  14981. }
  14982. if (lower > upper) {
  14983. var temp = lower;
  14984. lower = upper;
  14985. upper = temp;
  14986. }
  14987. if (floating || lower % 1 || upper % 1) {
  14988. var rand = nativeRandom();
  14989. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14990. }
  14991. return baseRandom(lower, upper);
  14992. }
  14993. /*------------------------------------------------------------------------*/
  14994. /**
  14995. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14996. *
  14997. * @static
  14998. * @memberOf _
  14999. * @since 3.0.0
  15000. * @category String
  15001. * @param {string} [string=''] The string to convert.
  15002. * @returns {string} Returns the camel cased string.
  15003. * @example
  15004. *
  15005. * _.camelCase('Foo Bar');
  15006. * // => 'fooBar'
  15007. *
  15008. * _.camelCase('--foo-bar--');
  15009. * // => 'fooBar'
  15010. *
  15011. * _.camelCase('__FOO_BAR__');
  15012. * // => 'fooBar'
  15013. */
  15014. var camelCase = createCompounder(function(result, word, index) {
  15015. word = word.toLowerCase();
  15016. return result + (index ? capitalize(word) : word);
  15017. });
  15018. /**
  15019. * Converts the first character of `string` to upper case and the remaining
  15020. * to lower case.
  15021. *
  15022. * @static
  15023. * @memberOf _
  15024. * @since 3.0.0
  15025. * @category String
  15026. * @param {string} [string=''] The string to capitalize.
  15027. * @returns {string} Returns the capitalized string.
  15028. * @example
  15029. *
  15030. * _.capitalize('FRED');
  15031. * // => 'Fred'
  15032. */
  15033. function capitalize(string) {
  15034. return upperFirst(toString(string).toLowerCase());
  15035. }
  15036. /**
  15037. * Deburrs `string` by converting
  15038. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  15039. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  15040. * letters to basic Latin letters and removing
  15041. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  15042. *
  15043. * @static
  15044. * @memberOf _
  15045. * @since 3.0.0
  15046. * @category String
  15047. * @param {string} [string=''] The string to deburr.
  15048. * @returns {string} Returns the deburred string.
  15049. * @example
  15050. *
  15051. * _.deburr('déjà vu');
  15052. * // => 'deja vu'
  15053. */
  15054. function deburr(string) {
  15055. string = toString(string);
  15056. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  15057. }
  15058. /**
  15059. * Checks if `string` ends with the given target string.
  15060. *
  15061. * @static
  15062. * @memberOf _
  15063. * @since 3.0.0
  15064. * @category String
  15065. * @param {string} [string=''] The string to inspect.
  15066. * @param {string} [target] The string to search for.
  15067. * @param {number} [position=string.length] The position to search up to.
  15068. * @returns {boolean} Returns `true` if `string` ends with `target`,
  15069. * else `false`.
  15070. * @example
  15071. *
  15072. * _.endsWith('abc', 'c');
  15073. * // => true
  15074. *
  15075. * _.endsWith('abc', 'b');
  15076. * // => false
  15077. *
  15078. * _.endsWith('abc', 'b', 2);
  15079. * // => true
  15080. */
  15081. function endsWith(string, target, position) {
  15082. string = toString(string);
  15083. target = baseToString(target);
  15084. var length = string.length;
  15085. position = position === undefined
  15086. ? length
  15087. : baseClamp(toInteger(position), 0, length);
  15088. var end = position;
  15089. position -= target.length;
  15090. return position >= 0 && string.slice(position, end) == target;
  15091. }
  15092. /**
  15093. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  15094. * corresponding HTML entities.
  15095. *
  15096. * **Note:** No other characters are escaped. To escape additional
  15097. * characters use a third-party library like [_he_](https://mths.be/he).
  15098. *
  15099. * Though the ">" character is escaped for symmetry, characters like
  15100. * ">" and "/" don't need escaping in HTML and have no special meaning
  15101. * unless they're part of a tag or unquoted attribute value. See
  15102. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  15103. * (under "semi-related fun fact") for more details.
  15104. *
  15105. * When working with HTML you should always
  15106. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  15107. * XSS vectors.
  15108. *
  15109. * @static
  15110. * @since 0.1.0
  15111. * @memberOf _
  15112. * @category String
  15113. * @param {string} [string=''] The string to escape.
  15114. * @returns {string} Returns the escaped string.
  15115. * @example
  15116. *
  15117. * _.escape('fred, barney, & pebbles');
  15118. * // => 'fred, barney, &amp; pebbles'
  15119. */
  15120. function escape(string) {
  15121. string = toString(string);
  15122. return (string && reHasUnescapedHtml.test(string))
  15123. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  15124. : string;
  15125. }
  15126. /**
  15127. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  15128. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  15129. *
  15130. * @static
  15131. * @memberOf _
  15132. * @since 3.0.0
  15133. * @category String
  15134. * @param {string} [string=''] The string to escape.
  15135. * @returns {string} Returns the escaped string.
  15136. * @example
  15137. *
  15138. * _.escapeRegExp('[lodash](https://lodash.com/)');
  15139. * // => '\[lodash\]\(https://lodash\.com/\)'
  15140. */
  15141. function escapeRegExp(string) {
  15142. string = toString(string);
  15143. return (string && reHasRegExpChar.test(string))
  15144. ? string.replace(reRegExpChar, '\\$&')
  15145. : string;
  15146. }
  15147. /**
  15148. * Converts `string` to
  15149. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  15150. *
  15151. * @static
  15152. * @memberOf _
  15153. * @since 3.0.0
  15154. * @category String
  15155. * @param {string} [string=''] The string to convert.
  15156. * @returns {string} Returns the kebab cased string.
  15157. * @example
  15158. *
  15159. * _.kebabCase('Foo Bar');
  15160. * // => 'foo-bar'
  15161. *
  15162. * _.kebabCase('fooBar');
  15163. * // => 'foo-bar'
  15164. *
  15165. * _.kebabCase('__FOO_BAR__');
  15166. * // => 'foo-bar'
  15167. */
  15168. var kebabCase = createCompounder(function(result, word, index) {
  15169. return result + (index ? '-' : '') + word.toLowerCase();
  15170. });
  15171. /**
  15172. * Converts `string`, as space separated words, to lower case.
  15173. *
  15174. * @static
  15175. * @memberOf _
  15176. * @since 4.0.0
  15177. * @category String
  15178. * @param {string} [string=''] The string to convert.
  15179. * @returns {string} Returns the lower cased string.
  15180. * @example
  15181. *
  15182. * _.lowerCase('--Foo-Bar--');
  15183. * // => 'foo bar'
  15184. *
  15185. * _.lowerCase('fooBar');
  15186. * // => 'foo bar'
  15187. *
  15188. * _.lowerCase('__FOO_BAR__');
  15189. * // => 'foo bar'
  15190. */
  15191. var lowerCase = createCompounder(function(result, word, index) {
  15192. return result + (index ? ' ' : '') + word.toLowerCase();
  15193. });
  15194. /**
  15195. * Converts the first character of `string` to lower case.
  15196. *
  15197. * @static
  15198. * @memberOf _
  15199. * @since 4.0.0
  15200. * @category String
  15201. * @param {string} [string=''] The string to convert.
  15202. * @returns {string} Returns the converted string.
  15203. * @example
  15204. *
  15205. * _.lowerFirst('Fred');
  15206. * // => 'fred'
  15207. *
  15208. * _.lowerFirst('FRED');
  15209. * // => 'fRED'
  15210. */
  15211. var lowerFirst = createCaseFirst('toLowerCase');
  15212. /**
  15213. * Pads `string` on the left and right sides if it's shorter than `length`.
  15214. * Padding characters are truncated if they can't be evenly divided by `length`.
  15215. *
  15216. * @static
  15217. * @memberOf _
  15218. * @since 3.0.0
  15219. * @category String
  15220. * @param {string} [string=''] The string to pad.
  15221. * @param {number} [length=0] The padding length.
  15222. * @param {string} [chars=' '] The string used as padding.
  15223. * @returns {string} Returns the padded string.
  15224. * @example
  15225. *
  15226. * _.pad('abc', 8);
  15227. * // => ' abc '
  15228. *
  15229. * _.pad('abc', 8, '_-');
  15230. * // => '_-abc_-_'
  15231. *
  15232. * _.pad('abc', 3);
  15233. * // => 'abc'
  15234. */
  15235. function pad(string, length, chars) {
  15236. string = toString(string);
  15237. length = toInteger(length);
  15238. var strLength = length ? stringSize(string) : 0;
  15239. if (!length || strLength >= length) {
  15240. return string;
  15241. }
  15242. var mid = (length - strLength) / 2;
  15243. return (
  15244. createPadding(nativeFloor(mid), chars) +
  15245. string +
  15246. createPadding(nativeCeil(mid), chars)
  15247. );
  15248. }
  15249. /**
  15250. * Pads `string` on the right side if it's shorter than `length`. Padding
  15251. * characters are truncated if they exceed `length`.
  15252. *
  15253. * @static
  15254. * @memberOf _
  15255. * @since 4.0.0
  15256. * @category String
  15257. * @param {string} [string=''] The string to pad.
  15258. * @param {number} [length=0] The padding length.
  15259. * @param {string} [chars=' '] The string used as padding.
  15260. * @returns {string} Returns the padded string.
  15261. * @example
  15262. *
  15263. * _.padEnd('abc', 6);
  15264. * // => 'abc '
  15265. *
  15266. * _.padEnd('abc', 6, '_-');
  15267. * // => 'abc_-_'
  15268. *
  15269. * _.padEnd('abc', 3);
  15270. * // => 'abc'
  15271. */
  15272. function padEnd(string, length, chars) {
  15273. string = toString(string);
  15274. length = toInteger(length);
  15275. var strLength = length ? stringSize(string) : 0;
  15276. return (length && strLength < length)
  15277. ? (string + createPadding(length - strLength, chars))
  15278. : string;
  15279. }
  15280. /**
  15281. * Pads `string` on the left side if it's shorter than `length`. Padding
  15282. * characters are truncated if they exceed `length`.
  15283. *
  15284. * @static
  15285. * @memberOf _
  15286. * @since 4.0.0
  15287. * @category String
  15288. * @param {string} [string=''] The string to pad.
  15289. * @param {number} [length=0] The padding length.
  15290. * @param {string} [chars=' '] The string used as padding.
  15291. * @returns {string} Returns the padded string.
  15292. * @example
  15293. *
  15294. * _.padStart('abc', 6);
  15295. * // => ' abc'
  15296. *
  15297. * _.padStart('abc', 6, '_-');
  15298. * // => '_-_abc'
  15299. *
  15300. * _.padStart('abc', 3);
  15301. * // => 'abc'
  15302. */
  15303. function padStart(string, length, chars) {
  15304. string = toString(string);
  15305. length = toInteger(length);
  15306. var strLength = length ? stringSize(string) : 0;
  15307. return (length && strLength < length)
  15308. ? (createPadding(length - strLength, chars) + string)
  15309. : string;
  15310. }
  15311. /**
  15312. * Converts `string` to an integer of the specified radix. If `radix` is
  15313. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  15314. * hexadecimal, in which case a `radix` of `16` is used.
  15315. *
  15316. * **Note:** This method aligns with the
  15317. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  15318. *
  15319. * @static
  15320. * @memberOf _
  15321. * @since 1.1.0
  15322. * @category String
  15323. * @param {string} string The string to convert.
  15324. * @param {number} [radix=10] The radix to interpret `value` by.
  15325. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15326. * @returns {number} Returns the converted integer.
  15327. * @example
  15328. *
  15329. * _.parseInt('08');
  15330. * // => 8
  15331. *
  15332. * _.map(['6', '08', '10'], _.parseInt);
  15333. * // => [6, 8, 10]
  15334. */
  15335. function parseInt(string, radix, guard) {
  15336. if (guard || radix == null) {
  15337. radix = 0;
  15338. } else if (radix) {
  15339. radix = +radix;
  15340. }
  15341. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  15342. }
  15343. /**
  15344. * Repeats the given string `n` times.
  15345. *
  15346. * @static
  15347. * @memberOf _
  15348. * @since 3.0.0
  15349. * @category String
  15350. * @param {string} [string=''] The string to repeat.
  15351. * @param {number} [n=1] The number of times to repeat the string.
  15352. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15353. * @returns {string} Returns the repeated string.
  15354. * @example
  15355. *
  15356. * _.repeat('*', 3);
  15357. * // => '***'
  15358. *
  15359. * _.repeat('abc', 2);
  15360. * // => 'abcabc'
  15361. *
  15362. * _.repeat('abc', 0);
  15363. * // => ''
  15364. */
  15365. function repeat(string, n, guard) {
  15366. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  15367. n = 1;
  15368. } else {
  15369. n = toInteger(n);
  15370. }
  15371. return baseRepeat(toString(string), n);
  15372. }
  15373. /**
  15374. * Replaces matches for `pattern` in `string` with `replacement`.
  15375. *
  15376. * **Note:** This method is based on
  15377. * [`String#replace`](https://mdn.io/String/replace).
  15378. *
  15379. * @static
  15380. * @memberOf _
  15381. * @since 4.0.0
  15382. * @category String
  15383. * @param {string} [string=''] The string to modify.
  15384. * @param {RegExp|string} pattern The pattern to replace.
  15385. * @param {Function|string} replacement The match replacement.
  15386. * @returns {string} Returns the modified string.
  15387. * @example
  15388. *
  15389. * _.replace('Hi Fred', 'Fred', 'Barney');
  15390. * // => 'Hi Barney'
  15391. */
  15392. function replace() {
  15393. var args = arguments,
  15394. string = toString(args[0]);
  15395. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15396. }
  15397. /**
  15398. * Converts `string` to
  15399. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15400. *
  15401. * @static
  15402. * @memberOf _
  15403. * @since 3.0.0
  15404. * @category String
  15405. * @param {string} [string=''] The string to convert.
  15406. * @returns {string} Returns the snake cased string.
  15407. * @example
  15408. *
  15409. * _.snakeCase('Foo Bar');
  15410. * // => 'foo_bar'
  15411. *
  15412. * _.snakeCase('fooBar');
  15413. * // => 'foo_bar'
  15414. *
  15415. * _.snakeCase('--FOO-BAR--');
  15416. * // => 'foo_bar'
  15417. */
  15418. var snakeCase = createCompounder(function(result, word, index) {
  15419. return result + (index ? '_' : '') + word.toLowerCase();
  15420. });
  15421. /**
  15422. * Splits `string` by `separator`.
  15423. *
  15424. * **Note:** This method is based on
  15425. * [`String#split`](https://mdn.io/String/split).
  15426. *
  15427. * @static
  15428. * @memberOf _
  15429. * @since 4.0.0
  15430. * @category String
  15431. * @param {string} [string=''] The string to split.
  15432. * @param {RegExp|string} separator The separator pattern to split by.
  15433. * @param {number} [limit] The length to truncate results to.
  15434. * @returns {Array} Returns the string segments.
  15435. * @example
  15436. *
  15437. * _.split('a-b-c', '-', 2);
  15438. * // => ['a', 'b']
  15439. */
  15440. function split(string, separator, limit) {
  15441. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15442. separator = limit = undefined;
  15443. }
  15444. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15445. if (!limit) {
  15446. return [];
  15447. }
  15448. string = toString(string);
  15449. if (string && (
  15450. typeof separator == 'string' ||
  15451. (separator != null && !isRegExp(separator))
  15452. )) {
  15453. separator = baseToString(separator);
  15454. if (!separator && hasUnicode(string)) {
  15455. return castSlice(stringToArray(string), 0, limit);
  15456. }
  15457. }
  15458. return string.split(separator, limit);
  15459. }
  15460. /**
  15461. * Converts `string` to
  15462. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15463. *
  15464. * @static
  15465. * @memberOf _
  15466. * @since 3.1.0
  15467. * @category String
  15468. * @param {string} [string=''] The string to convert.
  15469. * @returns {string} Returns the start cased string.
  15470. * @example
  15471. *
  15472. * _.startCase('--foo-bar--');
  15473. * // => 'Foo Bar'
  15474. *
  15475. * _.startCase('fooBar');
  15476. * // => 'Foo Bar'
  15477. *
  15478. * _.startCase('__FOO_BAR__');
  15479. * // => 'FOO BAR'
  15480. */
  15481. var startCase = createCompounder(function(result, word, index) {
  15482. return result + (index ? ' ' : '') + upperFirst(word);
  15483. });
  15484. /**
  15485. * Checks if `string` starts with the given target string.
  15486. *
  15487. * @static
  15488. * @memberOf _
  15489. * @since 3.0.0
  15490. * @category String
  15491. * @param {string} [string=''] The string to inspect.
  15492. * @param {string} [target] The string to search for.
  15493. * @param {number} [position=0] The position to search from.
  15494. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15495. * else `false`.
  15496. * @example
  15497. *
  15498. * _.startsWith('abc', 'a');
  15499. * // => true
  15500. *
  15501. * _.startsWith('abc', 'b');
  15502. * // => false
  15503. *
  15504. * _.startsWith('abc', 'b', 1);
  15505. * // => true
  15506. */
  15507. function startsWith(string, target, position) {
  15508. string = toString(string);
  15509. position = position == null
  15510. ? 0
  15511. : baseClamp(toInteger(position), 0, string.length);
  15512. target = baseToString(target);
  15513. return string.slice(position, position + target.length) == target;
  15514. }
  15515. /**
  15516. * Creates a compiled template function that can interpolate data properties
  15517. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15518. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15519. * properties may be accessed as free variables in the template. If a setting
  15520. * object is given, it takes precedence over `_.templateSettings` values.
  15521. *
  15522. * **Note:** In the development build `_.template` utilizes
  15523. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15524. * for easier debugging.
  15525. *
  15526. * For more information on precompiling templates see
  15527. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15528. *
  15529. * For more information on Chrome extension sandboxes see
  15530. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15531. *
  15532. * @static
  15533. * @since 0.1.0
  15534. * @memberOf _
  15535. * @category String
  15536. * @param {string} [string=''] The template string.
  15537. * @param {Object} [options={}] The options object.
  15538. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15539. * The HTML "escape" delimiter.
  15540. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15541. * The "evaluate" delimiter.
  15542. * @param {Object} [options.imports=_.templateSettings.imports]
  15543. * An object to import into the template as free variables.
  15544. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15545. * The "interpolate" delimiter.
  15546. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15547. * The sourceURL of the compiled template.
  15548. * @param {string} [options.variable='obj']
  15549. * The data object variable name.
  15550. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15551. * @returns {Function} Returns the compiled template function.
  15552. * @example
  15553. *
  15554. * // Use the "interpolate" delimiter to create a compiled template.
  15555. * var compiled = _.template('hello <%= user %>!');
  15556. * compiled({ 'user': 'fred' });
  15557. * // => 'hello fred!'
  15558. *
  15559. * // Use the HTML "escape" delimiter to escape data property values.
  15560. * var compiled = _.template('<b><%- value %></b>');
  15561. * compiled({ 'value': '<script>' });
  15562. * // => '<b>&lt;script&gt;</b>'
  15563. *
  15564. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15565. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15566. * compiled({ 'users': ['fred', 'barney'] });
  15567. * // => '<li>fred</li><li>barney</li>'
  15568. *
  15569. * // Use the internal `print` function in "evaluate" delimiters.
  15570. * var compiled = _.template('<% print("hello " + user); %>!');
  15571. * compiled({ 'user': 'barney' });
  15572. * // => 'hello barney!'
  15573. *
  15574. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15575. * // Disable support by replacing the "interpolate" delimiter.
  15576. * var compiled = _.template('hello ${ user }!');
  15577. * compiled({ 'user': 'pebbles' });
  15578. * // => 'hello pebbles!'
  15579. *
  15580. * // Use backslashes to treat delimiters as plain text.
  15581. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15582. * compiled({ 'value': 'ignored' });
  15583. * // => '<%- value %>'
  15584. *
  15585. * // Use the `imports` option to import `jQuery` as `jq`.
  15586. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15587. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15588. * compiled({ 'users': ['fred', 'barney'] });
  15589. * // => '<li>fred</li><li>barney</li>'
  15590. *
  15591. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15592. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15593. * compiled(data);
  15594. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15595. *
  15596. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15597. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15598. * compiled.source;
  15599. * // => function(data) {
  15600. * // var __t, __p = '';
  15601. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15602. * // return __p;
  15603. * // }
  15604. *
  15605. * // Use custom template delimiters.
  15606. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15607. * var compiled = _.template('hello {{ user }}!');
  15608. * compiled({ 'user': 'mustache' });
  15609. * // => 'hello mustache!'
  15610. *
  15611. * // Use the `source` property to inline compiled templates for meaningful
  15612. * // line numbers in error messages and stack traces.
  15613. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15614. * var JST = {\
  15615. * "main": ' + _.template(mainText).source + '\
  15616. * };\
  15617. * ');
  15618. */
  15619. function template(string, options, guard) {
  15620. // Based on John Resig's `tmpl` implementation
  15621. // (http://ejohn.org/blog/javascript-micro-templating/)
  15622. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15623. var settings = lodash.templateSettings;
  15624. if (guard && isIterateeCall(string, options, guard)) {
  15625. options = undefined;
  15626. }
  15627. string = toString(string);
  15628. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15629. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15630. importsKeys = keys(imports),
  15631. importsValues = baseValues(imports, importsKeys);
  15632. var isEscaping,
  15633. isEvaluating,
  15634. index = 0,
  15635. interpolate = options.interpolate || reNoMatch,
  15636. source = "__p += '";
  15637. // Compile the regexp to match each delimiter.
  15638. var reDelimiters = RegExp(
  15639. (options.escape || reNoMatch).source + '|' +
  15640. interpolate.source + '|' +
  15641. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15642. (options.evaluate || reNoMatch).source + '|$'
  15643. , 'g');
  15644. // Use a sourceURL for easier debugging.
  15645. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15646. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15647. // and escape the comment, thus injecting code that gets evaled.
  15648. var sourceURL = '//# sourceURL=' +
  15649. (hasOwnProperty.call(options, 'sourceURL')
  15650. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15651. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15652. ) + '\n';
  15653. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15654. interpolateValue || (interpolateValue = esTemplateValue);
  15655. // Escape characters that can't be included in string literals.
  15656. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15657. // Replace delimiters with snippets.
  15658. if (escapeValue) {
  15659. isEscaping = true;
  15660. source += "' +\n__e(" + escapeValue + ") +\n'";
  15661. }
  15662. if (evaluateValue) {
  15663. isEvaluating = true;
  15664. source += "';\n" + evaluateValue + ";\n__p += '";
  15665. }
  15666. if (interpolateValue) {
  15667. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15668. }
  15669. index = offset + match.length;
  15670. // The JS engine embedded in Adobe products needs `match` returned in
  15671. // order to produce the correct `offset` value.
  15672. return match;
  15673. });
  15674. source += "';\n";
  15675. // If `variable` is not specified wrap a with-statement around the generated
  15676. // code to add the data object to the top of the scope chain.
  15677. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15678. if (!variable) {
  15679. source = 'with (obj) {\n' + source + '\n}\n';
  15680. }
  15681. // Throw an error if a forbidden character was found in `variable`, to prevent
  15682. // potential command injection attacks.
  15683. else if (reForbiddenIdentifierChars.test(variable)) {
  15684. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15685. }
  15686. // Cleanup code by stripping empty strings.
  15687. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15688. .replace(reEmptyStringMiddle, '$1')
  15689. .replace(reEmptyStringTrailing, '$1;');
  15690. // Frame code as the function body.
  15691. source = 'function(' + (variable || 'obj') + ') {\n' +
  15692. (variable
  15693. ? ''
  15694. : 'obj || (obj = {});\n'
  15695. ) +
  15696. "var __t, __p = ''" +
  15697. (isEscaping
  15698. ? ', __e = _.escape'
  15699. : ''
  15700. ) +
  15701. (isEvaluating
  15702. ? ', __j = Array.prototype.join;\n' +
  15703. "function print() { __p += __j.call(arguments, '') }\n"
  15704. : ';\n'
  15705. ) +
  15706. source +
  15707. 'return __p\n}';
  15708. var result = attempt(function() {
  15709. return Function(importsKeys, sourceURL + 'return ' + source)
  15710. .apply(undefined, importsValues);
  15711. });
  15712. // Provide the compiled function's source by its `toString` method or
  15713. // the `source` property as a convenience for inlining compiled templates.
  15714. result.source = source;
  15715. if (isError(result)) {
  15716. throw result;
  15717. }
  15718. return result;
  15719. }
  15720. /**
  15721. * Converts `string`, as a whole, to lower case just like
  15722. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15723. *
  15724. * @static
  15725. * @memberOf _
  15726. * @since 4.0.0
  15727. * @category String
  15728. * @param {string} [string=''] The string to convert.
  15729. * @returns {string} Returns the lower cased string.
  15730. * @example
  15731. *
  15732. * _.toLower('--Foo-Bar--');
  15733. * // => '--foo-bar--'
  15734. *
  15735. * _.toLower('fooBar');
  15736. * // => 'foobar'
  15737. *
  15738. * _.toLower('__FOO_BAR__');
  15739. * // => '__foo_bar__'
  15740. */
  15741. function toLower(value) {
  15742. return toString(value).toLowerCase();
  15743. }
  15744. /**
  15745. * Converts `string`, as a whole, to upper case just like
  15746. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15747. *
  15748. * @static
  15749. * @memberOf _
  15750. * @since 4.0.0
  15751. * @category String
  15752. * @param {string} [string=''] The string to convert.
  15753. * @returns {string} Returns the upper cased string.
  15754. * @example
  15755. *
  15756. * _.toUpper('--foo-bar--');
  15757. * // => '--FOO-BAR--'
  15758. *
  15759. * _.toUpper('fooBar');
  15760. * // => 'FOOBAR'
  15761. *
  15762. * _.toUpper('__foo_bar__');
  15763. * // => '__FOO_BAR__'
  15764. */
  15765. function toUpper(value) {
  15766. return toString(value).toUpperCase();
  15767. }
  15768. /**
  15769. * Removes leading and trailing whitespace or specified characters from `string`.
  15770. *
  15771. * @static
  15772. * @memberOf _
  15773. * @since 3.0.0
  15774. * @category String
  15775. * @param {string} [string=''] The string to trim.
  15776. * @param {string} [chars=whitespace] The characters to trim.
  15777. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15778. * @returns {string} Returns the trimmed string.
  15779. * @example
  15780. *
  15781. * _.trim(' abc ');
  15782. * // => 'abc'
  15783. *
  15784. * _.trim('-_-abc-_-', '_-');
  15785. * // => 'abc'
  15786. *
  15787. * _.map([' foo ', ' bar '], _.trim);
  15788. * // => ['foo', 'bar']
  15789. */
  15790. function trim(string, chars, guard) {
  15791. string = toString(string);
  15792. if (string && (guard || chars === undefined)) {
  15793. return baseTrim(string);
  15794. }
  15795. if (!string || !(chars = baseToString(chars))) {
  15796. return string;
  15797. }
  15798. var strSymbols = stringToArray(string),
  15799. chrSymbols = stringToArray(chars),
  15800. start = charsStartIndex(strSymbols, chrSymbols),
  15801. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15802. return castSlice(strSymbols, start, end).join('');
  15803. }
  15804. /**
  15805. * Removes trailing whitespace or specified characters from `string`.
  15806. *
  15807. * @static
  15808. * @memberOf _
  15809. * @since 4.0.0
  15810. * @category String
  15811. * @param {string} [string=''] The string to trim.
  15812. * @param {string} [chars=whitespace] The characters to trim.
  15813. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15814. * @returns {string} Returns the trimmed string.
  15815. * @example
  15816. *
  15817. * _.trimEnd(' abc ');
  15818. * // => ' abc'
  15819. *
  15820. * _.trimEnd('-_-abc-_-', '_-');
  15821. * // => '-_-abc'
  15822. */
  15823. function trimEnd(string, chars, guard) {
  15824. string = toString(string);
  15825. if (string && (guard || chars === undefined)) {
  15826. return string.slice(0, trimmedEndIndex(string) + 1);
  15827. }
  15828. if (!string || !(chars = baseToString(chars))) {
  15829. return string;
  15830. }
  15831. var strSymbols = stringToArray(string),
  15832. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15833. return castSlice(strSymbols, 0, end).join('');
  15834. }
  15835. /**
  15836. * Removes leading whitespace or specified characters from `string`.
  15837. *
  15838. * @static
  15839. * @memberOf _
  15840. * @since 4.0.0
  15841. * @category String
  15842. * @param {string} [string=''] The string to trim.
  15843. * @param {string} [chars=whitespace] The characters to trim.
  15844. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15845. * @returns {string} Returns the trimmed string.
  15846. * @example
  15847. *
  15848. * _.trimStart(' abc ');
  15849. * // => 'abc '
  15850. *
  15851. * _.trimStart('-_-abc-_-', '_-');
  15852. * // => 'abc-_-'
  15853. */
  15854. function trimStart(string, chars, guard) {
  15855. string = toString(string);
  15856. if (string && (guard || chars === undefined)) {
  15857. return string.replace(reTrimStart, '');
  15858. }
  15859. if (!string || !(chars = baseToString(chars))) {
  15860. return string;
  15861. }
  15862. var strSymbols = stringToArray(string),
  15863. start = charsStartIndex(strSymbols, stringToArray(chars));
  15864. return castSlice(strSymbols, start).join('');
  15865. }
  15866. /**
  15867. * Truncates `string` if it's longer than the given maximum string length.
  15868. * The last characters of the truncated string are replaced with the omission
  15869. * string which defaults to "...".
  15870. *
  15871. * @static
  15872. * @memberOf _
  15873. * @since 4.0.0
  15874. * @category String
  15875. * @param {string} [string=''] The string to truncate.
  15876. * @param {Object} [options={}] The options object.
  15877. * @param {number} [options.length=30] The maximum string length.
  15878. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15879. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15880. * @returns {string} Returns the truncated string.
  15881. * @example
  15882. *
  15883. * _.truncate('hi-diddly-ho there, neighborino');
  15884. * // => 'hi-diddly-ho there, neighbo...'
  15885. *
  15886. * _.truncate('hi-diddly-ho there, neighborino', {
  15887. * 'length': 24,
  15888. * 'separator': ' '
  15889. * });
  15890. * // => 'hi-diddly-ho there,...'
  15891. *
  15892. * _.truncate('hi-diddly-ho there, neighborino', {
  15893. * 'length': 24,
  15894. * 'separator': /,? +/
  15895. * });
  15896. * // => 'hi-diddly-ho there...'
  15897. *
  15898. * _.truncate('hi-diddly-ho there, neighborino', {
  15899. * 'omission': ' [...]'
  15900. * });
  15901. * // => 'hi-diddly-ho there, neig [...]'
  15902. */
  15903. function truncate(string, options) {
  15904. var length = DEFAULT_TRUNC_LENGTH,
  15905. omission = DEFAULT_TRUNC_OMISSION;
  15906. if (isObject(options)) {
  15907. var separator = 'separator' in options ? options.separator : separator;
  15908. length = 'length' in options ? toInteger(options.length) : length;
  15909. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15910. }
  15911. string = toString(string);
  15912. var strLength = string.length;
  15913. if (hasUnicode(string)) {
  15914. var strSymbols = stringToArray(string);
  15915. strLength = strSymbols.length;
  15916. }
  15917. if (length >= strLength) {
  15918. return string;
  15919. }
  15920. var end = length - stringSize(omission);
  15921. if (end < 1) {
  15922. return omission;
  15923. }
  15924. var result = strSymbols
  15925. ? castSlice(strSymbols, 0, end).join('')
  15926. : string.slice(0, end);
  15927. if (separator === undefined) {
  15928. return result + omission;
  15929. }
  15930. if (strSymbols) {
  15931. end += (result.length - end);
  15932. }
  15933. if (isRegExp(separator)) {
  15934. if (string.slice(end).search(separator)) {
  15935. var match,
  15936. substring = result;
  15937. if (!separator.global) {
  15938. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15939. }
  15940. separator.lastIndex = 0;
  15941. while ((match = separator.exec(substring))) {
  15942. var newEnd = match.index;
  15943. }
  15944. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15945. }
  15946. } else if (string.indexOf(baseToString(separator), end) != end) {
  15947. var index = result.lastIndexOf(separator);
  15948. if (index > -1) {
  15949. result = result.slice(0, index);
  15950. }
  15951. }
  15952. return result + omission;
  15953. }
  15954. /**
  15955. * The inverse of `_.escape`; this method converts the HTML entities
  15956. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15957. * their corresponding characters.
  15958. *
  15959. * **Note:** No other HTML entities are unescaped. To unescape additional
  15960. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15961. *
  15962. * @static
  15963. * @memberOf _
  15964. * @since 0.6.0
  15965. * @category String
  15966. * @param {string} [string=''] The string to unescape.
  15967. * @returns {string} Returns the unescaped string.
  15968. * @example
  15969. *
  15970. * _.unescape('fred, barney, &amp; pebbles');
  15971. * // => 'fred, barney, & pebbles'
  15972. */
  15973. function unescape(string) {
  15974. string = toString(string);
  15975. return (string && reHasEscapedHtml.test(string))
  15976. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15977. : string;
  15978. }
  15979. /**
  15980. * Converts `string`, as space separated words, to upper case.
  15981. *
  15982. * @static
  15983. * @memberOf _
  15984. * @since 4.0.0
  15985. * @category String
  15986. * @param {string} [string=''] The string to convert.
  15987. * @returns {string} Returns the upper cased string.
  15988. * @example
  15989. *
  15990. * _.upperCase('--foo-bar');
  15991. * // => 'FOO BAR'
  15992. *
  15993. * _.upperCase('fooBar');
  15994. * // => 'FOO BAR'
  15995. *
  15996. * _.upperCase('__foo_bar__');
  15997. * // => 'FOO BAR'
  15998. */
  15999. var upperCase = createCompounder(function(result, word, index) {
  16000. return result + (index ? ' ' : '') + word.toUpperCase();
  16001. });
  16002. /**
  16003. * Converts the first character of `string` to upper case.
  16004. *
  16005. * @static
  16006. * @memberOf _
  16007. * @since 4.0.0
  16008. * @category String
  16009. * @param {string} [string=''] The string to convert.
  16010. * @returns {string} Returns the converted string.
  16011. * @example
  16012. *
  16013. * _.upperFirst('fred');
  16014. * // => 'Fred'
  16015. *
  16016. * _.upperFirst('FRED');
  16017. * // => 'FRED'
  16018. */
  16019. var upperFirst = createCaseFirst('toUpperCase');
  16020. /**
  16021. * Splits `string` into an array of its words.
  16022. *
  16023. * @static
  16024. * @memberOf _
  16025. * @since 3.0.0
  16026. * @category String
  16027. * @param {string} [string=''] The string to inspect.
  16028. * @param {RegExp|string} [pattern] The pattern to match words.
  16029. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16030. * @returns {Array} Returns the words of `string`.
  16031. * @example
  16032. *
  16033. * _.words('fred, barney, & pebbles');
  16034. * // => ['fred', 'barney', 'pebbles']
  16035. *
  16036. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  16037. * // => ['fred', 'barney', '&', 'pebbles']
  16038. */
  16039. function words(string, pattern, guard) {
  16040. string = toString(string);
  16041. pattern = guard ? undefined : pattern;
  16042. if (pattern === undefined) {
  16043. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  16044. }
  16045. return string.match(pattern) || [];
  16046. }
  16047. /*------------------------------------------------------------------------*/
  16048. /**
  16049. * Attempts to invoke `func`, returning either the result or the caught error
  16050. * object. Any additional arguments are provided to `func` when it's invoked.
  16051. *
  16052. * @static
  16053. * @memberOf _
  16054. * @since 3.0.0
  16055. * @category Util
  16056. * @param {Function} func The function to attempt.
  16057. * @param {...*} [args] The arguments to invoke `func` with.
  16058. * @returns {*} Returns the `func` result or error object.
  16059. * @example
  16060. *
  16061. * // Avoid throwing errors for invalid selectors.
  16062. * var elements = _.attempt(function(selector) {
  16063. * return document.querySelectorAll(selector);
  16064. * }, '>_>');
  16065. *
  16066. * if (_.isError(elements)) {
  16067. * elements = [];
  16068. * }
  16069. */
  16070. var attempt = baseRest(function(func, args) {
  16071. try {
  16072. return apply(func, undefined, args);
  16073. } catch (e) {
  16074. return isError(e) ? e : new Error(e);
  16075. }
  16076. });
  16077. /**
  16078. * Binds methods of an object to the object itself, overwriting the existing
  16079. * method.
  16080. *
  16081. * **Note:** This method doesn't set the "length" property of bound functions.
  16082. *
  16083. * @static
  16084. * @since 0.1.0
  16085. * @memberOf _
  16086. * @category Util
  16087. * @param {Object} object The object to bind and assign the bound methods to.
  16088. * @param {...(string|string[])} methodNames The object method names to bind.
  16089. * @returns {Object} Returns `object`.
  16090. * @example
  16091. *
  16092. * var view = {
  16093. * 'label': 'docs',
  16094. * 'click': function() {
  16095. * console.log('clicked ' + this.label);
  16096. * }
  16097. * };
  16098. *
  16099. * _.bindAll(view, ['click']);
  16100. * jQuery(element).on('click', view.click);
  16101. * // => Logs 'clicked docs' when clicked.
  16102. */
  16103. var bindAll = flatRest(function(object, methodNames) {
  16104. arrayEach(methodNames, function(key) {
  16105. key = toKey(key);
  16106. baseAssignValue(object, key, bind(object[key], object));
  16107. });
  16108. return object;
  16109. });
  16110. /**
  16111. * Creates a function that iterates over `pairs` and invokes the corresponding
  16112. * function of the first predicate to return truthy. The predicate-function
  16113. * pairs are invoked with the `this` binding and arguments of the created
  16114. * function.
  16115. *
  16116. * @static
  16117. * @memberOf _
  16118. * @since 4.0.0
  16119. * @category Util
  16120. * @param {Array} pairs The predicate-function pairs.
  16121. * @returns {Function} Returns the new composite function.
  16122. * @example
  16123. *
  16124. * var func = _.cond([
  16125. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  16126. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  16127. * [_.stubTrue, _.constant('no match')]
  16128. * ]);
  16129. *
  16130. * func({ 'a': 1, 'b': 2 });
  16131. * // => 'matches A'
  16132. *
  16133. * func({ 'a': 0, 'b': 1 });
  16134. * // => 'matches B'
  16135. *
  16136. * func({ 'a': '1', 'b': '2' });
  16137. * // => 'no match'
  16138. */
  16139. function cond(pairs) {
  16140. var length = pairs == null ? 0 : pairs.length,
  16141. toIteratee = getIteratee();
  16142. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  16143. if (typeof pair[1] != 'function') {
  16144. throw new TypeError(FUNC_ERROR_TEXT);
  16145. }
  16146. return [toIteratee(pair[0]), pair[1]];
  16147. });
  16148. return baseRest(function(args) {
  16149. var index = -1;
  16150. while (++index < length) {
  16151. var pair = pairs[index];
  16152. if (apply(pair[0], this, args)) {
  16153. return apply(pair[1], this, args);
  16154. }
  16155. }
  16156. });
  16157. }
  16158. /**
  16159. * Creates a function that invokes the predicate properties of `source` with
  16160. * the corresponding property values of a given object, returning `true` if
  16161. * all predicates return truthy, else `false`.
  16162. *
  16163. * **Note:** The created function is equivalent to `_.conformsTo` with
  16164. * `source` partially applied.
  16165. *
  16166. * @static
  16167. * @memberOf _
  16168. * @since 4.0.0
  16169. * @category Util
  16170. * @param {Object} source The object of property predicates to conform to.
  16171. * @returns {Function} Returns the new spec function.
  16172. * @example
  16173. *
  16174. * var objects = [
  16175. * { 'a': 2, 'b': 1 },
  16176. * { 'a': 1, 'b': 2 }
  16177. * ];
  16178. *
  16179. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  16180. * // => [{ 'a': 1, 'b': 2 }]
  16181. */
  16182. function conforms(source) {
  16183. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  16184. }
  16185. /**
  16186. * Creates a function that returns `value`.
  16187. *
  16188. * @static
  16189. * @memberOf _
  16190. * @since 2.4.0
  16191. * @category Util
  16192. * @param {*} value The value to return from the new function.
  16193. * @returns {Function} Returns the new constant function.
  16194. * @example
  16195. *
  16196. * var objects = _.times(2, _.constant({ 'a': 1 }));
  16197. *
  16198. * console.log(objects);
  16199. * // => [{ 'a': 1 }, { 'a': 1 }]
  16200. *
  16201. * console.log(objects[0] === objects[1]);
  16202. * // => true
  16203. */
  16204. function constant(value) {
  16205. return function() {
  16206. return value;
  16207. };
  16208. }
  16209. /**
  16210. * Checks `value` to determine whether a default value should be returned in
  16211. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  16212. * or `undefined`.
  16213. *
  16214. * @static
  16215. * @memberOf _
  16216. * @since 4.14.0
  16217. * @category Util
  16218. * @param {*} value The value to check.
  16219. * @param {*} defaultValue The default value.
  16220. * @returns {*} Returns the resolved value.
  16221. * @example
  16222. *
  16223. * _.defaultTo(1, 10);
  16224. * // => 1
  16225. *
  16226. * _.defaultTo(undefined, 10);
  16227. * // => 10
  16228. */
  16229. function defaultTo(value, defaultValue) {
  16230. return (value == null || value !== value) ? defaultValue : value;
  16231. }
  16232. /**
  16233. * Creates a function that returns the result of invoking the given functions
  16234. * with the `this` binding of the created function, where each successive
  16235. * invocation is supplied the return value of the previous.
  16236. *
  16237. * @static
  16238. * @memberOf _
  16239. * @since 3.0.0
  16240. * @category Util
  16241. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16242. * @returns {Function} Returns the new composite function.
  16243. * @see _.flowRight
  16244. * @example
  16245. *
  16246. * function square(n) {
  16247. * return n * n;
  16248. * }
  16249. *
  16250. * var addSquare = _.flow([_.add, square]);
  16251. * addSquare(1, 2);
  16252. * // => 9
  16253. */
  16254. var flow = createFlow();
  16255. /**
  16256. * This method is like `_.flow` except that it creates a function that
  16257. * invokes the given functions from right to left.
  16258. *
  16259. * @static
  16260. * @since 3.0.0
  16261. * @memberOf _
  16262. * @category Util
  16263. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16264. * @returns {Function} Returns the new composite function.
  16265. * @see _.flow
  16266. * @example
  16267. *
  16268. * function square(n) {
  16269. * return n * n;
  16270. * }
  16271. *
  16272. * var addSquare = _.flowRight([square, _.add]);
  16273. * addSquare(1, 2);
  16274. * // => 9
  16275. */
  16276. var flowRight = createFlow(true);
  16277. /**
  16278. * This method returns the first argument it receives.
  16279. *
  16280. * @static
  16281. * @since 0.1.0
  16282. * @memberOf _
  16283. * @category Util
  16284. * @param {*} value Any value.
  16285. * @returns {*} Returns `value`.
  16286. * @example
  16287. *
  16288. * var object = { 'a': 1 };
  16289. *
  16290. * console.log(_.identity(object) === object);
  16291. * // => true
  16292. */
  16293. function identity(value) {
  16294. return value;
  16295. }
  16296. /**
  16297. * Creates a function that invokes `func` with the arguments of the created
  16298. * function. If `func` is a property name, the created function returns the
  16299. * property value for a given element. If `func` is an array or object, the
  16300. * created function returns `true` for elements that contain the equivalent
  16301. * source properties, otherwise it returns `false`.
  16302. *
  16303. * @static
  16304. * @since 4.0.0
  16305. * @memberOf _
  16306. * @category Util
  16307. * @param {*} [func=_.identity] The value to convert to a callback.
  16308. * @returns {Function} Returns the callback.
  16309. * @example
  16310. *
  16311. * var users = [
  16312. * { 'user': 'barney', 'age': 36, 'active': true },
  16313. * { 'user': 'fred', 'age': 40, 'active': false }
  16314. * ];
  16315. *
  16316. * // The `_.matches` iteratee shorthand.
  16317. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  16318. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  16319. *
  16320. * // The `_.matchesProperty` iteratee shorthand.
  16321. * _.filter(users, _.iteratee(['user', 'fred']));
  16322. * // => [{ 'user': 'fred', 'age': 40 }]
  16323. *
  16324. * // The `_.property` iteratee shorthand.
  16325. * _.map(users, _.iteratee('user'));
  16326. * // => ['barney', 'fred']
  16327. *
  16328. * // Create custom iteratee shorthands.
  16329. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  16330. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  16331. * return func.test(string);
  16332. * };
  16333. * });
  16334. *
  16335. * _.filter(['abc', 'def'], /ef/);
  16336. * // => ['def']
  16337. */
  16338. function iteratee(func) {
  16339. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  16340. }
  16341. /**
  16342. * Creates a function that performs a partial deep comparison between a given
  16343. * object and `source`, returning `true` if the given object has equivalent
  16344. * property values, else `false`.
  16345. *
  16346. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  16347. * partially applied.
  16348. *
  16349. * Partial comparisons will match empty array and empty object `source`
  16350. * values against any array or object value, respectively. See `_.isEqual`
  16351. * for a list of supported value comparisons.
  16352. *
  16353. * **Note:** Multiple values can be checked by combining several matchers
  16354. * using `_.overSome`
  16355. *
  16356. * @static
  16357. * @memberOf _
  16358. * @since 3.0.0
  16359. * @category Util
  16360. * @param {Object} source The object of property values to match.
  16361. * @returns {Function} Returns the new spec function.
  16362. * @example
  16363. *
  16364. * var objects = [
  16365. * { 'a': 1, 'b': 2, 'c': 3 },
  16366. * { 'a': 4, 'b': 5, 'c': 6 }
  16367. * ];
  16368. *
  16369. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  16370. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  16371. *
  16372. * // Checking for several possible values
  16373. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16374. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16375. */
  16376. function matches(source) {
  16377. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16378. }
  16379. /**
  16380. * Creates a function that performs a partial deep comparison between the
  16381. * value at `path` of a given object to `srcValue`, returning `true` if the
  16382. * object value is equivalent, else `false`.
  16383. *
  16384. * **Note:** Partial comparisons will match empty array and empty object
  16385. * `srcValue` values against any array or object value, respectively. See
  16386. * `_.isEqual` for a list of supported value comparisons.
  16387. *
  16388. * **Note:** Multiple values can be checked by combining several matchers
  16389. * using `_.overSome`
  16390. *
  16391. * @static
  16392. * @memberOf _
  16393. * @since 3.2.0
  16394. * @category Util
  16395. * @param {Array|string} path The path of the property to get.
  16396. * @param {*} srcValue The value to match.
  16397. * @returns {Function} Returns the new spec function.
  16398. * @example
  16399. *
  16400. * var objects = [
  16401. * { 'a': 1, 'b': 2, 'c': 3 },
  16402. * { 'a': 4, 'b': 5, 'c': 6 }
  16403. * ];
  16404. *
  16405. * _.find(objects, _.matchesProperty('a', 4));
  16406. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16407. *
  16408. * // Checking for several possible values
  16409. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16410. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16411. */
  16412. function matchesProperty(path, srcValue) {
  16413. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16414. }
  16415. /**
  16416. * Creates a function that invokes the method at `path` of a given object.
  16417. * Any additional arguments are provided to the invoked method.
  16418. *
  16419. * @static
  16420. * @memberOf _
  16421. * @since 3.7.0
  16422. * @category Util
  16423. * @param {Array|string} path The path of the method to invoke.
  16424. * @param {...*} [args] The arguments to invoke the method with.
  16425. * @returns {Function} Returns the new invoker function.
  16426. * @example
  16427. *
  16428. * var objects = [
  16429. * { 'a': { 'b': _.constant(2) } },
  16430. * { 'a': { 'b': _.constant(1) } }
  16431. * ];
  16432. *
  16433. * _.map(objects, _.method('a.b'));
  16434. * // => [2, 1]
  16435. *
  16436. * _.map(objects, _.method(['a', 'b']));
  16437. * // => [2, 1]
  16438. */
  16439. var method = baseRest(function(path, args) {
  16440. return function(object) {
  16441. return baseInvoke(object, path, args);
  16442. };
  16443. });
  16444. /**
  16445. * The opposite of `_.method`; this method creates a function that invokes
  16446. * the method at a given path of `object`. Any additional arguments are
  16447. * provided to the invoked method.
  16448. *
  16449. * @static
  16450. * @memberOf _
  16451. * @since 3.7.0
  16452. * @category Util
  16453. * @param {Object} object The object to query.
  16454. * @param {...*} [args] The arguments to invoke the method with.
  16455. * @returns {Function} Returns the new invoker function.
  16456. * @example
  16457. *
  16458. * var array = _.times(3, _.constant),
  16459. * object = { 'a': array, 'b': array, 'c': array };
  16460. *
  16461. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16462. * // => [2, 0]
  16463. *
  16464. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16465. * // => [2, 0]
  16466. */
  16467. var methodOf = baseRest(function(object, args) {
  16468. return function(path) {
  16469. return baseInvoke(object, path, args);
  16470. };
  16471. });
  16472. /**
  16473. * Adds all own enumerable string keyed function properties of a source
  16474. * object to the destination object. If `object` is a function, then methods
  16475. * are added to its prototype as well.
  16476. *
  16477. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16478. * avoid conflicts caused by modifying the original.
  16479. *
  16480. * @static
  16481. * @since 0.1.0
  16482. * @memberOf _
  16483. * @category Util
  16484. * @param {Function|Object} [object=lodash] The destination object.
  16485. * @param {Object} source The object of functions to add.
  16486. * @param {Object} [options={}] The options object.
  16487. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16488. * @returns {Function|Object} Returns `object`.
  16489. * @example
  16490. *
  16491. * function vowels(string) {
  16492. * return _.filter(string, function(v) {
  16493. * return /[aeiou]/i.test(v);
  16494. * });
  16495. * }
  16496. *
  16497. * _.mixin({ 'vowels': vowels });
  16498. * _.vowels('fred');
  16499. * // => ['e']
  16500. *
  16501. * _('fred').vowels().value();
  16502. * // => ['e']
  16503. *
  16504. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16505. * _('fred').vowels();
  16506. * // => ['e']
  16507. */
  16508. function mixin(object, source, options) {
  16509. var props = keys(source),
  16510. methodNames = baseFunctions(source, props);
  16511. if (options == null &&
  16512. !(isObject(source) && (methodNames.length || !props.length))) {
  16513. options = source;
  16514. source = object;
  16515. object = this;
  16516. methodNames = baseFunctions(source, keys(source));
  16517. }
  16518. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16519. isFunc = isFunction(object);
  16520. arrayEach(methodNames, function(methodName) {
  16521. var func = source[methodName];
  16522. object[methodName] = func;
  16523. if (isFunc) {
  16524. object.prototype[methodName] = function() {
  16525. var chainAll = this.__chain__;
  16526. if (chain || chainAll) {
  16527. var result = object(this.__wrapped__),
  16528. actions = result.__actions__ = copyArray(this.__actions__);
  16529. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16530. result.__chain__ = chainAll;
  16531. return result;
  16532. }
  16533. return func.apply(object, arrayPush([this.value()], arguments));
  16534. };
  16535. }
  16536. });
  16537. return object;
  16538. }
  16539. /**
  16540. * Reverts the `_` variable to its previous value and returns a reference to
  16541. * the `lodash` function.
  16542. *
  16543. * @static
  16544. * @since 0.1.0
  16545. * @memberOf _
  16546. * @category Util
  16547. * @returns {Function} Returns the `lodash` function.
  16548. * @example
  16549. *
  16550. * var lodash = _.noConflict();
  16551. */
  16552. function noConflict() {
  16553. if (root._ === this) {
  16554. root._ = oldDash;
  16555. }
  16556. return this;
  16557. }
  16558. /**
  16559. * This method returns `undefined`.
  16560. *
  16561. * @static
  16562. * @memberOf _
  16563. * @since 2.3.0
  16564. * @category Util
  16565. * @example
  16566. *
  16567. * _.times(2, _.noop);
  16568. * // => [undefined, undefined]
  16569. */
  16570. function noop() {
  16571. // No operation performed.
  16572. }
  16573. /**
  16574. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16575. * the nth argument from the end is returned.
  16576. *
  16577. * @static
  16578. * @memberOf _
  16579. * @since 4.0.0
  16580. * @category Util
  16581. * @param {number} [n=0] The index of the argument to return.
  16582. * @returns {Function} Returns the new pass-thru function.
  16583. * @example
  16584. *
  16585. * var func = _.nthArg(1);
  16586. * func('a', 'b', 'c', 'd');
  16587. * // => 'b'
  16588. *
  16589. * var func = _.nthArg(-2);
  16590. * func('a', 'b', 'c', 'd');
  16591. * // => 'c'
  16592. */
  16593. function nthArg(n) {
  16594. n = toInteger(n);
  16595. return baseRest(function(args) {
  16596. return baseNth(args, n);
  16597. });
  16598. }
  16599. /**
  16600. * Creates a function that invokes `iteratees` with the arguments it receives
  16601. * and returns their results.
  16602. *
  16603. * @static
  16604. * @memberOf _
  16605. * @since 4.0.0
  16606. * @category Util
  16607. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16608. * The iteratees to invoke.
  16609. * @returns {Function} Returns the new function.
  16610. * @example
  16611. *
  16612. * var func = _.over([Math.max, Math.min]);
  16613. *
  16614. * func(1, 2, 3, 4);
  16615. * // => [4, 1]
  16616. */
  16617. var over = createOver(arrayMap);
  16618. /**
  16619. * Creates a function that checks if **all** of the `predicates` return
  16620. * truthy when invoked with the arguments it receives.
  16621. *
  16622. * Following shorthands are possible for providing predicates.
  16623. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16624. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16625. *
  16626. * @static
  16627. * @memberOf _
  16628. * @since 4.0.0
  16629. * @category Util
  16630. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16631. * The predicates to check.
  16632. * @returns {Function} Returns the new function.
  16633. * @example
  16634. *
  16635. * var func = _.overEvery([Boolean, isFinite]);
  16636. *
  16637. * func('1');
  16638. * // => true
  16639. *
  16640. * func(null);
  16641. * // => false
  16642. *
  16643. * func(NaN);
  16644. * // => false
  16645. */
  16646. var overEvery = createOver(arrayEvery);
  16647. /**
  16648. * Creates a function that checks if **any** of the `predicates` return
  16649. * truthy when invoked with the arguments it receives.
  16650. *
  16651. * Following shorthands are possible for providing predicates.
  16652. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16653. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16654. *
  16655. * @static
  16656. * @memberOf _
  16657. * @since 4.0.0
  16658. * @category Util
  16659. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16660. * The predicates to check.
  16661. * @returns {Function} Returns the new function.
  16662. * @example
  16663. *
  16664. * var func = _.overSome([Boolean, isFinite]);
  16665. *
  16666. * func('1');
  16667. * // => true
  16668. *
  16669. * func(null);
  16670. * // => true
  16671. *
  16672. * func(NaN);
  16673. * // => false
  16674. *
  16675. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16676. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16677. */
  16678. var overSome = createOver(arraySome);
  16679. /**
  16680. * Creates a function that returns the value at `path` of a given object.
  16681. *
  16682. * @static
  16683. * @memberOf _
  16684. * @since 2.4.0
  16685. * @category Util
  16686. * @param {Array|string} path The path of the property to get.
  16687. * @returns {Function} Returns the new accessor function.
  16688. * @example
  16689. *
  16690. * var objects = [
  16691. * { 'a': { 'b': 2 } },
  16692. * { 'a': { 'b': 1 } }
  16693. * ];
  16694. *
  16695. * _.map(objects, _.property('a.b'));
  16696. * // => [2, 1]
  16697. *
  16698. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16699. * // => [1, 2]
  16700. */
  16701. function property(path) {
  16702. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16703. }
  16704. /**
  16705. * The opposite of `_.property`; this method creates a function that returns
  16706. * the value at a given path of `object`.
  16707. *
  16708. * @static
  16709. * @memberOf _
  16710. * @since 3.0.0
  16711. * @category Util
  16712. * @param {Object} object The object to query.
  16713. * @returns {Function} Returns the new accessor function.
  16714. * @example
  16715. *
  16716. * var array = [0, 1, 2],
  16717. * object = { 'a': array, 'b': array, 'c': array };
  16718. *
  16719. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16720. * // => [2, 0]
  16721. *
  16722. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16723. * // => [2, 0]
  16724. */
  16725. function propertyOf(object) {
  16726. return function(path) {
  16727. return object == null ? undefined : baseGet(object, path);
  16728. };
  16729. }
  16730. /**
  16731. * Creates an array of numbers (positive and/or negative) progressing from
  16732. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16733. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16734. * it's set to `start` with `start` then set to `0`.
  16735. *
  16736. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16737. * floating-point values which can produce unexpected results.
  16738. *
  16739. * @static
  16740. * @since 0.1.0
  16741. * @memberOf _
  16742. * @category Util
  16743. * @param {number} [start=0] The start of the range.
  16744. * @param {number} end The end of the range.
  16745. * @param {number} [step=1] The value to increment or decrement by.
  16746. * @returns {Array} Returns the range of numbers.
  16747. * @see _.inRange, _.rangeRight
  16748. * @example
  16749. *
  16750. * _.range(4);
  16751. * // => [0, 1, 2, 3]
  16752. *
  16753. * _.range(-4);
  16754. * // => [0, -1, -2, -3]
  16755. *
  16756. * _.range(1, 5);
  16757. * // => [1, 2, 3, 4]
  16758. *
  16759. * _.range(0, 20, 5);
  16760. * // => [0, 5, 10, 15]
  16761. *
  16762. * _.range(0, -4, -1);
  16763. * // => [0, -1, -2, -3]
  16764. *
  16765. * _.range(1, 4, 0);
  16766. * // => [1, 1, 1]
  16767. *
  16768. * _.range(0);
  16769. * // => []
  16770. */
  16771. var range = createRange();
  16772. /**
  16773. * This method is like `_.range` except that it populates values in
  16774. * descending order.
  16775. *
  16776. * @static
  16777. * @memberOf _
  16778. * @since 4.0.0
  16779. * @category Util
  16780. * @param {number} [start=0] The start of the range.
  16781. * @param {number} end The end of the range.
  16782. * @param {number} [step=1] The value to increment or decrement by.
  16783. * @returns {Array} Returns the range of numbers.
  16784. * @see _.inRange, _.range
  16785. * @example
  16786. *
  16787. * _.rangeRight(4);
  16788. * // => [3, 2, 1, 0]
  16789. *
  16790. * _.rangeRight(-4);
  16791. * // => [-3, -2, -1, 0]
  16792. *
  16793. * _.rangeRight(1, 5);
  16794. * // => [4, 3, 2, 1]
  16795. *
  16796. * _.rangeRight(0, 20, 5);
  16797. * // => [15, 10, 5, 0]
  16798. *
  16799. * _.rangeRight(0, -4, -1);
  16800. * // => [-3, -2, -1, 0]
  16801. *
  16802. * _.rangeRight(1, 4, 0);
  16803. * // => [1, 1, 1]
  16804. *
  16805. * _.rangeRight(0);
  16806. * // => []
  16807. */
  16808. var rangeRight = createRange(true);
  16809. /**
  16810. * This method returns a new empty array.
  16811. *
  16812. * @static
  16813. * @memberOf _
  16814. * @since 4.13.0
  16815. * @category Util
  16816. * @returns {Array} Returns the new empty array.
  16817. * @example
  16818. *
  16819. * var arrays = _.times(2, _.stubArray);
  16820. *
  16821. * console.log(arrays);
  16822. * // => [[], []]
  16823. *
  16824. * console.log(arrays[0] === arrays[1]);
  16825. * // => false
  16826. */
  16827. function stubArray() {
  16828. return [];
  16829. }
  16830. /**
  16831. * This method returns `false`.
  16832. *
  16833. * @static
  16834. * @memberOf _
  16835. * @since 4.13.0
  16836. * @category Util
  16837. * @returns {boolean} Returns `false`.
  16838. * @example
  16839. *
  16840. * _.times(2, _.stubFalse);
  16841. * // => [false, false]
  16842. */
  16843. function stubFalse() {
  16844. return false;
  16845. }
  16846. /**
  16847. * This method returns a new empty object.
  16848. *
  16849. * @static
  16850. * @memberOf _
  16851. * @since 4.13.0
  16852. * @category Util
  16853. * @returns {Object} Returns the new empty object.
  16854. * @example
  16855. *
  16856. * var objects = _.times(2, _.stubObject);
  16857. *
  16858. * console.log(objects);
  16859. * // => [{}, {}]
  16860. *
  16861. * console.log(objects[0] === objects[1]);
  16862. * // => false
  16863. */
  16864. function stubObject() {
  16865. return {};
  16866. }
  16867. /**
  16868. * This method returns an empty string.
  16869. *
  16870. * @static
  16871. * @memberOf _
  16872. * @since 4.13.0
  16873. * @category Util
  16874. * @returns {string} Returns the empty string.
  16875. * @example
  16876. *
  16877. * _.times(2, _.stubString);
  16878. * // => ['', '']
  16879. */
  16880. function stubString() {
  16881. return '';
  16882. }
  16883. /**
  16884. * This method returns `true`.
  16885. *
  16886. * @static
  16887. * @memberOf _
  16888. * @since 4.13.0
  16889. * @category Util
  16890. * @returns {boolean} Returns `true`.
  16891. * @example
  16892. *
  16893. * _.times(2, _.stubTrue);
  16894. * // => [true, true]
  16895. */
  16896. function stubTrue() {
  16897. return true;
  16898. }
  16899. /**
  16900. * Invokes the iteratee `n` times, returning an array of the results of
  16901. * each invocation. The iteratee is invoked with one argument; (index).
  16902. *
  16903. * @static
  16904. * @since 0.1.0
  16905. * @memberOf _
  16906. * @category Util
  16907. * @param {number} n The number of times to invoke `iteratee`.
  16908. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16909. * @returns {Array} Returns the array of results.
  16910. * @example
  16911. *
  16912. * _.times(3, String);
  16913. * // => ['0', '1', '2']
  16914. *
  16915. * _.times(4, _.constant(0));
  16916. * // => [0, 0, 0, 0]
  16917. */
  16918. function times(n, iteratee) {
  16919. n = toInteger(n);
  16920. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16921. return [];
  16922. }
  16923. var index = MAX_ARRAY_LENGTH,
  16924. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16925. iteratee = getIteratee(iteratee);
  16926. n -= MAX_ARRAY_LENGTH;
  16927. var result = baseTimes(length, iteratee);
  16928. while (++index < n) {
  16929. iteratee(index);
  16930. }
  16931. return result;
  16932. }
  16933. /**
  16934. * Converts `value` to a property path array.
  16935. *
  16936. * @static
  16937. * @memberOf _
  16938. * @since 4.0.0
  16939. * @category Util
  16940. * @param {*} value The value to convert.
  16941. * @returns {Array} Returns the new property path array.
  16942. * @example
  16943. *
  16944. * _.toPath('a.b.c');
  16945. * // => ['a', 'b', 'c']
  16946. *
  16947. * _.toPath('a[0].b.c');
  16948. * // => ['a', '0', 'b', 'c']
  16949. */
  16950. function toPath(value) {
  16951. if (isArray(value)) {
  16952. return arrayMap(value, toKey);
  16953. }
  16954. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16955. }
  16956. /**
  16957. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16958. *
  16959. * @static
  16960. * @since 0.1.0
  16961. * @memberOf _
  16962. * @category Util
  16963. * @param {string} [prefix=''] The value to prefix the ID with.
  16964. * @returns {string} Returns the unique ID.
  16965. * @example
  16966. *
  16967. * _.uniqueId('contact_');
  16968. * // => 'contact_104'
  16969. *
  16970. * _.uniqueId();
  16971. * // => '105'
  16972. */
  16973. function uniqueId(prefix) {
  16974. var id = ++idCounter;
  16975. return toString(prefix) + id;
  16976. }
  16977. /*------------------------------------------------------------------------*/
  16978. /**
  16979. * Adds two numbers.
  16980. *
  16981. * @static
  16982. * @memberOf _
  16983. * @since 3.4.0
  16984. * @category Math
  16985. * @param {number} augend The first number in an addition.
  16986. * @param {number} addend The second number in an addition.
  16987. * @returns {number} Returns the total.
  16988. * @example
  16989. *
  16990. * _.add(6, 4);
  16991. * // => 10
  16992. */
  16993. var add = createMathOperation(function(augend, addend) {
  16994. return augend + addend;
  16995. }, 0);
  16996. /**
  16997. * Computes `number` rounded up to `precision`.
  16998. *
  16999. * @static
  17000. * @memberOf _
  17001. * @since 3.10.0
  17002. * @category Math
  17003. * @param {number} number The number to round up.
  17004. * @param {number} [precision=0] The precision to round up to.
  17005. * @returns {number} Returns the rounded up number.
  17006. * @example
  17007. *
  17008. * _.ceil(4.006);
  17009. * // => 5
  17010. *
  17011. * _.ceil(6.004, 2);
  17012. * // => 6.01
  17013. *
  17014. * _.ceil(6040, -2);
  17015. * // => 6100
  17016. */
  17017. var ceil = createRound('ceil');
  17018. /**
  17019. * Divide two numbers.
  17020. *
  17021. * @static
  17022. * @memberOf _
  17023. * @since 4.7.0
  17024. * @category Math
  17025. * @param {number} dividend The first number in a division.
  17026. * @param {number} divisor The second number in a division.
  17027. * @returns {number} Returns the quotient.
  17028. * @example
  17029. *
  17030. * _.divide(6, 4);
  17031. * // => 1.5
  17032. */
  17033. var divide = createMathOperation(function(dividend, divisor) {
  17034. return dividend / divisor;
  17035. }, 1);
  17036. /**
  17037. * Computes `number` rounded down to `precision`.
  17038. *
  17039. * @static
  17040. * @memberOf _
  17041. * @since 3.10.0
  17042. * @category Math
  17043. * @param {number} number The number to round down.
  17044. * @param {number} [precision=0] The precision to round down to.
  17045. * @returns {number} Returns the rounded down number.
  17046. * @example
  17047. *
  17048. * _.floor(4.006);
  17049. * // => 4
  17050. *
  17051. * _.floor(0.046, 2);
  17052. * // => 0.04
  17053. *
  17054. * _.floor(4060, -2);
  17055. * // => 4000
  17056. */
  17057. var floor = createRound('floor');
  17058. /**
  17059. * Computes the maximum value of `array`. If `array` is empty or falsey,
  17060. * `undefined` is returned.
  17061. *
  17062. * @static
  17063. * @since 0.1.0
  17064. * @memberOf _
  17065. * @category Math
  17066. * @param {Array} array The array to iterate over.
  17067. * @returns {*} Returns the maximum value.
  17068. * @example
  17069. *
  17070. * _.max([4, 2, 8, 6]);
  17071. * // => 8
  17072. *
  17073. * _.max([]);
  17074. * // => undefined
  17075. */
  17076. function max(array) {
  17077. return (array && array.length)
  17078. ? baseExtremum(array, identity, baseGt)
  17079. : undefined;
  17080. }
  17081. /**
  17082. * This method is like `_.max` except that it accepts `iteratee` which is
  17083. * invoked for each element in `array` to generate the criterion by which
  17084. * the value is ranked. The iteratee is invoked with one argument: (value).
  17085. *
  17086. * @static
  17087. * @memberOf _
  17088. * @since 4.0.0
  17089. * @category Math
  17090. * @param {Array} array The array to iterate over.
  17091. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17092. * @returns {*} Returns the maximum value.
  17093. * @example
  17094. *
  17095. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17096. *
  17097. * _.maxBy(objects, function(o) { return o.n; });
  17098. * // => { 'n': 2 }
  17099. *
  17100. * // The `_.property` iteratee shorthand.
  17101. * _.maxBy(objects, 'n');
  17102. * // => { 'n': 2 }
  17103. */
  17104. function maxBy(array, iteratee) {
  17105. return (array && array.length)
  17106. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  17107. : undefined;
  17108. }
  17109. /**
  17110. * Computes the mean of the values in `array`.
  17111. *
  17112. * @static
  17113. * @memberOf _
  17114. * @since 4.0.0
  17115. * @category Math
  17116. * @param {Array} array The array to iterate over.
  17117. * @returns {number} Returns the mean.
  17118. * @example
  17119. *
  17120. * _.mean([4, 2, 8, 6]);
  17121. * // => 5
  17122. */
  17123. function mean(array) {
  17124. return baseMean(array, identity);
  17125. }
  17126. /**
  17127. * This method is like `_.mean` except that it accepts `iteratee` which is
  17128. * invoked for each element in `array` to generate the value to be averaged.
  17129. * The iteratee is invoked with one argument: (value).
  17130. *
  17131. * @static
  17132. * @memberOf _
  17133. * @since 4.7.0
  17134. * @category Math
  17135. * @param {Array} array The array to iterate over.
  17136. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17137. * @returns {number} Returns the mean.
  17138. * @example
  17139. *
  17140. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17141. *
  17142. * _.meanBy(objects, function(o) { return o.n; });
  17143. * // => 5
  17144. *
  17145. * // The `_.property` iteratee shorthand.
  17146. * _.meanBy(objects, 'n');
  17147. * // => 5
  17148. */
  17149. function meanBy(array, iteratee) {
  17150. return baseMean(array, getIteratee(iteratee, 2));
  17151. }
  17152. /**
  17153. * Computes the minimum value of `array`. If `array` is empty or falsey,
  17154. * `undefined` is returned.
  17155. *
  17156. * @static
  17157. * @since 0.1.0
  17158. * @memberOf _
  17159. * @category Math
  17160. * @param {Array} array The array to iterate over.
  17161. * @returns {*} Returns the minimum value.
  17162. * @example
  17163. *
  17164. * _.min([4, 2, 8, 6]);
  17165. * // => 2
  17166. *
  17167. * _.min([]);
  17168. * // => undefined
  17169. */
  17170. function min(array) {
  17171. return (array && array.length)
  17172. ? baseExtremum(array, identity, baseLt)
  17173. : undefined;
  17174. }
  17175. /**
  17176. * This method is like `_.min` except that it accepts `iteratee` which is
  17177. * invoked for each element in `array` to generate the criterion by which
  17178. * the value is ranked. The iteratee is invoked with one argument: (value).
  17179. *
  17180. * @static
  17181. * @memberOf _
  17182. * @since 4.0.0
  17183. * @category Math
  17184. * @param {Array} array The array to iterate over.
  17185. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17186. * @returns {*} Returns the minimum value.
  17187. * @example
  17188. *
  17189. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17190. *
  17191. * _.minBy(objects, function(o) { return o.n; });
  17192. * // => { 'n': 1 }
  17193. *
  17194. * // The `_.property` iteratee shorthand.
  17195. * _.minBy(objects, 'n');
  17196. * // => { 'n': 1 }
  17197. */
  17198. function minBy(array, iteratee) {
  17199. return (array && array.length)
  17200. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  17201. : undefined;
  17202. }
  17203. /**
  17204. * Multiply two numbers.
  17205. *
  17206. * @static
  17207. * @memberOf _
  17208. * @since 4.7.0
  17209. * @category Math
  17210. * @param {number} multiplier The first number in a multiplication.
  17211. * @param {number} multiplicand The second number in a multiplication.
  17212. * @returns {number} Returns the product.
  17213. * @example
  17214. *
  17215. * _.multiply(6, 4);
  17216. * // => 24
  17217. */
  17218. var multiply = createMathOperation(function(multiplier, multiplicand) {
  17219. return multiplier * multiplicand;
  17220. }, 1);
  17221. /**
  17222. * Computes `number` rounded to `precision`.
  17223. *
  17224. * @static
  17225. * @memberOf _
  17226. * @since 3.10.0
  17227. * @category Math
  17228. * @param {number} number The number to round.
  17229. * @param {number} [precision=0] The precision to round to.
  17230. * @returns {number} Returns the rounded number.
  17231. * @example
  17232. *
  17233. * _.round(4.006);
  17234. * // => 4
  17235. *
  17236. * _.round(4.006, 2);
  17237. * // => 4.01
  17238. *
  17239. * _.round(4060, -2);
  17240. * // => 4100
  17241. */
  17242. var round = createRound('round');
  17243. /**
  17244. * Subtract two numbers.
  17245. *
  17246. * @static
  17247. * @memberOf _
  17248. * @since 4.0.0
  17249. * @category Math
  17250. * @param {number} minuend The first number in a subtraction.
  17251. * @param {number} subtrahend The second number in a subtraction.
  17252. * @returns {number} Returns the difference.
  17253. * @example
  17254. *
  17255. * _.subtract(6, 4);
  17256. * // => 2
  17257. */
  17258. var subtract = createMathOperation(function(minuend, subtrahend) {
  17259. return minuend - subtrahend;
  17260. }, 0);
  17261. /**
  17262. * Computes the sum of the values in `array`.
  17263. *
  17264. * @static
  17265. * @memberOf _
  17266. * @since 3.4.0
  17267. * @category Math
  17268. * @param {Array} array The array to iterate over.
  17269. * @returns {number} Returns the sum.
  17270. * @example
  17271. *
  17272. * _.sum([4, 2, 8, 6]);
  17273. * // => 20
  17274. */
  17275. function sum(array) {
  17276. return (array && array.length)
  17277. ? baseSum(array, identity)
  17278. : 0;
  17279. }
  17280. /**
  17281. * This method is like `_.sum` except that it accepts `iteratee` which is
  17282. * invoked for each element in `array` to generate the value to be summed.
  17283. * The iteratee is invoked with one argument: (value).
  17284. *
  17285. * @static
  17286. * @memberOf _
  17287. * @since 4.0.0
  17288. * @category Math
  17289. * @param {Array} array The array to iterate over.
  17290. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17291. * @returns {number} Returns the sum.
  17292. * @example
  17293. *
  17294. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17295. *
  17296. * _.sumBy(objects, function(o) { return o.n; });
  17297. * // => 20
  17298. *
  17299. * // The `_.property` iteratee shorthand.
  17300. * _.sumBy(objects, 'n');
  17301. * // => 20
  17302. */
  17303. function sumBy(array, iteratee) {
  17304. return (array && array.length)
  17305. ? baseSum(array, getIteratee(iteratee, 2))
  17306. : 0;
  17307. }
  17308. /*------------------------------------------------------------------------*/
  17309. // Add methods that return wrapped values in chain sequences.
  17310. lodash.after = after;
  17311. lodash.ary = ary;
  17312. lodash.assign = assign;
  17313. lodash.assignIn = assignIn;
  17314. lodash.assignInWith = assignInWith;
  17315. lodash.assignWith = assignWith;
  17316. lodash.at = at;
  17317. lodash.before = before;
  17318. lodash.bind = bind;
  17319. lodash.bindAll = bindAll;
  17320. lodash.bindKey = bindKey;
  17321. lodash.castArray = castArray;
  17322. lodash.chain = chain;
  17323. lodash.chunk = chunk;
  17324. lodash.compact = compact;
  17325. lodash.concat = concat;
  17326. lodash.cond = cond;
  17327. lodash.conforms = conforms;
  17328. lodash.constant = constant;
  17329. lodash.countBy = countBy;
  17330. lodash.create = create;
  17331. lodash.curry = curry;
  17332. lodash.curryRight = curryRight;
  17333. lodash.debounce = debounce;
  17334. lodash.defaults = defaults;
  17335. lodash.defaultsDeep = defaultsDeep;
  17336. lodash.defer = defer;
  17337. lodash.delay = delay;
  17338. lodash.difference = difference;
  17339. lodash.differenceBy = differenceBy;
  17340. lodash.differenceWith = differenceWith;
  17341. lodash.drop = drop;
  17342. lodash.dropRight = dropRight;
  17343. lodash.dropRightWhile = dropRightWhile;
  17344. lodash.dropWhile = dropWhile;
  17345. lodash.fill = fill;
  17346. lodash.filter = filter;
  17347. lodash.flatMap = flatMap;
  17348. lodash.flatMapDeep = flatMapDeep;
  17349. lodash.flatMapDepth = flatMapDepth;
  17350. lodash.flatten = flatten;
  17351. lodash.flattenDeep = flattenDeep;
  17352. lodash.flattenDepth = flattenDepth;
  17353. lodash.flip = flip;
  17354. lodash.flow = flow;
  17355. lodash.flowRight = flowRight;
  17356. lodash.fromPairs = fromPairs;
  17357. lodash.functions = functions;
  17358. lodash.functionsIn = functionsIn;
  17359. lodash.groupBy = groupBy;
  17360. lodash.initial = initial;
  17361. lodash.intersection = intersection;
  17362. lodash.intersectionBy = intersectionBy;
  17363. lodash.intersectionWith = intersectionWith;
  17364. lodash.invert = invert;
  17365. lodash.invertBy = invertBy;
  17366. lodash.invokeMap = invokeMap;
  17367. lodash.iteratee = iteratee;
  17368. lodash.keyBy = keyBy;
  17369. lodash.keys = keys;
  17370. lodash.keysIn = keysIn;
  17371. lodash.map = map;
  17372. lodash.mapKeys = mapKeys;
  17373. lodash.mapValues = mapValues;
  17374. lodash.matches = matches;
  17375. lodash.matchesProperty = matchesProperty;
  17376. lodash.memoize = memoize;
  17377. lodash.merge = merge;
  17378. lodash.mergeWith = mergeWith;
  17379. lodash.method = method;
  17380. lodash.methodOf = methodOf;
  17381. lodash.mixin = mixin;
  17382. lodash.negate = negate;
  17383. lodash.nthArg = nthArg;
  17384. lodash.omit = omit;
  17385. lodash.omitBy = omitBy;
  17386. lodash.once = once;
  17387. lodash.orderBy = orderBy;
  17388. lodash.over = over;
  17389. lodash.overArgs = overArgs;
  17390. lodash.overEvery = overEvery;
  17391. lodash.overSome = overSome;
  17392. lodash.partial = partial;
  17393. lodash.partialRight = partialRight;
  17394. lodash.partition = partition;
  17395. lodash.pick = pick;
  17396. lodash.pickBy = pickBy;
  17397. lodash.property = property;
  17398. lodash.propertyOf = propertyOf;
  17399. lodash.pull = pull;
  17400. lodash.pullAll = pullAll;
  17401. lodash.pullAllBy = pullAllBy;
  17402. lodash.pullAllWith = pullAllWith;
  17403. lodash.pullAt = pullAt;
  17404. lodash.range = range;
  17405. lodash.rangeRight = rangeRight;
  17406. lodash.rearg = rearg;
  17407. lodash.reject = reject;
  17408. lodash.remove = remove;
  17409. lodash.rest = rest;
  17410. lodash.reverse = reverse;
  17411. lodash.sampleSize = sampleSize;
  17412. lodash.set = set;
  17413. lodash.setWith = setWith;
  17414. lodash.shuffle = shuffle;
  17415. lodash.slice = slice;
  17416. lodash.sortBy = sortBy;
  17417. lodash.sortedUniq = sortedUniq;
  17418. lodash.sortedUniqBy = sortedUniqBy;
  17419. lodash.split = split;
  17420. lodash.spread = spread;
  17421. lodash.tail = tail;
  17422. lodash.take = take;
  17423. lodash.takeRight = takeRight;
  17424. lodash.takeRightWhile = takeRightWhile;
  17425. lodash.takeWhile = takeWhile;
  17426. lodash.tap = tap;
  17427. lodash.throttle = throttle;
  17428. lodash.thru = thru;
  17429. lodash.toArray = toArray;
  17430. lodash.toPairs = toPairs;
  17431. lodash.toPairsIn = toPairsIn;
  17432. lodash.toPath = toPath;
  17433. lodash.toPlainObject = toPlainObject;
  17434. lodash.transform = transform;
  17435. lodash.unary = unary;
  17436. lodash.union = union;
  17437. lodash.unionBy = unionBy;
  17438. lodash.unionWith = unionWith;
  17439. lodash.uniq = uniq;
  17440. lodash.uniqBy = uniqBy;
  17441. lodash.uniqWith = uniqWith;
  17442. lodash.unset = unset;
  17443. lodash.unzip = unzip;
  17444. lodash.unzipWith = unzipWith;
  17445. lodash.update = update;
  17446. lodash.updateWith = updateWith;
  17447. lodash.values = values;
  17448. lodash.valuesIn = valuesIn;
  17449. lodash.without = without;
  17450. lodash.words = words;
  17451. lodash.wrap = wrap;
  17452. lodash.xor = xor;
  17453. lodash.xorBy = xorBy;
  17454. lodash.xorWith = xorWith;
  17455. lodash.zip = zip;
  17456. lodash.zipObject = zipObject;
  17457. lodash.zipObjectDeep = zipObjectDeep;
  17458. lodash.zipWith = zipWith;
  17459. // Add aliases.
  17460. lodash.entries = toPairs;
  17461. lodash.entriesIn = toPairsIn;
  17462. lodash.extend = assignIn;
  17463. lodash.extendWith = assignInWith;
  17464. // Add methods to `lodash.prototype`.
  17465. mixin(lodash, lodash);
  17466. /*------------------------------------------------------------------------*/
  17467. // Add methods that return unwrapped values in chain sequences.
  17468. lodash.add = add;
  17469. lodash.attempt = attempt;
  17470. lodash.camelCase = camelCase;
  17471. lodash.capitalize = capitalize;
  17472. lodash.ceil = ceil;
  17473. lodash.clamp = clamp;
  17474. lodash.clone = clone;
  17475. lodash.cloneDeep = cloneDeep;
  17476. lodash.cloneDeepWith = cloneDeepWith;
  17477. lodash.cloneWith = cloneWith;
  17478. lodash.conformsTo = conformsTo;
  17479. lodash.deburr = deburr;
  17480. lodash.defaultTo = defaultTo;
  17481. lodash.divide = divide;
  17482. lodash.endsWith = endsWith;
  17483. lodash.eq = eq;
  17484. lodash.escape = escape;
  17485. lodash.escapeRegExp = escapeRegExp;
  17486. lodash.every = every;
  17487. lodash.find = find;
  17488. lodash.findIndex = findIndex;
  17489. lodash.findKey = findKey;
  17490. lodash.findLast = findLast;
  17491. lodash.findLastIndex = findLastIndex;
  17492. lodash.findLastKey = findLastKey;
  17493. lodash.floor = floor;
  17494. lodash.forEach = forEach;
  17495. lodash.forEachRight = forEachRight;
  17496. lodash.forIn = forIn;
  17497. lodash.forInRight = forInRight;
  17498. lodash.forOwn = forOwn;
  17499. lodash.forOwnRight = forOwnRight;
  17500. lodash.get = get;
  17501. lodash.gt = gt;
  17502. lodash.gte = gte;
  17503. lodash.has = has;
  17504. lodash.hasIn = hasIn;
  17505. lodash.head = head;
  17506. lodash.identity = identity;
  17507. lodash.includes = includes;
  17508. lodash.indexOf = indexOf;
  17509. lodash.inRange = inRange;
  17510. lodash.invoke = invoke;
  17511. lodash.isArguments = isArguments;
  17512. lodash.isArray = isArray;
  17513. lodash.isArrayBuffer = isArrayBuffer;
  17514. lodash.isArrayLike = isArrayLike;
  17515. lodash.isArrayLikeObject = isArrayLikeObject;
  17516. lodash.isBoolean = isBoolean;
  17517. lodash.isBuffer = isBuffer;
  17518. lodash.isDate = isDate;
  17519. lodash.isElement = isElement;
  17520. lodash.isEmpty = isEmpty;
  17521. lodash.isEqual = isEqual;
  17522. lodash.isEqualWith = isEqualWith;
  17523. lodash.isError = isError;
  17524. lodash.isFinite = isFinite;
  17525. lodash.isFunction = isFunction;
  17526. lodash.isInteger = isInteger;
  17527. lodash.isLength = isLength;
  17528. lodash.isMap = isMap;
  17529. lodash.isMatch = isMatch;
  17530. lodash.isMatchWith = isMatchWith;
  17531. lodash.isNaN = isNaN;
  17532. lodash.isNative = isNative;
  17533. lodash.isNil = isNil;
  17534. lodash.isNull = isNull;
  17535. lodash.isNumber = isNumber;
  17536. lodash.isObject = isObject;
  17537. lodash.isObjectLike = isObjectLike;
  17538. lodash.isPlainObject = isPlainObject;
  17539. lodash.isRegExp = isRegExp;
  17540. lodash.isSafeInteger = isSafeInteger;
  17541. lodash.isSet = isSet;
  17542. lodash.isString = isString;
  17543. lodash.isSymbol = isSymbol;
  17544. lodash.isTypedArray = isTypedArray;
  17545. lodash.isUndefined = isUndefined;
  17546. lodash.isWeakMap = isWeakMap;
  17547. lodash.isWeakSet = isWeakSet;
  17548. lodash.join = join;
  17549. lodash.kebabCase = kebabCase;
  17550. lodash.last = last;
  17551. lodash.lastIndexOf = lastIndexOf;
  17552. lodash.lowerCase = lowerCase;
  17553. lodash.lowerFirst = lowerFirst;
  17554. lodash.lt = lt;
  17555. lodash.lte = lte;
  17556. lodash.max = max;
  17557. lodash.maxBy = maxBy;
  17558. lodash.mean = mean;
  17559. lodash.meanBy = meanBy;
  17560. lodash.min = min;
  17561. lodash.minBy = minBy;
  17562. lodash.stubArray = stubArray;
  17563. lodash.stubFalse = stubFalse;
  17564. lodash.stubObject = stubObject;
  17565. lodash.stubString = stubString;
  17566. lodash.stubTrue = stubTrue;
  17567. lodash.multiply = multiply;
  17568. lodash.nth = nth;
  17569. lodash.noConflict = noConflict;
  17570. lodash.noop = noop;
  17571. lodash.now = now;
  17572. lodash.pad = pad;
  17573. lodash.padEnd = padEnd;
  17574. lodash.padStart = padStart;
  17575. lodash.parseInt = parseInt;
  17576. lodash.random = random;
  17577. lodash.reduce = reduce;
  17578. lodash.reduceRight = reduceRight;
  17579. lodash.repeat = repeat;
  17580. lodash.replace = replace;
  17581. lodash.result = result;
  17582. lodash.round = round;
  17583. lodash.runInContext = runInContext;
  17584. lodash.sample = sample;
  17585. lodash.size = size;
  17586. lodash.snakeCase = snakeCase;
  17587. lodash.some = some;
  17588. lodash.sortedIndex = sortedIndex;
  17589. lodash.sortedIndexBy = sortedIndexBy;
  17590. lodash.sortedIndexOf = sortedIndexOf;
  17591. lodash.sortedLastIndex = sortedLastIndex;
  17592. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17593. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17594. lodash.startCase = startCase;
  17595. lodash.startsWith = startsWith;
  17596. lodash.subtract = subtract;
  17597. lodash.sum = sum;
  17598. lodash.sumBy = sumBy;
  17599. lodash.template = template;
  17600. lodash.times = times;
  17601. lodash.toFinite = toFinite;
  17602. lodash.toInteger = toInteger;
  17603. lodash.toLength = toLength;
  17604. lodash.toLower = toLower;
  17605. lodash.toNumber = toNumber;
  17606. lodash.toSafeInteger = toSafeInteger;
  17607. lodash.toString = toString;
  17608. lodash.toUpper = toUpper;
  17609. lodash.trim = trim;
  17610. lodash.trimEnd = trimEnd;
  17611. lodash.trimStart = trimStart;
  17612. lodash.truncate = truncate;
  17613. lodash.unescape = unescape;
  17614. lodash.uniqueId = uniqueId;
  17615. lodash.upperCase = upperCase;
  17616. lodash.upperFirst = upperFirst;
  17617. // Add aliases.
  17618. lodash.each = forEach;
  17619. lodash.eachRight = forEachRight;
  17620. lodash.first = head;
  17621. mixin(lodash, (function() {
  17622. var source = {};
  17623. baseForOwn(lodash, function(func, methodName) {
  17624. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17625. source[methodName] = func;
  17626. }
  17627. });
  17628. return source;
  17629. }()), { 'chain': false });
  17630. /*------------------------------------------------------------------------*/
  17631. /**
  17632. * The semantic version number.
  17633. *
  17634. * @static
  17635. * @memberOf _
  17636. * @type {string}
  17637. */
  17638. lodash.VERSION = VERSION;
  17639. // Assign default placeholders.
  17640. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17641. lodash[methodName].placeholder = lodash;
  17642. });
  17643. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17644. arrayEach(['drop', 'take'], function(methodName, index) {
  17645. LazyWrapper.prototype[methodName] = function(n) {
  17646. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17647. var result = (this.__filtered__ && !index)
  17648. ? new LazyWrapper(this)
  17649. : this.clone();
  17650. if (result.__filtered__) {
  17651. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17652. } else {
  17653. result.__views__.push({
  17654. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17655. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17656. });
  17657. }
  17658. return result;
  17659. };
  17660. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17661. return this.reverse()[methodName](n).reverse();
  17662. };
  17663. });
  17664. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17665. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17666. var type = index + 1,
  17667. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17668. LazyWrapper.prototype[methodName] = function(iteratee) {
  17669. var result = this.clone();
  17670. result.__iteratees__.push({
  17671. 'iteratee': getIteratee(iteratee, 3),
  17672. 'type': type
  17673. });
  17674. result.__filtered__ = result.__filtered__ || isFilter;
  17675. return result;
  17676. };
  17677. });
  17678. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17679. arrayEach(['head', 'last'], function(methodName, index) {
  17680. var takeName = 'take' + (index ? 'Right' : '');
  17681. LazyWrapper.prototype[methodName] = function() {
  17682. return this[takeName](1).value()[0];
  17683. };
  17684. });
  17685. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17686. arrayEach(['initial', 'tail'], function(methodName, index) {
  17687. var dropName = 'drop' + (index ? '' : 'Right');
  17688. LazyWrapper.prototype[methodName] = function() {
  17689. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17690. };
  17691. });
  17692. LazyWrapper.prototype.compact = function() {
  17693. return this.filter(identity);
  17694. };
  17695. LazyWrapper.prototype.find = function(predicate) {
  17696. return this.filter(predicate).head();
  17697. };
  17698. LazyWrapper.prototype.findLast = function(predicate) {
  17699. return this.reverse().find(predicate);
  17700. };
  17701. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17702. if (typeof path == 'function') {
  17703. return new LazyWrapper(this);
  17704. }
  17705. return this.map(function(value) {
  17706. return baseInvoke(value, path, args);
  17707. });
  17708. });
  17709. LazyWrapper.prototype.reject = function(predicate) {
  17710. return this.filter(negate(getIteratee(predicate)));
  17711. };
  17712. LazyWrapper.prototype.slice = function(start, end) {
  17713. start = toInteger(start);
  17714. var result = this;
  17715. if (result.__filtered__ && (start > 0 || end < 0)) {
  17716. return new LazyWrapper(result);
  17717. }
  17718. if (start < 0) {
  17719. result = result.takeRight(-start);
  17720. } else if (start) {
  17721. result = result.drop(start);
  17722. }
  17723. if (end !== undefined) {
  17724. end = toInteger(end);
  17725. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17726. }
  17727. return result;
  17728. };
  17729. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17730. return this.reverse().takeWhile(predicate).reverse();
  17731. };
  17732. LazyWrapper.prototype.toArray = function() {
  17733. return this.take(MAX_ARRAY_LENGTH);
  17734. };
  17735. // Add `LazyWrapper` methods to `lodash.prototype`.
  17736. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17737. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17738. isTaker = /^(?:head|last)$/.test(methodName),
  17739. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17740. retUnwrapped = isTaker || /^find/.test(methodName);
  17741. if (!lodashFunc) {
  17742. return;
  17743. }
  17744. lodash.prototype[methodName] = function() {
  17745. var value = this.__wrapped__,
  17746. args = isTaker ? [1] : arguments,
  17747. isLazy = value instanceof LazyWrapper,
  17748. iteratee = args[0],
  17749. useLazy = isLazy || isArray(value);
  17750. var interceptor = function(value) {
  17751. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17752. return (isTaker && chainAll) ? result[0] : result;
  17753. };
  17754. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17755. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17756. isLazy = useLazy = false;
  17757. }
  17758. var chainAll = this.__chain__,
  17759. isHybrid = !!this.__actions__.length,
  17760. isUnwrapped = retUnwrapped && !chainAll,
  17761. onlyLazy = isLazy && !isHybrid;
  17762. if (!retUnwrapped && useLazy) {
  17763. value = onlyLazy ? value : new LazyWrapper(this);
  17764. var result = func.apply(value, args);
  17765. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17766. return new LodashWrapper(result, chainAll);
  17767. }
  17768. if (isUnwrapped && onlyLazy) {
  17769. return func.apply(this, args);
  17770. }
  17771. result = this.thru(interceptor);
  17772. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17773. };
  17774. });
  17775. // Add `Array` methods to `lodash.prototype`.
  17776. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17777. var func = arrayProto[methodName],
  17778. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17779. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17780. lodash.prototype[methodName] = function() {
  17781. var args = arguments;
  17782. if (retUnwrapped && !this.__chain__) {
  17783. var value = this.value();
  17784. return func.apply(isArray(value) ? value : [], args);
  17785. }
  17786. return this[chainName](function(value) {
  17787. return func.apply(isArray(value) ? value : [], args);
  17788. });
  17789. };
  17790. });
  17791. // Map minified method names to their real names.
  17792. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17793. var lodashFunc = lodash[methodName];
  17794. if (lodashFunc) {
  17795. var key = lodashFunc.name + '';
  17796. if (!hasOwnProperty.call(realNames, key)) {
  17797. realNames[key] = [];
  17798. }
  17799. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17800. }
  17801. });
  17802. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17803. 'name': 'wrapper',
  17804. 'func': undefined
  17805. }];
  17806. // Add methods to `LazyWrapper`.
  17807. LazyWrapper.prototype.clone = lazyClone;
  17808. LazyWrapper.prototype.reverse = lazyReverse;
  17809. LazyWrapper.prototype.value = lazyValue;
  17810. // Add chain sequence methods to the `lodash` wrapper.
  17811. lodash.prototype.at = wrapperAt;
  17812. lodash.prototype.chain = wrapperChain;
  17813. lodash.prototype.commit = wrapperCommit;
  17814. lodash.prototype.next = wrapperNext;
  17815. lodash.prototype.plant = wrapperPlant;
  17816. lodash.prototype.reverse = wrapperReverse;
  17817. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17818. // Add lazy aliases.
  17819. lodash.prototype.first = lodash.prototype.head;
  17820. if (symIterator) {
  17821. lodash.prototype[symIterator] = wrapperToIterator;
  17822. }
  17823. return lodash;
  17824. });
  17825. /*--------------------------------------------------------------------------*/
  17826. // Export lodash.
  17827. var _ = runInContext();
  17828. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17829. if (true) {
  17830. // Expose Lodash on the global object to prevent errors when Lodash is
  17831. // loaded by a script tag in the presence of an AMD loader.
  17832. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17833. // Use `_.noConflict` to remove Lodash from the global object.
  17834. root._ = _;
  17835. // Define as an anonymous module so, through path mapping, it can be
  17836. // referenced as the "underscore" module.
  17837. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17838. return _;
  17839. }).call(exports, __webpack_require__, exports, module),
  17840. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17841. }
  17842. // Check for `exports` after `define` in case a build optimizer adds it.
  17843. else {}
  17844. }.call(this));
  17845. /***/ }),
  17846. /***/ "./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":
  17847. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17848. !*** ./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 ***!
  17849. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17850. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17851. "use strict";
  17852. __webpack_require__.r(__webpack_exports__);
  17853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17854. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17855. /* harmony export */ });
  17856. /* 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");
  17857. /* 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__);
  17858. /* 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");
  17859. var options = {};
  17860. options.insert = "head";
  17861. options.singleton = false;
  17862. 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);
  17863. /* 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 || {});
  17864. /***/ }),
  17865. /***/ "./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":
  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/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17868. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17869. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17870. "use strict";
  17871. __webpack_require__.r(__webpack_exports__);
  17872. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17873. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17874. /* harmony export */ });
  17875. /* 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");
  17876. /* 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__);
  17877. /* 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");
  17878. var options = {};
  17879. options.insert = "head";
  17880. options.singleton = false;
  17881. 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);
  17882. /* 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 || {});
  17883. /***/ }),
  17884. /***/ "./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":
  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/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17887. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17888. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17889. "use strict";
  17890. __webpack_require__.r(__webpack_exports__);
  17891. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17892. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17893. /* harmony export */ });
  17894. /* 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");
  17895. /* 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__);
  17896. /* 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");
  17897. var options = {};
  17898. options.insert = "head";
  17899. options.singleton = false;
  17900. 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);
  17901. /* 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 || {});
  17902. /***/ }),
  17903. /***/ "./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":
  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/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17906. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17907. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17908. "use strict";
  17909. __webpack_require__.r(__webpack_exports__);
  17910. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17911. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17912. /* harmony export */ });
  17913. /* 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");
  17914. /* 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__);
  17915. /* 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");
  17916. var options = {};
  17917. options.insert = "head";
  17918. options.singleton = false;
  17919. 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);
  17920. /* 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 || {});
  17921. /***/ }),
  17922. /***/ "./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":
  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/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17925. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17926. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17927. "use strict";
  17928. __webpack_require__.r(__webpack_exports__);
  17929. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17930. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17931. /* harmony export */ });
  17932. /* 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");
  17933. /* 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__);
  17934. /* 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");
  17935. var options = {};
  17936. options.insert = "head";
  17937. options.singleton = false;
  17938. 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);
  17939. /* 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 || {});
  17940. /***/ }),
  17941. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17942. /*!******************************************************!*\
  17943. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17944. \******************************************************/
  17945. /***/ ((__unused_webpack_module, exports) => {
  17946. "use strict";
  17947. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17948. // runtime helper for setting properties on components
  17949. // in a tree-shakable way
  17950. exports["default"] = (sfc, props) => {
  17951. const target = sfc.__vccOpts || sfc;
  17952. for (const [key, val] of props) {
  17953. target[key] = val;
  17954. }
  17955. return target;
  17956. };
  17957. /***/ }),
  17958. /***/ "./resources/js/components/AppDropdown.vue":
  17959. /*!*************************************************!*\
  17960. !*** ./resources/js/components/AppDropdown.vue ***!
  17961. \*************************************************/
  17962. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17963. "use strict";
  17964. __webpack_require__.r(__webpack_exports__);
  17965. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17966. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17967. /* harmony export */ });
  17968. /* 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");
  17969. /* 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");
  17970. /* 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");
  17971. ;
  17972. 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"]])
  17973. /* hot reload */
  17974. if (false) {}
  17975. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17976. /***/ }),
  17977. /***/ "./resources/js/components/AppFooter.vue":
  17978. /*!***********************************************!*\
  17979. !*** ./resources/js/components/AppFooter.vue ***!
  17980. \***********************************************/
  17981. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17982. "use strict";
  17983. __webpack_require__.r(__webpack_exports__);
  17984. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17985. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17986. /* harmony export */ });
  17987. /* 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");
  17988. /* 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");
  17989. /* 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");
  17990. const script = {}
  17991. ;
  17992. 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"]])
  17993. /* hot reload */
  17994. if (false) {}
  17995. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17996. /***/ }),
  17997. /***/ "./resources/js/components/AppInputText.vue":
  17998. /*!**************************************************!*\
  17999. !*** ./resources/js/components/AppInputText.vue ***!
  18000. \**************************************************/
  18001. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18002. "use strict";
  18003. __webpack_require__.r(__webpack_exports__);
  18004. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18005. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18006. /* harmony export */ });
  18007. /* 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");
  18008. /* 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");
  18009. /* 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");
  18010. ;
  18011. 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"]])
  18012. /* hot reload */
  18013. if (false) {}
  18014. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18015. /***/ }),
  18016. /***/ "./resources/js/components/AppMessage.vue":
  18017. /*!************************************************!*\
  18018. !*** ./resources/js/components/AppMessage.vue ***!
  18019. \************************************************/
  18020. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18021. "use strict";
  18022. __webpack_require__.r(__webpack_exports__);
  18023. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18024. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18025. /* harmony export */ });
  18026. /* 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");
  18027. /* 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");
  18028. /* 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");
  18029. ;
  18030. 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"]])
  18031. /* hot reload */
  18032. if (false) {}
  18033. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18034. /***/ }),
  18035. /***/ "./resources/js/components/AppSidebar.vue":
  18036. /*!************************************************!*\
  18037. !*** ./resources/js/components/AppSidebar.vue ***!
  18038. \************************************************/
  18039. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18040. "use strict";
  18041. __webpack_require__.r(__webpack_exports__);
  18042. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18043. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18044. /* harmony export */ });
  18045. /* 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");
  18046. /* 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");
  18047. /* 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");
  18048. /* 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");
  18049. ;
  18050. 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"]])
  18051. /* hot reload */
  18052. if (false) {}
  18053. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18054. /***/ }),
  18055. /***/ "./resources/js/components/AppSubSidebar.vue":
  18056. /*!***************************************************!*\
  18057. !*** ./resources/js/components/AppSubSidebar.vue ***!
  18058. \***************************************************/
  18059. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18060. "use strict";
  18061. __webpack_require__.r(__webpack_exports__);
  18062. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18063. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18064. /* harmony export */ });
  18065. /* 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");
  18066. /* 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");
  18067. /* 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");
  18068. /* 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");
  18069. ;
  18070. 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"]])
  18071. /* hot reload */
  18072. if (false) {}
  18073. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18074. /***/ }),
  18075. /***/ "./resources/js/components/AppTopBar.vue":
  18076. /*!***********************************************!*\
  18077. !*** ./resources/js/components/AppTopBar.vue ***!
  18078. \***********************************************/
  18079. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18080. "use strict";
  18081. __webpack_require__.r(__webpack_exports__);
  18082. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18083. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18084. /* harmony export */ });
  18085. /* 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");
  18086. /* 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");
  18087. /* 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");
  18088. /* 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");
  18089. ;
  18090. 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"]])
  18091. /* hot reload */
  18092. if (false) {}
  18093. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18094. /***/ }),
  18095. /***/ "./resources/js/layouts/DashboardLayout.vue":
  18096. /*!**************************************************!*\
  18097. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  18098. \**************************************************/
  18099. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18100. "use strict";
  18101. __webpack_require__.r(__webpack_exports__);
  18102. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18103. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18104. /* harmony export */ });
  18105. /* 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");
  18106. /* 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");
  18107. /* 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");
  18108. /* 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");
  18109. ;
  18110. 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"]])
  18111. /* hot reload */
  18112. if (false) {}
  18113. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18114. /***/ }),
  18115. /***/ "./resources/js/pages/member/Edit.vue":
  18116. /*!********************************************!*\
  18117. !*** ./resources/js/pages/member/Edit.vue ***!
  18118. \********************************************/
  18119. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18120. "use strict";
  18121. __webpack_require__.r(__webpack_exports__);
  18122. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18123. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18124. /* harmony export */ });
  18125. /* 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");
  18126. /* 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");
  18127. /* 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");
  18128. ;
  18129. 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"]])
  18130. /* hot reload */
  18131. if (false) {}
  18132. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18133. /***/ }),
  18134. /***/ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  18135. /*!************************************************************************************!*\
  18136. !*** ./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  18137. \************************************************************************************/
  18138. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18139. "use strict";
  18140. __webpack_require__.r(__webpack_exports__);
  18141. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18142. /* 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"])
  18143. /* harmony export */ });
  18144. /* 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");
  18145. /***/ }),
  18146. /***/ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  18147. /*!*************************************************************************************!*\
  18148. !*** ./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  18149. \*************************************************************************************/
  18150. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18151. "use strict";
  18152. __webpack_require__.r(__webpack_exports__);
  18153. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18154. /* 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"])
  18155. /* harmony export */ });
  18156. /* 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");
  18157. /***/ }),
  18158. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  18159. /*!***********************************************************************************!*\
  18160. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  18161. \***********************************************************************************/
  18162. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18163. "use strict";
  18164. __webpack_require__.r(__webpack_exports__);
  18165. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18166. /* 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"])
  18167. /* harmony export */ });
  18168. /* 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");
  18169. /***/ }),
  18170. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  18171. /*!***********************************************************************************!*\
  18172. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18173. \***********************************************************************************/
  18174. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18175. "use strict";
  18176. __webpack_require__.r(__webpack_exports__);
  18177. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18178. /* 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"])
  18179. /* harmony export */ });
  18180. /* 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");
  18181. /***/ }),
  18182. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  18183. /*!**************************************************************************************!*\
  18184. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18185. \**************************************************************************************/
  18186. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18187. "use strict";
  18188. __webpack_require__.r(__webpack_exports__);
  18189. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18190. /* 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"])
  18191. /* harmony export */ });
  18192. /* 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");
  18193. /***/ }),
  18194. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  18195. /*!**********************************************************************************!*\
  18196. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  18197. \**********************************************************************************/
  18198. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18199. "use strict";
  18200. __webpack_require__.r(__webpack_exports__);
  18201. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18202. /* 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"])
  18203. /* harmony export */ });
  18204. /* 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");
  18205. /***/ }),
  18206. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  18207. /*!*************************************************************************************!*\
  18208. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  18209. \*************************************************************************************/
  18210. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18211. "use strict";
  18212. __webpack_require__.r(__webpack_exports__);
  18213. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18214. /* 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"])
  18215. /* harmony export */ });
  18216. /* 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");
  18217. /***/ }),
  18218. /***/ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js":
  18219. /*!*******************************************************************************!*\
  18220. !*** ./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  18221. \*******************************************************************************/
  18222. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18223. "use strict";
  18224. __webpack_require__.r(__webpack_exports__);
  18225. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18226. /* 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"])
  18227. /* harmony export */ });
  18228. /* 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");
  18229. /***/ }),
  18230. /***/ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  18231. /*!*******************************************************************************!*\
  18232. !*** ./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  18233. \*******************************************************************************/
  18234. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18235. "use strict";
  18236. __webpack_require__.r(__webpack_exports__);
  18237. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18238. /* 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)
  18239. /* harmony export */ });
  18240. /* 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");
  18241. /***/ }),
  18242. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  18243. /*!*****************************************************************************************!*\
  18244. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  18245. \*****************************************************************************************/
  18246. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18247. "use strict";
  18248. __webpack_require__.r(__webpack_exports__);
  18249. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18250. /* 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)
  18251. /* harmony export */ });
  18252. /* 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");
  18253. /***/ }),
  18254. /***/ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  18255. /*!********************************************************************************!*\
  18256. !*** ./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  18257. \********************************************************************************/
  18258. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18259. "use strict";
  18260. __webpack_require__.r(__webpack_exports__);
  18261. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18262. /* 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)
  18263. /* harmony export */ });
  18264. /* 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");
  18265. /***/ }),
  18266. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  18267. /*!******************************************************************************!*\
  18268. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  18269. \******************************************************************************/
  18270. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18271. "use strict";
  18272. __webpack_require__.r(__webpack_exports__);
  18273. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18274. /* 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)
  18275. /* harmony export */ });
  18276. /* 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");
  18277. /***/ }),
  18278. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  18279. /*!******************************************************************************************!*\
  18280. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  18281. \******************************************************************************************/
  18282. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18283. "use strict";
  18284. __webpack_require__.r(__webpack_exports__);
  18285. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18286. /* 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)
  18287. /* harmony export */ });
  18288. /* 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");
  18289. /***/ }),
  18290. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  18291. /*!*********************************************************************************************!*\
  18292. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  18293. \*********************************************************************************************/
  18294. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18295. "use strict";
  18296. __webpack_require__.r(__webpack_exports__);
  18297. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18298. /* 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)
  18299. /* harmony export */ });
  18300. /* 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");
  18301. /***/ }),
  18302. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  18303. /*!*****************************************************************************************!*\
  18304. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  18305. \*****************************************************************************************/
  18306. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18307. "use strict";
  18308. __webpack_require__.r(__webpack_exports__);
  18309. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18310. /* 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)
  18311. /* harmony export */ });
  18312. /* 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");
  18313. /***/ }),
  18314. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  18315. /*!********************************************************************************************!*\
  18316. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  18317. \********************************************************************************************/
  18318. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18319. "use strict";
  18320. __webpack_require__.r(__webpack_exports__);
  18321. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18322. /* 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)
  18323. /* harmony export */ });
  18324. /* 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");
  18325. /***/ }),
  18326. /***/ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226":
  18327. /*!**************************************************************************!*\
  18328. !*** ./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  18329. \**************************************************************************/
  18330. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18331. "use strict";
  18332. __webpack_require__.r(__webpack_exports__);
  18333. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18334. /* 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)
  18335. /* harmony export */ });
  18336. /* 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");
  18337. /***/ }),
  18338. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  18339. /*!********************************************************************************************************!*\
  18340. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  18341. \********************************************************************************************************/
  18342. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18343. "use strict";
  18344. __webpack_require__.r(__webpack_exports__);
  18345. /* 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");
  18346. /***/ }),
  18347. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  18348. /*!*********************************************************************************************************!*\
  18349. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  18350. \*********************************************************************************************************/
  18351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18352. "use strict";
  18353. __webpack_require__.r(__webpack_exports__);
  18354. /* 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");
  18355. /***/ }),
  18356. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  18357. /*!************************************************************************************************************!*\
  18358. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  18359. \************************************************************************************************************/
  18360. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18361. "use strict";
  18362. __webpack_require__.r(__webpack_exports__);
  18363. /* 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");
  18364. /***/ }),
  18365. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  18366. /*!********************************************************************************************************!*\
  18367. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  18368. \********************************************************************************************************/
  18369. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18370. "use strict";
  18371. __webpack_require__.r(__webpack_exports__);
  18372. /* 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");
  18373. /***/ }),
  18374. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18375. /*!***********************************************************************************************************!*\
  18376. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18377. \***********************************************************************************************************/
  18378. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18379. "use strict";
  18380. __webpack_require__.r(__webpack_exports__);
  18381. /* 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");
  18382. /***/ })
  18383. }]);