sinon-esm.js 1.5 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468
  1. var call = Function.call;
  2. var copyPrototype = function copyPrototypeMethods(prototype) {
  3. /* eslint-disable local-rules/no-prototype-methods */
  4. return Object.getOwnPropertyNames(prototype).reduce(function(result, name) {
  5. // ignore size because it throws from Map
  6. if (
  7. name !== "size" &&
  8. name !== "caller" &&
  9. name !== "callee" &&
  10. name !== "arguments" &&
  11. typeof prototype[name] === "function"
  12. ) {
  13. result[name] = call.bind(prototype[name]);
  14. }
  15. return result;
  16. }, Object.create(null));
  17. };
  18. var array = copyPrototype(Array.prototype);
  19. var every = array.every;
  20. function hasCallsLeft(callMap, spy) {
  21. if (callMap[spy.id] === undefined) {
  22. callMap[spy.id] = 0;
  23. }
  24. return callMap[spy.id] < spy.callCount;
  25. }
  26. function checkAdjacentCalls(callMap, spy, index, spies) {
  27. var calledBeforeNext = true;
  28. if (index !== spies.length - 1) {
  29. calledBeforeNext = spy.calledBefore(spies[index + 1]);
  30. }
  31. if (hasCallsLeft(callMap, spy) && calledBeforeNext) {
  32. callMap[spy.id] += 1;
  33. return true;
  34. }
  35. return false;
  36. }
  37. var calledInOrder = function calledInOrder(spies) {
  38. var callMap = {};
  39. // eslint-disable-next-line no-underscore-dangle
  40. var _spies = arguments.length > 1 ? arguments : spies;
  41. return every(_spies, checkAdjacentCalls.bind(null, callMap));
  42. };
  43. var functionName = function functionName(func) {
  44. return (
  45. func.displayName ||
  46. func.name ||
  47. // Use function decomposition as a last resort to get function
  48. // name. Does not rely on function decomposition to work - if it
  49. // doesn't debugging will be slightly less informative
  50. // (i.e. toString will say 'spy' rather than 'myFunc').
  51. (String(func).match(/function ([^\s(]+)/) || [])[1]
  52. );
  53. };
  54. var className = function className(value) {
  55. return (
  56. (value.constructor && value.constructor.name) ||
  57. // The next branch is for IE11 support only:
  58. // Because the name property is not set on the prototype
  59. // of the Function object, we finally try to grab the
  60. // name from its definition. This will never be reached
  61. // in node, so we are not able to test this properly.
  62. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
  63. (typeof value.constructor === "function" &&
  64. /* istanbul ignore next */
  65. functionName(value.constructor)) ||
  66. null
  67. );
  68. };
  69. // This is an `every` implementation that works for all iterables
  70. var every$1 = function every(obj, fn) {
  71. var pass = true;
  72. try {
  73. /* eslint-disable-next-line local-rules/no-prototype-methods */
  74. obj.forEach(function() {
  75. if (!fn.apply(this, arguments)) {
  76. // Throwing an error is the only way to break `forEach`
  77. throw new Error();
  78. }
  79. });
  80. } catch (e) {
  81. pass = false;
  82. }
  83. return pass;
  84. };
  85. var sort = array.sort;
  86. var slice = array.slice;
  87. function comparator(a, b) {
  88. // uuid, won't ever be equal
  89. var aCall = a.getCall(0);
  90. var bCall = b.getCall(0);
  91. var aId = (aCall && aCall.callId) || -1;
  92. var bId = (bCall && bCall.callId) || -1;
  93. return aId < bId ? -1 : 1;
  94. }
  95. var orderByFirstCall = function orderByFirstCall(spies) {
  96. return sort(slice(spies), comparator);
  97. };
  98. var _function = copyPrototype(Function.prototype);
  99. var object = copyPrototype(Object.prototype);
  100. var string = copyPrototype(String.prototype);
  101. var prototypes = {
  102. array: array,
  103. function: _function,
  104. object: object,
  105. string: string
  106. };
  107. var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  108. function commonjsRequire () {
  109. throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
  110. }
  111. function unwrapExports (x) {
  112. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;
  113. }
  114. function createCommonjsModule(fn, module) {
  115. return module = { exports: {} }, fn(module, module.exports), module.exports;
  116. }
  117. var typeDetect = createCommonjsModule(function (module, exports) {
  118. (function (global, factory) {
  119. module.exports = factory();
  120. }(commonjsGlobal, (function () {
  121. /* !
  122. * type-detect
  123. * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
  124. * MIT Licensed
  125. */
  126. var promiseExists = typeof Promise === 'function';
  127. /* eslint-disable no-undef */
  128. var globalObject = typeof self === 'object' ? self : commonjsGlobal; // eslint-disable-line id-blacklist
  129. var symbolExists = typeof Symbol !== 'undefined';
  130. var mapExists = typeof Map !== 'undefined';
  131. var setExists = typeof Set !== 'undefined';
  132. var weakMapExists = typeof WeakMap !== 'undefined';
  133. var weakSetExists = typeof WeakSet !== 'undefined';
  134. var dataViewExists = typeof DataView !== 'undefined';
  135. var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined';
  136. var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined';
  137. var setEntriesExists = setExists && typeof Set.prototype.entries === 'function';
  138. var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function';
  139. var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries());
  140. var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries());
  141. var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function';
  142. var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]());
  143. var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function';
  144. var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]());
  145. var toStringLeftSliceLength = 8;
  146. var toStringRightSliceLength = -1;
  147. /**
  148. * ### typeOf (obj)
  149. *
  150. * Uses `Object.prototype.toString` to determine the type of an object,
  151. * normalising behaviour across engine versions & well optimised.
  152. *
  153. * @param {Mixed} object
  154. * @return {String} object type
  155. * @api public
  156. */
  157. function typeDetect(obj) {
  158. /* ! Speed optimisation
  159. * Pre:
  160. * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled)
  161. * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled)
  162. * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled)
  163. * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled)
  164. * function x 2,556,769 ops/sec ±1.73% (77 runs sampled)
  165. * Post:
  166. * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled)
  167. * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled)
  168. * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled)
  169. * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled)
  170. * function x 31,296,870 ops/sec ±0.96% (83 runs sampled)
  171. */
  172. var typeofObj = typeof obj;
  173. if (typeofObj !== 'object') {
  174. return typeofObj;
  175. }
  176. /* ! Speed optimisation
  177. * Pre:
  178. * null x 28,645,765 ops/sec ±1.17% (82 runs sampled)
  179. * Post:
  180. * null x 36,428,962 ops/sec ±1.37% (84 runs sampled)
  181. */
  182. if (obj === null) {
  183. return 'null';
  184. }
  185. /* ! Spec Conformance
  186. * Test: `Object.prototype.toString.call(window)``
  187. * - Node === "[object global]"
  188. * - Chrome === "[object global]"
  189. * - Firefox === "[object Window]"
  190. * - PhantomJS === "[object Window]"
  191. * - Safari === "[object Window]"
  192. * - IE 11 === "[object Window]"
  193. * - IE Edge === "[object Window]"
  194. * Test: `Object.prototype.toString.call(this)``
  195. * - Chrome Worker === "[object global]"
  196. * - Firefox Worker === "[object DedicatedWorkerGlobalScope]"
  197. * - Safari Worker === "[object DedicatedWorkerGlobalScope]"
  198. * - IE 11 Worker === "[object WorkerGlobalScope]"
  199. * - IE Edge Worker === "[object WorkerGlobalScope]"
  200. */
  201. if (obj === globalObject) {
  202. return 'global';
  203. }
  204. /* ! Speed optimisation
  205. * Pre:
  206. * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled)
  207. * Post:
  208. * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled)
  209. */
  210. if (
  211. Array.isArray(obj) &&
  212. (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))
  213. ) {
  214. return 'Array';
  215. }
  216. // Not caching existence of `window` and related properties due to potential
  217. // for `window` to be unset before tests in quasi-browser environments.
  218. if (typeof window === 'object' && window !== null) {
  219. /* ! Spec Conformance
  220. * (https://html.spec.whatwg.org/multipage/browsers.html#location)
  221. * WhatWG HTML$7.7.3 - The `Location` interface
  222. * Test: `Object.prototype.toString.call(window.location)``
  223. * - IE <=11 === "[object Object]"
  224. * - IE Edge <=13 === "[object Object]"
  225. */
  226. if (typeof window.location === 'object' && obj === window.location) {
  227. return 'Location';
  228. }
  229. /* ! Spec Conformance
  230. * (https://html.spec.whatwg.org/#document)
  231. * WhatWG HTML$3.1.1 - The `Document` object
  232. * Note: Most browsers currently adher to the W3C DOM Level 2 spec
  233. * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268)
  234. * which suggests that browsers should use HTMLTableCellElement for
  235. * both TD and TH elements. WhatWG separates these.
  236. * WhatWG HTML states:
  237. * > For historical reasons, Window objects must also have a
  238. * > writable, configurable, non-enumerable property named
  239. * > HTMLDocument whose value is the Document interface object.
  240. * Test: `Object.prototype.toString.call(document)``
  241. * - Chrome === "[object HTMLDocument]"
  242. * - Firefox === "[object HTMLDocument]"
  243. * - Safari === "[object HTMLDocument]"
  244. * - IE <=10 === "[object Document]"
  245. * - IE 11 === "[object HTMLDocument]"
  246. * - IE Edge <=13 === "[object HTMLDocument]"
  247. */
  248. if (typeof window.document === 'object' && obj === window.document) {
  249. return 'Document';
  250. }
  251. if (typeof window.navigator === 'object') {
  252. /* ! Spec Conformance
  253. * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray)
  254. * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray
  255. * Test: `Object.prototype.toString.call(navigator.mimeTypes)``
  256. * - IE <=10 === "[object MSMimeTypesCollection]"
  257. */
  258. if (typeof window.navigator.mimeTypes === 'object' &&
  259. obj === window.navigator.mimeTypes) {
  260. return 'MimeTypeArray';
  261. }
  262. /* ! Spec Conformance
  263. * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray)
  264. * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray
  265. * Test: `Object.prototype.toString.call(navigator.plugins)``
  266. * - IE <=10 === "[object MSPluginsCollection]"
  267. */
  268. if (typeof window.navigator.plugins === 'object' &&
  269. obj === window.navigator.plugins) {
  270. return 'PluginArray';
  271. }
  272. }
  273. if ((typeof window.HTMLElement === 'function' ||
  274. typeof window.HTMLElement === 'object') &&
  275. obj instanceof window.HTMLElement) {
  276. /* ! Spec Conformance
  277. * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray)
  278. * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement`
  279. * Test: `Object.prototype.toString.call(document.createElement('blockquote'))``
  280. * - IE <=10 === "[object HTMLBlockElement]"
  281. */
  282. if (obj.tagName === 'BLOCKQUOTE') {
  283. return 'HTMLQuoteElement';
  284. }
  285. /* ! Spec Conformance
  286. * (https://html.spec.whatwg.org/#htmltabledatacellelement)
  287. * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement`
  288. * Note: Most browsers currently adher to the W3C DOM Level 2 spec
  289. * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075)
  290. * which suggests that browsers should use HTMLTableCellElement for
  291. * both TD and TH elements. WhatWG separates these.
  292. * Test: Object.prototype.toString.call(document.createElement('td'))
  293. * - Chrome === "[object HTMLTableCellElement]"
  294. * - Firefox === "[object HTMLTableCellElement]"
  295. * - Safari === "[object HTMLTableCellElement]"
  296. */
  297. if (obj.tagName === 'TD') {
  298. return 'HTMLTableDataCellElement';
  299. }
  300. /* ! Spec Conformance
  301. * (https://html.spec.whatwg.org/#htmltableheadercellelement)
  302. * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement`
  303. * Note: Most browsers currently adher to the W3C DOM Level 2 spec
  304. * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075)
  305. * which suggests that browsers should use HTMLTableCellElement for
  306. * both TD and TH elements. WhatWG separates these.
  307. * Test: Object.prototype.toString.call(document.createElement('th'))
  308. * - Chrome === "[object HTMLTableCellElement]"
  309. * - Firefox === "[object HTMLTableCellElement]"
  310. * - Safari === "[object HTMLTableCellElement]"
  311. */
  312. if (obj.tagName === 'TH') {
  313. return 'HTMLTableHeaderCellElement';
  314. }
  315. }
  316. }
  317. /* ! Speed optimisation
  318. * Pre:
  319. * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled)
  320. * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled)
  321. * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled)
  322. * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled)
  323. * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled)
  324. * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled)
  325. * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled)
  326. * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled)
  327. * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled)
  328. * Post:
  329. * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled)
  330. * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled)
  331. * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled)
  332. * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled)
  333. * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled)
  334. * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled)
  335. * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled)
  336. * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled)
  337. * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled)
  338. */
  339. var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]);
  340. if (typeof stringTag === 'string') {
  341. return stringTag;
  342. }
  343. var objPrototype = Object.getPrototypeOf(obj);
  344. /* ! Speed optimisation
  345. * Pre:
  346. * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled)
  347. * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled)
  348. * Post:
  349. * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled)
  350. * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled)
  351. */
  352. if (objPrototype === RegExp.prototype) {
  353. return 'RegExp';
  354. }
  355. /* ! Speed optimisation
  356. * Pre:
  357. * date x 2,130,074 ops/sec ±4.42% (68 runs sampled)
  358. * Post:
  359. * date x 3,953,779 ops/sec ±1.35% (77 runs sampled)
  360. */
  361. if (objPrototype === Date.prototype) {
  362. return 'Date';
  363. }
  364. /* ! Spec Conformance
  365. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag)
  366. * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise":
  367. * Test: `Object.prototype.toString.call(Promise.resolve())``
  368. * - Chrome <=47 === "[object Object]"
  369. * - Edge <=20 === "[object Object]"
  370. * - Firefox 29-Latest === "[object Promise]"
  371. * - Safari 7.1-Latest === "[object Promise]"
  372. */
  373. if (promiseExists && objPrototype === Promise.prototype) {
  374. return 'Promise';
  375. }
  376. /* ! Speed optimisation
  377. * Pre:
  378. * set x 2,222,186 ops/sec ±1.31% (82 runs sampled)
  379. * Post:
  380. * set x 4,545,879 ops/sec ±1.13% (83 runs sampled)
  381. */
  382. if (setExists && objPrototype === Set.prototype) {
  383. return 'Set';
  384. }
  385. /* ! Speed optimisation
  386. * Pre:
  387. * map x 2,396,842 ops/sec ±1.59% (81 runs sampled)
  388. * Post:
  389. * map x 4,183,945 ops/sec ±6.59% (82 runs sampled)
  390. */
  391. if (mapExists && objPrototype === Map.prototype) {
  392. return 'Map';
  393. }
  394. /* ! Speed optimisation
  395. * Pre:
  396. * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled)
  397. * Post:
  398. * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled)
  399. */
  400. if (weakSetExists && objPrototype === WeakSet.prototype) {
  401. return 'WeakSet';
  402. }
  403. /* ! Speed optimisation
  404. * Pre:
  405. * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled)
  406. * Post:
  407. * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled)
  408. */
  409. if (weakMapExists && objPrototype === WeakMap.prototype) {
  410. return 'WeakMap';
  411. }
  412. /* ! Spec Conformance
  413. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag)
  414. * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView":
  415. * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))``
  416. * - Edge <=13 === "[object Object]"
  417. */
  418. if (dataViewExists && objPrototype === DataView.prototype) {
  419. return 'DataView';
  420. }
  421. /* ! Spec Conformance
  422. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag)
  423. * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator":
  424. * Test: `Object.prototype.toString.call(new Map().entries())``
  425. * - Edge <=13 === "[object Object]"
  426. */
  427. if (mapExists && objPrototype === mapIteratorPrototype) {
  428. return 'Map Iterator';
  429. }
  430. /* ! Spec Conformance
  431. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag)
  432. * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator":
  433. * Test: `Object.prototype.toString.call(new Set().entries())``
  434. * - Edge <=13 === "[object Object]"
  435. */
  436. if (setExists && objPrototype === setIteratorPrototype) {
  437. return 'Set Iterator';
  438. }
  439. /* ! Spec Conformance
  440. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag)
  441. * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator":
  442. * Test: `Object.prototype.toString.call([][Symbol.iterator]())``
  443. * - Edge <=13 === "[object Object]"
  444. */
  445. if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) {
  446. return 'Array Iterator';
  447. }
  448. /* ! Spec Conformance
  449. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag)
  450. * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator":
  451. * Test: `Object.prototype.toString.call(''[Symbol.iterator]())``
  452. * - Edge <=13 === "[object Object]"
  453. */
  454. if (stringIteratorExists && objPrototype === stringIteratorPrototype) {
  455. return 'String Iterator';
  456. }
  457. /* ! Speed optimisation
  458. * Pre:
  459. * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled)
  460. * Post:
  461. * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled)
  462. */
  463. if (objPrototype === null) {
  464. return 'Object';
  465. }
  466. return Object
  467. .prototype
  468. .toString
  469. .call(obj)
  470. .slice(toStringLeftSliceLength, toStringRightSliceLength);
  471. }
  472. return typeDetect;
  473. })));
  474. });
  475. var typeOf = function typeOf(value) {
  476. return typeDetect(value).toLowerCase();
  477. };
  478. function valueToString(value) {
  479. if (value && value.toString) {
  480. /* eslint-disable-next-line local-rules/no-prototype-methods */
  481. return value.toString();
  482. }
  483. return String(value);
  484. }
  485. var valueToString_1 = valueToString;
  486. var lib = {
  487. calledInOrder: calledInOrder,
  488. className: className,
  489. every: every$1,
  490. functionName: functionName,
  491. orderByFirstCall: orderByFirstCall,
  492. prototypes: prototypes,
  493. typeOf: typeOf,
  494. valueToString: valueToString_1
  495. };
  496. var arrayProto = lib.prototypes.array;
  497. var hasOwnProperty = lib.prototypes.object.hasOwnProperty;
  498. var join = arrayProto.join;
  499. var push = arrayProto.push;
  500. var slice$1 = arrayProto.slice;
  501. // Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
  502. var hasDontEnumBug = (function() {
  503. var obj = {
  504. constructor: function() {
  505. return "0";
  506. },
  507. toString: function() {
  508. return "1";
  509. },
  510. valueOf: function() {
  511. return "2";
  512. },
  513. toLocaleString: function() {
  514. return "3";
  515. },
  516. prototype: function() {
  517. return "4";
  518. },
  519. isPrototypeOf: function() {
  520. return "5";
  521. },
  522. propertyIsEnumerable: function() {
  523. return "6";
  524. },
  525. hasOwnProperty: function() {
  526. return "7";
  527. },
  528. length: function() {
  529. return "8";
  530. },
  531. unique: function() {
  532. return "9";
  533. }
  534. };
  535. var result = [];
  536. for (var prop in obj) {
  537. if (hasOwnProperty(obj, prop)) {
  538. push(result, obj[prop]());
  539. }
  540. }
  541. return join(result, "") !== "0123456789";
  542. })();
  543. function extendCommon(target, sources, doCopy) {
  544. var source, i, prop;
  545. for (i = 0; i < sources.length; i++) {
  546. source = sources[i];
  547. for (prop in source) {
  548. if (hasOwnProperty(source, prop)) {
  549. doCopy(target, source, prop);
  550. }
  551. }
  552. // Make sure we copy (own) toString method even when in JScript with DontEnum bug
  553. // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
  554. if (hasDontEnumBug && hasOwnProperty(source, "toString") && source.toString !== target.toString) {
  555. target.toString = source.toString;
  556. }
  557. }
  558. return target;
  559. }
  560. /** Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will
  561. * override properties in previous sources.
  562. *
  563. * @arg {Object} target - The Object to extend
  564. * @arg {Object[]} sources - Objects to copy properties from.
  565. *
  566. * @returns {Object} the extended target
  567. */
  568. var extend = function extend(target /*, sources */) {
  569. var sources = slice$1(arguments, 1);
  570. return extendCommon(target, sources, function copyValue(dest, source, prop) {
  571. dest[prop] = source[prop];
  572. });
  573. };
  574. /** Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will
  575. * override properties in previous sources. Define the properties as non enumerable.
  576. *
  577. * @arg {Object} target - The Object to extend
  578. * @arg {Object[]} sources - Objects to copy properties from.
  579. *
  580. * @returns {Object} the extended target
  581. */
  582. var nonEnum = function extendNonEnum(target /*, sources */) {
  583. var sources = slice$1(arguments, 1);
  584. return extendCommon(target, sources, function copyProperty(dest, source, prop) {
  585. Object.defineProperty(dest, prop, {
  586. value: source[prop],
  587. enumerable: false,
  588. configurable: true,
  589. writable: true
  590. });
  591. });
  592. };
  593. extend.nonEnum = nonEnum;
  594. /* istanbul ignore next : not testing that setTimeout works */
  595. function nextTick(callback) {
  596. setTimeout(callback, 0);
  597. }
  598. var getNextTick = function getNextTick(process, setImmediate) {
  599. if (typeof process === "object" && typeof process.nextTick === "function") {
  600. return process.nextTick;
  601. }
  602. if (typeof setImmediate === "function") {
  603. return setImmediate;
  604. }
  605. return nextTick;
  606. };
  607. /* istanbul ignore next */
  608. var root = typeof window !== "undefined" ? window : commonjsGlobal;
  609. var nextTick$1 = getNextTick(root.process, root.setImmediate);
  610. var arrayProto$1 = lib.prototypes.array;
  611. var reduce = arrayProto$1.reduce;
  612. var exportAsyncBehaviors = function exportAsyncBehaviors(behaviorMethods) {
  613. return reduce(
  614. Object.keys(behaviorMethods),
  615. function(acc, method) {
  616. // need to avoid creating another async versions of the newly added async methods
  617. if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) {
  618. acc[method + "Async"] = function() {
  619. var result = behaviorMethods[method].apply(this, arguments);
  620. this.callbackAsync = true;
  621. return result;
  622. };
  623. }
  624. return acc;
  625. },
  626. {}
  627. );
  628. };
  629. var arrayProto$2 = lib.prototypes.array;
  630. var functionName$1 = lib.functionName;
  631. var valueToString$1 = lib.valueToString;
  632. var concat = arrayProto$2.concat;
  633. var join$1 = arrayProto$2.join;
  634. var reverse = arrayProto$2.reverse;
  635. var slice$2 = arrayProto$2.slice;
  636. var useLeftMostCallback = -1;
  637. var useRightMostCallback = -2;
  638. function getCallback(behavior, args) {
  639. var callArgAt = behavior.callArgAt;
  640. if (callArgAt >= 0) {
  641. return args[callArgAt];
  642. }
  643. var argumentList;
  644. if (callArgAt === useLeftMostCallback) {
  645. argumentList = args;
  646. }
  647. if (callArgAt === useRightMostCallback) {
  648. argumentList = reverse(slice$2(args));
  649. }
  650. var callArgProp = behavior.callArgProp;
  651. for (var i = 0, l = argumentList.length; i < l; ++i) {
  652. if (!callArgProp && typeof argumentList[i] === "function") {
  653. return argumentList[i];
  654. }
  655. if (callArgProp && argumentList[i] && typeof argumentList[i][callArgProp] === "function") {
  656. return argumentList[i][callArgProp];
  657. }
  658. }
  659. return null;
  660. }
  661. function getCallbackError(behavior, func, args) {
  662. if (behavior.callArgAt < 0) {
  663. var msg;
  664. if (behavior.callArgProp) {
  665. msg =
  666. functionName$1(behavior.stub) +
  667. " expected to yield to '" +
  668. valueToString$1(behavior.callArgProp) +
  669. "', but no object with such a property was passed.";
  670. } else {
  671. msg = functionName$1(behavior.stub) + " expected to yield, but no callback was passed.";
  672. }
  673. if (args.length > 0) {
  674. msg += " Received [" + join$1(args, ", ") + "]";
  675. }
  676. return msg;
  677. }
  678. return "argument at index " + behavior.callArgAt + " is not a function: " + func;
  679. }
  680. function ensureArgs(name, behavior, args) {
  681. // map function name to internal property
  682. // callsArg => callArgAt
  683. var property = name.replace(/sArg/, "ArgAt");
  684. var index = behavior[property];
  685. if (index >= args.length) {
  686. throw new TypeError(
  687. name + " failed: " + (index + 1) + " arguments required but only " + args.length + " present"
  688. );
  689. }
  690. }
  691. function callCallback(behavior, args) {
  692. if (typeof behavior.callArgAt === "number") {
  693. ensureArgs("callsArg", behavior, args);
  694. var func = getCallback(behavior, args);
  695. if (typeof func !== "function") {
  696. throw new TypeError(getCallbackError(behavior, func, args));
  697. }
  698. if (behavior.callbackAsync) {
  699. nextTick$1(function() {
  700. func.apply(behavior.callbackContext, behavior.callbackArguments);
  701. });
  702. } else {
  703. return func.apply(behavior.callbackContext, behavior.callbackArguments);
  704. }
  705. }
  706. return undefined;
  707. }
  708. var proto = {
  709. create: function create(stub) {
  710. var behavior = extend({}, proto);
  711. delete behavior.create;
  712. delete behavior.addBehavior;
  713. delete behavior.createBehavior;
  714. behavior.stub = stub;
  715. if (stub.defaultBehavior && stub.defaultBehavior.promiseLibrary) {
  716. behavior.promiseLibrary = stub.defaultBehavior.promiseLibrary;
  717. }
  718. return behavior;
  719. },
  720. isPresent: function isPresent() {
  721. return (
  722. typeof this.callArgAt === "number" ||
  723. this.exception ||
  724. this.exceptionCreator ||
  725. typeof this.returnArgAt === "number" ||
  726. this.returnThis ||
  727. typeof this.resolveArgAt === "number" ||
  728. this.resolveThis ||
  729. typeof this.throwArgAt === "number" ||
  730. this.fakeFn ||
  731. this.returnValueDefined
  732. );
  733. },
  734. invoke: function invoke(context, args) {
  735. /*
  736. * callCallback (conditionally) calls ensureArgs
  737. *
  738. * Note: callCallback intentionally happens before
  739. * everything else and cannot be moved lower
  740. */
  741. var returnValue = callCallback(this, args);
  742. if (this.exception) {
  743. throw this.exception;
  744. } else if (this.exceptionCreator) {
  745. this.exception = this.exceptionCreator();
  746. this.exceptionCreator = undefined;
  747. throw this.exception;
  748. } else if (typeof this.returnArgAt === "number") {
  749. ensureArgs("returnsArg", this, args);
  750. return args[this.returnArgAt];
  751. } else if (this.returnThis) {
  752. return context;
  753. } else if (typeof this.throwArgAt === "number") {
  754. ensureArgs("throwsArg", this, args);
  755. throw args[this.throwArgAt];
  756. } else if (this.fakeFn) {
  757. return this.fakeFn.apply(context, args);
  758. } else if (typeof this.resolveArgAt === "number") {
  759. ensureArgs("resolvesArg", this, args);
  760. return (this.promiseLibrary || Promise).resolve(args[this.resolveArgAt]);
  761. } else if (this.resolveThis) {
  762. return (this.promiseLibrary || Promise).resolve(context);
  763. } else if (this.resolve) {
  764. return (this.promiseLibrary || Promise).resolve(this.returnValue);
  765. } else if (this.reject) {
  766. return (this.promiseLibrary || Promise).reject(this.returnValue);
  767. } else if (this.callsThrough) {
  768. return this.stub.wrappedMethod.apply(context, args);
  769. } else if (typeof this.returnValue !== "undefined") {
  770. return this.returnValue;
  771. } else if (typeof this.callArgAt === "number") {
  772. return returnValue;
  773. }
  774. return this.returnValue;
  775. },
  776. onCall: function onCall(index) {
  777. return this.stub.onCall(index);
  778. },
  779. onFirstCall: function onFirstCall() {
  780. return this.stub.onFirstCall();
  781. },
  782. onSecondCall: function onSecondCall() {
  783. return this.stub.onSecondCall();
  784. },
  785. onThirdCall: function onThirdCall() {
  786. return this.stub.onThirdCall();
  787. },
  788. withArgs: function withArgs(/* arguments */) {
  789. throw new Error(
  790. 'Defining a stub by invoking "stub.onCall(...).withArgs(...)" ' +
  791. 'is not supported. Use "stub.withArgs(...).onCall(...)" ' +
  792. "to define sequential behavior for calls with certain arguments."
  793. );
  794. }
  795. };
  796. function createBehavior(behaviorMethod) {
  797. return function() {
  798. this.defaultBehavior = this.defaultBehavior || proto.create(this);
  799. this.defaultBehavior[behaviorMethod].apply(this.defaultBehavior, arguments);
  800. return this;
  801. };
  802. }
  803. function addBehavior(stub, name, fn) {
  804. proto[name] = function() {
  805. fn.apply(this, concat([this], slice$2(arguments)));
  806. return this.stub || this;
  807. };
  808. stub[name] = createBehavior(name);
  809. }
  810. proto.addBehavior = addBehavior;
  811. proto.createBehavior = createBehavior;
  812. var asyncBehaviors = exportAsyncBehaviors(proto);
  813. var behavior = extend.nonEnum({}, proto, asyncBehaviors);
  814. var forEach = lib.prototypes.array.forEach;
  815. function walkInternal(obj, iterator, context, originalObj, seen) {
  816. var proto, prop;
  817. if (typeof Object.getOwnPropertyNames !== "function") {
  818. // We explicitly want to enumerate through all of the prototype's properties
  819. // in this case, therefore we deliberately leave out an own property check.
  820. /* eslint-disable-next-line guard-for-in */
  821. for (prop in obj) {
  822. iterator.call(context, obj[prop], prop, obj);
  823. }
  824. return;
  825. }
  826. forEach(Object.getOwnPropertyNames(obj), function(k) {
  827. if (seen[k] !== true) {
  828. seen[k] = true;
  829. var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ? originalObj : obj;
  830. iterator.call(context, k, target);
  831. }
  832. });
  833. proto = Object.getPrototypeOf(obj);
  834. if (proto) {
  835. walkInternal(proto, iterator, context, originalObj, seen);
  836. }
  837. }
  838. /* Walks the prototype chain of an object and iterates over every own property
  839. * name encountered. The iterator is called in the same fashion that Array.prototype.forEach
  840. * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional
  841. * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will
  842. * default to using a simple for..in loop.
  843. *
  844. * obj - The object to walk the prototype chain for.
  845. * iterator - The function to be called on each pass of the walk.
  846. * context - (Optional) When given, the iterator will be called with this object as the receiver.
  847. */
  848. var walk = function walk(obj, iterator, context) {
  849. return walkInternal(obj, iterator, context, obj, {});
  850. };
  851. var getPropertyDescriptor = function getPropertyDescriptor(object, property) {
  852. var proto = object;
  853. var descriptor;
  854. while (proto && !(descriptor = Object.getOwnPropertyDescriptor(proto, property))) {
  855. proto = Object.getPrototypeOf(proto);
  856. }
  857. return descriptor;
  858. };
  859. var hasOwnProperty$1 = lib.prototypes.object.hasOwnProperty;
  860. var push$1 = lib.prototypes.array.push;
  861. function collectMethod(methods, object, prop, propOwner) {
  862. if (typeof getPropertyDescriptor(propOwner, prop).value === "function" && hasOwnProperty$1(object, prop)) {
  863. push$1(methods, object[prop]);
  864. }
  865. }
  866. // This function returns an array of all the own methods on the passed object
  867. function collectOwnMethods(object) {
  868. var methods = [];
  869. walk(object, collectMethod.bind(null, methods, object));
  870. return methods;
  871. }
  872. var collectOwnMethods_1 = collectOwnMethods;
  873. /**
  874. * Verify if an object is a ECMAScript Module
  875. *
  876. * As the exports from a module is immutable we cannot alter the exports
  877. * using spies or stubs. Let the consumer know this to avoid bug reports
  878. * on weird error messages.
  879. *
  880. * @param {Object} object The object to examine
  881. *
  882. * @returns {Boolean} true when the object is a module
  883. */
  884. var isEsModule = function(object) {
  885. return (
  886. object && typeof Symbol !== "undefined" && object[Symbol.toStringTag] === "Module" && Object.isSealed(object)
  887. );
  888. };
  889. function isPropertyConfigurable(obj, propName) {
  890. var propertyDescriptor = getPropertyDescriptor(obj, propName);
  891. return propertyDescriptor ? propertyDescriptor.configurable : true;
  892. }
  893. var isPropertyConfigurable_1 = isPropertyConfigurable;
  894. function isNonExistentOwnProperty(object, property) {
  895. return object && typeof property !== "undefined" && !(property in object);
  896. }
  897. var isNonExistentOwnProperty_1 = isNonExistentOwnProperty;
  898. function isNaN$1(value) {
  899. // Unlike global isNaN, this avoids type coercion
  900. // typeof check avoids IE host object issues, hat tip to
  901. // lodash
  902. var val = value; // JsLint thinks value !== value is "weird"
  903. return typeof value === "number" && value !== val;
  904. }
  905. var isNan = isNaN$1;
  906. /**
  907. * @name samsam.isNegZero
  908. * @param Object value
  909. *
  910. * Returns ``true`` if ``value`` is ``-0``.
  911. */
  912. function isNegZero(value) {
  913. return value === 0 && 1 / value === -Infinity;
  914. }
  915. var isNegZero_1 = isNegZero;
  916. /**
  917. * @name samsam.equal
  918. * @param Object obj1
  919. * @param Object obj2
  920. *
  921. * Returns ``true`` if two objects are strictly equal. Compared to
  922. * ``===`` there are two exceptions:
  923. *
  924. * - NaN is considered equal to NaN
  925. * - -0 and +0 are not considered equal
  926. */
  927. function identical(obj1, obj2) {
  928. if (obj1 === obj2 || (isNan(obj1) && isNan(obj2))) {
  929. return obj1 !== 0 || isNegZero_1(obj1) === isNegZero_1(obj2);
  930. }
  931. return false;
  932. }
  933. var identical_1 = identical;
  934. var o = Object.prototype;
  935. function getClass(value) {
  936. // Returns the internal [[Class]] by calling Object.prototype.toString
  937. // with the provided value as this. Return value is a string, naming the
  938. // internal class, e.g. "Array"
  939. return o.toString.call(value).split(/[ \]]/)[1];
  940. }
  941. var getClass_1 = getClass;
  942. /**
  943. * @name samsam.isArguments
  944. * @param Object object
  945. *
  946. * Returns ``true`` if ``object`` is an ``arguments`` object,
  947. * ``false`` otherwise.
  948. */
  949. function isArguments(object) {
  950. if (getClass_1(object) === "Arguments") {
  951. return true;
  952. }
  953. if (
  954. typeof object !== "object" ||
  955. typeof object.length !== "number" ||
  956. getClass_1(object) === "Array"
  957. ) {
  958. return false;
  959. }
  960. if (typeof object.callee === "function") {
  961. return true;
  962. }
  963. try {
  964. object[object.length] = 6;
  965. delete object[object.length];
  966. } catch (e) {
  967. return true;
  968. }
  969. return false;
  970. }
  971. var isArguments_1 = isArguments;
  972. var div = typeof document !== "undefined" && document.createElement("div");
  973. /**
  974. * @name samsam.isElement
  975. * @param Object object
  976. *
  977. * Returns ``true`` if ``object`` is a DOM element node. Unlike
  978. * Underscore.js/lodash, this function will return ``false`` if ``object``
  979. * is an *element-like* object, i.e. a regular object with a ``nodeType``
  980. * property that holds the value ``1``.
  981. */
  982. function isElement(object) {
  983. if (!object || object.nodeType !== 1 || !div) {
  984. return false;
  985. }
  986. try {
  987. object.appendChild(div);
  988. object.removeChild(div);
  989. } catch (e) {
  990. return false;
  991. }
  992. return true;
  993. }
  994. var isElement_1 = isElement;
  995. function isSet(val) {
  996. return (typeof Set !== "undefined" && val instanceof Set) || false;
  997. }
  998. var isSet_1 = isSet;
  999. function isDate(value) {
  1000. return value instanceof Date;
  1001. }
  1002. var isDate_1 = isDate;
  1003. // Returns true when the value is a regular Object and not a specialized Object
  1004. //
  1005. // This helps speeding up deepEqual cyclic checks
  1006. // The premise is that only Objects are stored in the visited array.
  1007. // So if this function returns false, we don't have to do the
  1008. // expensive operation of searching for the value in the the array of already
  1009. // visited objects
  1010. function isObject(value) {
  1011. return (
  1012. typeof value === "object" &&
  1013. value !== null &&
  1014. // none of these are collection objects, so we can return false
  1015. !(value instanceof Boolean) &&
  1016. !(value instanceof Date) &&
  1017. !(value instanceof Error) &&
  1018. !(value instanceof Number) &&
  1019. !(value instanceof RegExp) &&
  1020. !(value instanceof String)
  1021. );
  1022. }
  1023. var isObject_1 = isObject;
  1024. function isSubset(s1, s2, compare) {
  1025. var allContained = true;
  1026. s1.forEach(function(v1) {
  1027. var includes = false;
  1028. s2.forEach(function(v2) {
  1029. if (compare(v2, v1)) {
  1030. includes = true;
  1031. }
  1032. });
  1033. allContained = allContained && includes;
  1034. });
  1035. return allContained;
  1036. }
  1037. var isSubset_1 = isSubset;
  1038. var valueToString$2 = lib.valueToString;
  1039. var re = /function (\w+)\s*\(/;
  1040. function getClassName(value) {
  1041. if (value.constructor && "name" in value.constructor) {
  1042. return value.constructor.name;
  1043. }
  1044. if (typeof value.constructor === "function") {
  1045. var match = valueToString$2(value.constructor).match(re);
  1046. if (match.length > 1) {
  1047. return match[1];
  1048. }
  1049. }
  1050. return null;
  1051. }
  1052. var getClassName_1 = getClassName;
  1053. var valueToString$3 = lib.valueToString;
  1054. var every$2 = Array.prototype.every;
  1055. var getTime = Date.prototype.getTime;
  1056. var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  1057. var indexOf = Array.prototype.indexOf;
  1058. var keys = Object.keys;
  1059. /**
  1060. * @name samsam.deepEqual
  1061. * @param Object first
  1062. * @param Object second
  1063. *
  1064. * Deep equal comparison. Two values are "deep equal" if:
  1065. *
  1066. * - They are equal, according to samsam.identical
  1067. * - They are both date objects representing the same time
  1068. * - They are both arrays containing elements that are all deepEqual
  1069. * - They are objects with the same set of properties, and each property
  1070. * in ``first`` is deepEqual to the corresponding property in ``second``
  1071. *
  1072. * Supports cyclic objects.
  1073. */
  1074. function deepEqualCyclic(first, second, match) {
  1075. // used for cyclic comparison
  1076. // contain already visited objects
  1077. var objects1 = [];
  1078. var objects2 = [];
  1079. // contain pathes (position in the object structure)
  1080. // of the already visited objects
  1081. // indexes same as in objects arrays
  1082. var paths1 = [];
  1083. var paths2 = [];
  1084. // contains combinations of already compared objects
  1085. // in the manner: { "$1['ref']$2['ref']": true }
  1086. var compared = {};
  1087. // does the recursion for the deep equal check
  1088. return (function deepEqual(obj1, obj2, path1, path2) {
  1089. // If both are matchers they must be the same instance in order to be
  1090. // considered equal If we didn't do that we would end up running one
  1091. // matcher against the other
  1092. if (match && match.isMatcher(obj2)) {
  1093. if (match.isMatcher(obj1)) {
  1094. return obj1 === obj2;
  1095. }
  1096. return obj2.test(obj1);
  1097. }
  1098. var type1 = typeof obj1;
  1099. var type2 = typeof obj2;
  1100. // == null also matches undefined
  1101. if (
  1102. obj1 === obj2 ||
  1103. isNan(obj1) ||
  1104. isNan(obj2) ||
  1105. obj1 == null ||
  1106. obj2 == null ||
  1107. type1 !== "object" ||
  1108. type2 !== "object"
  1109. ) {
  1110. return identical_1(obj1, obj2);
  1111. }
  1112. // Elements are only equal if identical(expected, actual)
  1113. if (isElement_1(obj1) || isElement_1(obj2)) {
  1114. return false;
  1115. }
  1116. var isDate1 = isDate_1(obj1);
  1117. var isDate2 = isDate_1(obj2);
  1118. if (isDate1 || isDate2) {
  1119. if (
  1120. !isDate1 ||
  1121. !isDate2 ||
  1122. getTime.call(obj1) !== getTime.call(obj2)
  1123. ) {
  1124. return false;
  1125. }
  1126. }
  1127. if (obj1 instanceof RegExp && obj2 instanceof RegExp) {
  1128. if (valueToString$3(obj1) !== valueToString$3(obj2)) {
  1129. return false;
  1130. }
  1131. }
  1132. if (obj1 instanceof Error && obj2 instanceof Error) {
  1133. return obj1 === obj2;
  1134. }
  1135. var class1 = getClass_1(obj1);
  1136. var class2 = getClass_1(obj2);
  1137. var keys1 = keys(obj1);
  1138. var keys2 = keys(obj2);
  1139. var name1 = getClassName_1(obj1);
  1140. var name2 = getClassName_1(obj2);
  1141. if (isArguments_1(obj1) || isArguments_1(obj2)) {
  1142. if (obj1.length !== obj2.length) {
  1143. return false;
  1144. }
  1145. } else {
  1146. if (
  1147. type1 !== type2 ||
  1148. class1 !== class2 ||
  1149. keys1.length !== keys2.length ||
  1150. (name1 && name2 && name1 !== name2)
  1151. ) {
  1152. return false;
  1153. }
  1154. }
  1155. if (isSet_1(obj1) || isSet_1(obj2)) {
  1156. if (!isSet_1(obj1) || !isSet_1(obj2) || obj1.size !== obj2.size) {
  1157. return false;
  1158. }
  1159. return isSubset_1(obj1, obj2, deepEqual);
  1160. }
  1161. return every$2.call(keys1, function(key) {
  1162. if (!hasOwnProperty$2.call(obj2, key)) {
  1163. return false;
  1164. }
  1165. var value1 = obj1[key];
  1166. var value2 = obj2[key];
  1167. var isObject1 = isObject_1(value1);
  1168. var isObject2 = isObject_1(value2);
  1169. // determines, if the objects were already visited
  1170. // (it's faster to check for isObject first, than to
  1171. // get -1 from getIndex for non objects)
  1172. var index1 = isObject1 ? indexOf.call(objects1, value1) : -1;
  1173. var index2 = isObject2 ? indexOf.call(objects2, value2) : -1;
  1174. // determines the new paths of the objects
  1175. // - for non cyclic objects the current path will be extended
  1176. // by current property name
  1177. // - for cyclic objects the stored path is taken
  1178. var newPath1 =
  1179. index1 !== -1
  1180. ? paths1[index1]
  1181. : path1 + "[" + JSON.stringify(key) + "]";
  1182. var newPath2 =
  1183. index2 !== -1
  1184. ? paths2[index2]
  1185. : path2 + "[" + JSON.stringify(key) + "]";
  1186. var combinedPath = newPath1 + newPath2;
  1187. // stop recursion if current objects are already compared
  1188. if (compared[combinedPath]) {
  1189. return true;
  1190. }
  1191. // remember the current objects and their paths
  1192. if (index1 === -1 && isObject1) {
  1193. objects1.push(value1);
  1194. paths1.push(newPath1);
  1195. }
  1196. if (index2 === -1 && isObject2) {
  1197. objects2.push(value2);
  1198. paths2.push(newPath2);
  1199. }
  1200. // remember that the current objects are already compared
  1201. if (isObject1 && isObject2) {
  1202. compared[combinedPath] = true;
  1203. }
  1204. // End of cyclic logic
  1205. // neither value1 nor value2 is a cycle
  1206. // continue with next level
  1207. return deepEqual(value1, value2, newPath1, newPath2);
  1208. });
  1209. })(first, second, "$1", "$2");
  1210. }
  1211. deepEqualCyclic.use = function(match) {
  1212. return function(a, b) {
  1213. return deepEqualCyclic(a, b, match);
  1214. };
  1215. };
  1216. var deepEqual = deepEqualCyclic;
  1217. var lodash = createCommonjsModule(function (module, exports) {
  1218. (function() {
  1219. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1220. var undefined;
  1221. /** Used as the semantic version number. */
  1222. var VERSION = '4.17.11';
  1223. /** Used as the size to enable large array optimizations. */
  1224. var LARGE_ARRAY_SIZE = 200;
  1225. /** Error message constants. */
  1226. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1227. FUNC_ERROR_TEXT = 'Expected a function';
  1228. /** Used to stand-in for `undefined` hash values. */
  1229. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1230. /** Used as the maximum memoize cache size. */
  1231. var MAX_MEMOIZE_SIZE = 500;
  1232. /** Used as the internal argument placeholder. */
  1233. var PLACEHOLDER = '__lodash_placeholder__';
  1234. /** Used to compose bitmasks for cloning. */
  1235. var CLONE_DEEP_FLAG = 1,
  1236. CLONE_FLAT_FLAG = 2,
  1237. CLONE_SYMBOLS_FLAG = 4;
  1238. /** Used to compose bitmasks for value comparisons. */
  1239. var COMPARE_PARTIAL_FLAG = 1,
  1240. COMPARE_UNORDERED_FLAG = 2;
  1241. /** Used to compose bitmasks for function metadata. */
  1242. var WRAP_BIND_FLAG = 1,
  1243. WRAP_BIND_KEY_FLAG = 2,
  1244. WRAP_CURRY_BOUND_FLAG = 4,
  1245. WRAP_CURRY_FLAG = 8,
  1246. WRAP_CURRY_RIGHT_FLAG = 16,
  1247. WRAP_PARTIAL_FLAG = 32,
  1248. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1249. WRAP_ARY_FLAG = 128,
  1250. WRAP_REARG_FLAG = 256,
  1251. WRAP_FLIP_FLAG = 512;
  1252. /** Used as default options for `_.truncate`. */
  1253. var DEFAULT_TRUNC_LENGTH = 30,
  1254. DEFAULT_TRUNC_OMISSION = '...';
  1255. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1256. var HOT_COUNT = 800,
  1257. HOT_SPAN = 16;
  1258. /** Used to indicate the type of lazy iteratees. */
  1259. var LAZY_FILTER_FLAG = 1,
  1260. LAZY_MAP_FLAG = 2,
  1261. LAZY_WHILE_FLAG = 3;
  1262. /** Used as references for various `Number` constants. */
  1263. var INFINITY = 1 / 0,
  1264. MAX_SAFE_INTEGER = 9007199254740991,
  1265. MAX_INTEGER = 1.7976931348623157e+308,
  1266. NAN = 0 / 0;
  1267. /** Used as references for the maximum length and index of an array. */
  1268. var MAX_ARRAY_LENGTH = 4294967295,
  1269. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1270. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1271. /** Used to associate wrap methods with their bit flags. */
  1272. var wrapFlags = [
  1273. ['ary', WRAP_ARY_FLAG],
  1274. ['bind', WRAP_BIND_FLAG],
  1275. ['bindKey', WRAP_BIND_KEY_FLAG],
  1276. ['curry', WRAP_CURRY_FLAG],
  1277. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1278. ['flip', WRAP_FLIP_FLAG],
  1279. ['partial', WRAP_PARTIAL_FLAG],
  1280. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1281. ['rearg', WRAP_REARG_FLAG]
  1282. ];
  1283. /** `Object#toString` result references. */
  1284. var argsTag = '[object Arguments]',
  1285. arrayTag = '[object Array]',
  1286. asyncTag = '[object AsyncFunction]',
  1287. boolTag = '[object Boolean]',
  1288. dateTag = '[object Date]',
  1289. domExcTag = '[object DOMException]',
  1290. errorTag = '[object Error]',
  1291. funcTag = '[object Function]',
  1292. genTag = '[object GeneratorFunction]',
  1293. mapTag = '[object Map]',
  1294. numberTag = '[object Number]',
  1295. nullTag = '[object Null]',
  1296. objectTag = '[object Object]',
  1297. promiseTag = '[object Promise]',
  1298. proxyTag = '[object Proxy]',
  1299. regexpTag = '[object RegExp]',
  1300. setTag = '[object Set]',
  1301. stringTag = '[object String]',
  1302. symbolTag = '[object Symbol]',
  1303. undefinedTag = '[object Undefined]',
  1304. weakMapTag = '[object WeakMap]',
  1305. weakSetTag = '[object WeakSet]';
  1306. var arrayBufferTag = '[object ArrayBuffer]',
  1307. dataViewTag = '[object DataView]',
  1308. float32Tag = '[object Float32Array]',
  1309. float64Tag = '[object Float64Array]',
  1310. int8Tag = '[object Int8Array]',
  1311. int16Tag = '[object Int16Array]',
  1312. int32Tag = '[object Int32Array]',
  1313. uint8Tag = '[object Uint8Array]',
  1314. uint8ClampedTag = '[object Uint8ClampedArray]',
  1315. uint16Tag = '[object Uint16Array]',
  1316. uint32Tag = '[object Uint32Array]';
  1317. /** Used to match empty string literals in compiled template source. */
  1318. var reEmptyStringLeading = /\b__p \+= '';/g,
  1319. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1320. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1321. /** Used to match HTML entities and HTML characters. */
  1322. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1323. reUnescapedHtml = /[&<>"']/g,
  1324. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1325. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1326. /** Used to match template delimiters. */
  1327. var reEscape = /<%-([\s\S]+?)%>/g,
  1328. reEvaluate = /<%([\s\S]+?)%>/g,
  1329. reInterpolate = /<%=([\s\S]+?)%>/g;
  1330. /** Used to match property names within property paths. */
  1331. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1332. reIsPlainProp = /^\w*$/,
  1333. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1334. /**
  1335. * Used to match `RegExp`
  1336. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1337. */
  1338. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1339. reHasRegExpChar = RegExp(reRegExpChar.source);
  1340. /** Used to match leading and trailing whitespace. */
  1341. var reTrim = /^\s+|\s+$/g,
  1342. reTrimStart = /^\s+/,
  1343. reTrimEnd = /\s+$/;
  1344. /** Used to match wrap detail comments. */
  1345. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1346. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1347. reSplitDetails = /,? & /;
  1348. /** Used to match words composed of alphanumeric characters. */
  1349. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1350. /** Used to match backslashes in property paths. */
  1351. var reEscapeChar = /\\(\\)?/g;
  1352. /**
  1353. * Used to match
  1354. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1355. */
  1356. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1357. /** Used to match `RegExp` flags from their coerced string values. */
  1358. var reFlags = /\w*$/;
  1359. /** Used to detect bad signed hexadecimal string values. */
  1360. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1361. /** Used to detect binary string values. */
  1362. var reIsBinary = /^0b[01]+$/i;
  1363. /** Used to detect host constructors (Safari). */
  1364. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1365. /** Used to detect octal string values. */
  1366. var reIsOctal = /^0o[0-7]+$/i;
  1367. /** Used to detect unsigned integer values. */
  1368. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1369. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1370. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1371. /** Used to ensure capturing order of template delimiters. */
  1372. var reNoMatch = /($^)/;
  1373. /** Used to match unescaped characters in compiled string literals. */
  1374. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1375. /** Used to compose unicode character classes. */
  1376. var rsAstralRange = '\\ud800-\\udfff',
  1377. rsComboMarksRange = '\\u0300-\\u036f',
  1378. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1379. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1380. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1381. rsDingbatRange = '\\u2700-\\u27bf',
  1382. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1383. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1384. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1385. rsPunctuationRange = '\\u2000-\\u206f',
  1386. 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',
  1387. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1388. rsVarRange = '\\ufe0e\\ufe0f',
  1389. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1390. /** Used to compose unicode capture groups. */
  1391. var rsApos = "['\u2019]",
  1392. rsAstral = '[' + rsAstralRange + ']',
  1393. rsBreak = '[' + rsBreakRange + ']',
  1394. rsCombo = '[' + rsComboRange + ']',
  1395. rsDigits = '\\d+',
  1396. rsDingbat = '[' + rsDingbatRange + ']',
  1397. rsLower = '[' + rsLowerRange + ']',
  1398. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1399. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1400. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1401. rsNonAstral = '[^' + rsAstralRange + ']',
  1402. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1403. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1404. rsUpper = '[' + rsUpperRange + ']',
  1405. rsZWJ = '\\u200d';
  1406. /** Used to compose unicode regexes. */
  1407. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1408. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1409. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1410. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1411. reOptMod = rsModifier + '?',
  1412. rsOptVar = '[' + rsVarRange + ']?',
  1413. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1414. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1415. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1416. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1417. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1418. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1419. /** Used to match apostrophes. */
  1420. var reApos = RegExp(rsApos, 'g');
  1421. /**
  1422. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1423. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1424. */
  1425. var reComboMark = RegExp(rsCombo, 'g');
  1426. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1427. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1428. /** Used to match complex or compound words. */
  1429. var reUnicodeWord = RegExp([
  1430. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1431. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1432. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1433. rsUpper + '+' + rsOptContrUpper,
  1434. rsOrdUpper,
  1435. rsOrdLower,
  1436. rsDigits,
  1437. rsEmoji
  1438. ].join('|'), 'g');
  1439. /** 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/). */
  1440. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1441. /** Used to detect strings that need a more robust regexp to match words. */
  1442. 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 ]/;
  1443. /** Used to assign default `context` object properties. */
  1444. var contextProps = [
  1445. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1446. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1447. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1448. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1449. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1450. ];
  1451. /** Used to make template sourceURLs easier to identify. */
  1452. var templateCounter = -1;
  1453. /** Used to identify `toStringTag` values of typed arrays. */
  1454. var typedArrayTags = {};
  1455. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1456. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1457. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1458. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1459. typedArrayTags[uint32Tag] = true;
  1460. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1461. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1462. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1463. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1464. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1465. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1466. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1467. typedArrayTags[weakMapTag] = false;
  1468. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1469. var cloneableTags = {};
  1470. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1471. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1472. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1473. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1474. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1475. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1476. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1477. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1478. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1479. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1480. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1481. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1482. cloneableTags[weakMapTag] = false;
  1483. /** Used to map Latin Unicode letters to basic Latin letters. */
  1484. var deburredLetters = {
  1485. // Latin-1 Supplement block.
  1486. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1487. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1488. '\xc7': 'C', '\xe7': 'c',
  1489. '\xd0': 'D', '\xf0': 'd',
  1490. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1491. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1492. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1493. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1494. '\xd1': 'N', '\xf1': 'n',
  1495. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1496. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1497. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1498. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1499. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1500. '\xc6': 'Ae', '\xe6': 'ae',
  1501. '\xde': 'Th', '\xfe': 'th',
  1502. '\xdf': 'ss',
  1503. // Latin Extended-A block.
  1504. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1505. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1506. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1507. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1508. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1509. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1510. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1511. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1512. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1513. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1514. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1515. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1516. '\u0134': 'J', '\u0135': 'j',
  1517. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1518. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1519. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1520. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1521. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1522. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1523. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1524. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1525. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1526. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1527. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1528. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1529. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1530. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1531. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1532. '\u0174': 'W', '\u0175': 'w',
  1533. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1534. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1535. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1536. '\u0132': 'IJ', '\u0133': 'ij',
  1537. '\u0152': 'Oe', '\u0153': 'oe',
  1538. '\u0149': "'n", '\u017f': 's'
  1539. };
  1540. /** Used to map characters to HTML entities. */
  1541. var htmlEscapes = {
  1542. '&': '&amp;',
  1543. '<': '&lt;',
  1544. '>': '&gt;',
  1545. '"': '&quot;',
  1546. "'": '&#39;'
  1547. };
  1548. /** Used to map HTML entities to characters. */
  1549. var htmlUnescapes = {
  1550. '&amp;': '&',
  1551. '&lt;': '<',
  1552. '&gt;': '>',
  1553. '&quot;': '"',
  1554. '&#39;': "'"
  1555. };
  1556. /** Used to escape characters for inclusion in compiled string literals. */
  1557. var stringEscapes = {
  1558. '\\': '\\',
  1559. "'": "'",
  1560. '\n': 'n',
  1561. '\r': 'r',
  1562. '\u2028': 'u2028',
  1563. '\u2029': 'u2029'
  1564. };
  1565. /** Built-in method references without a dependency on `root`. */
  1566. var freeParseFloat = parseFloat,
  1567. freeParseInt = parseInt;
  1568. /** Detect free variable `global` from Node.js. */
  1569. var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  1570. /** Detect free variable `self`. */
  1571. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1572. /** Used as a reference to the global object. */
  1573. var root = freeGlobal || freeSelf || Function('return this')();
  1574. /** Detect free variable `exports`. */
  1575. var freeExports = exports && !exports.nodeType && exports;
  1576. /** Detect free variable `module`. */
  1577. var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
  1578. /** Detect the popular CommonJS extension `module.exports`. */
  1579. var moduleExports = freeModule && freeModule.exports === freeExports;
  1580. /** Detect free variable `process` from Node.js. */
  1581. var freeProcess = moduleExports && freeGlobal.process;
  1582. /** Used to access faster Node.js helpers. */
  1583. var nodeUtil = (function() {
  1584. try {
  1585. // Use `util.types` for Node.js 10+.
  1586. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1587. if (types) {
  1588. return types;
  1589. }
  1590. // Legacy `process.binding('util')` for Node.js < 10.
  1591. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1592. } catch (e) {}
  1593. }());
  1594. /* Node.js helper references. */
  1595. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1596. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1597. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1598. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1599. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1600. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1601. /*--------------------------------------------------------------------------*/
  1602. /**
  1603. * A faster alternative to `Function#apply`, this function invokes `func`
  1604. * with the `this` binding of `thisArg` and the arguments of `args`.
  1605. *
  1606. * @private
  1607. * @param {Function} func The function to invoke.
  1608. * @param {*} thisArg The `this` binding of `func`.
  1609. * @param {Array} args The arguments to invoke `func` with.
  1610. * @returns {*} Returns the result of `func`.
  1611. */
  1612. function apply(func, thisArg, args) {
  1613. switch (args.length) {
  1614. case 0: return func.call(thisArg);
  1615. case 1: return func.call(thisArg, args[0]);
  1616. case 2: return func.call(thisArg, args[0], args[1]);
  1617. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1618. }
  1619. return func.apply(thisArg, args);
  1620. }
  1621. /**
  1622. * A specialized version of `baseAggregator` for arrays.
  1623. *
  1624. * @private
  1625. * @param {Array} [array] The array to iterate over.
  1626. * @param {Function} setter The function to set `accumulator` values.
  1627. * @param {Function} iteratee The iteratee to transform keys.
  1628. * @param {Object} accumulator The initial aggregated object.
  1629. * @returns {Function} Returns `accumulator`.
  1630. */
  1631. function arrayAggregator(array, setter, iteratee, accumulator) {
  1632. var index = -1,
  1633. length = array == null ? 0 : array.length;
  1634. while (++index < length) {
  1635. var value = array[index];
  1636. setter(accumulator, value, iteratee(value), array);
  1637. }
  1638. return accumulator;
  1639. }
  1640. /**
  1641. * A specialized version of `_.forEach` for arrays without support for
  1642. * iteratee shorthands.
  1643. *
  1644. * @private
  1645. * @param {Array} [array] The array to iterate over.
  1646. * @param {Function} iteratee The function invoked per iteration.
  1647. * @returns {Array} Returns `array`.
  1648. */
  1649. function arrayEach(array, iteratee) {
  1650. var index = -1,
  1651. length = array == null ? 0 : array.length;
  1652. while (++index < length) {
  1653. if (iteratee(array[index], index, array) === false) {
  1654. break;
  1655. }
  1656. }
  1657. return array;
  1658. }
  1659. /**
  1660. * A specialized version of `_.forEachRight` for arrays without support for
  1661. * iteratee shorthands.
  1662. *
  1663. * @private
  1664. * @param {Array} [array] The array to iterate over.
  1665. * @param {Function} iteratee The function invoked per iteration.
  1666. * @returns {Array} Returns `array`.
  1667. */
  1668. function arrayEachRight(array, iteratee) {
  1669. var length = array == null ? 0 : array.length;
  1670. while (length--) {
  1671. if (iteratee(array[length], length, array) === false) {
  1672. break;
  1673. }
  1674. }
  1675. return array;
  1676. }
  1677. /**
  1678. * A specialized version of `_.every` for arrays without support for
  1679. * iteratee shorthands.
  1680. *
  1681. * @private
  1682. * @param {Array} [array] The array to iterate over.
  1683. * @param {Function} predicate The function invoked per iteration.
  1684. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1685. * else `false`.
  1686. */
  1687. function arrayEvery(array, predicate) {
  1688. var index = -1,
  1689. length = array == null ? 0 : array.length;
  1690. while (++index < length) {
  1691. if (!predicate(array[index], index, array)) {
  1692. return false;
  1693. }
  1694. }
  1695. return true;
  1696. }
  1697. /**
  1698. * A specialized version of `_.filter` for arrays without support for
  1699. * iteratee shorthands.
  1700. *
  1701. * @private
  1702. * @param {Array} [array] The array to iterate over.
  1703. * @param {Function} predicate The function invoked per iteration.
  1704. * @returns {Array} Returns the new filtered array.
  1705. */
  1706. function arrayFilter(array, predicate) {
  1707. var index = -1,
  1708. length = array == null ? 0 : array.length,
  1709. resIndex = 0,
  1710. result = [];
  1711. while (++index < length) {
  1712. var value = array[index];
  1713. if (predicate(value, index, array)) {
  1714. result[resIndex++] = value;
  1715. }
  1716. }
  1717. return result;
  1718. }
  1719. /**
  1720. * A specialized version of `_.includes` for arrays without support for
  1721. * specifying an index to search from.
  1722. *
  1723. * @private
  1724. * @param {Array} [array] The array to inspect.
  1725. * @param {*} target The value to search for.
  1726. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1727. */
  1728. function arrayIncludes(array, value) {
  1729. var length = array == null ? 0 : array.length;
  1730. return !!length && baseIndexOf(array, value, 0) > -1;
  1731. }
  1732. /**
  1733. * This function is like `arrayIncludes` except that it accepts a comparator.
  1734. *
  1735. * @private
  1736. * @param {Array} [array] The array to inspect.
  1737. * @param {*} target The value to search for.
  1738. * @param {Function} comparator The comparator invoked per element.
  1739. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1740. */
  1741. function arrayIncludesWith(array, value, comparator) {
  1742. var index = -1,
  1743. length = array == null ? 0 : array.length;
  1744. while (++index < length) {
  1745. if (comparator(value, array[index])) {
  1746. return true;
  1747. }
  1748. }
  1749. return false;
  1750. }
  1751. /**
  1752. * A specialized version of `_.map` for arrays without support for iteratee
  1753. * shorthands.
  1754. *
  1755. * @private
  1756. * @param {Array} [array] The array to iterate over.
  1757. * @param {Function} iteratee The function invoked per iteration.
  1758. * @returns {Array} Returns the new mapped array.
  1759. */
  1760. function arrayMap(array, iteratee) {
  1761. var index = -1,
  1762. length = array == null ? 0 : array.length,
  1763. result = Array(length);
  1764. while (++index < length) {
  1765. result[index] = iteratee(array[index], index, array);
  1766. }
  1767. return result;
  1768. }
  1769. /**
  1770. * Appends the elements of `values` to `array`.
  1771. *
  1772. * @private
  1773. * @param {Array} array The array to modify.
  1774. * @param {Array} values The values to append.
  1775. * @returns {Array} Returns `array`.
  1776. */
  1777. function arrayPush(array, values) {
  1778. var index = -1,
  1779. length = values.length,
  1780. offset = array.length;
  1781. while (++index < length) {
  1782. array[offset + index] = values[index];
  1783. }
  1784. return array;
  1785. }
  1786. /**
  1787. * A specialized version of `_.reduce` for arrays without support for
  1788. * iteratee shorthands.
  1789. *
  1790. * @private
  1791. * @param {Array} [array] The array to iterate over.
  1792. * @param {Function} iteratee The function invoked per iteration.
  1793. * @param {*} [accumulator] The initial value.
  1794. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1795. * the initial value.
  1796. * @returns {*} Returns the accumulated value.
  1797. */
  1798. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1799. var index = -1,
  1800. length = array == null ? 0 : array.length;
  1801. if (initAccum && length) {
  1802. accumulator = array[++index];
  1803. }
  1804. while (++index < length) {
  1805. accumulator = iteratee(accumulator, array[index], index, array);
  1806. }
  1807. return accumulator;
  1808. }
  1809. /**
  1810. * A specialized version of `_.reduceRight` for arrays without support for
  1811. * iteratee shorthands.
  1812. *
  1813. * @private
  1814. * @param {Array} [array] The array to iterate over.
  1815. * @param {Function} iteratee The function invoked per iteration.
  1816. * @param {*} [accumulator] The initial value.
  1817. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1818. * the initial value.
  1819. * @returns {*} Returns the accumulated value.
  1820. */
  1821. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1822. var length = array == null ? 0 : array.length;
  1823. if (initAccum && length) {
  1824. accumulator = array[--length];
  1825. }
  1826. while (length--) {
  1827. accumulator = iteratee(accumulator, array[length], length, array);
  1828. }
  1829. return accumulator;
  1830. }
  1831. /**
  1832. * A specialized version of `_.some` for arrays without support for iteratee
  1833. * shorthands.
  1834. *
  1835. * @private
  1836. * @param {Array} [array] The array to iterate over.
  1837. * @param {Function} predicate The function invoked per iteration.
  1838. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1839. * else `false`.
  1840. */
  1841. function arraySome(array, predicate) {
  1842. var index = -1,
  1843. length = array == null ? 0 : array.length;
  1844. while (++index < length) {
  1845. if (predicate(array[index], index, array)) {
  1846. return true;
  1847. }
  1848. }
  1849. return false;
  1850. }
  1851. /**
  1852. * Gets the size of an ASCII `string`.
  1853. *
  1854. * @private
  1855. * @param {string} string The string inspect.
  1856. * @returns {number} Returns the string size.
  1857. */
  1858. var asciiSize = baseProperty('length');
  1859. /**
  1860. * Converts an ASCII `string` to an array.
  1861. *
  1862. * @private
  1863. * @param {string} string The string to convert.
  1864. * @returns {Array} Returns the converted array.
  1865. */
  1866. function asciiToArray(string) {
  1867. return string.split('');
  1868. }
  1869. /**
  1870. * Splits an ASCII `string` into an array of its words.
  1871. *
  1872. * @private
  1873. * @param {string} The string to inspect.
  1874. * @returns {Array} Returns the words of `string`.
  1875. */
  1876. function asciiWords(string) {
  1877. return string.match(reAsciiWord) || [];
  1878. }
  1879. /**
  1880. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1881. * without support for iteratee shorthands, which iterates over `collection`
  1882. * using `eachFunc`.
  1883. *
  1884. * @private
  1885. * @param {Array|Object} collection The collection to inspect.
  1886. * @param {Function} predicate The function invoked per iteration.
  1887. * @param {Function} eachFunc The function to iterate over `collection`.
  1888. * @returns {*} Returns the found element or its key, else `undefined`.
  1889. */
  1890. function baseFindKey(collection, predicate, eachFunc) {
  1891. var result;
  1892. eachFunc(collection, function(value, key, collection) {
  1893. if (predicate(value, key, collection)) {
  1894. result = key;
  1895. return false;
  1896. }
  1897. });
  1898. return result;
  1899. }
  1900. /**
  1901. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1902. * support for iteratee shorthands.
  1903. *
  1904. * @private
  1905. * @param {Array} array The array to inspect.
  1906. * @param {Function} predicate The function invoked per iteration.
  1907. * @param {number} fromIndex The index to search from.
  1908. * @param {boolean} [fromRight] Specify iterating from right to left.
  1909. * @returns {number} Returns the index of the matched value, else `-1`.
  1910. */
  1911. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1912. var length = array.length,
  1913. index = fromIndex + (fromRight ? 1 : -1);
  1914. while ((fromRight ? index-- : ++index < length)) {
  1915. if (predicate(array[index], index, array)) {
  1916. return index;
  1917. }
  1918. }
  1919. return -1;
  1920. }
  1921. /**
  1922. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1923. *
  1924. * @private
  1925. * @param {Array} array The array to inspect.
  1926. * @param {*} value The value to search for.
  1927. * @param {number} fromIndex The index to search from.
  1928. * @returns {number} Returns the index of the matched value, else `-1`.
  1929. */
  1930. function baseIndexOf(array, value, fromIndex) {
  1931. return value === value
  1932. ? strictIndexOf(array, value, fromIndex)
  1933. : baseFindIndex(array, baseIsNaN, fromIndex);
  1934. }
  1935. /**
  1936. * This function is like `baseIndexOf` except that it accepts a comparator.
  1937. *
  1938. * @private
  1939. * @param {Array} array The array to inspect.
  1940. * @param {*} value The value to search for.
  1941. * @param {number} fromIndex The index to search from.
  1942. * @param {Function} comparator The comparator invoked per element.
  1943. * @returns {number} Returns the index of the matched value, else `-1`.
  1944. */
  1945. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1946. var index = fromIndex - 1,
  1947. length = array.length;
  1948. while (++index < length) {
  1949. if (comparator(array[index], value)) {
  1950. return index;
  1951. }
  1952. }
  1953. return -1;
  1954. }
  1955. /**
  1956. * The base implementation of `_.isNaN` without support for number objects.
  1957. *
  1958. * @private
  1959. * @param {*} value The value to check.
  1960. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1961. */
  1962. function baseIsNaN(value) {
  1963. return value !== value;
  1964. }
  1965. /**
  1966. * The base implementation of `_.mean` and `_.meanBy` without support for
  1967. * iteratee shorthands.
  1968. *
  1969. * @private
  1970. * @param {Array} array The array to iterate over.
  1971. * @param {Function} iteratee The function invoked per iteration.
  1972. * @returns {number} Returns the mean.
  1973. */
  1974. function baseMean(array, iteratee) {
  1975. var length = array == null ? 0 : array.length;
  1976. return length ? (baseSum(array, iteratee) / length) : NAN;
  1977. }
  1978. /**
  1979. * The base implementation of `_.property` without support for deep paths.
  1980. *
  1981. * @private
  1982. * @param {string} key The key of the property to get.
  1983. * @returns {Function} Returns the new accessor function.
  1984. */
  1985. function baseProperty(key) {
  1986. return function(object) {
  1987. return object == null ? undefined : object[key];
  1988. };
  1989. }
  1990. /**
  1991. * The base implementation of `_.propertyOf` without support for deep paths.
  1992. *
  1993. * @private
  1994. * @param {Object} object The object to query.
  1995. * @returns {Function} Returns the new accessor function.
  1996. */
  1997. function basePropertyOf(object) {
  1998. return function(key) {
  1999. return object == null ? undefined : object[key];
  2000. };
  2001. }
  2002. /**
  2003. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2004. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2005. *
  2006. * @private
  2007. * @param {Array|Object} collection The collection to iterate over.
  2008. * @param {Function} iteratee The function invoked per iteration.
  2009. * @param {*} accumulator The initial value.
  2010. * @param {boolean} initAccum Specify using the first or last element of
  2011. * `collection` as the initial value.
  2012. * @param {Function} eachFunc The function to iterate over `collection`.
  2013. * @returns {*} Returns the accumulated value.
  2014. */
  2015. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2016. eachFunc(collection, function(value, index, collection) {
  2017. accumulator = initAccum
  2018. ? (initAccum = false, value)
  2019. : iteratee(accumulator, value, index, collection);
  2020. });
  2021. return accumulator;
  2022. }
  2023. /**
  2024. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2025. * sort order of `array` and replaces criteria objects with their corresponding
  2026. * values.
  2027. *
  2028. * @private
  2029. * @param {Array} array The array to sort.
  2030. * @param {Function} comparer The function to define sort order.
  2031. * @returns {Array} Returns `array`.
  2032. */
  2033. function baseSortBy(array, comparer) {
  2034. var length = array.length;
  2035. array.sort(comparer);
  2036. while (length--) {
  2037. array[length] = array[length].value;
  2038. }
  2039. return array;
  2040. }
  2041. /**
  2042. * The base implementation of `_.sum` and `_.sumBy` without support for
  2043. * iteratee shorthands.
  2044. *
  2045. * @private
  2046. * @param {Array} array The array to iterate over.
  2047. * @param {Function} iteratee The function invoked per iteration.
  2048. * @returns {number} Returns the sum.
  2049. */
  2050. function baseSum(array, iteratee) {
  2051. var result,
  2052. index = -1,
  2053. length = array.length;
  2054. while (++index < length) {
  2055. var current = iteratee(array[index]);
  2056. if (current !== undefined) {
  2057. result = result === undefined ? current : (result + current);
  2058. }
  2059. }
  2060. return result;
  2061. }
  2062. /**
  2063. * The base implementation of `_.times` without support for iteratee shorthands
  2064. * or max array length checks.
  2065. *
  2066. * @private
  2067. * @param {number} n The number of times to invoke `iteratee`.
  2068. * @param {Function} iteratee The function invoked per iteration.
  2069. * @returns {Array} Returns the array of results.
  2070. */
  2071. function baseTimes(n, iteratee) {
  2072. var index = -1,
  2073. result = Array(n);
  2074. while (++index < n) {
  2075. result[index] = iteratee(index);
  2076. }
  2077. return result;
  2078. }
  2079. /**
  2080. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2081. * of key-value pairs for `object` corresponding to the property names of `props`.
  2082. *
  2083. * @private
  2084. * @param {Object} object The object to query.
  2085. * @param {Array} props The property names to get values for.
  2086. * @returns {Object} Returns the key-value pairs.
  2087. */
  2088. function baseToPairs(object, props) {
  2089. return arrayMap(props, function(key) {
  2090. return [key, object[key]];
  2091. });
  2092. }
  2093. /**
  2094. * The base implementation of `_.unary` without support for storing metadata.
  2095. *
  2096. * @private
  2097. * @param {Function} func The function to cap arguments for.
  2098. * @returns {Function} Returns the new capped function.
  2099. */
  2100. function baseUnary(func) {
  2101. return function(value) {
  2102. return func(value);
  2103. };
  2104. }
  2105. /**
  2106. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2107. * array of `object` property values corresponding to the property names
  2108. * of `props`.
  2109. *
  2110. * @private
  2111. * @param {Object} object The object to query.
  2112. * @param {Array} props The property names to get values for.
  2113. * @returns {Object} Returns the array of property values.
  2114. */
  2115. function baseValues(object, props) {
  2116. return arrayMap(props, function(key) {
  2117. return object[key];
  2118. });
  2119. }
  2120. /**
  2121. * Checks if a `cache` value for `key` exists.
  2122. *
  2123. * @private
  2124. * @param {Object} cache The cache to query.
  2125. * @param {string} key The key of the entry to check.
  2126. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2127. */
  2128. function cacheHas(cache, key) {
  2129. return cache.has(key);
  2130. }
  2131. /**
  2132. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2133. * that is not found in the character symbols.
  2134. *
  2135. * @private
  2136. * @param {Array} strSymbols The string symbols to inspect.
  2137. * @param {Array} chrSymbols The character symbols to find.
  2138. * @returns {number} Returns the index of the first unmatched string symbol.
  2139. */
  2140. function charsStartIndex(strSymbols, chrSymbols) {
  2141. var index = -1,
  2142. length = strSymbols.length;
  2143. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2144. return index;
  2145. }
  2146. /**
  2147. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2148. * that is not found in the character symbols.
  2149. *
  2150. * @private
  2151. * @param {Array} strSymbols The string symbols to inspect.
  2152. * @param {Array} chrSymbols The character symbols to find.
  2153. * @returns {number} Returns the index of the last unmatched string symbol.
  2154. */
  2155. function charsEndIndex(strSymbols, chrSymbols) {
  2156. var index = strSymbols.length;
  2157. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2158. return index;
  2159. }
  2160. /**
  2161. * Gets the number of `placeholder` occurrences in `array`.
  2162. *
  2163. * @private
  2164. * @param {Array} array The array to inspect.
  2165. * @param {*} placeholder The placeholder to search for.
  2166. * @returns {number} Returns the placeholder count.
  2167. */
  2168. function countHolders(array, placeholder) {
  2169. var length = array.length,
  2170. result = 0;
  2171. while (length--) {
  2172. if (array[length] === placeholder) {
  2173. ++result;
  2174. }
  2175. }
  2176. return result;
  2177. }
  2178. /**
  2179. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2180. * letters to basic Latin letters.
  2181. *
  2182. * @private
  2183. * @param {string} letter The matched letter to deburr.
  2184. * @returns {string} Returns the deburred letter.
  2185. */
  2186. var deburrLetter = basePropertyOf(deburredLetters);
  2187. /**
  2188. * Used by `_.escape` to convert characters to HTML entities.
  2189. *
  2190. * @private
  2191. * @param {string} chr The matched character to escape.
  2192. * @returns {string} Returns the escaped character.
  2193. */
  2194. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2195. /**
  2196. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2197. *
  2198. * @private
  2199. * @param {string} chr The matched character to escape.
  2200. * @returns {string} Returns the escaped character.
  2201. */
  2202. function escapeStringChar(chr) {
  2203. return '\\' + stringEscapes[chr];
  2204. }
  2205. /**
  2206. * Gets the value at `key` of `object`.
  2207. *
  2208. * @private
  2209. * @param {Object} [object] The object to query.
  2210. * @param {string} key The key of the property to get.
  2211. * @returns {*} Returns the property value.
  2212. */
  2213. function getValue(object, key) {
  2214. return object == null ? undefined : object[key];
  2215. }
  2216. /**
  2217. * Checks if `string` contains Unicode symbols.
  2218. *
  2219. * @private
  2220. * @param {string} string The string to inspect.
  2221. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2222. */
  2223. function hasUnicode(string) {
  2224. return reHasUnicode.test(string);
  2225. }
  2226. /**
  2227. * Checks if `string` contains a word composed of Unicode symbols.
  2228. *
  2229. * @private
  2230. * @param {string} string The string to inspect.
  2231. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2232. */
  2233. function hasUnicodeWord(string) {
  2234. return reHasUnicodeWord.test(string);
  2235. }
  2236. /**
  2237. * Converts `iterator` to an array.
  2238. *
  2239. * @private
  2240. * @param {Object} iterator The iterator to convert.
  2241. * @returns {Array} Returns the converted array.
  2242. */
  2243. function iteratorToArray(iterator) {
  2244. var data,
  2245. result = [];
  2246. while (!(data = iterator.next()).done) {
  2247. result.push(data.value);
  2248. }
  2249. return result;
  2250. }
  2251. /**
  2252. * Converts `map` to its key-value pairs.
  2253. *
  2254. * @private
  2255. * @param {Object} map The map to convert.
  2256. * @returns {Array} Returns the key-value pairs.
  2257. */
  2258. function mapToArray(map) {
  2259. var index = -1,
  2260. result = Array(map.size);
  2261. map.forEach(function(value, key) {
  2262. result[++index] = [key, value];
  2263. });
  2264. return result;
  2265. }
  2266. /**
  2267. * Creates a unary function that invokes `func` with its argument transformed.
  2268. *
  2269. * @private
  2270. * @param {Function} func The function to wrap.
  2271. * @param {Function} transform The argument transform.
  2272. * @returns {Function} Returns the new function.
  2273. */
  2274. function overArg(func, transform) {
  2275. return function(arg) {
  2276. return func(transform(arg));
  2277. };
  2278. }
  2279. /**
  2280. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2281. * and returns an array of their indexes.
  2282. *
  2283. * @private
  2284. * @param {Array} array The array to modify.
  2285. * @param {*} placeholder The placeholder to replace.
  2286. * @returns {Array} Returns the new array of placeholder indexes.
  2287. */
  2288. function replaceHolders(array, placeholder) {
  2289. var index = -1,
  2290. length = array.length,
  2291. resIndex = 0,
  2292. result = [];
  2293. while (++index < length) {
  2294. var value = array[index];
  2295. if (value === placeholder || value === PLACEHOLDER) {
  2296. array[index] = PLACEHOLDER;
  2297. result[resIndex++] = index;
  2298. }
  2299. }
  2300. return result;
  2301. }
  2302. /**
  2303. * Converts `set` to an array of its values.
  2304. *
  2305. * @private
  2306. * @param {Object} set The set to convert.
  2307. * @returns {Array} Returns the values.
  2308. */
  2309. function setToArray(set) {
  2310. var index = -1,
  2311. result = Array(set.size);
  2312. set.forEach(function(value) {
  2313. result[++index] = value;
  2314. });
  2315. return result;
  2316. }
  2317. /**
  2318. * Converts `set` to its value-value pairs.
  2319. *
  2320. * @private
  2321. * @param {Object} set The set to convert.
  2322. * @returns {Array} Returns the value-value pairs.
  2323. */
  2324. function setToPairs(set) {
  2325. var index = -1,
  2326. result = Array(set.size);
  2327. set.forEach(function(value) {
  2328. result[++index] = [value, value];
  2329. });
  2330. return result;
  2331. }
  2332. /**
  2333. * A specialized version of `_.indexOf` which performs strict equality
  2334. * comparisons of values, i.e. `===`.
  2335. *
  2336. * @private
  2337. * @param {Array} array The array to inspect.
  2338. * @param {*} value The value to search for.
  2339. * @param {number} fromIndex The index to search from.
  2340. * @returns {number} Returns the index of the matched value, else `-1`.
  2341. */
  2342. function strictIndexOf(array, value, fromIndex) {
  2343. var index = fromIndex - 1,
  2344. length = array.length;
  2345. while (++index < length) {
  2346. if (array[index] === value) {
  2347. return index;
  2348. }
  2349. }
  2350. return -1;
  2351. }
  2352. /**
  2353. * A specialized version of `_.lastIndexOf` which performs strict equality
  2354. * comparisons of values, i.e. `===`.
  2355. *
  2356. * @private
  2357. * @param {Array} array The array to inspect.
  2358. * @param {*} value The value to search for.
  2359. * @param {number} fromIndex The index to search from.
  2360. * @returns {number} Returns the index of the matched value, else `-1`.
  2361. */
  2362. function strictLastIndexOf(array, value, fromIndex) {
  2363. var index = fromIndex + 1;
  2364. while (index--) {
  2365. if (array[index] === value) {
  2366. return index;
  2367. }
  2368. }
  2369. return index;
  2370. }
  2371. /**
  2372. * Gets the number of symbols in `string`.
  2373. *
  2374. * @private
  2375. * @param {string} string The string to inspect.
  2376. * @returns {number} Returns the string size.
  2377. */
  2378. function stringSize(string) {
  2379. return hasUnicode(string)
  2380. ? unicodeSize(string)
  2381. : asciiSize(string);
  2382. }
  2383. /**
  2384. * Converts `string` to an array.
  2385. *
  2386. * @private
  2387. * @param {string} string The string to convert.
  2388. * @returns {Array} Returns the converted array.
  2389. */
  2390. function stringToArray(string) {
  2391. return hasUnicode(string)
  2392. ? unicodeToArray(string)
  2393. : asciiToArray(string);
  2394. }
  2395. /**
  2396. * Used by `_.unescape` to convert HTML entities to characters.
  2397. *
  2398. * @private
  2399. * @param {string} chr The matched character to unescape.
  2400. * @returns {string} Returns the unescaped character.
  2401. */
  2402. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2403. /**
  2404. * Gets the size of a Unicode `string`.
  2405. *
  2406. * @private
  2407. * @param {string} string The string inspect.
  2408. * @returns {number} Returns the string size.
  2409. */
  2410. function unicodeSize(string) {
  2411. var result = reUnicode.lastIndex = 0;
  2412. while (reUnicode.test(string)) {
  2413. ++result;
  2414. }
  2415. return result;
  2416. }
  2417. /**
  2418. * Converts a Unicode `string` to an array.
  2419. *
  2420. * @private
  2421. * @param {string} string The string to convert.
  2422. * @returns {Array} Returns the converted array.
  2423. */
  2424. function unicodeToArray(string) {
  2425. return string.match(reUnicode) || [];
  2426. }
  2427. /**
  2428. * Splits a Unicode `string` into an array of its words.
  2429. *
  2430. * @private
  2431. * @param {string} The string to inspect.
  2432. * @returns {Array} Returns the words of `string`.
  2433. */
  2434. function unicodeWords(string) {
  2435. return string.match(reUnicodeWord) || [];
  2436. }
  2437. /*--------------------------------------------------------------------------*/
  2438. /**
  2439. * Create a new pristine `lodash` function using the `context` object.
  2440. *
  2441. * @static
  2442. * @memberOf _
  2443. * @since 1.1.0
  2444. * @category Util
  2445. * @param {Object} [context=root] The context object.
  2446. * @returns {Function} Returns a new `lodash` function.
  2447. * @example
  2448. *
  2449. * _.mixin({ 'foo': _.constant('foo') });
  2450. *
  2451. * var lodash = _.runInContext();
  2452. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2453. *
  2454. * _.isFunction(_.foo);
  2455. * // => true
  2456. * _.isFunction(_.bar);
  2457. * // => false
  2458. *
  2459. * lodash.isFunction(lodash.foo);
  2460. * // => false
  2461. * lodash.isFunction(lodash.bar);
  2462. * // => true
  2463. *
  2464. * // Create a suped-up `defer` in Node.js.
  2465. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2466. */
  2467. var runInContext = (function runInContext(context) {
  2468. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2469. /** Built-in constructor references. */
  2470. var Array = context.Array,
  2471. Date = context.Date,
  2472. Error = context.Error,
  2473. Function = context.Function,
  2474. Math = context.Math,
  2475. Object = context.Object,
  2476. RegExp = context.RegExp,
  2477. String = context.String,
  2478. TypeError = context.TypeError;
  2479. /** Used for built-in method references. */
  2480. var arrayProto = Array.prototype,
  2481. funcProto = Function.prototype,
  2482. objectProto = Object.prototype;
  2483. /** Used to detect overreaching core-js shims. */
  2484. var coreJsData = context['__core-js_shared__'];
  2485. /** Used to resolve the decompiled source of functions. */
  2486. var funcToString = funcProto.toString;
  2487. /** Used to check objects for own properties. */
  2488. var hasOwnProperty = objectProto.hasOwnProperty;
  2489. /** Used to generate unique IDs. */
  2490. var idCounter = 0;
  2491. /** Used to detect methods masquerading as native. */
  2492. var maskSrcKey = (function() {
  2493. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2494. return uid ? ('Symbol(src)_1.' + uid) : '';
  2495. }());
  2496. /**
  2497. * Used to resolve the
  2498. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2499. * of values.
  2500. */
  2501. var nativeObjectToString = objectProto.toString;
  2502. /** Used to infer the `Object` constructor. */
  2503. var objectCtorString = funcToString.call(Object);
  2504. /** Used to restore the original `_` reference in `_.noConflict`. */
  2505. var oldDash = root._;
  2506. /** Used to detect if a method is native. */
  2507. var reIsNative = RegExp('^' +
  2508. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2509. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2510. );
  2511. /** Built-in value references. */
  2512. var Buffer = moduleExports ? context.Buffer : undefined,
  2513. Symbol = context.Symbol,
  2514. Uint8Array = context.Uint8Array,
  2515. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2516. getPrototype = overArg(Object.getPrototypeOf, Object),
  2517. objectCreate = Object.create,
  2518. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2519. splice = arrayProto.splice,
  2520. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2521. symIterator = Symbol ? Symbol.iterator : undefined,
  2522. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2523. var defineProperty = (function() {
  2524. try {
  2525. var func = getNative(Object, 'defineProperty');
  2526. func({}, '', {});
  2527. return func;
  2528. } catch (e) {}
  2529. }());
  2530. /** Mocked built-ins. */
  2531. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2532. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2533. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2534. /* Built-in method references for those with the same name as other `lodash` methods. */
  2535. var nativeCeil = Math.ceil,
  2536. nativeFloor = Math.floor,
  2537. nativeGetSymbols = Object.getOwnPropertySymbols,
  2538. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2539. nativeIsFinite = context.isFinite,
  2540. nativeJoin = arrayProto.join,
  2541. nativeKeys = overArg(Object.keys, Object),
  2542. nativeMax = Math.max,
  2543. nativeMin = Math.min,
  2544. nativeNow = Date.now,
  2545. nativeParseInt = context.parseInt,
  2546. nativeRandom = Math.random,
  2547. nativeReverse = arrayProto.reverse;
  2548. /* Built-in method references that are verified to be native. */
  2549. var DataView = getNative(context, 'DataView'),
  2550. Map = getNative(context, 'Map'),
  2551. Promise = getNative(context, 'Promise'),
  2552. Set = getNative(context, 'Set'),
  2553. WeakMap = getNative(context, 'WeakMap'),
  2554. nativeCreate = getNative(Object, 'create');
  2555. /** Used to store function metadata. */
  2556. var metaMap = WeakMap && new WeakMap;
  2557. /** Used to lookup unminified function names. */
  2558. var realNames = {};
  2559. /** Used to detect maps, sets, and weakmaps. */
  2560. var dataViewCtorString = toSource(DataView),
  2561. mapCtorString = toSource(Map),
  2562. promiseCtorString = toSource(Promise),
  2563. setCtorString = toSource(Set),
  2564. weakMapCtorString = toSource(WeakMap);
  2565. /** Used to convert symbols to primitives and strings. */
  2566. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2567. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2568. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2569. /*------------------------------------------------------------------------*/
  2570. /**
  2571. * Creates a `lodash` object which wraps `value` to enable implicit method
  2572. * chain sequences. Methods that operate on and return arrays, collections,
  2573. * and functions can be chained together. Methods that retrieve a single value
  2574. * or may return a primitive value will automatically end the chain sequence
  2575. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2576. * with `_#value`.
  2577. *
  2578. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2579. * enabled using `_.chain`.
  2580. *
  2581. * The execution of chained methods is lazy, that is, it's deferred until
  2582. * `_#value` is implicitly or explicitly called.
  2583. *
  2584. * Lazy evaluation allows several methods to support shortcut fusion.
  2585. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2586. * the creation of intermediate arrays and can greatly reduce the number of
  2587. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2588. * fusion if the section is applied to an array and iteratees accept only
  2589. * one argument. The heuristic for whether a section qualifies for shortcut
  2590. * fusion is subject to change.
  2591. *
  2592. * Chaining is supported in custom builds as long as the `_#value` method is
  2593. * directly or indirectly included in the build.
  2594. *
  2595. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2596. *
  2597. * The wrapper `Array` methods are:
  2598. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2599. *
  2600. * The wrapper `String` methods are:
  2601. * `replace` and `split`
  2602. *
  2603. * The wrapper methods that support shortcut fusion are:
  2604. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2605. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2606. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2607. *
  2608. * The chainable wrapper methods are:
  2609. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2610. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2611. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2612. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2613. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2614. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2615. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2616. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2617. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2618. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2619. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2620. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2621. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2622. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2623. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2624. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2625. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2626. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2627. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2628. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2629. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2630. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2631. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2632. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2633. *
  2634. * The wrapper methods that are **not** chainable by default are:
  2635. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2636. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2637. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2638. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2639. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2640. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2641. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2642. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2643. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2644. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2645. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2646. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2647. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2648. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2649. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2650. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2651. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2652. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2653. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2654. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2655. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2656. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2657. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2658. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2659. * `upperFirst`, `value`, and `words`
  2660. *
  2661. * @name _
  2662. * @constructor
  2663. * @category Seq
  2664. * @param {*} value The value to wrap in a `lodash` instance.
  2665. * @returns {Object} Returns the new `lodash` wrapper instance.
  2666. * @example
  2667. *
  2668. * function square(n) {
  2669. * return n * n;
  2670. * }
  2671. *
  2672. * var wrapped = _([1, 2, 3]);
  2673. *
  2674. * // Returns an unwrapped value.
  2675. * wrapped.reduce(_.add);
  2676. * // => 6
  2677. *
  2678. * // Returns a wrapped value.
  2679. * var squares = wrapped.map(square);
  2680. *
  2681. * _.isArray(squares);
  2682. * // => false
  2683. *
  2684. * _.isArray(squares.value());
  2685. * // => true
  2686. */
  2687. function lodash(value) {
  2688. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2689. if (value instanceof LodashWrapper) {
  2690. return value;
  2691. }
  2692. if (hasOwnProperty.call(value, '__wrapped__')) {
  2693. return wrapperClone(value);
  2694. }
  2695. }
  2696. return new LodashWrapper(value);
  2697. }
  2698. /**
  2699. * The base implementation of `_.create` without support for assigning
  2700. * properties to the created object.
  2701. *
  2702. * @private
  2703. * @param {Object} proto The object to inherit from.
  2704. * @returns {Object} Returns the new object.
  2705. */
  2706. var baseCreate = (function() {
  2707. function object() {}
  2708. return function(proto) {
  2709. if (!isObject(proto)) {
  2710. return {};
  2711. }
  2712. if (objectCreate) {
  2713. return objectCreate(proto);
  2714. }
  2715. object.prototype = proto;
  2716. var result = new object;
  2717. object.prototype = undefined;
  2718. return result;
  2719. };
  2720. }());
  2721. /**
  2722. * The function whose prototype chain sequence wrappers inherit from.
  2723. *
  2724. * @private
  2725. */
  2726. function baseLodash() {
  2727. // No operation performed.
  2728. }
  2729. /**
  2730. * The base constructor for creating `lodash` wrapper objects.
  2731. *
  2732. * @private
  2733. * @param {*} value The value to wrap.
  2734. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2735. */
  2736. function LodashWrapper(value, chainAll) {
  2737. this.__wrapped__ = value;
  2738. this.__actions__ = [];
  2739. this.__chain__ = !!chainAll;
  2740. this.__index__ = 0;
  2741. this.__values__ = undefined;
  2742. }
  2743. /**
  2744. * By default, the template delimiters used by lodash are like those in
  2745. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2746. * following template settings to use alternative delimiters.
  2747. *
  2748. * @static
  2749. * @memberOf _
  2750. * @type {Object}
  2751. */
  2752. lodash.templateSettings = {
  2753. /**
  2754. * Used to detect `data` property values to be HTML-escaped.
  2755. *
  2756. * @memberOf _.templateSettings
  2757. * @type {RegExp}
  2758. */
  2759. 'escape': reEscape,
  2760. /**
  2761. * Used to detect code to be evaluated.
  2762. *
  2763. * @memberOf _.templateSettings
  2764. * @type {RegExp}
  2765. */
  2766. 'evaluate': reEvaluate,
  2767. /**
  2768. * Used to detect `data` property values to inject.
  2769. *
  2770. * @memberOf _.templateSettings
  2771. * @type {RegExp}
  2772. */
  2773. 'interpolate': reInterpolate,
  2774. /**
  2775. * Used to reference the data object in the template text.
  2776. *
  2777. * @memberOf _.templateSettings
  2778. * @type {string}
  2779. */
  2780. 'variable': '',
  2781. /**
  2782. * Used to import variables into the compiled template.
  2783. *
  2784. * @memberOf _.templateSettings
  2785. * @type {Object}
  2786. */
  2787. 'imports': {
  2788. /**
  2789. * A reference to the `lodash` function.
  2790. *
  2791. * @memberOf _.templateSettings.imports
  2792. * @type {Function}
  2793. */
  2794. '_': lodash
  2795. }
  2796. };
  2797. // Ensure wrappers are instances of `baseLodash`.
  2798. lodash.prototype = baseLodash.prototype;
  2799. lodash.prototype.constructor = lodash;
  2800. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2801. LodashWrapper.prototype.constructor = LodashWrapper;
  2802. /*------------------------------------------------------------------------*/
  2803. /**
  2804. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2805. *
  2806. * @private
  2807. * @constructor
  2808. * @param {*} value The value to wrap.
  2809. */
  2810. function LazyWrapper(value) {
  2811. this.__wrapped__ = value;
  2812. this.__actions__ = [];
  2813. this.__dir__ = 1;
  2814. this.__filtered__ = false;
  2815. this.__iteratees__ = [];
  2816. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2817. this.__views__ = [];
  2818. }
  2819. /**
  2820. * Creates a clone of the lazy wrapper object.
  2821. *
  2822. * @private
  2823. * @name clone
  2824. * @memberOf LazyWrapper
  2825. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2826. */
  2827. function lazyClone() {
  2828. var result = new LazyWrapper(this.__wrapped__);
  2829. result.__actions__ = copyArray(this.__actions__);
  2830. result.__dir__ = this.__dir__;
  2831. result.__filtered__ = this.__filtered__;
  2832. result.__iteratees__ = copyArray(this.__iteratees__);
  2833. result.__takeCount__ = this.__takeCount__;
  2834. result.__views__ = copyArray(this.__views__);
  2835. return result;
  2836. }
  2837. /**
  2838. * Reverses the direction of lazy iteration.
  2839. *
  2840. * @private
  2841. * @name reverse
  2842. * @memberOf LazyWrapper
  2843. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2844. */
  2845. function lazyReverse() {
  2846. if (this.__filtered__) {
  2847. var result = new LazyWrapper(this);
  2848. result.__dir__ = -1;
  2849. result.__filtered__ = true;
  2850. } else {
  2851. result = this.clone();
  2852. result.__dir__ *= -1;
  2853. }
  2854. return result;
  2855. }
  2856. /**
  2857. * Extracts the unwrapped value from its lazy wrapper.
  2858. *
  2859. * @private
  2860. * @name value
  2861. * @memberOf LazyWrapper
  2862. * @returns {*} Returns the unwrapped value.
  2863. */
  2864. function lazyValue() {
  2865. var array = this.__wrapped__.value(),
  2866. dir = this.__dir__,
  2867. isArr = isArray(array),
  2868. isRight = dir < 0,
  2869. arrLength = isArr ? array.length : 0,
  2870. view = getView(0, arrLength, this.__views__),
  2871. start = view.start,
  2872. end = view.end,
  2873. length = end - start,
  2874. index = isRight ? end : (start - 1),
  2875. iteratees = this.__iteratees__,
  2876. iterLength = iteratees.length,
  2877. resIndex = 0,
  2878. takeCount = nativeMin(length, this.__takeCount__);
  2879. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2880. return baseWrapperValue(array, this.__actions__);
  2881. }
  2882. var result = [];
  2883. outer:
  2884. while (length-- && resIndex < takeCount) {
  2885. index += dir;
  2886. var iterIndex = -1,
  2887. value = array[index];
  2888. while (++iterIndex < iterLength) {
  2889. var data = iteratees[iterIndex],
  2890. iteratee = data.iteratee,
  2891. type = data.type,
  2892. computed = iteratee(value);
  2893. if (type == LAZY_MAP_FLAG) {
  2894. value = computed;
  2895. } else if (!computed) {
  2896. if (type == LAZY_FILTER_FLAG) {
  2897. continue outer;
  2898. } else {
  2899. break outer;
  2900. }
  2901. }
  2902. }
  2903. result[resIndex++] = value;
  2904. }
  2905. return result;
  2906. }
  2907. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2908. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2909. LazyWrapper.prototype.constructor = LazyWrapper;
  2910. /*------------------------------------------------------------------------*/
  2911. /**
  2912. * Creates a hash object.
  2913. *
  2914. * @private
  2915. * @constructor
  2916. * @param {Array} [entries] The key-value pairs to cache.
  2917. */
  2918. function Hash(entries) {
  2919. var index = -1,
  2920. length = entries == null ? 0 : entries.length;
  2921. this.clear();
  2922. while (++index < length) {
  2923. var entry = entries[index];
  2924. this.set(entry[0], entry[1]);
  2925. }
  2926. }
  2927. /**
  2928. * Removes all key-value entries from the hash.
  2929. *
  2930. * @private
  2931. * @name clear
  2932. * @memberOf Hash
  2933. */
  2934. function hashClear() {
  2935. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2936. this.size = 0;
  2937. }
  2938. /**
  2939. * Removes `key` and its value from the hash.
  2940. *
  2941. * @private
  2942. * @name delete
  2943. * @memberOf Hash
  2944. * @param {Object} hash The hash to modify.
  2945. * @param {string} key The key of the value to remove.
  2946. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2947. */
  2948. function hashDelete(key) {
  2949. var result = this.has(key) && delete this.__data__[key];
  2950. this.size -= result ? 1 : 0;
  2951. return result;
  2952. }
  2953. /**
  2954. * Gets the hash value for `key`.
  2955. *
  2956. * @private
  2957. * @name get
  2958. * @memberOf Hash
  2959. * @param {string} key The key of the value to get.
  2960. * @returns {*} Returns the entry value.
  2961. */
  2962. function hashGet(key) {
  2963. var data = this.__data__;
  2964. if (nativeCreate) {
  2965. var result = data[key];
  2966. return result === HASH_UNDEFINED ? undefined : result;
  2967. }
  2968. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2969. }
  2970. /**
  2971. * Checks if a hash value for `key` exists.
  2972. *
  2973. * @private
  2974. * @name has
  2975. * @memberOf Hash
  2976. * @param {string} key The key of the entry to check.
  2977. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2978. */
  2979. function hashHas(key) {
  2980. var data = this.__data__;
  2981. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2982. }
  2983. /**
  2984. * Sets the hash `key` to `value`.
  2985. *
  2986. * @private
  2987. * @name set
  2988. * @memberOf Hash
  2989. * @param {string} key The key of the value to set.
  2990. * @param {*} value The value to set.
  2991. * @returns {Object} Returns the hash instance.
  2992. */
  2993. function hashSet(key, value) {
  2994. var data = this.__data__;
  2995. this.size += this.has(key) ? 0 : 1;
  2996. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2997. return this;
  2998. }
  2999. // Add methods to `Hash`.
  3000. Hash.prototype.clear = hashClear;
  3001. Hash.prototype['delete'] = hashDelete;
  3002. Hash.prototype.get = hashGet;
  3003. Hash.prototype.has = hashHas;
  3004. Hash.prototype.set = hashSet;
  3005. /*------------------------------------------------------------------------*/
  3006. /**
  3007. * Creates an list cache object.
  3008. *
  3009. * @private
  3010. * @constructor
  3011. * @param {Array} [entries] The key-value pairs to cache.
  3012. */
  3013. function ListCache(entries) {
  3014. var index = -1,
  3015. length = entries == null ? 0 : entries.length;
  3016. this.clear();
  3017. while (++index < length) {
  3018. var entry = entries[index];
  3019. this.set(entry[0], entry[1]);
  3020. }
  3021. }
  3022. /**
  3023. * Removes all key-value entries from the list cache.
  3024. *
  3025. * @private
  3026. * @name clear
  3027. * @memberOf ListCache
  3028. */
  3029. function listCacheClear() {
  3030. this.__data__ = [];
  3031. this.size = 0;
  3032. }
  3033. /**
  3034. * Removes `key` and its value from the list cache.
  3035. *
  3036. * @private
  3037. * @name delete
  3038. * @memberOf ListCache
  3039. * @param {string} key The key of the value to remove.
  3040. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3041. */
  3042. function listCacheDelete(key) {
  3043. var data = this.__data__,
  3044. index = assocIndexOf(data, key);
  3045. if (index < 0) {
  3046. return false;
  3047. }
  3048. var lastIndex = data.length - 1;
  3049. if (index == lastIndex) {
  3050. data.pop();
  3051. } else {
  3052. splice.call(data, index, 1);
  3053. }
  3054. --this.size;
  3055. return true;
  3056. }
  3057. /**
  3058. * Gets the list cache value for `key`.
  3059. *
  3060. * @private
  3061. * @name get
  3062. * @memberOf ListCache
  3063. * @param {string} key The key of the value to get.
  3064. * @returns {*} Returns the entry value.
  3065. */
  3066. function listCacheGet(key) {
  3067. var data = this.__data__,
  3068. index = assocIndexOf(data, key);
  3069. return index < 0 ? undefined : data[index][1];
  3070. }
  3071. /**
  3072. * Checks if a list cache value for `key` exists.
  3073. *
  3074. * @private
  3075. * @name has
  3076. * @memberOf ListCache
  3077. * @param {string} key The key of the entry to check.
  3078. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3079. */
  3080. function listCacheHas(key) {
  3081. return assocIndexOf(this.__data__, key) > -1;
  3082. }
  3083. /**
  3084. * Sets the list cache `key` to `value`.
  3085. *
  3086. * @private
  3087. * @name set
  3088. * @memberOf ListCache
  3089. * @param {string} key The key of the value to set.
  3090. * @param {*} value The value to set.
  3091. * @returns {Object} Returns the list cache instance.
  3092. */
  3093. function listCacheSet(key, value) {
  3094. var data = this.__data__,
  3095. index = assocIndexOf(data, key);
  3096. if (index < 0) {
  3097. ++this.size;
  3098. data.push([key, value]);
  3099. } else {
  3100. data[index][1] = value;
  3101. }
  3102. return this;
  3103. }
  3104. // Add methods to `ListCache`.
  3105. ListCache.prototype.clear = listCacheClear;
  3106. ListCache.prototype['delete'] = listCacheDelete;
  3107. ListCache.prototype.get = listCacheGet;
  3108. ListCache.prototype.has = listCacheHas;
  3109. ListCache.prototype.set = listCacheSet;
  3110. /*------------------------------------------------------------------------*/
  3111. /**
  3112. * Creates a map cache object to store key-value pairs.
  3113. *
  3114. * @private
  3115. * @constructor
  3116. * @param {Array} [entries] The key-value pairs to cache.
  3117. */
  3118. function MapCache(entries) {
  3119. var index = -1,
  3120. length = entries == null ? 0 : entries.length;
  3121. this.clear();
  3122. while (++index < length) {
  3123. var entry = entries[index];
  3124. this.set(entry[0], entry[1]);
  3125. }
  3126. }
  3127. /**
  3128. * Removes all key-value entries from the map.
  3129. *
  3130. * @private
  3131. * @name clear
  3132. * @memberOf MapCache
  3133. */
  3134. function mapCacheClear() {
  3135. this.size = 0;
  3136. this.__data__ = {
  3137. 'hash': new Hash,
  3138. 'map': new (Map || ListCache),
  3139. 'string': new Hash
  3140. };
  3141. }
  3142. /**
  3143. * Removes `key` and its value from the map.
  3144. *
  3145. * @private
  3146. * @name delete
  3147. * @memberOf MapCache
  3148. * @param {string} key The key of the value to remove.
  3149. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3150. */
  3151. function mapCacheDelete(key) {
  3152. var result = getMapData(this, key)['delete'](key);
  3153. this.size -= result ? 1 : 0;
  3154. return result;
  3155. }
  3156. /**
  3157. * Gets the map value for `key`.
  3158. *
  3159. * @private
  3160. * @name get
  3161. * @memberOf MapCache
  3162. * @param {string} key The key of the value to get.
  3163. * @returns {*} Returns the entry value.
  3164. */
  3165. function mapCacheGet(key) {
  3166. return getMapData(this, key).get(key);
  3167. }
  3168. /**
  3169. * Checks if a map value for `key` exists.
  3170. *
  3171. * @private
  3172. * @name has
  3173. * @memberOf MapCache
  3174. * @param {string} key The key of the entry to check.
  3175. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3176. */
  3177. function mapCacheHas(key) {
  3178. return getMapData(this, key).has(key);
  3179. }
  3180. /**
  3181. * Sets the map `key` to `value`.
  3182. *
  3183. * @private
  3184. * @name set
  3185. * @memberOf MapCache
  3186. * @param {string} key The key of the value to set.
  3187. * @param {*} value The value to set.
  3188. * @returns {Object} Returns the map cache instance.
  3189. */
  3190. function mapCacheSet(key, value) {
  3191. var data = getMapData(this, key),
  3192. size = data.size;
  3193. data.set(key, value);
  3194. this.size += data.size == size ? 0 : 1;
  3195. return this;
  3196. }
  3197. // Add methods to `MapCache`.
  3198. MapCache.prototype.clear = mapCacheClear;
  3199. MapCache.prototype['delete'] = mapCacheDelete;
  3200. MapCache.prototype.get = mapCacheGet;
  3201. MapCache.prototype.has = mapCacheHas;
  3202. MapCache.prototype.set = mapCacheSet;
  3203. /*------------------------------------------------------------------------*/
  3204. /**
  3205. *
  3206. * Creates an array cache object to store unique values.
  3207. *
  3208. * @private
  3209. * @constructor
  3210. * @param {Array} [values] The values to cache.
  3211. */
  3212. function SetCache(values) {
  3213. var index = -1,
  3214. length = values == null ? 0 : values.length;
  3215. this.__data__ = new MapCache;
  3216. while (++index < length) {
  3217. this.add(values[index]);
  3218. }
  3219. }
  3220. /**
  3221. * Adds `value` to the array cache.
  3222. *
  3223. * @private
  3224. * @name add
  3225. * @memberOf SetCache
  3226. * @alias push
  3227. * @param {*} value The value to cache.
  3228. * @returns {Object} Returns the cache instance.
  3229. */
  3230. function setCacheAdd(value) {
  3231. this.__data__.set(value, HASH_UNDEFINED);
  3232. return this;
  3233. }
  3234. /**
  3235. * Checks if `value` is in the array cache.
  3236. *
  3237. * @private
  3238. * @name has
  3239. * @memberOf SetCache
  3240. * @param {*} value The value to search for.
  3241. * @returns {number} Returns `true` if `value` is found, else `false`.
  3242. */
  3243. function setCacheHas(value) {
  3244. return this.__data__.has(value);
  3245. }
  3246. // Add methods to `SetCache`.
  3247. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3248. SetCache.prototype.has = setCacheHas;
  3249. /*------------------------------------------------------------------------*/
  3250. /**
  3251. * Creates a stack cache object to store key-value pairs.
  3252. *
  3253. * @private
  3254. * @constructor
  3255. * @param {Array} [entries] The key-value pairs to cache.
  3256. */
  3257. function Stack(entries) {
  3258. var data = this.__data__ = new ListCache(entries);
  3259. this.size = data.size;
  3260. }
  3261. /**
  3262. * Removes all key-value entries from the stack.
  3263. *
  3264. * @private
  3265. * @name clear
  3266. * @memberOf Stack
  3267. */
  3268. function stackClear() {
  3269. this.__data__ = new ListCache;
  3270. this.size = 0;
  3271. }
  3272. /**
  3273. * Removes `key` and its value from the stack.
  3274. *
  3275. * @private
  3276. * @name delete
  3277. * @memberOf Stack
  3278. * @param {string} key The key of the value to remove.
  3279. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3280. */
  3281. function stackDelete(key) {
  3282. var data = this.__data__,
  3283. result = data['delete'](key);
  3284. this.size = data.size;
  3285. return result;
  3286. }
  3287. /**
  3288. * Gets the stack value for `key`.
  3289. *
  3290. * @private
  3291. * @name get
  3292. * @memberOf Stack
  3293. * @param {string} key The key of the value to get.
  3294. * @returns {*} Returns the entry value.
  3295. */
  3296. function stackGet(key) {
  3297. return this.__data__.get(key);
  3298. }
  3299. /**
  3300. * Checks if a stack value for `key` exists.
  3301. *
  3302. * @private
  3303. * @name has
  3304. * @memberOf Stack
  3305. * @param {string} key The key of the entry to check.
  3306. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3307. */
  3308. function stackHas(key) {
  3309. return this.__data__.has(key);
  3310. }
  3311. /**
  3312. * Sets the stack `key` to `value`.
  3313. *
  3314. * @private
  3315. * @name set
  3316. * @memberOf Stack
  3317. * @param {string} key The key of the value to set.
  3318. * @param {*} value The value to set.
  3319. * @returns {Object} Returns the stack cache instance.
  3320. */
  3321. function stackSet(key, value) {
  3322. var data = this.__data__;
  3323. if (data instanceof ListCache) {
  3324. var pairs = data.__data__;
  3325. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3326. pairs.push([key, value]);
  3327. this.size = ++data.size;
  3328. return this;
  3329. }
  3330. data = this.__data__ = new MapCache(pairs);
  3331. }
  3332. data.set(key, value);
  3333. this.size = data.size;
  3334. return this;
  3335. }
  3336. // Add methods to `Stack`.
  3337. Stack.prototype.clear = stackClear;
  3338. Stack.prototype['delete'] = stackDelete;
  3339. Stack.prototype.get = stackGet;
  3340. Stack.prototype.has = stackHas;
  3341. Stack.prototype.set = stackSet;
  3342. /*------------------------------------------------------------------------*/
  3343. /**
  3344. * Creates an array of the enumerable property names of the array-like `value`.
  3345. *
  3346. * @private
  3347. * @param {*} value The value to query.
  3348. * @param {boolean} inherited Specify returning inherited property names.
  3349. * @returns {Array} Returns the array of property names.
  3350. */
  3351. function arrayLikeKeys(value, inherited) {
  3352. var isArr = isArray(value),
  3353. isArg = !isArr && isArguments(value),
  3354. isBuff = !isArr && !isArg && isBuffer(value),
  3355. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3356. skipIndexes = isArr || isArg || isBuff || isType,
  3357. result = skipIndexes ? baseTimes(value.length, String) : [],
  3358. length = result.length;
  3359. for (var key in value) {
  3360. if ((inherited || hasOwnProperty.call(value, key)) &&
  3361. !(skipIndexes && (
  3362. // Safari 9 has enumerable `arguments.length` in strict mode.
  3363. key == 'length' ||
  3364. // Node.js 0.10 has enumerable non-index properties on buffers.
  3365. (isBuff && (key == 'offset' || key == 'parent')) ||
  3366. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3367. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3368. // Skip index properties.
  3369. isIndex(key, length)
  3370. ))) {
  3371. result.push(key);
  3372. }
  3373. }
  3374. return result;
  3375. }
  3376. /**
  3377. * A specialized version of `_.sample` for arrays.
  3378. *
  3379. * @private
  3380. * @param {Array} array The array to sample.
  3381. * @returns {*} Returns the random element.
  3382. */
  3383. function arraySample(array) {
  3384. var length = array.length;
  3385. return length ? array[baseRandom(0, length - 1)] : undefined;
  3386. }
  3387. /**
  3388. * A specialized version of `_.sampleSize` for arrays.
  3389. *
  3390. * @private
  3391. * @param {Array} array The array to sample.
  3392. * @param {number} n The number of elements to sample.
  3393. * @returns {Array} Returns the random elements.
  3394. */
  3395. function arraySampleSize(array, n) {
  3396. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3397. }
  3398. /**
  3399. * A specialized version of `_.shuffle` for arrays.
  3400. *
  3401. * @private
  3402. * @param {Array} array The array to shuffle.
  3403. * @returns {Array} Returns the new shuffled array.
  3404. */
  3405. function arrayShuffle(array) {
  3406. return shuffleSelf(copyArray(array));
  3407. }
  3408. /**
  3409. * This function is like `assignValue` except that it doesn't assign
  3410. * `undefined` values.
  3411. *
  3412. * @private
  3413. * @param {Object} object The object to modify.
  3414. * @param {string} key The key of the property to assign.
  3415. * @param {*} value The value to assign.
  3416. */
  3417. function assignMergeValue(object, key, value) {
  3418. if ((value !== undefined && !eq(object[key], value)) ||
  3419. (value === undefined && !(key in object))) {
  3420. baseAssignValue(object, key, value);
  3421. }
  3422. }
  3423. /**
  3424. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3425. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3426. * for equality comparisons.
  3427. *
  3428. * @private
  3429. * @param {Object} object The object to modify.
  3430. * @param {string} key The key of the property to assign.
  3431. * @param {*} value The value to assign.
  3432. */
  3433. function assignValue(object, key, value) {
  3434. var objValue = object[key];
  3435. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3436. (value === undefined && !(key in object))) {
  3437. baseAssignValue(object, key, value);
  3438. }
  3439. }
  3440. /**
  3441. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3442. *
  3443. * @private
  3444. * @param {Array} array The array to inspect.
  3445. * @param {*} key The key to search for.
  3446. * @returns {number} Returns the index of the matched value, else `-1`.
  3447. */
  3448. function assocIndexOf(array, key) {
  3449. var length = array.length;
  3450. while (length--) {
  3451. if (eq(array[length][0], key)) {
  3452. return length;
  3453. }
  3454. }
  3455. return -1;
  3456. }
  3457. /**
  3458. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3459. * by `iteratee` and values set by `setter`.
  3460. *
  3461. * @private
  3462. * @param {Array|Object} collection The collection to iterate over.
  3463. * @param {Function} setter The function to set `accumulator` values.
  3464. * @param {Function} iteratee The iteratee to transform keys.
  3465. * @param {Object} accumulator The initial aggregated object.
  3466. * @returns {Function} Returns `accumulator`.
  3467. */
  3468. function baseAggregator(collection, setter, iteratee, accumulator) {
  3469. baseEach(collection, function(value, key, collection) {
  3470. setter(accumulator, value, iteratee(value), collection);
  3471. });
  3472. return accumulator;
  3473. }
  3474. /**
  3475. * The base implementation of `_.assign` without support for multiple sources
  3476. * or `customizer` functions.
  3477. *
  3478. * @private
  3479. * @param {Object} object The destination object.
  3480. * @param {Object} source The source object.
  3481. * @returns {Object} Returns `object`.
  3482. */
  3483. function baseAssign(object, source) {
  3484. return object && copyObject(source, keys(source), object);
  3485. }
  3486. /**
  3487. * The base implementation of `_.assignIn` without support for multiple sources
  3488. * or `customizer` functions.
  3489. *
  3490. * @private
  3491. * @param {Object} object The destination object.
  3492. * @param {Object} source The source object.
  3493. * @returns {Object} Returns `object`.
  3494. */
  3495. function baseAssignIn(object, source) {
  3496. return object && copyObject(source, keysIn(source), object);
  3497. }
  3498. /**
  3499. * The base implementation of `assignValue` and `assignMergeValue` without
  3500. * value checks.
  3501. *
  3502. * @private
  3503. * @param {Object} object The object to modify.
  3504. * @param {string} key The key of the property to assign.
  3505. * @param {*} value The value to assign.
  3506. */
  3507. function baseAssignValue(object, key, value) {
  3508. if (key == '__proto__' && defineProperty) {
  3509. defineProperty(object, key, {
  3510. 'configurable': true,
  3511. 'enumerable': true,
  3512. 'value': value,
  3513. 'writable': true
  3514. });
  3515. } else {
  3516. object[key] = value;
  3517. }
  3518. }
  3519. /**
  3520. * The base implementation of `_.at` without support for individual paths.
  3521. *
  3522. * @private
  3523. * @param {Object} object The object to iterate over.
  3524. * @param {string[]} paths The property paths to pick.
  3525. * @returns {Array} Returns the picked elements.
  3526. */
  3527. function baseAt(object, paths) {
  3528. var index = -1,
  3529. length = paths.length,
  3530. result = Array(length),
  3531. skip = object == null;
  3532. while (++index < length) {
  3533. result[index] = skip ? undefined : get(object, paths[index]);
  3534. }
  3535. return result;
  3536. }
  3537. /**
  3538. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3539. *
  3540. * @private
  3541. * @param {number} number The number to clamp.
  3542. * @param {number} [lower] The lower bound.
  3543. * @param {number} upper The upper bound.
  3544. * @returns {number} Returns the clamped number.
  3545. */
  3546. function baseClamp(number, lower, upper) {
  3547. if (number === number) {
  3548. if (upper !== undefined) {
  3549. number = number <= upper ? number : upper;
  3550. }
  3551. if (lower !== undefined) {
  3552. number = number >= lower ? number : lower;
  3553. }
  3554. }
  3555. return number;
  3556. }
  3557. /**
  3558. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3559. * traversed objects.
  3560. *
  3561. * @private
  3562. * @param {*} value The value to clone.
  3563. * @param {boolean} bitmask The bitmask flags.
  3564. * 1 - Deep clone
  3565. * 2 - Flatten inherited properties
  3566. * 4 - Clone symbols
  3567. * @param {Function} [customizer] The function to customize cloning.
  3568. * @param {string} [key] The key of `value`.
  3569. * @param {Object} [object] The parent object of `value`.
  3570. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3571. * @returns {*} Returns the cloned value.
  3572. */
  3573. function baseClone(value, bitmask, customizer, key, object, stack) {
  3574. var result,
  3575. isDeep = bitmask & CLONE_DEEP_FLAG,
  3576. isFlat = bitmask & CLONE_FLAT_FLAG,
  3577. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3578. if (customizer) {
  3579. result = object ? customizer(value, key, object, stack) : customizer(value);
  3580. }
  3581. if (result !== undefined) {
  3582. return result;
  3583. }
  3584. if (!isObject(value)) {
  3585. return value;
  3586. }
  3587. var isArr = isArray(value);
  3588. if (isArr) {
  3589. result = initCloneArray(value);
  3590. if (!isDeep) {
  3591. return copyArray(value, result);
  3592. }
  3593. } else {
  3594. var tag = getTag(value),
  3595. isFunc = tag == funcTag || tag == genTag;
  3596. if (isBuffer(value)) {
  3597. return cloneBuffer(value, isDeep);
  3598. }
  3599. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3600. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3601. if (!isDeep) {
  3602. return isFlat
  3603. ? copySymbolsIn(value, baseAssignIn(result, value))
  3604. : copySymbols(value, baseAssign(result, value));
  3605. }
  3606. } else {
  3607. if (!cloneableTags[tag]) {
  3608. return object ? value : {};
  3609. }
  3610. result = initCloneByTag(value, tag, isDeep);
  3611. }
  3612. }
  3613. // Check for circular references and return its corresponding clone.
  3614. stack || (stack = new Stack);
  3615. var stacked = stack.get(value);
  3616. if (stacked) {
  3617. return stacked;
  3618. }
  3619. stack.set(value, result);
  3620. if (isSet(value)) {
  3621. value.forEach(function(subValue) {
  3622. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3623. });
  3624. return result;
  3625. }
  3626. if (isMap(value)) {
  3627. value.forEach(function(subValue, key) {
  3628. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3629. });
  3630. return result;
  3631. }
  3632. var keysFunc = isFull
  3633. ? (isFlat ? getAllKeysIn : getAllKeys)
  3634. : (isFlat ? keysIn : keys);
  3635. var props = isArr ? undefined : keysFunc(value);
  3636. arrayEach(props || value, function(subValue, key) {
  3637. if (props) {
  3638. key = subValue;
  3639. subValue = value[key];
  3640. }
  3641. // Recursively populate clone (susceptible to call stack limits).
  3642. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3643. });
  3644. return result;
  3645. }
  3646. /**
  3647. * The base implementation of `_.conforms` which doesn't clone `source`.
  3648. *
  3649. * @private
  3650. * @param {Object} source The object of property predicates to conform to.
  3651. * @returns {Function} Returns the new spec function.
  3652. */
  3653. function baseConforms(source) {
  3654. var props = keys(source);
  3655. return function(object) {
  3656. return baseConformsTo(object, source, props);
  3657. };
  3658. }
  3659. /**
  3660. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3661. *
  3662. * @private
  3663. * @param {Object} object The object to inspect.
  3664. * @param {Object} source The object of property predicates to conform to.
  3665. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3666. */
  3667. function baseConformsTo(object, source, props) {
  3668. var length = props.length;
  3669. if (object == null) {
  3670. return !length;
  3671. }
  3672. object = Object(object);
  3673. while (length--) {
  3674. var key = props[length],
  3675. predicate = source[key],
  3676. value = object[key];
  3677. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3678. return false;
  3679. }
  3680. }
  3681. return true;
  3682. }
  3683. /**
  3684. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3685. * to provide to `func`.
  3686. *
  3687. * @private
  3688. * @param {Function} func The function to delay.
  3689. * @param {number} wait The number of milliseconds to delay invocation.
  3690. * @param {Array} args The arguments to provide to `func`.
  3691. * @returns {number|Object} Returns the timer id or timeout object.
  3692. */
  3693. function baseDelay(func, wait, args) {
  3694. if (typeof func != 'function') {
  3695. throw new TypeError(FUNC_ERROR_TEXT);
  3696. }
  3697. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3698. }
  3699. /**
  3700. * The base implementation of methods like `_.difference` without support
  3701. * for excluding multiple arrays or iteratee shorthands.
  3702. *
  3703. * @private
  3704. * @param {Array} array The array to inspect.
  3705. * @param {Array} values The values to exclude.
  3706. * @param {Function} [iteratee] The iteratee invoked per element.
  3707. * @param {Function} [comparator] The comparator invoked per element.
  3708. * @returns {Array} Returns the new array of filtered values.
  3709. */
  3710. function baseDifference(array, values, iteratee, comparator) {
  3711. var index = -1,
  3712. includes = arrayIncludes,
  3713. isCommon = true,
  3714. length = array.length,
  3715. result = [],
  3716. valuesLength = values.length;
  3717. if (!length) {
  3718. return result;
  3719. }
  3720. if (iteratee) {
  3721. values = arrayMap(values, baseUnary(iteratee));
  3722. }
  3723. if (comparator) {
  3724. includes = arrayIncludesWith;
  3725. isCommon = false;
  3726. }
  3727. else if (values.length >= LARGE_ARRAY_SIZE) {
  3728. includes = cacheHas;
  3729. isCommon = false;
  3730. values = new SetCache(values);
  3731. }
  3732. outer:
  3733. while (++index < length) {
  3734. var value = array[index],
  3735. computed = iteratee == null ? value : iteratee(value);
  3736. value = (comparator || value !== 0) ? value : 0;
  3737. if (isCommon && computed === computed) {
  3738. var valuesIndex = valuesLength;
  3739. while (valuesIndex--) {
  3740. if (values[valuesIndex] === computed) {
  3741. continue outer;
  3742. }
  3743. }
  3744. result.push(value);
  3745. }
  3746. else if (!includes(values, computed, comparator)) {
  3747. result.push(value);
  3748. }
  3749. }
  3750. return result;
  3751. }
  3752. /**
  3753. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3754. *
  3755. * @private
  3756. * @param {Array|Object} collection The collection to iterate over.
  3757. * @param {Function} iteratee The function invoked per iteration.
  3758. * @returns {Array|Object} Returns `collection`.
  3759. */
  3760. var baseEach = createBaseEach(baseForOwn);
  3761. /**
  3762. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3763. *
  3764. * @private
  3765. * @param {Array|Object} collection The collection to iterate over.
  3766. * @param {Function} iteratee The function invoked per iteration.
  3767. * @returns {Array|Object} Returns `collection`.
  3768. */
  3769. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3770. /**
  3771. * The base implementation of `_.every` without support for iteratee shorthands.
  3772. *
  3773. * @private
  3774. * @param {Array|Object} collection The collection to iterate over.
  3775. * @param {Function} predicate The function invoked per iteration.
  3776. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3777. * else `false`
  3778. */
  3779. function baseEvery(collection, predicate) {
  3780. var result = true;
  3781. baseEach(collection, function(value, index, collection) {
  3782. result = !!predicate(value, index, collection);
  3783. return result;
  3784. });
  3785. return result;
  3786. }
  3787. /**
  3788. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3789. * `comparator` to determine the extremum value.
  3790. *
  3791. * @private
  3792. * @param {Array} array The array to iterate over.
  3793. * @param {Function} iteratee The iteratee invoked per iteration.
  3794. * @param {Function} comparator The comparator used to compare values.
  3795. * @returns {*} Returns the extremum value.
  3796. */
  3797. function baseExtremum(array, iteratee, comparator) {
  3798. var index = -1,
  3799. length = array.length;
  3800. while (++index < length) {
  3801. var value = array[index],
  3802. current = iteratee(value);
  3803. if (current != null && (computed === undefined
  3804. ? (current === current && !isSymbol(current))
  3805. : comparator(current, computed)
  3806. )) {
  3807. var computed = current,
  3808. result = value;
  3809. }
  3810. }
  3811. return result;
  3812. }
  3813. /**
  3814. * The base implementation of `_.fill` without an iteratee call guard.
  3815. *
  3816. * @private
  3817. * @param {Array} array The array to fill.
  3818. * @param {*} value The value to fill `array` with.
  3819. * @param {number} [start=0] The start position.
  3820. * @param {number} [end=array.length] The end position.
  3821. * @returns {Array} Returns `array`.
  3822. */
  3823. function baseFill(array, value, start, end) {
  3824. var length = array.length;
  3825. start = toInteger(start);
  3826. if (start < 0) {
  3827. start = -start > length ? 0 : (length + start);
  3828. }
  3829. end = (end === undefined || end > length) ? length : toInteger(end);
  3830. if (end < 0) {
  3831. end += length;
  3832. }
  3833. end = start > end ? 0 : toLength(end);
  3834. while (start < end) {
  3835. array[start++] = value;
  3836. }
  3837. return array;
  3838. }
  3839. /**
  3840. * The base implementation of `_.filter` without support for iteratee shorthands.
  3841. *
  3842. * @private
  3843. * @param {Array|Object} collection The collection to iterate over.
  3844. * @param {Function} predicate The function invoked per iteration.
  3845. * @returns {Array} Returns the new filtered array.
  3846. */
  3847. function baseFilter(collection, predicate) {
  3848. var result = [];
  3849. baseEach(collection, function(value, index, collection) {
  3850. if (predicate(value, index, collection)) {
  3851. result.push(value);
  3852. }
  3853. });
  3854. return result;
  3855. }
  3856. /**
  3857. * The base implementation of `_.flatten` with support for restricting flattening.
  3858. *
  3859. * @private
  3860. * @param {Array} array The array to flatten.
  3861. * @param {number} depth The maximum recursion depth.
  3862. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3863. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3864. * @param {Array} [result=[]] The initial result value.
  3865. * @returns {Array} Returns the new flattened array.
  3866. */
  3867. function baseFlatten(array, depth, predicate, isStrict, result) {
  3868. var index = -1,
  3869. length = array.length;
  3870. predicate || (predicate = isFlattenable);
  3871. result || (result = []);
  3872. while (++index < length) {
  3873. var value = array[index];
  3874. if (depth > 0 && predicate(value)) {
  3875. if (depth > 1) {
  3876. // Recursively flatten arrays (susceptible to call stack limits).
  3877. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3878. } else {
  3879. arrayPush(result, value);
  3880. }
  3881. } else if (!isStrict) {
  3882. result[result.length] = value;
  3883. }
  3884. }
  3885. return result;
  3886. }
  3887. /**
  3888. * The base implementation of `baseForOwn` which iterates over `object`
  3889. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3890. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3891. *
  3892. * @private
  3893. * @param {Object} object The object to iterate over.
  3894. * @param {Function} iteratee The function invoked per iteration.
  3895. * @param {Function} keysFunc The function to get the keys of `object`.
  3896. * @returns {Object} Returns `object`.
  3897. */
  3898. var baseFor = createBaseFor();
  3899. /**
  3900. * This function is like `baseFor` except that it iterates over properties
  3901. * in the opposite order.
  3902. *
  3903. * @private
  3904. * @param {Object} object The object to iterate over.
  3905. * @param {Function} iteratee The function invoked per iteration.
  3906. * @param {Function} keysFunc The function to get the keys of `object`.
  3907. * @returns {Object} Returns `object`.
  3908. */
  3909. var baseForRight = createBaseFor(true);
  3910. /**
  3911. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3912. *
  3913. * @private
  3914. * @param {Object} object The object to iterate over.
  3915. * @param {Function} iteratee The function invoked per iteration.
  3916. * @returns {Object} Returns `object`.
  3917. */
  3918. function baseForOwn(object, iteratee) {
  3919. return object && baseFor(object, iteratee, keys);
  3920. }
  3921. /**
  3922. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3923. *
  3924. * @private
  3925. * @param {Object} object The object to iterate over.
  3926. * @param {Function} iteratee The function invoked per iteration.
  3927. * @returns {Object} Returns `object`.
  3928. */
  3929. function baseForOwnRight(object, iteratee) {
  3930. return object && baseForRight(object, iteratee, keys);
  3931. }
  3932. /**
  3933. * The base implementation of `_.functions` which creates an array of
  3934. * `object` function property names filtered from `props`.
  3935. *
  3936. * @private
  3937. * @param {Object} object The object to inspect.
  3938. * @param {Array} props The property names to filter.
  3939. * @returns {Array} Returns the function names.
  3940. */
  3941. function baseFunctions(object, props) {
  3942. return arrayFilter(props, function(key) {
  3943. return isFunction(object[key]);
  3944. });
  3945. }
  3946. /**
  3947. * The base implementation of `_.get` without support for default values.
  3948. *
  3949. * @private
  3950. * @param {Object} object The object to query.
  3951. * @param {Array|string} path The path of the property to get.
  3952. * @returns {*} Returns the resolved value.
  3953. */
  3954. function baseGet(object, path) {
  3955. path = castPath(path, object);
  3956. var index = 0,
  3957. length = path.length;
  3958. while (object != null && index < length) {
  3959. object = object[toKey(path[index++])];
  3960. }
  3961. return (index && index == length) ? object : undefined;
  3962. }
  3963. /**
  3964. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3965. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3966. * symbols of `object`.
  3967. *
  3968. * @private
  3969. * @param {Object} object The object to query.
  3970. * @param {Function} keysFunc The function to get the keys of `object`.
  3971. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3972. * @returns {Array} Returns the array of property names and symbols.
  3973. */
  3974. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3975. var result = keysFunc(object);
  3976. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3977. }
  3978. /**
  3979. * The base implementation of `getTag` without fallbacks for buggy environments.
  3980. *
  3981. * @private
  3982. * @param {*} value The value to query.
  3983. * @returns {string} Returns the `toStringTag`.
  3984. */
  3985. function baseGetTag(value) {
  3986. if (value == null) {
  3987. return value === undefined ? undefinedTag : nullTag;
  3988. }
  3989. return (symToStringTag && symToStringTag in Object(value))
  3990. ? getRawTag(value)
  3991. : objectToString(value);
  3992. }
  3993. /**
  3994. * The base implementation of `_.gt` which doesn't coerce arguments.
  3995. *
  3996. * @private
  3997. * @param {*} value The value to compare.
  3998. * @param {*} other The other value to compare.
  3999. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4000. * else `false`.
  4001. */
  4002. function baseGt(value, other) {
  4003. return value > other;
  4004. }
  4005. /**
  4006. * The base implementation of `_.has` without support for deep paths.
  4007. *
  4008. * @private
  4009. * @param {Object} [object] The object to query.
  4010. * @param {Array|string} key The key to check.
  4011. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4012. */
  4013. function baseHas(object, key) {
  4014. return object != null && hasOwnProperty.call(object, key);
  4015. }
  4016. /**
  4017. * The base implementation of `_.hasIn` without support for deep paths.
  4018. *
  4019. * @private
  4020. * @param {Object} [object] The object to query.
  4021. * @param {Array|string} key The key to check.
  4022. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4023. */
  4024. function baseHasIn(object, key) {
  4025. return object != null && key in Object(object);
  4026. }
  4027. /**
  4028. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4029. *
  4030. * @private
  4031. * @param {number} number The number to check.
  4032. * @param {number} start The start of the range.
  4033. * @param {number} end The end of the range.
  4034. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4035. */
  4036. function baseInRange(number, start, end) {
  4037. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4038. }
  4039. /**
  4040. * The base implementation of methods like `_.intersection`, without support
  4041. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4042. *
  4043. * @private
  4044. * @param {Array} arrays The arrays to inspect.
  4045. * @param {Function} [iteratee] The iteratee invoked per element.
  4046. * @param {Function} [comparator] The comparator invoked per element.
  4047. * @returns {Array} Returns the new array of shared values.
  4048. */
  4049. function baseIntersection(arrays, iteratee, comparator) {
  4050. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4051. length = arrays[0].length,
  4052. othLength = arrays.length,
  4053. othIndex = othLength,
  4054. caches = Array(othLength),
  4055. maxLength = Infinity,
  4056. result = [];
  4057. while (othIndex--) {
  4058. var array = arrays[othIndex];
  4059. if (othIndex && iteratee) {
  4060. array = arrayMap(array, baseUnary(iteratee));
  4061. }
  4062. maxLength = nativeMin(array.length, maxLength);
  4063. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4064. ? new SetCache(othIndex && array)
  4065. : undefined;
  4066. }
  4067. array = arrays[0];
  4068. var index = -1,
  4069. seen = caches[0];
  4070. outer:
  4071. while (++index < length && result.length < maxLength) {
  4072. var value = array[index],
  4073. computed = iteratee ? iteratee(value) : value;
  4074. value = (comparator || value !== 0) ? value : 0;
  4075. if (!(seen
  4076. ? cacheHas(seen, computed)
  4077. : includes(result, computed, comparator)
  4078. )) {
  4079. othIndex = othLength;
  4080. while (--othIndex) {
  4081. var cache = caches[othIndex];
  4082. if (!(cache
  4083. ? cacheHas(cache, computed)
  4084. : includes(arrays[othIndex], computed, comparator))
  4085. ) {
  4086. continue outer;
  4087. }
  4088. }
  4089. if (seen) {
  4090. seen.push(computed);
  4091. }
  4092. result.push(value);
  4093. }
  4094. }
  4095. return result;
  4096. }
  4097. /**
  4098. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4099. * `object` with values transformed by `iteratee` and set by `setter`.
  4100. *
  4101. * @private
  4102. * @param {Object} object The object to iterate over.
  4103. * @param {Function} setter The function to set `accumulator` values.
  4104. * @param {Function} iteratee The iteratee to transform values.
  4105. * @param {Object} accumulator The initial inverted object.
  4106. * @returns {Function} Returns `accumulator`.
  4107. */
  4108. function baseInverter(object, setter, iteratee, accumulator) {
  4109. baseForOwn(object, function(value, key, object) {
  4110. setter(accumulator, iteratee(value), key, object);
  4111. });
  4112. return accumulator;
  4113. }
  4114. /**
  4115. * The base implementation of `_.invoke` without support for individual
  4116. * method arguments.
  4117. *
  4118. * @private
  4119. * @param {Object} object The object to query.
  4120. * @param {Array|string} path The path of the method to invoke.
  4121. * @param {Array} args The arguments to invoke the method with.
  4122. * @returns {*} Returns the result of the invoked method.
  4123. */
  4124. function baseInvoke(object, path, args) {
  4125. path = castPath(path, object);
  4126. object = parent(object, path);
  4127. var func = object == null ? object : object[toKey(last(path))];
  4128. return func == null ? undefined : apply(func, object, args);
  4129. }
  4130. /**
  4131. * The base implementation of `_.isArguments`.
  4132. *
  4133. * @private
  4134. * @param {*} value The value to check.
  4135. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4136. */
  4137. function baseIsArguments(value) {
  4138. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4139. }
  4140. /**
  4141. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4142. *
  4143. * @private
  4144. * @param {*} value The value to check.
  4145. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4146. */
  4147. function baseIsArrayBuffer(value) {
  4148. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4149. }
  4150. /**
  4151. * The base implementation of `_.isDate` without Node.js optimizations.
  4152. *
  4153. * @private
  4154. * @param {*} value The value to check.
  4155. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4156. */
  4157. function baseIsDate(value) {
  4158. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4159. }
  4160. /**
  4161. * The base implementation of `_.isEqual` which supports partial comparisons
  4162. * and tracks traversed objects.
  4163. *
  4164. * @private
  4165. * @param {*} value The value to compare.
  4166. * @param {*} other The other value to compare.
  4167. * @param {boolean} bitmask The bitmask flags.
  4168. * 1 - Unordered comparison
  4169. * 2 - Partial comparison
  4170. * @param {Function} [customizer] The function to customize comparisons.
  4171. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4172. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4173. */
  4174. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4175. if (value === other) {
  4176. return true;
  4177. }
  4178. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4179. return value !== value && other !== other;
  4180. }
  4181. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4182. }
  4183. /**
  4184. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4185. * deep comparisons and tracks traversed objects enabling objects with circular
  4186. * references to be compared.
  4187. *
  4188. * @private
  4189. * @param {Object} object The object to compare.
  4190. * @param {Object} other The other object to compare.
  4191. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4192. * @param {Function} customizer The function to customize comparisons.
  4193. * @param {Function} equalFunc The function to determine equivalents of values.
  4194. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4195. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4196. */
  4197. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4198. var objIsArr = isArray(object),
  4199. othIsArr = isArray(other),
  4200. objTag = objIsArr ? arrayTag : getTag(object),
  4201. othTag = othIsArr ? arrayTag : getTag(other);
  4202. objTag = objTag == argsTag ? objectTag : objTag;
  4203. othTag = othTag == argsTag ? objectTag : othTag;
  4204. var objIsObj = objTag == objectTag,
  4205. othIsObj = othTag == objectTag,
  4206. isSameTag = objTag == othTag;
  4207. if (isSameTag && isBuffer(object)) {
  4208. if (!isBuffer(other)) {
  4209. return false;
  4210. }
  4211. objIsArr = true;
  4212. objIsObj = false;
  4213. }
  4214. if (isSameTag && !objIsObj) {
  4215. stack || (stack = new Stack);
  4216. return (objIsArr || isTypedArray(object))
  4217. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4218. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4219. }
  4220. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4221. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4222. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4223. if (objIsWrapped || othIsWrapped) {
  4224. var objUnwrapped = objIsWrapped ? object.value() : object,
  4225. othUnwrapped = othIsWrapped ? other.value() : other;
  4226. stack || (stack = new Stack);
  4227. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4228. }
  4229. }
  4230. if (!isSameTag) {
  4231. return false;
  4232. }
  4233. stack || (stack = new Stack);
  4234. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4235. }
  4236. /**
  4237. * The base implementation of `_.isMap` without Node.js optimizations.
  4238. *
  4239. * @private
  4240. * @param {*} value The value to check.
  4241. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4242. */
  4243. function baseIsMap(value) {
  4244. return isObjectLike(value) && getTag(value) == mapTag;
  4245. }
  4246. /**
  4247. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4248. *
  4249. * @private
  4250. * @param {Object} object The object to inspect.
  4251. * @param {Object} source The object of property values to match.
  4252. * @param {Array} matchData The property names, values, and compare flags to match.
  4253. * @param {Function} [customizer] The function to customize comparisons.
  4254. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4255. */
  4256. function baseIsMatch(object, source, matchData, customizer) {
  4257. var index = matchData.length,
  4258. length = index,
  4259. noCustomizer = !customizer;
  4260. if (object == null) {
  4261. return !length;
  4262. }
  4263. object = Object(object);
  4264. while (index--) {
  4265. var data = matchData[index];
  4266. if ((noCustomizer && data[2])
  4267. ? data[1] !== object[data[0]]
  4268. : !(data[0] in object)
  4269. ) {
  4270. return false;
  4271. }
  4272. }
  4273. while (++index < length) {
  4274. data = matchData[index];
  4275. var key = data[0],
  4276. objValue = object[key],
  4277. srcValue = data[1];
  4278. if (noCustomizer && data[2]) {
  4279. if (objValue === undefined && !(key in object)) {
  4280. return false;
  4281. }
  4282. } else {
  4283. var stack = new Stack;
  4284. if (customizer) {
  4285. var result = customizer(objValue, srcValue, key, object, source, stack);
  4286. }
  4287. if (!(result === undefined
  4288. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4289. : result
  4290. )) {
  4291. return false;
  4292. }
  4293. }
  4294. }
  4295. return true;
  4296. }
  4297. /**
  4298. * The base implementation of `_.isNative` without bad shim checks.
  4299. *
  4300. * @private
  4301. * @param {*} value The value to check.
  4302. * @returns {boolean} Returns `true` if `value` is a native function,
  4303. * else `false`.
  4304. */
  4305. function baseIsNative(value) {
  4306. if (!isObject(value) || isMasked(value)) {
  4307. return false;
  4308. }
  4309. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4310. return pattern.test(toSource(value));
  4311. }
  4312. /**
  4313. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4314. *
  4315. * @private
  4316. * @param {*} value The value to check.
  4317. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4318. */
  4319. function baseIsRegExp(value) {
  4320. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4321. }
  4322. /**
  4323. * The base implementation of `_.isSet` without Node.js optimizations.
  4324. *
  4325. * @private
  4326. * @param {*} value The value to check.
  4327. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4328. */
  4329. function baseIsSet(value) {
  4330. return isObjectLike(value) && getTag(value) == setTag;
  4331. }
  4332. /**
  4333. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4334. *
  4335. * @private
  4336. * @param {*} value The value to check.
  4337. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4338. */
  4339. function baseIsTypedArray(value) {
  4340. return isObjectLike(value) &&
  4341. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4342. }
  4343. /**
  4344. * The base implementation of `_.iteratee`.
  4345. *
  4346. * @private
  4347. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4348. * @returns {Function} Returns the iteratee.
  4349. */
  4350. function baseIteratee(value) {
  4351. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4352. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4353. if (typeof value == 'function') {
  4354. return value;
  4355. }
  4356. if (value == null) {
  4357. return identity;
  4358. }
  4359. if (typeof value == 'object') {
  4360. return isArray(value)
  4361. ? baseMatchesProperty(value[0], value[1])
  4362. : baseMatches(value);
  4363. }
  4364. return property(value);
  4365. }
  4366. /**
  4367. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4368. *
  4369. * @private
  4370. * @param {Object} object The object to query.
  4371. * @returns {Array} Returns the array of property names.
  4372. */
  4373. function baseKeys(object) {
  4374. if (!isPrototype(object)) {
  4375. return nativeKeys(object);
  4376. }
  4377. var result = [];
  4378. for (var key in Object(object)) {
  4379. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4380. result.push(key);
  4381. }
  4382. }
  4383. return result;
  4384. }
  4385. /**
  4386. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4387. *
  4388. * @private
  4389. * @param {Object} object The object to query.
  4390. * @returns {Array} Returns the array of property names.
  4391. */
  4392. function baseKeysIn(object) {
  4393. if (!isObject(object)) {
  4394. return nativeKeysIn(object);
  4395. }
  4396. var isProto = isPrototype(object),
  4397. result = [];
  4398. for (var key in object) {
  4399. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4400. result.push(key);
  4401. }
  4402. }
  4403. return result;
  4404. }
  4405. /**
  4406. * The base implementation of `_.lt` which doesn't coerce arguments.
  4407. *
  4408. * @private
  4409. * @param {*} value The value to compare.
  4410. * @param {*} other The other value to compare.
  4411. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4412. * else `false`.
  4413. */
  4414. function baseLt(value, other) {
  4415. return value < other;
  4416. }
  4417. /**
  4418. * The base implementation of `_.map` without support for iteratee shorthands.
  4419. *
  4420. * @private
  4421. * @param {Array|Object} collection The collection to iterate over.
  4422. * @param {Function} iteratee The function invoked per iteration.
  4423. * @returns {Array} Returns the new mapped array.
  4424. */
  4425. function baseMap(collection, iteratee) {
  4426. var index = -1,
  4427. result = isArrayLike(collection) ? Array(collection.length) : [];
  4428. baseEach(collection, function(value, key, collection) {
  4429. result[++index] = iteratee(value, key, collection);
  4430. });
  4431. return result;
  4432. }
  4433. /**
  4434. * The base implementation of `_.matches` which doesn't clone `source`.
  4435. *
  4436. * @private
  4437. * @param {Object} source The object of property values to match.
  4438. * @returns {Function} Returns the new spec function.
  4439. */
  4440. function baseMatches(source) {
  4441. var matchData = getMatchData(source);
  4442. if (matchData.length == 1 && matchData[0][2]) {
  4443. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4444. }
  4445. return function(object) {
  4446. return object === source || baseIsMatch(object, source, matchData);
  4447. };
  4448. }
  4449. /**
  4450. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4451. *
  4452. * @private
  4453. * @param {string} path The path of the property to get.
  4454. * @param {*} srcValue The value to match.
  4455. * @returns {Function} Returns the new spec function.
  4456. */
  4457. function baseMatchesProperty(path, srcValue) {
  4458. if (isKey(path) && isStrictComparable(srcValue)) {
  4459. return matchesStrictComparable(toKey(path), srcValue);
  4460. }
  4461. return function(object) {
  4462. var objValue = get(object, path);
  4463. return (objValue === undefined && objValue === srcValue)
  4464. ? hasIn(object, path)
  4465. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4466. };
  4467. }
  4468. /**
  4469. * The base implementation of `_.merge` without support for multiple sources.
  4470. *
  4471. * @private
  4472. * @param {Object} object The destination object.
  4473. * @param {Object} source The source object.
  4474. * @param {number} srcIndex The index of `source`.
  4475. * @param {Function} [customizer] The function to customize merged values.
  4476. * @param {Object} [stack] Tracks traversed source values and their merged
  4477. * counterparts.
  4478. */
  4479. function baseMerge(object, source, srcIndex, customizer, stack) {
  4480. if (object === source) {
  4481. return;
  4482. }
  4483. baseFor(source, function(srcValue, key) {
  4484. if (isObject(srcValue)) {
  4485. stack || (stack = new Stack);
  4486. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4487. }
  4488. else {
  4489. var newValue = customizer
  4490. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4491. : undefined;
  4492. if (newValue === undefined) {
  4493. newValue = srcValue;
  4494. }
  4495. assignMergeValue(object, key, newValue);
  4496. }
  4497. }, keysIn);
  4498. }
  4499. /**
  4500. * A specialized version of `baseMerge` for arrays and objects which performs
  4501. * deep merges and tracks traversed objects enabling objects with circular
  4502. * references to be merged.
  4503. *
  4504. * @private
  4505. * @param {Object} object The destination object.
  4506. * @param {Object} source The source object.
  4507. * @param {string} key The key of the value to merge.
  4508. * @param {number} srcIndex The index of `source`.
  4509. * @param {Function} mergeFunc The function to merge values.
  4510. * @param {Function} [customizer] The function to customize assigned values.
  4511. * @param {Object} [stack] Tracks traversed source values and their merged
  4512. * counterparts.
  4513. */
  4514. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4515. var objValue = safeGet(object, key),
  4516. srcValue = safeGet(source, key),
  4517. stacked = stack.get(srcValue);
  4518. if (stacked) {
  4519. assignMergeValue(object, key, stacked);
  4520. return;
  4521. }
  4522. var newValue = customizer
  4523. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4524. : undefined;
  4525. var isCommon = newValue === undefined;
  4526. if (isCommon) {
  4527. var isArr = isArray(srcValue),
  4528. isBuff = !isArr && isBuffer(srcValue),
  4529. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4530. newValue = srcValue;
  4531. if (isArr || isBuff || isTyped) {
  4532. if (isArray(objValue)) {
  4533. newValue = objValue;
  4534. }
  4535. else if (isArrayLikeObject(objValue)) {
  4536. newValue = copyArray(objValue);
  4537. }
  4538. else if (isBuff) {
  4539. isCommon = false;
  4540. newValue = cloneBuffer(srcValue, true);
  4541. }
  4542. else if (isTyped) {
  4543. isCommon = false;
  4544. newValue = cloneTypedArray(srcValue, true);
  4545. }
  4546. else {
  4547. newValue = [];
  4548. }
  4549. }
  4550. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4551. newValue = objValue;
  4552. if (isArguments(objValue)) {
  4553. newValue = toPlainObject(objValue);
  4554. }
  4555. else if (!isObject(objValue) || isFunction(objValue)) {
  4556. newValue = initCloneObject(srcValue);
  4557. }
  4558. }
  4559. else {
  4560. isCommon = false;
  4561. }
  4562. }
  4563. if (isCommon) {
  4564. // Recursively merge objects and arrays (susceptible to call stack limits).
  4565. stack.set(srcValue, newValue);
  4566. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4567. stack['delete'](srcValue);
  4568. }
  4569. assignMergeValue(object, key, newValue);
  4570. }
  4571. /**
  4572. * The base implementation of `_.nth` which doesn't coerce arguments.
  4573. *
  4574. * @private
  4575. * @param {Array} array The array to query.
  4576. * @param {number} n The index of the element to return.
  4577. * @returns {*} Returns the nth element of `array`.
  4578. */
  4579. function baseNth(array, n) {
  4580. var length = array.length;
  4581. if (!length) {
  4582. return;
  4583. }
  4584. n += n < 0 ? length : 0;
  4585. return isIndex(n, length) ? array[n] : undefined;
  4586. }
  4587. /**
  4588. * The base implementation of `_.orderBy` without param guards.
  4589. *
  4590. * @private
  4591. * @param {Array|Object} collection The collection to iterate over.
  4592. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4593. * @param {string[]} orders The sort orders of `iteratees`.
  4594. * @returns {Array} Returns the new sorted array.
  4595. */
  4596. function baseOrderBy(collection, iteratees, orders) {
  4597. var index = -1;
  4598. iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
  4599. var result = baseMap(collection, function(value, key, collection) {
  4600. var criteria = arrayMap(iteratees, function(iteratee) {
  4601. return iteratee(value);
  4602. });
  4603. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4604. });
  4605. return baseSortBy(result, function(object, other) {
  4606. return compareMultiple(object, other, orders);
  4607. });
  4608. }
  4609. /**
  4610. * The base implementation of `_.pick` without support for individual
  4611. * property identifiers.
  4612. *
  4613. * @private
  4614. * @param {Object} object The source object.
  4615. * @param {string[]} paths The property paths to pick.
  4616. * @returns {Object} Returns the new object.
  4617. */
  4618. function basePick(object, paths) {
  4619. return basePickBy(object, paths, function(value, path) {
  4620. return hasIn(object, path);
  4621. });
  4622. }
  4623. /**
  4624. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4625. *
  4626. * @private
  4627. * @param {Object} object The source object.
  4628. * @param {string[]} paths The property paths to pick.
  4629. * @param {Function} predicate The function invoked per property.
  4630. * @returns {Object} Returns the new object.
  4631. */
  4632. function basePickBy(object, paths, predicate) {
  4633. var index = -1,
  4634. length = paths.length,
  4635. result = {};
  4636. while (++index < length) {
  4637. var path = paths[index],
  4638. value = baseGet(object, path);
  4639. if (predicate(value, path)) {
  4640. baseSet(result, castPath(path, object), value);
  4641. }
  4642. }
  4643. return result;
  4644. }
  4645. /**
  4646. * A specialized version of `baseProperty` which supports deep paths.
  4647. *
  4648. * @private
  4649. * @param {Array|string} path The path of the property to get.
  4650. * @returns {Function} Returns the new accessor function.
  4651. */
  4652. function basePropertyDeep(path) {
  4653. return function(object) {
  4654. return baseGet(object, path);
  4655. };
  4656. }
  4657. /**
  4658. * The base implementation of `_.pullAllBy` without support for iteratee
  4659. * shorthands.
  4660. *
  4661. * @private
  4662. * @param {Array} array The array to modify.
  4663. * @param {Array} values The values to remove.
  4664. * @param {Function} [iteratee] The iteratee invoked per element.
  4665. * @param {Function} [comparator] The comparator invoked per element.
  4666. * @returns {Array} Returns `array`.
  4667. */
  4668. function basePullAll(array, values, iteratee, comparator) {
  4669. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4670. index = -1,
  4671. length = values.length,
  4672. seen = array;
  4673. if (array === values) {
  4674. values = copyArray(values);
  4675. }
  4676. if (iteratee) {
  4677. seen = arrayMap(array, baseUnary(iteratee));
  4678. }
  4679. while (++index < length) {
  4680. var fromIndex = 0,
  4681. value = values[index],
  4682. computed = iteratee ? iteratee(value) : value;
  4683. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4684. if (seen !== array) {
  4685. splice.call(seen, fromIndex, 1);
  4686. }
  4687. splice.call(array, fromIndex, 1);
  4688. }
  4689. }
  4690. return array;
  4691. }
  4692. /**
  4693. * The base implementation of `_.pullAt` without support for individual
  4694. * indexes or capturing the removed elements.
  4695. *
  4696. * @private
  4697. * @param {Array} array The array to modify.
  4698. * @param {number[]} indexes The indexes of elements to remove.
  4699. * @returns {Array} Returns `array`.
  4700. */
  4701. function basePullAt(array, indexes) {
  4702. var length = array ? indexes.length : 0,
  4703. lastIndex = length - 1;
  4704. while (length--) {
  4705. var index = indexes[length];
  4706. if (length == lastIndex || index !== previous) {
  4707. var previous = index;
  4708. if (isIndex(index)) {
  4709. splice.call(array, index, 1);
  4710. } else {
  4711. baseUnset(array, index);
  4712. }
  4713. }
  4714. }
  4715. return array;
  4716. }
  4717. /**
  4718. * The base implementation of `_.random` without support for returning
  4719. * floating-point numbers.
  4720. *
  4721. * @private
  4722. * @param {number} lower The lower bound.
  4723. * @param {number} upper The upper bound.
  4724. * @returns {number} Returns the random number.
  4725. */
  4726. function baseRandom(lower, upper) {
  4727. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4728. }
  4729. /**
  4730. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4731. * coerce arguments.
  4732. *
  4733. * @private
  4734. * @param {number} start The start of the range.
  4735. * @param {number} end The end of the range.
  4736. * @param {number} step The value to increment or decrement by.
  4737. * @param {boolean} [fromRight] Specify iterating from right to left.
  4738. * @returns {Array} Returns the range of numbers.
  4739. */
  4740. function baseRange(start, end, step, fromRight) {
  4741. var index = -1,
  4742. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4743. result = Array(length);
  4744. while (length--) {
  4745. result[fromRight ? length : ++index] = start;
  4746. start += step;
  4747. }
  4748. return result;
  4749. }
  4750. /**
  4751. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4752. *
  4753. * @private
  4754. * @param {string} string The string to repeat.
  4755. * @param {number} n The number of times to repeat the string.
  4756. * @returns {string} Returns the repeated string.
  4757. */
  4758. function baseRepeat(string, n) {
  4759. var result = '';
  4760. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4761. return result;
  4762. }
  4763. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4764. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4765. do {
  4766. if (n % 2) {
  4767. result += string;
  4768. }
  4769. n = nativeFloor(n / 2);
  4770. if (n) {
  4771. string += string;
  4772. }
  4773. } while (n);
  4774. return result;
  4775. }
  4776. /**
  4777. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4778. *
  4779. * @private
  4780. * @param {Function} func The function to apply a rest parameter to.
  4781. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4782. * @returns {Function} Returns the new function.
  4783. */
  4784. function baseRest(func, start) {
  4785. return setToString(overRest(func, start, identity), func + '');
  4786. }
  4787. /**
  4788. * The base implementation of `_.sample`.
  4789. *
  4790. * @private
  4791. * @param {Array|Object} collection The collection to sample.
  4792. * @returns {*} Returns the random element.
  4793. */
  4794. function baseSample(collection) {
  4795. return arraySample(values(collection));
  4796. }
  4797. /**
  4798. * The base implementation of `_.sampleSize` without param guards.
  4799. *
  4800. * @private
  4801. * @param {Array|Object} collection The collection to sample.
  4802. * @param {number} n The number of elements to sample.
  4803. * @returns {Array} Returns the random elements.
  4804. */
  4805. function baseSampleSize(collection, n) {
  4806. var array = values(collection);
  4807. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4808. }
  4809. /**
  4810. * The base implementation of `_.set`.
  4811. *
  4812. * @private
  4813. * @param {Object} object The object to modify.
  4814. * @param {Array|string} path The path of the property to set.
  4815. * @param {*} value The value to set.
  4816. * @param {Function} [customizer] The function to customize path creation.
  4817. * @returns {Object} Returns `object`.
  4818. */
  4819. function baseSet(object, path, value, customizer) {
  4820. if (!isObject(object)) {
  4821. return object;
  4822. }
  4823. path = castPath(path, object);
  4824. var index = -1,
  4825. length = path.length,
  4826. lastIndex = length - 1,
  4827. nested = object;
  4828. while (nested != null && ++index < length) {
  4829. var key = toKey(path[index]),
  4830. newValue = value;
  4831. if (index != lastIndex) {
  4832. var objValue = nested[key];
  4833. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4834. if (newValue === undefined) {
  4835. newValue = isObject(objValue)
  4836. ? objValue
  4837. : (isIndex(path[index + 1]) ? [] : {});
  4838. }
  4839. }
  4840. assignValue(nested, key, newValue);
  4841. nested = nested[key];
  4842. }
  4843. return object;
  4844. }
  4845. /**
  4846. * The base implementation of `setData` without support for hot loop shorting.
  4847. *
  4848. * @private
  4849. * @param {Function} func The function to associate metadata with.
  4850. * @param {*} data The metadata.
  4851. * @returns {Function} Returns `func`.
  4852. */
  4853. var baseSetData = !metaMap ? identity : function(func, data) {
  4854. metaMap.set(func, data);
  4855. return func;
  4856. };
  4857. /**
  4858. * The base implementation of `setToString` without support for hot loop shorting.
  4859. *
  4860. * @private
  4861. * @param {Function} func The function to modify.
  4862. * @param {Function} string The `toString` result.
  4863. * @returns {Function} Returns `func`.
  4864. */
  4865. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4866. return defineProperty(func, 'toString', {
  4867. 'configurable': true,
  4868. 'enumerable': false,
  4869. 'value': constant(string),
  4870. 'writable': true
  4871. });
  4872. };
  4873. /**
  4874. * The base implementation of `_.shuffle`.
  4875. *
  4876. * @private
  4877. * @param {Array|Object} collection The collection to shuffle.
  4878. * @returns {Array} Returns the new shuffled array.
  4879. */
  4880. function baseShuffle(collection) {
  4881. return shuffleSelf(values(collection));
  4882. }
  4883. /**
  4884. * The base implementation of `_.slice` without an iteratee call guard.
  4885. *
  4886. * @private
  4887. * @param {Array} array The array to slice.
  4888. * @param {number} [start=0] The start position.
  4889. * @param {number} [end=array.length] The end position.
  4890. * @returns {Array} Returns the slice of `array`.
  4891. */
  4892. function baseSlice(array, start, end) {
  4893. var index = -1,
  4894. length = array.length;
  4895. if (start < 0) {
  4896. start = -start > length ? 0 : (length + start);
  4897. }
  4898. end = end > length ? length : end;
  4899. if (end < 0) {
  4900. end += length;
  4901. }
  4902. length = start > end ? 0 : ((end - start) >>> 0);
  4903. start >>>= 0;
  4904. var result = Array(length);
  4905. while (++index < length) {
  4906. result[index] = array[index + start];
  4907. }
  4908. return result;
  4909. }
  4910. /**
  4911. * The base implementation of `_.some` without support for iteratee shorthands.
  4912. *
  4913. * @private
  4914. * @param {Array|Object} collection The collection to iterate over.
  4915. * @param {Function} predicate The function invoked per iteration.
  4916. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4917. * else `false`.
  4918. */
  4919. function baseSome(collection, predicate) {
  4920. var result;
  4921. baseEach(collection, function(value, index, collection) {
  4922. result = predicate(value, index, collection);
  4923. return !result;
  4924. });
  4925. return !!result;
  4926. }
  4927. /**
  4928. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4929. * performs a binary search of `array` to determine the index at which `value`
  4930. * should be inserted into `array` in order to maintain its sort order.
  4931. *
  4932. * @private
  4933. * @param {Array} array The sorted array to inspect.
  4934. * @param {*} value The value to evaluate.
  4935. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4936. * @returns {number} Returns the index at which `value` should be inserted
  4937. * into `array`.
  4938. */
  4939. function baseSortedIndex(array, value, retHighest) {
  4940. var low = 0,
  4941. high = array == null ? low : array.length;
  4942. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4943. while (low < high) {
  4944. var mid = (low + high) >>> 1,
  4945. computed = array[mid];
  4946. if (computed !== null && !isSymbol(computed) &&
  4947. (retHighest ? (computed <= value) : (computed < value))) {
  4948. low = mid + 1;
  4949. } else {
  4950. high = mid;
  4951. }
  4952. }
  4953. return high;
  4954. }
  4955. return baseSortedIndexBy(array, value, identity, retHighest);
  4956. }
  4957. /**
  4958. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4959. * which invokes `iteratee` for `value` and each element of `array` to compute
  4960. * their sort ranking. The iteratee is invoked with one argument; (value).
  4961. *
  4962. * @private
  4963. * @param {Array} array The sorted array to inspect.
  4964. * @param {*} value The value to evaluate.
  4965. * @param {Function} iteratee The iteratee invoked per element.
  4966. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4967. * @returns {number} Returns the index at which `value` should be inserted
  4968. * into `array`.
  4969. */
  4970. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4971. value = iteratee(value);
  4972. var low = 0,
  4973. high = array == null ? 0 : array.length,
  4974. valIsNaN = value !== value,
  4975. valIsNull = value === null,
  4976. valIsSymbol = isSymbol(value),
  4977. valIsUndefined = value === undefined;
  4978. while (low < high) {
  4979. var mid = nativeFloor((low + high) / 2),
  4980. computed = iteratee(array[mid]),
  4981. othIsDefined = computed !== undefined,
  4982. othIsNull = computed === null,
  4983. othIsReflexive = computed === computed,
  4984. othIsSymbol = isSymbol(computed);
  4985. if (valIsNaN) {
  4986. var setLow = retHighest || othIsReflexive;
  4987. } else if (valIsUndefined) {
  4988. setLow = othIsReflexive && (retHighest || othIsDefined);
  4989. } else if (valIsNull) {
  4990. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4991. } else if (valIsSymbol) {
  4992. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4993. } else if (othIsNull || othIsSymbol) {
  4994. setLow = false;
  4995. } else {
  4996. setLow = retHighest ? (computed <= value) : (computed < value);
  4997. }
  4998. if (setLow) {
  4999. low = mid + 1;
  5000. } else {
  5001. high = mid;
  5002. }
  5003. }
  5004. return nativeMin(high, MAX_ARRAY_INDEX);
  5005. }
  5006. /**
  5007. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5008. * support for iteratee shorthands.
  5009. *
  5010. * @private
  5011. * @param {Array} array The array to inspect.
  5012. * @param {Function} [iteratee] The iteratee invoked per element.
  5013. * @returns {Array} Returns the new duplicate free array.
  5014. */
  5015. function baseSortedUniq(array, iteratee) {
  5016. var index = -1,
  5017. length = array.length,
  5018. resIndex = 0,
  5019. result = [];
  5020. while (++index < length) {
  5021. var value = array[index],
  5022. computed = iteratee ? iteratee(value) : value;
  5023. if (!index || !eq(computed, seen)) {
  5024. var seen = computed;
  5025. result[resIndex++] = value === 0 ? 0 : value;
  5026. }
  5027. }
  5028. return result;
  5029. }
  5030. /**
  5031. * The base implementation of `_.toNumber` which doesn't ensure correct
  5032. * conversions of binary, hexadecimal, or octal string values.
  5033. *
  5034. * @private
  5035. * @param {*} value The value to process.
  5036. * @returns {number} Returns the number.
  5037. */
  5038. function baseToNumber(value) {
  5039. if (typeof value == 'number') {
  5040. return value;
  5041. }
  5042. if (isSymbol(value)) {
  5043. return NAN;
  5044. }
  5045. return +value;
  5046. }
  5047. /**
  5048. * The base implementation of `_.toString` which doesn't convert nullish
  5049. * values to empty strings.
  5050. *
  5051. * @private
  5052. * @param {*} value The value to process.
  5053. * @returns {string} Returns the string.
  5054. */
  5055. function baseToString(value) {
  5056. // Exit early for strings to avoid a performance hit in some environments.
  5057. if (typeof value == 'string') {
  5058. return value;
  5059. }
  5060. if (isArray(value)) {
  5061. // Recursively convert values (susceptible to call stack limits).
  5062. return arrayMap(value, baseToString) + '';
  5063. }
  5064. if (isSymbol(value)) {
  5065. return symbolToString ? symbolToString.call(value) : '';
  5066. }
  5067. var result = (value + '');
  5068. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5069. }
  5070. /**
  5071. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5072. *
  5073. * @private
  5074. * @param {Array} array The array to inspect.
  5075. * @param {Function} [iteratee] The iteratee invoked per element.
  5076. * @param {Function} [comparator] The comparator invoked per element.
  5077. * @returns {Array} Returns the new duplicate free array.
  5078. */
  5079. function baseUniq(array, iteratee, comparator) {
  5080. var index = -1,
  5081. includes = arrayIncludes,
  5082. length = array.length,
  5083. isCommon = true,
  5084. result = [],
  5085. seen = result;
  5086. if (comparator) {
  5087. isCommon = false;
  5088. includes = arrayIncludesWith;
  5089. }
  5090. else if (length >= LARGE_ARRAY_SIZE) {
  5091. var set = iteratee ? null : createSet(array);
  5092. if (set) {
  5093. return setToArray(set);
  5094. }
  5095. isCommon = false;
  5096. includes = cacheHas;
  5097. seen = new SetCache;
  5098. }
  5099. else {
  5100. seen = iteratee ? [] : result;
  5101. }
  5102. outer:
  5103. while (++index < length) {
  5104. var value = array[index],
  5105. computed = iteratee ? iteratee(value) : value;
  5106. value = (comparator || value !== 0) ? value : 0;
  5107. if (isCommon && computed === computed) {
  5108. var seenIndex = seen.length;
  5109. while (seenIndex--) {
  5110. if (seen[seenIndex] === computed) {
  5111. continue outer;
  5112. }
  5113. }
  5114. if (iteratee) {
  5115. seen.push(computed);
  5116. }
  5117. result.push(value);
  5118. }
  5119. else if (!includes(seen, computed, comparator)) {
  5120. if (seen !== result) {
  5121. seen.push(computed);
  5122. }
  5123. result.push(value);
  5124. }
  5125. }
  5126. return result;
  5127. }
  5128. /**
  5129. * The base implementation of `_.unset`.
  5130. *
  5131. * @private
  5132. * @param {Object} object The object to modify.
  5133. * @param {Array|string} path The property path to unset.
  5134. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5135. */
  5136. function baseUnset(object, path) {
  5137. path = castPath(path, object);
  5138. object = parent(object, path);
  5139. return object == null || delete object[toKey(last(path))];
  5140. }
  5141. /**
  5142. * The base implementation of `_.update`.
  5143. *
  5144. * @private
  5145. * @param {Object} object The object to modify.
  5146. * @param {Array|string} path The path of the property to update.
  5147. * @param {Function} updater The function to produce the updated value.
  5148. * @param {Function} [customizer] The function to customize path creation.
  5149. * @returns {Object} Returns `object`.
  5150. */
  5151. function baseUpdate(object, path, updater, customizer) {
  5152. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5153. }
  5154. /**
  5155. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5156. * without support for iteratee shorthands.
  5157. *
  5158. * @private
  5159. * @param {Array} array The array to query.
  5160. * @param {Function} predicate The function invoked per iteration.
  5161. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5162. * @param {boolean} [fromRight] Specify iterating from right to left.
  5163. * @returns {Array} Returns the slice of `array`.
  5164. */
  5165. function baseWhile(array, predicate, isDrop, fromRight) {
  5166. var length = array.length,
  5167. index = fromRight ? length : -1;
  5168. while ((fromRight ? index-- : ++index < length) &&
  5169. predicate(array[index], index, array)) {}
  5170. return isDrop
  5171. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5172. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5173. }
  5174. /**
  5175. * The base implementation of `wrapperValue` which returns the result of
  5176. * performing a sequence of actions on the unwrapped `value`, where each
  5177. * successive action is supplied the return value of the previous.
  5178. *
  5179. * @private
  5180. * @param {*} value The unwrapped value.
  5181. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5182. * @returns {*} Returns the resolved value.
  5183. */
  5184. function baseWrapperValue(value, actions) {
  5185. var result = value;
  5186. if (result instanceof LazyWrapper) {
  5187. result = result.value();
  5188. }
  5189. return arrayReduce(actions, function(result, action) {
  5190. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5191. }, result);
  5192. }
  5193. /**
  5194. * The base implementation of methods like `_.xor`, without support for
  5195. * iteratee shorthands, that accepts an array of arrays to inspect.
  5196. *
  5197. * @private
  5198. * @param {Array} arrays The arrays to inspect.
  5199. * @param {Function} [iteratee] The iteratee invoked per element.
  5200. * @param {Function} [comparator] The comparator invoked per element.
  5201. * @returns {Array} Returns the new array of values.
  5202. */
  5203. function baseXor(arrays, iteratee, comparator) {
  5204. var length = arrays.length;
  5205. if (length < 2) {
  5206. return length ? baseUniq(arrays[0]) : [];
  5207. }
  5208. var index = -1,
  5209. result = Array(length);
  5210. while (++index < length) {
  5211. var array = arrays[index],
  5212. othIndex = -1;
  5213. while (++othIndex < length) {
  5214. if (othIndex != index) {
  5215. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5216. }
  5217. }
  5218. }
  5219. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5220. }
  5221. /**
  5222. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5223. *
  5224. * @private
  5225. * @param {Array} props The property identifiers.
  5226. * @param {Array} values The property values.
  5227. * @param {Function} assignFunc The function to assign values.
  5228. * @returns {Object} Returns the new object.
  5229. */
  5230. function baseZipObject(props, values, assignFunc) {
  5231. var index = -1,
  5232. length = props.length,
  5233. valsLength = values.length,
  5234. result = {};
  5235. while (++index < length) {
  5236. var value = index < valsLength ? values[index] : undefined;
  5237. assignFunc(result, props[index], value);
  5238. }
  5239. return result;
  5240. }
  5241. /**
  5242. * Casts `value` to an empty array if it's not an array like object.
  5243. *
  5244. * @private
  5245. * @param {*} value The value to inspect.
  5246. * @returns {Array|Object} Returns the cast array-like object.
  5247. */
  5248. function castArrayLikeObject(value) {
  5249. return isArrayLikeObject(value) ? value : [];
  5250. }
  5251. /**
  5252. * Casts `value` to `identity` if it's not a function.
  5253. *
  5254. * @private
  5255. * @param {*} value The value to inspect.
  5256. * @returns {Function} Returns cast function.
  5257. */
  5258. function castFunction(value) {
  5259. return typeof value == 'function' ? value : identity;
  5260. }
  5261. /**
  5262. * Casts `value` to a path array if it's not one.
  5263. *
  5264. * @private
  5265. * @param {*} value The value to inspect.
  5266. * @param {Object} [object] The object to query keys on.
  5267. * @returns {Array} Returns the cast property path array.
  5268. */
  5269. function castPath(value, object) {
  5270. if (isArray(value)) {
  5271. return value;
  5272. }
  5273. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5274. }
  5275. /**
  5276. * A `baseRest` alias which can be replaced with `identity` by module
  5277. * replacement plugins.
  5278. *
  5279. * @private
  5280. * @type {Function}
  5281. * @param {Function} func The function to apply a rest parameter to.
  5282. * @returns {Function} Returns the new function.
  5283. */
  5284. var castRest = baseRest;
  5285. /**
  5286. * Casts `array` to a slice if it's needed.
  5287. *
  5288. * @private
  5289. * @param {Array} array The array to inspect.
  5290. * @param {number} start The start position.
  5291. * @param {number} [end=array.length] The end position.
  5292. * @returns {Array} Returns the cast slice.
  5293. */
  5294. function castSlice(array, start, end) {
  5295. var length = array.length;
  5296. end = end === undefined ? length : end;
  5297. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5298. }
  5299. /**
  5300. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5301. *
  5302. * @private
  5303. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5304. */
  5305. var clearTimeout = ctxClearTimeout || function(id) {
  5306. return root.clearTimeout(id);
  5307. };
  5308. /**
  5309. * Creates a clone of `buffer`.
  5310. *
  5311. * @private
  5312. * @param {Buffer} buffer The buffer to clone.
  5313. * @param {boolean} [isDeep] Specify a deep clone.
  5314. * @returns {Buffer} Returns the cloned buffer.
  5315. */
  5316. function cloneBuffer(buffer, isDeep) {
  5317. if (isDeep) {
  5318. return buffer.slice();
  5319. }
  5320. var length = buffer.length,
  5321. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5322. buffer.copy(result);
  5323. return result;
  5324. }
  5325. /**
  5326. * Creates a clone of `arrayBuffer`.
  5327. *
  5328. * @private
  5329. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5330. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5331. */
  5332. function cloneArrayBuffer(arrayBuffer) {
  5333. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5334. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5335. return result;
  5336. }
  5337. /**
  5338. * Creates a clone of `dataView`.
  5339. *
  5340. * @private
  5341. * @param {Object} dataView The data view to clone.
  5342. * @param {boolean} [isDeep] Specify a deep clone.
  5343. * @returns {Object} Returns the cloned data view.
  5344. */
  5345. function cloneDataView(dataView, isDeep) {
  5346. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5347. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5348. }
  5349. /**
  5350. * Creates a clone of `regexp`.
  5351. *
  5352. * @private
  5353. * @param {Object} regexp The regexp to clone.
  5354. * @returns {Object} Returns the cloned regexp.
  5355. */
  5356. function cloneRegExp(regexp) {
  5357. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5358. result.lastIndex = regexp.lastIndex;
  5359. return result;
  5360. }
  5361. /**
  5362. * Creates a clone of the `symbol` object.
  5363. *
  5364. * @private
  5365. * @param {Object} symbol The symbol object to clone.
  5366. * @returns {Object} Returns the cloned symbol object.
  5367. */
  5368. function cloneSymbol(symbol) {
  5369. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5370. }
  5371. /**
  5372. * Creates a clone of `typedArray`.
  5373. *
  5374. * @private
  5375. * @param {Object} typedArray The typed array to clone.
  5376. * @param {boolean} [isDeep] Specify a deep clone.
  5377. * @returns {Object} Returns the cloned typed array.
  5378. */
  5379. function cloneTypedArray(typedArray, isDeep) {
  5380. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5381. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5382. }
  5383. /**
  5384. * Compares values to sort them in ascending order.
  5385. *
  5386. * @private
  5387. * @param {*} value The value to compare.
  5388. * @param {*} other The other value to compare.
  5389. * @returns {number} Returns the sort order indicator for `value`.
  5390. */
  5391. function compareAscending(value, other) {
  5392. if (value !== other) {
  5393. var valIsDefined = value !== undefined,
  5394. valIsNull = value === null,
  5395. valIsReflexive = value === value,
  5396. valIsSymbol = isSymbol(value);
  5397. var othIsDefined = other !== undefined,
  5398. othIsNull = other === null,
  5399. othIsReflexive = other === other,
  5400. othIsSymbol = isSymbol(other);
  5401. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5402. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5403. (valIsNull && othIsDefined && othIsReflexive) ||
  5404. (!valIsDefined && othIsReflexive) ||
  5405. !valIsReflexive) {
  5406. return 1;
  5407. }
  5408. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5409. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5410. (othIsNull && valIsDefined && valIsReflexive) ||
  5411. (!othIsDefined && valIsReflexive) ||
  5412. !othIsReflexive) {
  5413. return -1;
  5414. }
  5415. }
  5416. return 0;
  5417. }
  5418. /**
  5419. * Used by `_.orderBy` to compare multiple properties of a value to another
  5420. * and stable sort them.
  5421. *
  5422. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5423. * specify an order of "desc" for descending or "asc" for ascending sort order
  5424. * of corresponding values.
  5425. *
  5426. * @private
  5427. * @param {Object} object The object to compare.
  5428. * @param {Object} other The other object to compare.
  5429. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5430. * @returns {number} Returns the sort order indicator for `object`.
  5431. */
  5432. function compareMultiple(object, other, orders) {
  5433. var index = -1,
  5434. objCriteria = object.criteria,
  5435. othCriteria = other.criteria,
  5436. length = objCriteria.length,
  5437. ordersLength = orders.length;
  5438. while (++index < length) {
  5439. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5440. if (result) {
  5441. if (index >= ordersLength) {
  5442. return result;
  5443. }
  5444. var order = orders[index];
  5445. return result * (order == 'desc' ? -1 : 1);
  5446. }
  5447. }
  5448. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5449. // that causes it, under certain circumstances, to provide the same value for
  5450. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5451. // for more details.
  5452. //
  5453. // This also ensures a stable sort in V8 and other engines.
  5454. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5455. return object.index - other.index;
  5456. }
  5457. /**
  5458. * Creates an array that is the composition of partially applied arguments,
  5459. * placeholders, and provided arguments into a single array of arguments.
  5460. *
  5461. * @private
  5462. * @param {Array} args The provided arguments.
  5463. * @param {Array} partials The arguments to prepend to those provided.
  5464. * @param {Array} holders The `partials` placeholder indexes.
  5465. * @params {boolean} [isCurried] Specify composing for a curried function.
  5466. * @returns {Array} Returns the new array of composed arguments.
  5467. */
  5468. function composeArgs(args, partials, holders, isCurried) {
  5469. var argsIndex = -1,
  5470. argsLength = args.length,
  5471. holdersLength = holders.length,
  5472. leftIndex = -1,
  5473. leftLength = partials.length,
  5474. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5475. result = Array(leftLength + rangeLength),
  5476. isUncurried = !isCurried;
  5477. while (++leftIndex < leftLength) {
  5478. result[leftIndex] = partials[leftIndex];
  5479. }
  5480. while (++argsIndex < holdersLength) {
  5481. if (isUncurried || argsIndex < argsLength) {
  5482. result[holders[argsIndex]] = args[argsIndex];
  5483. }
  5484. }
  5485. while (rangeLength--) {
  5486. result[leftIndex++] = args[argsIndex++];
  5487. }
  5488. return result;
  5489. }
  5490. /**
  5491. * This function is like `composeArgs` except that the arguments composition
  5492. * is tailored for `_.partialRight`.
  5493. *
  5494. * @private
  5495. * @param {Array} args The provided arguments.
  5496. * @param {Array} partials The arguments to append to those provided.
  5497. * @param {Array} holders The `partials` placeholder indexes.
  5498. * @params {boolean} [isCurried] Specify composing for a curried function.
  5499. * @returns {Array} Returns the new array of composed arguments.
  5500. */
  5501. function composeArgsRight(args, partials, holders, isCurried) {
  5502. var argsIndex = -1,
  5503. argsLength = args.length,
  5504. holdersIndex = -1,
  5505. holdersLength = holders.length,
  5506. rightIndex = -1,
  5507. rightLength = partials.length,
  5508. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5509. result = Array(rangeLength + rightLength),
  5510. isUncurried = !isCurried;
  5511. while (++argsIndex < rangeLength) {
  5512. result[argsIndex] = args[argsIndex];
  5513. }
  5514. var offset = argsIndex;
  5515. while (++rightIndex < rightLength) {
  5516. result[offset + rightIndex] = partials[rightIndex];
  5517. }
  5518. while (++holdersIndex < holdersLength) {
  5519. if (isUncurried || argsIndex < argsLength) {
  5520. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5521. }
  5522. }
  5523. return result;
  5524. }
  5525. /**
  5526. * Copies the values of `source` to `array`.
  5527. *
  5528. * @private
  5529. * @param {Array} source The array to copy values from.
  5530. * @param {Array} [array=[]] The array to copy values to.
  5531. * @returns {Array} Returns `array`.
  5532. */
  5533. function copyArray(source, array) {
  5534. var index = -1,
  5535. length = source.length;
  5536. array || (array = Array(length));
  5537. while (++index < length) {
  5538. array[index] = source[index];
  5539. }
  5540. return array;
  5541. }
  5542. /**
  5543. * Copies properties of `source` to `object`.
  5544. *
  5545. * @private
  5546. * @param {Object} source The object to copy properties from.
  5547. * @param {Array} props The property identifiers to copy.
  5548. * @param {Object} [object={}] The object to copy properties to.
  5549. * @param {Function} [customizer] The function to customize copied values.
  5550. * @returns {Object} Returns `object`.
  5551. */
  5552. function copyObject(source, props, object, customizer) {
  5553. var isNew = !object;
  5554. object || (object = {});
  5555. var index = -1,
  5556. length = props.length;
  5557. while (++index < length) {
  5558. var key = props[index];
  5559. var newValue = customizer
  5560. ? customizer(object[key], source[key], key, object, source)
  5561. : undefined;
  5562. if (newValue === undefined) {
  5563. newValue = source[key];
  5564. }
  5565. if (isNew) {
  5566. baseAssignValue(object, key, newValue);
  5567. } else {
  5568. assignValue(object, key, newValue);
  5569. }
  5570. }
  5571. return object;
  5572. }
  5573. /**
  5574. * Copies own symbols of `source` to `object`.
  5575. *
  5576. * @private
  5577. * @param {Object} source The object to copy symbols from.
  5578. * @param {Object} [object={}] The object to copy symbols to.
  5579. * @returns {Object} Returns `object`.
  5580. */
  5581. function copySymbols(source, object) {
  5582. return copyObject(source, getSymbols(source), object);
  5583. }
  5584. /**
  5585. * Copies own and inherited symbols of `source` to `object`.
  5586. *
  5587. * @private
  5588. * @param {Object} source The object to copy symbols from.
  5589. * @param {Object} [object={}] The object to copy symbols to.
  5590. * @returns {Object} Returns `object`.
  5591. */
  5592. function copySymbolsIn(source, object) {
  5593. return copyObject(source, getSymbolsIn(source), object);
  5594. }
  5595. /**
  5596. * Creates a function like `_.groupBy`.
  5597. *
  5598. * @private
  5599. * @param {Function} setter The function to set accumulator values.
  5600. * @param {Function} [initializer] The accumulator object initializer.
  5601. * @returns {Function} Returns the new aggregator function.
  5602. */
  5603. function createAggregator(setter, initializer) {
  5604. return function(collection, iteratee) {
  5605. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5606. accumulator = initializer ? initializer() : {};
  5607. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5608. };
  5609. }
  5610. /**
  5611. * Creates a function like `_.assign`.
  5612. *
  5613. * @private
  5614. * @param {Function} assigner The function to assign values.
  5615. * @returns {Function} Returns the new assigner function.
  5616. */
  5617. function createAssigner(assigner) {
  5618. return baseRest(function(object, sources) {
  5619. var index = -1,
  5620. length = sources.length,
  5621. customizer = length > 1 ? sources[length - 1] : undefined,
  5622. guard = length > 2 ? sources[2] : undefined;
  5623. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5624. ? (length--, customizer)
  5625. : undefined;
  5626. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5627. customizer = length < 3 ? undefined : customizer;
  5628. length = 1;
  5629. }
  5630. object = Object(object);
  5631. while (++index < length) {
  5632. var source = sources[index];
  5633. if (source) {
  5634. assigner(object, source, index, customizer);
  5635. }
  5636. }
  5637. return object;
  5638. });
  5639. }
  5640. /**
  5641. * Creates a `baseEach` or `baseEachRight` function.
  5642. *
  5643. * @private
  5644. * @param {Function} eachFunc The function to iterate over a collection.
  5645. * @param {boolean} [fromRight] Specify iterating from right to left.
  5646. * @returns {Function} Returns the new base function.
  5647. */
  5648. function createBaseEach(eachFunc, fromRight) {
  5649. return function(collection, iteratee) {
  5650. if (collection == null) {
  5651. return collection;
  5652. }
  5653. if (!isArrayLike(collection)) {
  5654. return eachFunc(collection, iteratee);
  5655. }
  5656. var length = collection.length,
  5657. index = fromRight ? length : -1,
  5658. iterable = Object(collection);
  5659. while ((fromRight ? index-- : ++index < length)) {
  5660. if (iteratee(iterable[index], index, iterable) === false) {
  5661. break;
  5662. }
  5663. }
  5664. return collection;
  5665. };
  5666. }
  5667. /**
  5668. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5669. *
  5670. * @private
  5671. * @param {boolean} [fromRight] Specify iterating from right to left.
  5672. * @returns {Function} Returns the new base function.
  5673. */
  5674. function createBaseFor(fromRight) {
  5675. return function(object, iteratee, keysFunc) {
  5676. var index = -1,
  5677. iterable = Object(object),
  5678. props = keysFunc(object),
  5679. length = props.length;
  5680. while (length--) {
  5681. var key = props[fromRight ? length : ++index];
  5682. if (iteratee(iterable[key], key, iterable) === false) {
  5683. break;
  5684. }
  5685. }
  5686. return object;
  5687. };
  5688. }
  5689. /**
  5690. * Creates a function that wraps `func` to invoke it with the optional `this`
  5691. * binding of `thisArg`.
  5692. *
  5693. * @private
  5694. * @param {Function} func The function to wrap.
  5695. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5696. * @param {*} [thisArg] The `this` binding of `func`.
  5697. * @returns {Function} Returns the new wrapped function.
  5698. */
  5699. function createBind(func, bitmask, thisArg) {
  5700. var isBind = bitmask & WRAP_BIND_FLAG,
  5701. Ctor = createCtor(func);
  5702. function wrapper() {
  5703. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5704. return fn.apply(isBind ? thisArg : this, arguments);
  5705. }
  5706. return wrapper;
  5707. }
  5708. /**
  5709. * Creates a function like `_.lowerFirst`.
  5710. *
  5711. * @private
  5712. * @param {string} methodName The name of the `String` case method to use.
  5713. * @returns {Function} Returns the new case function.
  5714. */
  5715. function createCaseFirst(methodName) {
  5716. return function(string) {
  5717. string = toString(string);
  5718. var strSymbols = hasUnicode(string)
  5719. ? stringToArray(string)
  5720. : undefined;
  5721. var chr = strSymbols
  5722. ? strSymbols[0]
  5723. : string.charAt(0);
  5724. var trailing = strSymbols
  5725. ? castSlice(strSymbols, 1).join('')
  5726. : string.slice(1);
  5727. return chr[methodName]() + trailing;
  5728. };
  5729. }
  5730. /**
  5731. * Creates a function like `_.camelCase`.
  5732. *
  5733. * @private
  5734. * @param {Function} callback The function to combine each word.
  5735. * @returns {Function} Returns the new compounder function.
  5736. */
  5737. function createCompounder(callback) {
  5738. return function(string) {
  5739. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5740. };
  5741. }
  5742. /**
  5743. * Creates a function that produces an instance of `Ctor` regardless of
  5744. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5745. *
  5746. * @private
  5747. * @param {Function} Ctor The constructor to wrap.
  5748. * @returns {Function} Returns the new wrapped function.
  5749. */
  5750. function createCtor(Ctor) {
  5751. return function() {
  5752. // Use a `switch` statement to work with class constructors. See
  5753. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5754. // for more details.
  5755. var args = arguments;
  5756. switch (args.length) {
  5757. case 0: return new Ctor;
  5758. case 1: return new Ctor(args[0]);
  5759. case 2: return new Ctor(args[0], args[1]);
  5760. case 3: return new Ctor(args[0], args[1], args[2]);
  5761. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5762. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5763. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5764. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5765. }
  5766. var thisBinding = baseCreate(Ctor.prototype),
  5767. result = Ctor.apply(thisBinding, args);
  5768. // Mimic the constructor's `return` behavior.
  5769. // See https://es5.github.io/#x13.2.2 for more details.
  5770. return isObject(result) ? result : thisBinding;
  5771. };
  5772. }
  5773. /**
  5774. * Creates a function that wraps `func` to enable currying.
  5775. *
  5776. * @private
  5777. * @param {Function} func The function to wrap.
  5778. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5779. * @param {number} arity The arity of `func`.
  5780. * @returns {Function} Returns the new wrapped function.
  5781. */
  5782. function createCurry(func, bitmask, arity) {
  5783. var Ctor = createCtor(func);
  5784. function wrapper() {
  5785. var length = arguments.length,
  5786. args = Array(length),
  5787. index = length,
  5788. placeholder = getHolder(wrapper);
  5789. while (index--) {
  5790. args[index] = arguments[index];
  5791. }
  5792. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5793. ? []
  5794. : replaceHolders(args, placeholder);
  5795. length -= holders.length;
  5796. if (length < arity) {
  5797. return createRecurry(
  5798. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5799. args, holders, undefined, undefined, arity - length);
  5800. }
  5801. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5802. return apply(fn, this, args);
  5803. }
  5804. return wrapper;
  5805. }
  5806. /**
  5807. * Creates a `_.find` or `_.findLast` function.
  5808. *
  5809. * @private
  5810. * @param {Function} findIndexFunc The function to find the collection index.
  5811. * @returns {Function} Returns the new find function.
  5812. */
  5813. function createFind(findIndexFunc) {
  5814. return function(collection, predicate, fromIndex) {
  5815. var iterable = Object(collection);
  5816. if (!isArrayLike(collection)) {
  5817. var iteratee = getIteratee(predicate, 3);
  5818. collection = keys(collection);
  5819. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5820. }
  5821. var index = findIndexFunc(collection, predicate, fromIndex);
  5822. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5823. };
  5824. }
  5825. /**
  5826. * Creates a `_.flow` or `_.flowRight` function.
  5827. *
  5828. * @private
  5829. * @param {boolean} [fromRight] Specify iterating from right to left.
  5830. * @returns {Function} Returns the new flow function.
  5831. */
  5832. function createFlow(fromRight) {
  5833. return flatRest(function(funcs) {
  5834. var length = funcs.length,
  5835. index = length,
  5836. prereq = LodashWrapper.prototype.thru;
  5837. if (fromRight) {
  5838. funcs.reverse();
  5839. }
  5840. while (index--) {
  5841. var func = funcs[index];
  5842. if (typeof func != 'function') {
  5843. throw new TypeError(FUNC_ERROR_TEXT);
  5844. }
  5845. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5846. var wrapper = new LodashWrapper([], true);
  5847. }
  5848. }
  5849. index = wrapper ? index : length;
  5850. while (++index < length) {
  5851. func = funcs[index];
  5852. var funcName = getFuncName(func),
  5853. data = funcName == 'wrapper' ? getData(func) : undefined;
  5854. if (data && isLaziable(data[0]) &&
  5855. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5856. !data[4].length && data[9] == 1
  5857. ) {
  5858. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5859. } else {
  5860. wrapper = (func.length == 1 && isLaziable(func))
  5861. ? wrapper[funcName]()
  5862. : wrapper.thru(func);
  5863. }
  5864. }
  5865. return function() {
  5866. var args = arguments,
  5867. value = args[0];
  5868. if (wrapper && args.length == 1 && isArray(value)) {
  5869. return wrapper.plant(value).value();
  5870. }
  5871. var index = 0,
  5872. result = length ? funcs[index].apply(this, args) : value;
  5873. while (++index < length) {
  5874. result = funcs[index].call(this, result);
  5875. }
  5876. return result;
  5877. };
  5878. });
  5879. }
  5880. /**
  5881. * Creates a function that wraps `func` to invoke it with optional `this`
  5882. * binding of `thisArg`, partial application, and currying.
  5883. *
  5884. * @private
  5885. * @param {Function|string} func The function or method name to wrap.
  5886. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5887. * @param {*} [thisArg] The `this` binding of `func`.
  5888. * @param {Array} [partials] The arguments to prepend to those provided to
  5889. * the new function.
  5890. * @param {Array} [holders] The `partials` placeholder indexes.
  5891. * @param {Array} [partialsRight] The arguments to append to those provided
  5892. * to the new function.
  5893. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5894. * @param {Array} [argPos] The argument positions of the new function.
  5895. * @param {number} [ary] The arity cap of `func`.
  5896. * @param {number} [arity] The arity of `func`.
  5897. * @returns {Function} Returns the new wrapped function.
  5898. */
  5899. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5900. var isAry = bitmask & WRAP_ARY_FLAG,
  5901. isBind = bitmask & WRAP_BIND_FLAG,
  5902. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5903. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5904. isFlip = bitmask & WRAP_FLIP_FLAG,
  5905. Ctor = isBindKey ? undefined : createCtor(func);
  5906. function wrapper() {
  5907. var length = arguments.length,
  5908. args = Array(length),
  5909. index = length;
  5910. while (index--) {
  5911. args[index] = arguments[index];
  5912. }
  5913. if (isCurried) {
  5914. var placeholder = getHolder(wrapper),
  5915. holdersCount = countHolders(args, placeholder);
  5916. }
  5917. if (partials) {
  5918. args = composeArgs(args, partials, holders, isCurried);
  5919. }
  5920. if (partialsRight) {
  5921. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5922. }
  5923. length -= holdersCount;
  5924. if (isCurried && length < arity) {
  5925. var newHolders = replaceHolders(args, placeholder);
  5926. return createRecurry(
  5927. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5928. args, newHolders, argPos, ary, arity - length
  5929. );
  5930. }
  5931. var thisBinding = isBind ? thisArg : this,
  5932. fn = isBindKey ? thisBinding[func] : func;
  5933. length = args.length;
  5934. if (argPos) {
  5935. args = reorder(args, argPos);
  5936. } else if (isFlip && length > 1) {
  5937. args.reverse();
  5938. }
  5939. if (isAry && ary < length) {
  5940. args.length = ary;
  5941. }
  5942. if (this && this !== root && this instanceof wrapper) {
  5943. fn = Ctor || createCtor(fn);
  5944. }
  5945. return fn.apply(thisBinding, args);
  5946. }
  5947. return wrapper;
  5948. }
  5949. /**
  5950. * Creates a function like `_.invertBy`.
  5951. *
  5952. * @private
  5953. * @param {Function} setter The function to set accumulator values.
  5954. * @param {Function} toIteratee The function to resolve iteratees.
  5955. * @returns {Function} Returns the new inverter function.
  5956. */
  5957. function createInverter(setter, toIteratee) {
  5958. return function(object, iteratee) {
  5959. return baseInverter(object, setter, toIteratee(iteratee), {});
  5960. };
  5961. }
  5962. /**
  5963. * Creates a function that performs a mathematical operation on two values.
  5964. *
  5965. * @private
  5966. * @param {Function} operator The function to perform the operation.
  5967. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5968. * @returns {Function} Returns the new mathematical operation function.
  5969. */
  5970. function createMathOperation(operator, defaultValue) {
  5971. return function(value, other) {
  5972. var result;
  5973. if (value === undefined && other === undefined) {
  5974. return defaultValue;
  5975. }
  5976. if (value !== undefined) {
  5977. result = value;
  5978. }
  5979. if (other !== undefined) {
  5980. if (result === undefined) {
  5981. return other;
  5982. }
  5983. if (typeof value == 'string' || typeof other == 'string') {
  5984. value = baseToString(value);
  5985. other = baseToString(other);
  5986. } else {
  5987. value = baseToNumber(value);
  5988. other = baseToNumber(other);
  5989. }
  5990. result = operator(value, other);
  5991. }
  5992. return result;
  5993. };
  5994. }
  5995. /**
  5996. * Creates a function like `_.over`.
  5997. *
  5998. * @private
  5999. * @param {Function} arrayFunc The function to iterate over iteratees.
  6000. * @returns {Function} Returns the new over function.
  6001. */
  6002. function createOver(arrayFunc) {
  6003. return flatRest(function(iteratees) {
  6004. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6005. return baseRest(function(args) {
  6006. var thisArg = this;
  6007. return arrayFunc(iteratees, function(iteratee) {
  6008. return apply(iteratee, thisArg, args);
  6009. });
  6010. });
  6011. });
  6012. }
  6013. /**
  6014. * Creates the padding for `string` based on `length`. The `chars` string
  6015. * is truncated if the number of characters exceeds `length`.
  6016. *
  6017. * @private
  6018. * @param {number} length The padding length.
  6019. * @param {string} [chars=' '] The string used as padding.
  6020. * @returns {string} Returns the padding for `string`.
  6021. */
  6022. function createPadding(length, chars) {
  6023. chars = chars === undefined ? ' ' : baseToString(chars);
  6024. var charsLength = chars.length;
  6025. if (charsLength < 2) {
  6026. return charsLength ? baseRepeat(chars, length) : chars;
  6027. }
  6028. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6029. return hasUnicode(chars)
  6030. ? castSlice(stringToArray(result), 0, length).join('')
  6031. : result.slice(0, length);
  6032. }
  6033. /**
  6034. * Creates a function that wraps `func` to invoke it with the `this` binding
  6035. * of `thisArg` and `partials` prepended to the arguments it receives.
  6036. *
  6037. * @private
  6038. * @param {Function} func The function to wrap.
  6039. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6040. * @param {*} thisArg The `this` binding of `func`.
  6041. * @param {Array} partials The arguments to prepend to those provided to
  6042. * the new function.
  6043. * @returns {Function} Returns the new wrapped function.
  6044. */
  6045. function createPartial(func, bitmask, thisArg, partials) {
  6046. var isBind = bitmask & WRAP_BIND_FLAG,
  6047. Ctor = createCtor(func);
  6048. function wrapper() {
  6049. var argsIndex = -1,
  6050. argsLength = arguments.length,
  6051. leftIndex = -1,
  6052. leftLength = partials.length,
  6053. args = Array(leftLength + argsLength),
  6054. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6055. while (++leftIndex < leftLength) {
  6056. args[leftIndex] = partials[leftIndex];
  6057. }
  6058. while (argsLength--) {
  6059. args[leftIndex++] = arguments[++argsIndex];
  6060. }
  6061. return apply(fn, isBind ? thisArg : this, args);
  6062. }
  6063. return wrapper;
  6064. }
  6065. /**
  6066. * Creates a `_.range` or `_.rangeRight` function.
  6067. *
  6068. * @private
  6069. * @param {boolean} [fromRight] Specify iterating from right to left.
  6070. * @returns {Function} Returns the new range function.
  6071. */
  6072. function createRange(fromRight) {
  6073. return function(start, end, step) {
  6074. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6075. end = step = undefined;
  6076. }
  6077. // Ensure the sign of `-0` is preserved.
  6078. start = toFinite(start);
  6079. if (end === undefined) {
  6080. end = start;
  6081. start = 0;
  6082. } else {
  6083. end = toFinite(end);
  6084. }
  6085. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6086. return baseRange(start, end, step, fromRight);
  6087. };
  6088. }
  6089. /**
  6090. * Creates a function that performs a relational operation on two values.
  6091. *
  6092. * @private
  6093. * @param {Function} operator The function to perform the operation.
  6094. * @returns {Function} Returns the new relational operation function.
  6095. */
  6096. function createRelationalOperation(operator) {
  6097. return function(value, other) {
  6098. if (!(typeof value == 'string' && typeof other == 'string')) {
  6099. value = toNumber(value);
  6100. other = toNumber(other);
  6101. }
  6102. return operator(value, other);
  6103. };
  6104. }
  6105. /**
  6106. * Creates a function that wraps `func` to continue currying.
  6107. *
  6108. * @private
  6109. * @param {Function} func The function to wrap.
  6110. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6111. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6112. * @param {*} placeholder The placeholder value.
  6113. * @param {*} [thisArg] The `this` binding of `func`.
  6114. * @param {Array} [partials] The arguments to prepend to those provided to
  6115. * the new function.
  6116. * @param {Array} [holders] The `partials` placeholder indexes.
  6117. * @param {Array} [argPos] The argument positions of the new function.
  6118. * @param {number} [ary] The arity cap of `func`.
  6119. * @param {number} [arity] The arity of `func`.
  6120. * @returns {Function} Returns the new wrapped function.
  6121. */
  6122. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6123. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6124. newHolders = isCurry ? holders : undefined,
  6125. newHoldersRight = isCurry ? undefined : holders,
  6126. newPartials = isCurry ? partials : undefined,
  6127. newPartialsRight = isCurry ? undefined : partials;
  6128. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6129. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6130. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6131. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6132. }
  6133. var newData = [
  6134. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6135. newHoldersRight, argPos, ary, arity
  6136. ];
  6137. var result = wrapFunc.apply(undefined, newData);
  6138. if (isLaziable(func)) {
  6139. setData(result, newData);
  6140. }
  6141. result.placeholder = placeholder;
  6142. return setWrapToString(result, func, bitmask);
  6143. }
  6144. /**
  6145. * Creates a function like `_.round`.
  6146. *
  6147. * @private
  6148. * @param {string} methodName The name of the `Math` method to use when rounding.
  6149. * @returns {Function} Returns the new round function.
  6150. */
  6151. function createRound(methodName) {
  6152. var func = Math[methodName];
  6153. return function(number, precision) {
  6154. number = toNumber(number);
  6155. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6156. if (precision) {
  6157. // Shift with exponential notation to avoid floating-point issues.
  6158. // See [MDN](https://mdn.io/round#Examples) for more details.
  6159. var pair = (toString(number) + 'e').split('e'),
  6160. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6161. pair = (toString(value) + 'e').split('e');
  6162. return +(pair[0] + 'e' + (+pair[1] - precision));
  6163. }
  6164. return func(number);
  6165. };
  6166. }
  6167. /**
  6168. * Creates a set object of `values`.
  6169. *
  6170. * @private
  6171. * @param {Array} values The values to add to the set.
  6172. * @returns {Object} Returns the new set.
  6173. */
  6174. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6175. return new Set(values);
  6176. };
  6177. /**
  6178. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6179. *
  6180. * @private
  6181. * @param {Function} keysFunc The function to get the keys of a given object.
  6182. * @returns {Function} Returns the new pairs function.
  6183. */
  6184. function createToPairs(keysFunc) {
  6185. return function(object) {
  6186. var tag = getTag(object);
  6187. if (tag == mapTag) {
  6188. return mapToArray(object);
  6189. }
  6190. if (tag == setTag) {
  6191. return setToPairs(object);
  6192. }
  6193. return baseToPairs(object, keysFunc(object));
  6194. };
  6195. }
  6196. /**
  6197. * Creates a function that either curries or invokes `func` with optional
  6198. * `this` binding and partially applied arguments.
  6199. *
  6200. * @private
  6201. * @param {Function|string} func The function or method name to wrap.
  6202. * @param {number} bitmask The bitmask flags.
  6203. * 1 - `_.bind`
  6204. * 2 - `_.bindKey`
  6205. * 4 - `_.curry` or `_.curryRight` of a bound function
  6206. * 8 - `_.curry`
  6207. * 16 - `_.curryRight`
  6208. * 32 - `_.partial`
  6209. * 64 - `_.partialRight`
  6210. * 128 - `_.rearg`
  6211. * 256 - `_.ary`
  6212. * 512 - `_.flip`
  6213. * @param {*} [thisArg] The `this` binding of `func`.
  6214. * @param {Array} [partials] The arguments to be partially applied.
  6215. * @param {Array} [holders] The `partials` placeholder indexes.
  6216. * @param {Array} [argPos] The argument positions of the new function.
  6217. * @param {number} [ary] The arity cap of `func`.
  6218. * @param {number} [arity] The arity of `func`.
  6219. * @returns {Function} Returns the new wrapped function.
  6220. */
  6221. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6222. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6223. if (!isBindKey && typeof func != 'function') {
  6224. throw new TypeError(FUNC_ERROR_TEXT);
  6225. }
  6226. var length = partials ? partials.length : 0;
  6227. if (!length) {
  6228. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6229. partials = holders = undefined;
  6230. }
  6231. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6232. arity = arity === undefined ? arity : toInteger(arity);
  6233. length -= holders ? holders.length : 0;
  6234. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6235. var partialsRight = partials,
  6236. holdersRight = holders;
  6237. partials = holders = undefined;
  6238. }
  6239. var data = isBindKey ? undefined : getData(func);
  6240. var newData = [
  6241. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6242. argPos, ary, arity
  6243. ];
  6244. if (data) {
  6245. mergeData(newData, data);
  6246. }
  6247. func = newData[0];
  6248. bitmask = newData[1];
  6249. thisArg = newData[2];
  6250. partials = newData[3];
  6251. holders = newData[4];
  6252. arity = newData[9] = newData[9] === undefined
  6253. ? (isBindKey ? 0 : func.length)
  6254. : nativeMax(newData[9] - length, 0);
  6255. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6256. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6257. }
  6258. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6259. var result = createBind(func, bitmask, thisArg);
  6260. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6261. result = createCurry(func, bitmask, arity);
  6262. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6263. result = createPartial(func, bitmask, thisArg, partials);
  6264. } else {
  6265. result = createHybrid.apply(undefined, newData);
  6266. }
  6267. var setter = data ? baseSetData : setData;
  6268. return setWrapToString(setter(result, newData), func, bitmask);
  6269. }
  6270. /**
  6271. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6272. * of source objects to the destination object for all destination properties
  6273. * that resolve to `undefined`.
  6274. *
  6275. * @private
  6276. * @param {*} objValue The destination value.
  6277. * @param {*} srcValue The source value.
  6278. * @param {string} key The key of the property to assign.
  6279. * @param {Object} object The parent object of `objValue`.
  6280. * @returns {*} Returns the value to assign.
  6281. */
  6282. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6283. if (objValue === undefined ||
  6284. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6285. return srcValue;
  6286. }
  6287. return objValue;
  6288. }
  6289. /**
  6290. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6291. * objects into destination objects that are passed thru.
  6292. *
  6293. * @private
  6294. * @param {*} objValue The destination value.
  6295. * @param {*} srcValue The source value.
  6296. * @param {string} key The key of the property to merge.
  6297. * @param {Object} object The parent object of `objValue`.
  6298. * @param {Object} source The parent object of `srcValue`.
  6299. * @param {Object} [stack] Tracks traversed source values and their merged
  6300. * counterparts.
  6301. * @returns {*} Returns the value to assign.
  6302. */
  6303. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6304. if (isObject(objValue) && isObject(srcValue)) {
  6305. // Recursively merge objects and arrays (susceptible to call stack limits).
  6306. stack.set(srcValue, objValue);
  6307. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6308. stack['delete'](srcValue);
  6309. }
  6310. return objValue;
  6311. }
  6312. /**
  6313. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6314. * objects.
  6315. *
  6316. * @private
  6317. * @param {*} value The value to inspect.
  6318. * @param {string} key The key of the property to inspect.
  6319. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6320. */
  6321. function customOmitClone(value) {
  6322. return isPlainObject(value) ? undefined : value;
  6323. }
  6324. /**
  6325. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6326. * partial deep comparisons.
  6327. *
  6328. * @private
  6329. * @param {Array} array The array to compare.
  6330. * @param {Array} other The other array to compare.
  6331. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6332. * @param {Function} customizer The function to customize comparisons.
  6333. * @param {Function} equalFunc The function to determine equivalents of values.
  6334. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6335. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6336. */
  6337. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6338. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6339. arrLength = array.length,
  6340. othLength = other.length;
  6341. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6342. return false;
  6343. }
  6344. // Assume cyclic values are equal.
  6345. var stacked = stack.get(array);
  6346. if (stacked && stack.get(other)) {
  6347. return stacked == other;
  6348. }
  6349. var index = -1,
  6350. result = true,
  6351. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6352. stack.set(array, other);
  6353. stack.set(other, array);
  6354. // Ignore non-index properties.
  6355. while (++index < arrLength) {
  6356. var arrValue = array[index],
  6357. othValue = other[index];
  6358. if (customizer) {
  6359. var compared = isPartial
  6360. ? customizer(othValue, arrValue, index, other, array, stack)
  6361. : customizer(arrValue, othValue, index, array, other, stack);
  6362. }
  6363. if (compared !== undefined) {
  6364. if (compared) {
  6365. continue;
  6366. }
  6367. result = false;
  6368. break;
  6369. }
  6370. // Recursively compare arrays (susceptible to call stack limits).
  6371. if (seen) {
  6372. if (!arraySome(other, function(othValue, othIndex) {
  6373. if (!cacheHas(seen, othIndex) &&
  6374. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6375. return seen.push(othIndex);
  6376. }
  6377. })) {
  6378. result = false;
  6379. break;
  6380. }
  6381. } else if (!(
  6382. arrValue === othValue ||
  6383. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6384. )) {
  6385. result = false;
  6386. break;
  6387. }
  6388. }
  6389. stack['delete'](array);
  6390. stack['delete'](other);
  6391. return result;
  6392. }
  6393. /**
  6394. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6395. * the same `toStringTag`.
  6396. *
  6397. * **Note:** This function only supports comparing values with tags of
  6398. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6399. *
  6400. * @private
  6401. * @param {Object} object The object to compare.
  6402. * @param {Object} other The other object to compare.
  6403. * @param {string} tag The `toStringTag` of the objects to compare.
  6404. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6405. * @param {Function} customizer The function to customize comparisons.
  6406. * @param {Function} equalFunc The function to determine equivalents of values.
  6407. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6408. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6409. */
  6410. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6411. switch (tag) {
  6412. case dataViewTag:
  6413. if ((object.byteLength != other.byteLength) ||
  6414. (object.byteOffset != other.byteOffset)) {
  6415. return false;
  6416. }
  6417. object = object.buffer;
  6418. other = other.buffer;
  6419. case arrayBufferTag:
  6420. if ((object.byteLength != other.byteLength) ||
  6421. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6422. return false;
  6423. }
  6424. return true;
  6425. case boolTag:
  6426. case dateTag:
  6427. case numberTag:
  6428. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6429. // Invalid dates are coerced to `NaN`.
  6430. return eq(+object, +other);
  6431. case errorTag:
  6432. return object.name == other.name && object.message == other.message;
  6433. case regexpTag:
  6434. case stringTag:
  6435. // Coerce regexes to strings and treat strings, primitives and objects,
  6436. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6437. // for more details.
  6438. return object == (other + '');
  6439. case mapTag:
  6440. var convert = mapToArray;
  6441. case setTag:
  6442. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6443. convert || (convert = setToArray);
  6444. if (object.size != other.size && !isPartial) {
  6445. return false;
  6446. }
  6447. // Assume cyclic values are equal.
  6448. var stacked = stack.get(object);
  6449. if (stacked) {
  6450. return stacked == other;
  6451. }
  6452. bitmask |= COMPARE_UNORDERED_FLAG;
  6453. // Recursively compare objects (susceptible to call stack limits).
  6454. stack.set(object, other);
  6455. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6456. stack['delete'](object);
  6457. return result;
  6458. case symbolTag:
  6459. if (symbolValueOf) {
  6460. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6461. }
  6462. }
  6463. return false;
  6464. }
  6465. /**
  6466. * A specialized version of `baseIsEqualDeep` for objects with support for
  6467. * partial deep comparisons.
  6468. *
  6469. * @private
  6470. * @param {Object} object The object to compare.
  6471. * @param {Object} other The other object to compare.
  6472. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6473. * @param {Function} customizer The function to customize comparisons.
  6474. * @param {Function} equalFunc The function to determine equivalents of values.
  6475. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6476. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6477. */
  6478. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6479. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6480. objProps = getAllKeys(object),
  6481. objLength = objProps.length,
  6482. othProps = getAllKeys(other),
  6483. othLength = othProps.length;
  6484. if (objLength != othLength && !isPartial) {
  6485. return false;
  6486. }
  6487. var index = objLength;
  6488. while (index--) {
  6489. var key = objProps[index];
  6490. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6491. return false;
  6492. }
  6493. }
  6494. // Assume cyclic values are equal.
  6495. var stacked = stack.get(object);
  6496. if (stacked && stack.get(other)) {
  6497. return stacked == other;
  6498. }
  6499. var result = true;
  6500. stack.set(object, other);
  6501. stack.set(other, object);
  6502. var skipCtor = isPartial;
  6503. while (++index < objLength) {
  6504. key = objProps[index];
  6505. var objValue = object[key],
  6506. othValue = other[key];
  6507. if (customizer) {
  6508. var compared = isPartial
  6509. ? customizer(othValue, objValue, key, other, object, stack)
  6510. : customizer(objValue, othValue, key, object, other, stack);
  6511. }
  6512. // Recursively compare objects (susceptible to call stack limits).
  6513. if (!(compared === undefined
  6514. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6515. : compared
  6516. )) {
  6517. result = false;
  6518. break;
  6519. }
  6520. skipCtor || (skipCtor = key == 'constructor');
  6521. }
  6522. if (result && !skipCtor) {
  6523. var objCtor = object.constructor,
  6524. othCtor = other.constructor;
  6525. // Non `Object` object instances with different constructors are not equal.
  6526. if (objCtor != othCtor &&
  6527. ('constructor' in object && 'constructor' in other) &&
  6528. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6529. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6530. result = false;
  6531. }
  6532. }
  6533. stack['delete'](object);
  6534. stack['delete'](other);
  6535. return result;
  6536. }
  6537. /**
  6538. * A specialized version of `baseRest` which flattens the rest array.
  6539. *
  6540. * @private
  6541. * @param {Function} func The function to apply a rest parameter to.
  6542. * @returns {Function} Returns the new function.
  6543. */
  6544. function flatRest(func) {
  6545. return setToString(overRest(func, undefined, flatten), func + '');
  6546. }
  6547. /**
  6548. * Creates an array of own enumerable property names and symbols of `object`.
  6549. *
  6550. * @private
  6551. * @param {Object} object The object to query.
  6552. * @returns {Array} Returns the array of property names and symbols.
  6553. */
  6554. function getAllKeys(object) {
  6555. return baseGetAllKeys(object, keys, getSymbols);
  6556. }
  6557. /**
  6558. * Creates an array of own and inherited enumerable property names and
  6559. * symbols of `object`.
  6560. *
  6561. * @private
  6562. * @param {Object} object The object to query.
  6563. * @returns {Array} Returns the array of property names and symbols.
  6564. */
  6565. function getAllKeysIn(object) {
  6566. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6567. }
  6568. /**
  6569. * Gets metadata for `func`.
  6570. *
  6571. * @private
  6572. * @param {Function} func The function to query.
  6573. * @returns {*} Returns the metadata for `func`.
  6574. */
  6575. var getData = !metaMap ? noop : function(func) {
  6576. return metaMap.get(func);
  6577. };
  6578. /**
  6579. * Gets the name of `func`.
  6580. *
  6581. * @private
  6582. * @param {Function} func The function to query.
  6583. * @returns {string} Returns the function name.
  6584. */
  6585. function getFuncName(func) {
  6586. var result = (func.name + ''),
  6587. array = realNames[result],
  6588. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6589. while (length--) {
  6590. var data = array[length],
  6591. otherFunc = data.func;
  6592. if (otherFunc == null || otherFunc == func) {
  6593. return data.name;
  6594. }
  6595. }
  6596. return result;
  6597. }
  6598. /**
  6599. * Gets the argument placeholder value for `func`.
  6600. *
  6601. * @private
  6602. * @param {Function} func The function to inspect.
  6603. * @returns {*} Returns the placeholder value.
  6604. */
  6605. function getHolder(func) {
  6606. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6607. return object.placeholder;
  6608. }
  6609. /**
  6610. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6611. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6612. * If arguments are provided, the chosen function is invoked with them and
  6613. * its result is returned.
  6614. *
  6615. * @private
  6616. * @param {*} [value] The value to convert to an iteratee.
  6617. * @param {number} [arity] The arity of the created iteratee.
  6618. * @returns {Function} Returns the chosen function or its result.
  6619. */
  6620. function getIteratee() {
  6621. var result = lodash.iteratee || iteratee;
  6622. result = result === iteratee ? baseIteratee : result;
  6623. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6624. }
  6625. /**
  6626. * Gets the data for `map`.
  6627. *
  6628. * @private
  6629. * @param {Object} map The map to query.
  6630. * @param {string} key The reference key.
  6631. * @returns {*} Returns the map data.
  6632. */
  6633. function getMapData(map, key) {
  6634. var data = map.__data__;
  6635. return isKeyable(key)
  6636. ? data[typeof key == 'string' ? 'string' : 'hash']
  6637. : data.map;
  6638. }
  6639. /**
  6640. * Gets the property names, values, and compare flags of `object`.
  6641. *
  6642. * @private
  6643. * @param {Object} object The object to query.
  6644. * @returns {Array} Returns the match data of `object`.
  6645. */
  6646. function getMatchData(object) {
  6647. var result = keys(object),
  6648. length = result.length;
  6649. while (length--) {
  6650. var key = result[length],
  6651. value = object[key];
  6652. result[length] = [key, value, isStrictComparable(value)];
  6653. }
  6654. return result;
  6655. }
  6656. /**
  6657. * Gets the native function at `key` of `object`.
  6658. *
  6659. * @private
  6660. * @param {Object} object The object to query.
  6661. * @param {string} key The key of the method to get.
  6662. * @returns {*} Returns the function if it's native, else `undefined`.
  6663. */
  6664. function getNative(object, key) {
  6665. var value = getValue(object, key);
  6666. return baseIsNative(value) ? value : undefined;
  6667. }
  6668. /**
  6669. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6670. *
  6671. * @private
  6672. * @param {*} value The value to query.
  6673. * @returns {string} Returns the raw `toStringTag`.
  6674. */
  6675. function getRawTag(value) {
  6676. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6677. tag = value[symToStringTag];
  6678. try {
  6679. value[symToStringTag] = undefined;
  6680. } catch (e) {}
  6681. var result = nativeObjectToString.call(value);
  6682. {
  6683. if (isOwn) {
  6684. value[symToStringTag] = tag;
  6685. } else {
  6686. delete value[symToStringTag];
  6687. }
  6688. }
  6689. return result;
  6690. }
  6691. /**
  6692. * Creates an array of the own enumerable symbols of `object`.
  6693. *
  6694. * @private
  6695. * @param {Object} object The object to query.
  6696. * @returns {Array} Returns the array of symbols.
  6697. */
  6698. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6699. if (object == null) {
  6700. return [];
  6701. }
  6702. object = Object(object);
  6703. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6704. return propertyIsEnumerable.call(object, symbol);
  6705. });
  6706. };
  6707. /**
  6708. * Creates an array of the own and inherited enumerable symbols of `object`.
  6709. *
  6710. * @private
  6711. * @param {Object} object The object to query.
  6712. * @returns {Array} Returns the array of symbols.
  6713. */
  6714. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6715. var result = [];
  6716. while (object) {
  6717. arrayPush(result, getSymbols(object));
  6718. object = getPrototype(object);
  6719. }
  6720. return result;
  6721. };
  6722. /**
  6723. * Gets the `toStringTag` of `value`.
  6724. *
  6725. * @private
  6726. * @param {*} value The value to query.
  6727. * @returns {string} Returns the `toStringTag`.
  6728. */
  6729. var getTag = baseGetTag;
  6730. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6731. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6732. (Map && getTag(new Map) != mapTag) ||
  6733. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6734. (Set && getTag(new Set) != setTag) ||
  6735. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6736. getTag = function(value) {
  6737. var result = baseGetTag(value),
  6738. Ctor = result == objectTag ? value.constructor : undefined,
  6739. ctorString = Ctor ? toSource(Ctor) : '';
  6740. if (ctorString) {
  6741. switch (ctorString) {
  6742. case dataViewCtorString: return dataViewTag;
  6743. case mapCtorString: return mapTag;
  6744. case promiseCtorString: return promiseTag;
  6745. case setCtorString: return setTag;
  6746. case weakMapCtorString: return weakMapTag;
  6747. }
  6748. }
  6749. return result;
  6750. };
  6751. }
  6752. /**
  6753. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6754. *
  6755. * @private
  6756. * @param {number} start The start of the view.
  6757. * @param {number} end The end of the view.
  6758. * @param {Array} transforms The transformations to apply to the view.
  6759. * @returns {Object} Returns an object containing the `start` and `end`
  6760. * positions of the view.
  6761. */
  6762. function getView(start, end, transforms) {
  6763. var index = -1,
  6764. length = transforms.length;
  6765. while (++index < length) {
  6766. var data = transforms[index],
  6767. size = data.size;
  6768. switch (data.type) {
  6769. case 'drop': start += size; break;
  6770. case 'dropRight': end -= size; break;
  6771. case 'take': end = nativeMin(end, start + size); break;
  6772. case 'takeRight': start = nativeMax(start, end - size); break;
  6773. }
  6774. }
  6775. return { 'start': start, 'end': end };
  6776. }
  6777. /**
  6778. * Extracts wrapper details from the `source` body comment.
  6779. *
  6780. * @private
  6781. * @param {string} source The source to inspect.
  6782. * @returns {Array} Returns the wrapper details.
  6783. */
  6784. function getWrapDetails(source) {
  6785. var match = source.match(reWrapDetails);
  6786. return match ? match[1].split(reSplitDetails) : [];
  6787. }
  6788. /**
  6789. * Checks if `path` exists on `object`.
  6790. *
  6791. * @private
  6792. * @param {Object} object The object to query.
  6793. * @param {Array|string} path The path to check.
  6794. * @param {Function} hasFunc The function to check properties.
  6795. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6796. */
  6797. function hasPath(object, path, hasFunc) {
  6798. path = castPath(path, object);
  6799. var index = -1,
  6800. length = path.length,
  6801. result = false;
  6802. while (++index < length) {
  6803. var key = toKey(path[index]);
  6804. if (!(result = object != null && hasFunc(object, key))) {
  6805. break;
  6806. }
  6807. object = object[key];
  6808. }
  6809. if (result || ++index != length) {
  6810. return result;
  6811. }
  6812. length = object == null ? 0 : object.length;
  6813. return !!length && isLength(length) && isIndex(key, length) &&
  6814. (isArray(object) || isArguments(object));
  6815. }
  6816. /**
  6817. * Initializes an array clone.
  6818. *
  6819. * @private
  6820. * @param {Array} array The array to clone.
  6821. * @returns {Array} Returns the initialized clone.
  6822. */
  6823. function initCloneArray(array) {
  6824. var length = array.length,
  6825. result = new array.constructor(length);
  6826. // Add properties assigned by `RegExp#exec`.
  6827. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6828. result.index = array.index;
  6829. result.input = array.input;
  6830. }
  6831. return result;
  6832. }
  6833. /**
  6834. * Initializes an object clone.
  6835. *
  6836. * @private
  6837. * @param {Object} object The object to clone.
  6838. * @returns {Object} Returns the initialized clone.
  6839. */
  6840. function initCloneObject(object) {
  6841. return (typeof object.constructor == 'function' && !isPrototype(object))
  6842. ? baseCreate(getPrototype(object))
  6843. : {};
  6844. }
  6845. /**
  6846. * Initializes an object clone based on its `toStringTag`.
  6847. *
  6848. * **Note:** This function only supports cloning values with tags of
  6849. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6850. *
  6851. * @private
  6852. * @param {Object} object The object to clone.
  6853. * @param {string} tag The `toStringTag` of the object to clone.
  6854. * @param {boolean} [isDeep] Specify a deep clone.
  6855. * @returns {Object} Returns the initialized clone.
  6856. */
  6857. function initCloneByTag(object, tag, isDeep) {
  6858. var Ctor = object.constructor;
  6859. switch (tag) {
  6860. case arrayBufferTag:
  6861. return cloneArrayBuffer(object);
  6862. case boolTag:
  6863. case dateTag:
  6864. return new Ctor(+object);
  6865. case dataViewTag:
  6866. return cloneDataView(object, isDeep);
  6867. case float32Tag: case float64Tag:
  6868. case int8Tag: case int16Tag: case int32Tag:
  6869. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6870. return cloneTypedArray(object, isDeep);
  6871. case mapTag:
  6872. return new Ctor;
  6873. case numberTag:
  6874. case stringTag:
  6875. return new Ctor(object);
  6876. case regexpTag:
  6877. return cloneRegExp(object);
  6878. case setTag:
  6879. return new Ctor;
  6880. case symbolTag:
  6881. return cloneSymbol(object);
  6882. }
  6883. }
  6884. /**
  6885. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6886. *
  6887. * @private
  6888. * @param {string} source The source to modify.
  6889. * @returns {Array} details The details to insert.
  6890. * @returns {string} Returns the modified source.
  6891. */
  6892. function insertWrapDetails(source, details) {
  6893. var length = details.length;
  6894. if (!length) {
  6895. return source;
  6896. }
  6897. var lastIndex = length - 1;
  6898. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6899. details = details.join(length > 2 ? ', ' : ' ');
  6900. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6901. }
  6902. /**
  6903. * Checks if `value` is a flattenable `arguments` object or array.
  6904. *
  6905. * @private
  6906. * @param {*} value The value to check.
  6907. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6908. */
  6909. function isFlattenable(value) {
  6910. return isArray(value) || isArguments(value) ||
  6911. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6912. }
  6913. /**
  6914. * Checks if `value` is a valid array-like index.
  6915. *
  6916. * @private
  6917. * @param {*} value The value to check.
  6918. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6919. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6920. */
  6921. function isIndex(value, length) {
  6922. var type = typeof value;
  6923. length = length == null ? MAX_SAFE_INTEGER : length;
  6924. return !!length &&
  6925. (type == 'number' ||
  6926. (type != 'symbol' && reIsUint.test(value))) &&
  6927. (value > -1 && value % 1 == 0 && value < length);
  6928. }
  6929. /**
  6930. * Checks if the given arguments are from an iteratee call.
  6931. *
  6932. * @private
  6933. * @param {*} value The potential iteratee value argument.
  6934. * @param {*} index The potential iteratee index or key argument.
  6935. * @param {*} object The potential iteratee object argument.
  6936. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6937. * else `false`.
  6938. */
  6939. function isIterateeCall(value, index, object) {
  6940. if (!isObject(object)) {
  6941. return false;
  6942. }
  6943. var type = typeof index;
  6944. if (type == 'number'
  6945. ? (isArrayLike(object) && isIndex(index, object.length))
  6946. : (type == 'string' && index in object)
  6947. ) {
  6948. return eq(object[index], value);
  6949. }
  6950. return false;
  6951. }
  6952. /**
  6953. * Checks if `value` is a property name and not a property path.
  6954. *
  6955. * @private
  6956. * @param {*} value The value to check.
  6957. * @param {Object} [object] The object to query keys on.
  6958. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6959. */
  6960. function isKey(value, object) {
  6961. if (isArray(value)) {
  6962. return false;
  6963. }
  6964. var type = typeof value;
  6965. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6966. value == null || isSymbol(value)) {
  6967. return true;
  6968. }
  6969. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6970. (object != null && value in Object(object));
  6971. }
  6972. /**
  6973. * Checks if `value` is suitable for use as unique object key.
  6974. *
  6975. * @private
  6976. * @param {*} value The value to check.
  6977. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6978. */
  6979. function isKeyable(value) {
  6980. var type = typeof value;
  6981. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6982. ? (value !== '__proto__')
  6983. : (value === null);
  6984. }
  6985. /**
  6986. * Checks if `func` has a lazy counterpart.
  6987. *
  6988. * @private
  6989. * @param {Function} func The function to check.
  6990. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6991. * else `false`.
  6992. */
  6993. function isLaziable(func) {
  6994. var funcName = getFuncName(func),
  6995. other = lodash[funcName];
  6996. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6997. return false;
  6998. }
  6999. if (func === other) {
  7000. return true;
  7001. }
  7002. var data = getData(other);
  7003. return !!data && func === data[0];
  7004. }
  7005. /**
  7006. * Checks if `func` has its source masked.
  7007. *
  7008. * @private
  7009. * @param {Function} func The function to check.
  7010. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7011. */
  7012. function isMasked(func) {
  7013. return !!maskSrcKey && (maskSrcKey in func);
  7014. }
  7015. /**
  7016. * Checks if `func` is capable of being masked.
  7017. *
  7018. * @private
  7019. * @param {*} value The value to check.
  7020. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7021. */
  7022. var isMaskable = coreJsData ? isFunction : stubFalse;
  7023. /**
  7024. * Checks if `value` is likely a prototype object.
  7025. *
  7026. * @private
  7027. * @param {*} value The value to check.
  7028. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7029. */
  7030. function isPrototype(value) {
  7031. var Ctor = value && value.constructor,
  7032. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7033. return value === proto;
  7034. }
  7035. /**
  7036. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7037. *
  7038. * @private
  7039. * @param {*} value The value to check.
  7040. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7041. * equality comparisons, else `false`.
  7042. */
  7043. function isStrictComparable(value) {
  7044. return value === value && !isObject(value);
  7045. }
  7046. /**
  7047. * A specialized version of `matchesProperty` for source values suitable
  7048. * for strict equality comparisons, i.e. `===`.
  7049. *
  7050. * @private
  7051. * @param {string} key The key of the property to get.
  7052. * @param {*} srcValue The value to match.
  7053. * @returns {Function} Returns the new spec function.
  7054. */
  7055. function matchesStrictComparable(key, srcValue) {
  7056. return function(object) {
  7057. if (object == null) {
  7058. return false;
  7059. }
  7060. return object[key] === srcValue &&
  7061. (srcValue !== undefined || (key in Object(object)));
  7062. };
  7063. }
  7064. /**
  7065. * A specialized version of `_.memoize` which clears the memoized function's
  7066. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7067. *
  7068. * @private
  7069. * @param {Function} func The function to have its output memoized.
  7070. * @returns {Function} Returns the new memoized function.
  7071. */
  7072. function memoizeCapped(func) {
  7073. var result = memoize(func, function(key) {
  7074. if (cache.size === MAX_MEMOIZE_SIZE) {
  7075. cache.clear();
  7076. }
  7077. return key;
  7078. });
  7079. var cache = result.cache;
  7080. return result;
  7081. }
  7082. /**
  7083. * Merges the function metadata of `source` into `data`.
  7084. *
  7085. * Merging metadata reduces the number of wrappers used to invoke a function.
  7086. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7087. * may be applied regardless of execution order. Methods like `_.ary` and
  7088. * `_.rearg` modify function arguments, making the order in which they are
  7089. * executed important, preventing the merging of metadata. However, we make
  7090. * an exception for a safe combined case where curried functions have `_.ary`
  7091. * and or `_.rearg` applied.
  7092. *
  7093. * @private
  7094. * @param {Array} data The destination metadata.
  7095. * @param {Array} source The source metadata.
  7096. * @returns {Array} Returns `data`.
  7097. */
  7098. function mergeData(data, source) {
  7099. var bitmask = data[1],
  7100. srcBitmask = source[1],
  7101. newBitmask = bitmask | srcBitmask,
  7102. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7103. var isCombo =
  7104. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7105. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7106. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7107. // Exit early if metadata can't be merged.
  7108. if (!(isCommon || isCombo)) {
  7109. return data;
  7110. }
  7111. // Use source `thisArg` if available.
  7112. if (srcBitmask & WRAP_BIND_FLAG) {
  7113. data[2] = source[2];
  7114. // Set when currying a bound function.
  7115. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7116. }
  7117. // Compose partial arguments.
  7118. var value = source[3];
  7119. if (value) {
  7120. var partials = data[3];
  7121. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7122. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7123. }
  7124. // Compose partial right arguments.
  7125. value = source[5];
  7126. if (value) {
  7127. partials = data[5];
  7128. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7129. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7130. }
  7131. // Use source `argPos` if available.
  7132. value = source[7];
  7133. if (value) {
  7134. data[7] = value;
  7135. }
  7136. // Use source `ary` if it's smaller.
  7137. if (srcBitmask & WRAP_ARY_FLAG) {
  7138. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7139. }
  7140. // Use source `arity` if one is not provided.
  7141. if (data[9] == null) {
  7142. data[9] = source[9];
  7143. }
  7144. // Use source `func` and merge bitmasks.
  7145. data[0] = source[0];
  7146. data[1] = newBitmask;
  7147. return data;
  7148. }
  7149. /**
  7150. * This function is like
  7151. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7152. * except that it includes inherited enumerable properties.
  7153. *
  7154. * @private
  7155. * @param {Object} object The object to query.
  7156. * @returns {Array} Returns the array of property names.
  7157. */
  7158. function nativeKeysIn(object) {
  7159. var result = [];
  7160. if (object != null) {
  7161. for (var key in Object(object)) {
  7162. result.push(key);
  7163. }
  7164. }
  7165. return result;
  7166. }
  7167. /**
  7168. * Converts `value` to a string using `Object.prototype.toString`.
  7169. *
  7170. * @private
  7171. * @param {*} value The value to convert.
  7172. * @returns {string} Returns the converted string.
  7173. */
  7174. function objectToString(value) {
  7175. return nativeObjectToString.call(value);
  7176. }
  7177. /**
  7178. * A specialized version of `baseRest` which transforms the rest array.
  7179. *
  7180. * @private
  7181. * @param {Function} func The function to apply a rest parameter to.
  7182. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7183. * @param {Function} transform The rest array transform.
  7184. * @returns {Function} Returns the new function.
  7185. */
  7186. function overRest(func, start, transform) {
  7187. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7188. return function() {
  7189. var args = arguments,
  7190. index = -1,
  7191. length = nativeMax(args.length - start, 0),
  7192. array = Array(length);
  7193. while (++index < length) {
  7194. array[index] = args[start + index];
  7195. }
  7196. index = -1;
  7197. var otherArgs = Array(start + 1);
  7198. while (++index < start) {
  7199. otherArgs[index] = args[index];
  7200. }
  7201. otherArgs[start] = transform(array);
  7202. return apply(func, this, otherArgs);
  7203. };
  7204. }
  7205. /**
  7206. * Gets the parent value at `path` of `object`.
  7207. *
  7208. * @private
  7209. * @param {Object} object The object to query.
  7210. * @param {Array} path The path to get the parent value of.
  7211. * @returns {*} Returns the parent value.
  7212. */
  7213. function parent(object, path) {
  7214. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7215. }
  7216. /**
  7217. * Reorder `array` according to the specified indexes where the element at
  7218. * the first index is assigned as the first element, the element at
  7219. * the second index is assigned as the second element, and so on.
  7220. *
  7221. * @private
  7222. * @param {Array} array The array to reorder.
  7223. * @param {Array} indexes The arranged array indexes.
  7224. * @returns {Array} Returns `array`.
  7225. */
  7226. function reorder(array, indexes) {
  7227. var arrLength = array.length,
  7228. length = nativeMin(indexes.length, arrLength),
  7229. oldArray = copyArray(array);
  7230. while (length--) {
  7231. var index = indexes[length];
  7232. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7233. }
  7234. return array;
  7235. }
  7236. /**
  7237. * Gets the value at `key`, unless `key` is "__proto__".
  7238. *
  7239. * @private
  7240. * @param {Object} object The object to query.
  7241. * @param {string} key The key of the property to get.
  7242. * @returns {*} Returns the property value.
  7243. */
  7244. function safeGet(object, key) {
  7245. if (key == '__proto__') {
  7246. return;
  7247. }
  7248. return object[key];
  7249. }
  7250. /**
  7251. * Sets metadata for `func`.
  7252. *
  7253. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7254. * period of time, it will trip its breaker and transition to an identity
  7255. * function to avoid garbage collection pauses in V8. See
  7256. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7257. * for more details.
  7258. *
  7259. * @private
  7260. * @param {Function} func The function to associate metadata with.
  7261. * @param {*} data The metadata.
  7262. * @returns {Function} Returns `func`.
  7263. */
  7264. var setData = shortOut(baseSetData);
  7265. /**
  7266. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7267. *
  7268. * @private
  7269. * @param {Function} func The function to delay.
  7270. * @param {number} wait The number of milliseconds to delay invocation.
  7271. * @returns {number|Object} Returns the timer id or timeout object.
  7272. */
  7273. var setTimeout = ctxSetTimeout || function(func, wait) {
  7274. return root.setTimeout(func, wait);
  7275. };
  7276. /**
  7277. * Sets the `toString` method of `func` to return `string`.
  7278. *
  7279. * @private
  7280. * @param {Function} func The function to modify.
  7281. * @param {Function} string The `toString` result.
  7282. * @returns {Function} Returns `func`.
  7283. */
  7284. var setToString = shortOut(baseSetToString);
  7285. /**
  7286. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7287. * with wrapper details in a comment at the top of the source body.
  7288. *
  7289. * @private
  7290. * @param {Function} wrapper The function to modify.
  7291. * @param {Function} reference The reference function.
  7292. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7293. * @returns {Function} Returns `wrapper`.
  7294. */
  7295. function setWrapToString(wrapper, reference, bitmask) {
  7296. var source = (reference + '');
  7297. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7298. }
  7299. /**
  7300. * Creates a function that'll short out and invoke `identity` instead
  7301. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7302. * milliseconds.
  7303. *
  7304. * @private
  7305. * @param {Function} func The function to restrict.
  7306. * @returns {Function} Returns the new shortable function.
  7307. */
  7308. function shortOut(func) {
  7309. var count = 0,
  7310. lastCalled = 0;
  7311. return function() {
  7312. var stamp = nativeNow(),
  7313. remaining = HOT_SPAN - (stamp - lastCalled);
  7314. lastCalled = stamp;
  7315. if (remaining > 0) {
  7316. if (++count >= HOT_COUNT) {
  7317. return arguments[0];
  7318. }
  7319. } else {
  7320. count = 0;
  7321. }
  7322. return func.apply(undefined, arguments);
  7323. };
  7324. }
  7325. /**
  7326. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7327. *
  7328. * @private
  7329. * @param {Array} array The array to shuffle.
  7330. * @param {number} [size=array.length] The size of `array`.
  7331. * @returns {Array} Returns `array`.
  7332. */
  7333. function shuffleSelf(array, size) {
  7334. var index = -1,
  7335. length = array.length,
  7336. lastIndex = length - 1;
  7337. size = size === undefined ? length : size;
  7338. while (++index < size) {
  7339. var rand = baseRandom(index, lastIndex),
  7340. value = array[rand];
  7341. array[rand] = array[index];
  7342. array[index] = value;
  7343. }
  7344. array.length = size;
  7345. return array;
  7346. }
  7347. /**
  7348. * Converts `string` to a property path array.
  7349. *
  7350. * @private
  7351. * @param {string} string The string to convert.
  7352. * @returns {Array} Returns the property path array.
  7353. */
  7354. var stringToPath = memoizeCapped(function(string) {
  7355. var result = [];
  7356. if (string.charCodeAt(0) === 46 /* . */) {
  7357. result.push('');
  7358. }
  7359. string.replace(rePropName, function(match, number, quote, subString) {
  7360. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7361. });
  7362. return result;
  7363. });
  7364. /**
  7365. * Converts `value` to a string key if it's not a string or symbol.
  7366. *
  7367. * @private
  7368. * @param {*} value The value to inspect.
  7369. * @returns {string|symbol} Returns the key.
  7370. */
  7371. function toKey(value) {
  7372. if (typeof value == 'string' || isSymbol(value)) {
  7373. return value;
  7374. }
  7375. var result = (value + '');
  7376. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7377. }
  7378. /**
  7379. * Converts `func` to its source code.
  7380. *
  7381. * @private
  7382. * @param {Function} func The function to convert.
  7383. * @returns {string} Returns the source code.
  7384. */
  7385. function toSource(func) {
  7386. if (func != null) {
  7387. try {
  7388. return funcToString.call(func);
  7389. } catch (e) {}
  7390. try {
  7391. return (func + '');
  7392. } catch (e) {}
  7393. }
  7394. return '';
  7395. }
  7396. /**
  7397. * Updates wrapper `details` based on `bitmask` flags.
  7398. *
  7399. * @private
  7400. * @returns {Array} details The details to modify.
  7401. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7402. * @returns {Array} Returns `details`.
  7403. */
  7404. function updateWrapDetails(details, bitmask) {
  7405. arrayEach(wrapFlags, function(pair) {
  7406. var value = '_.' + pair[0];
  7407. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7408. details.push(value);
  7409. }
  7410. });
  7411. return details.sort();
  7412. }
  7413. /**
  7414. * Creates a clone of `wrapper`.
  7415. *
  7416. * @private
  7417. * @param {Object} wrapper The wrapper to clone.
  7418. * @returns {Object} Returns the cloned wrapper.
  7419. */
  7420. function wrapperClone(wrapper) {
  7421. if (wrapper instanceof LazyWrapper) {
  7422. return wrapper.clone();
  7423. }
  7424. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7425. result.__actions__ = copyArray(wrapper.__actions__);
  7426. result.__index__ = wrapper.__index__;
  7427. result.__values__ = wrapper.__values__;
  7428. return result;
  7429. }
  7430. /*------------------------------------------------------------------------*/
  7431. /**
  7432. * Creates an array of elements split into groups the length of `size`.
  7433. * If `array` can't be split evenly, the final chunk will be the remaining
  7434. * elements.
  7435. *
  7436. * @static
  7437. * @memberOf _
  7438. * @since 3.0.0
  7439. * @category Array
  7440. * @param {Array} array The array to process.
  7441. * @param {number} [size=1] The length of each chunk
  7442. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7443. * @returns {Array} Returns the new array of chunks.
  7444. * @example
  7445. *
  7446. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7447. * // => [['a', 'b'], ['c', 'd']]
  7448. *
  7449. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7450. * // => [['a', 'b', 'c'], ['d']]
  7451. */
  7452. function chunk(array, size, guard) {
  7453. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7454. size = 1;
  7455. } else {
  7456. size = nativeMax(toInteger(size), 0);
  7457. }
  7458. var length = array == null ? 0 : array.length;
  7459. if (!length || size < 1) {
  7460. return [];
  7461. }
  7462. var index = 0,
  7463. resIndex = 0,
  7464. result = Array(nativeCeil(length / size));
  7465. while (index < length) {
  7466. result[resIndex++] = baseSlice(array, index, (index += size));
  7467. }
  7468. return result;
  7469. }
  7470. /**
  7471. * Creates an array with all falsey values removed. The values `false`, `null`,
  7472. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7473. *
  7474. * @static
  7475. * @memberOf _
  7476. * @since 0.1.0
  7477. * @category Array
  7478. * @param {Array} array The array to compact.
  7479. * @returns {Array} Returns the new array of filtered values.
  7480. * @example
  7481. *
  7482. * _.compact([0, 1, false, 2, '', 3]);
  7483. * // => [1, 2, 3]
  7484. */
  7485. function compact(array) {
  7486. var index = -1,
  7487. length = array == null ? 0 : array.length,
  7488. resIndex = 0,
  7489. result = [];
  7490. while (++index < length) {
  7491. var value = array[index];
  7492. if (value) {
  7493. result[resIndex++] = value;
  7494. }
  7495. }
  7496. return result;
  7497. }
  7498. /**
  7499. * Creates a new array concatenating `array` with any additional arrays
  7500. * and/or values.
  7501. *
  7502. * @static
  7503. * @memberOf _
  7504. * @since 4.0.0
  7505. * @category Array
  7506. * @param {Array} array The array to concatenate.
  7507. * @param {...*} [values] The values to concatenate.
  7508. * @returns {Array} Returns the new concatenated array.
  7509. * @example
  7510. *
  7511. * var array = [1];
  7512. * var other = _.concat(array, 2, [3], [[4]]);
  7513. *
  7514. * console.log(other);
  7515. * // => [1, 2, 3, [4]]
  7516. *
  7517. * console.log(array);
  7518. * // => [1]
  7519. */
  7520. function concat() {
  7521. var length = arguments.length;
  7522. if (!length) {
  7523. return [];
  7524. }
  7525. var args = Array(length - 1),
  7526. array = arguments[0],
  7527. index = length;
  7528. while (index--) {
  7529. args[index - 1] = arguments[index];
  7530. }
  7531. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7532. }
  7533. /**
  7534. * Creates an array of `array` values not included in the other given arrays
  7535. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7536. * for equality comparisons. The order and references of result values are
  7537. * determined by the first array.
  7538. *
  7539. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7540. *
  7541. * @static
  7542. * @memberOf _
  7543. * @since 0.1.0
  7544. * @category Array
  7545. * @param {Array} array The array to inspect.
  7546. * @param {...Array} [values] The values to exclude.
  7547. * @returns {Array} Returns the new array of filtered values.
  7548. * @see _.without, _.xor
  7549. * @example
  7550. *
  7551. * _.difference([2, 1], [2, 3]);
  7552. * // => [1]
  7553. */
  7554. var difference = baseRest(function(array, values) {
  7555. return isArrayLikeObject(array)
  7556. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7557. : [];
  7558. });
  7559. /**
  7560. * This method is like `_.difference` except that it accepts `iteratee` which
  7561. * is invoked for each element of `array` and `values` to generate the criterion
  7562. * by which they're compared. The order and references of result values are
  7563. * determined by the first array. The iteratee is invoked with one argument:
  7564. * (value).
  7565. *
  7566. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7567. *
  7568. * @static
  7569. * @memberOf _
  7570. * @since 4.0.0
  7571. * @category Array
  7572. * @param {Array} array The array to inspect.
  7573. * @param {...Array} [values] The values to exclude.
  7574. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7575. * @returns {Array} Returns the new array of filtered values.
  7576. * @example
  7577. *
  7578. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7579. * // => [1.2]
  7580. *
  7581. * // The `_.property` iteratee shorthand.
  7582. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7583. * // => [{ 'x': 2 }]
  7584. */
  7585. var differenceBy = baseRest(function(array, values) {
  7586. var iteratee = last(values);
  7587. if (isArrayLikeObject(iteratee)) {
  7588. iteratee = undefined;
  7589. }
  7590. return isArrayLikeObject(array)
  7591. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7592. : [];
  7593. });
  7594. /**
  7595. * This method is like `_.difference` except that it accepts `comparator`
  7596. * which is invoked to compare elements of `array` to `values`. The order and
  7597. * references of result values are determined by the first array. The comparator
  7598. * is invoked with two arguments: (arrVal, othVal).
  7599. *
  7600. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7601. *
  7602. * @static
  7603. * @memberOf _
  7604. * @since 4.0.0
  7605. * @category Array
  7606. * @param {Array} array The array to inspect.
  7607. * @param {...Array} [values] The values to exclude.
  7608. * @param {Function} [comparator] The comparator invoked per element.
  7609. * @returns {Array} Returns the new array of filtered values.
  7610. * @example
  7611. *
  7612. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7613. *
  7614. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7615. * // => [{ 'x': 2, 'y': 1 }]
  7616. */
  7617. var differenceWith = baseRest(function(array, values) {
  7618. var comparator = last(values);
  7619. if (isArrayLikeObject(comparator)) {
  7620. comparator = undefined;
  7621. }
  7622. return isArrayLikeObject(array)
  7623. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7624. : [];
  7625. });
  7626. /**
  7627. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7628. *
  7629. * @static
  7630. * @memberOf _
  7631. * @since 0.5.0
  7632. * @category Array
  7633. * @param {Array} array The array to query.
  7634. * @param {number} [n=1] The number of elements to drop.
  7635. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7636. * @returns {Array} Returns the slice of `array`.
  7637. * @example
  7638. *
  7639. * _.drop([1, 2, 3]);
  7640. * // => [2, 3]
  7641. *
  7642. * _.drop([1, 2, 3], 2);
  7643. * // => [3]
  7644. *
  7645. * _.drop([1, 2, 3], 5);
  7646. * // => []
  7647. *
  7648. * _.drop([1, 2, 3], 0);
  7649. * // => [1, 2, 3]
  7650. */
  7651. function drop(array, n, guard) {
  7652. var length = array == null ? 0 : array.length;
  7653. if (!length) {
  7654. return [];
  7655. }
  7656. n = (guard || n === undefined) ? 1 : toInteger(n);
  7657. return baseSlice(array, n < 0 ? 0 : n, length);
  7658. }
  7659. /**
  7660. * Creates a slice of `array` with `n` elements dropped from the end.
  7661. *
  7662. * @static
  7663. * @memberOf _
  7664. * @since 3.0.0
  7665. * @category Array
  7666. * @param {Array} array The array to query.
  7667. * @param {number} [n=1] The number of elements to drop.
  7668. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7669. * @returns {Array} Returns the slice of `array`.
  7670. * @example
  7671. *
  7672. * _.dropRight([1, 2, 3]);
  7673. * // => [1, 2]
  7674. *
  7675. * _.dropRight([1, 2, 3], 2);
  7676. * // => [1]
  7677. *
  7678. * _.dropRight([1, 2, 3], 5);
  7679. * // => []
  7680. *
  7681. * _.dropRight([1, 2, 3], 0);
  7682. * // => [1, 2, 3]
  7683. */
  7684. function dropRight(array, n, guard) {
  7685. var length = array == null ? 0 : array.length;
  7686. if (!length) {
  7687. return [];
  7688. }
  7689. n = (guard || n === undefined) ? 1 : toInteger(n);
  7690. n = length - n;
  7691. return baseSlice(array, 0, n < 0 ? 0 : n);
  7692. }
  7693. /**
  7694. * Creates a slice of `array` excluding elements dropped from the end.
  7695. * Elements are dropped until `predicate` returns falsey. The predicate is
  7696. * invoked with three arguments: (value, index, array).
  7697. *
  7698. * @static
  7699. * @memberOf _
  7700. * @since 3.0.0
  7701. * @category Array
  7702. * @param {Array} array The array to query.
  7703. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7704. * @returns {Array} Returns the slice of `array`.
  7705. * @example
  7706. *
  7707. * var users = [
  7708. * { 'user': 'barney', 'active': true },
  7709. * { 'user': 'fred', 'active': false },
  7710. * { 'user': 'pebbles', 'active': false }
  7711. * ];
  7712. *
  7713. * _.dropRightWhile(users, function(o) { return !o.active; });
  7714. * // => objects for ['barney']
  7715. *
  7716. * // The `_.matches` iteratee shorthand.
  7717. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7718. * // => objects for ['barney', 'fred']
  7719. *
  7720. * // The `_.matchesProperty` iteratee shorthand.
  7721. * _.dropRightWhile(users, ['active', false]);
  7722. * // => objects for ['barney']
  7723. *
  7724. * // The `_.property` iteratee shorthand.
  7725. * _.dropRightWhile(users, 'active');
  7726. * // => objects for ['barney', 'fred', 'pebbles']
  7727. */
  7728. function dropRightWhile(array, predicate) {
  7729. return (array && array.length)
  7730. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7731. : [];
  7732. }
  7733. /**
  7734. * Creates a slice of `array` excluding elements dropped from the beginning.
  7735. * Elements are dropped until `predicate` returns falsey. The predicate is
  7736. * invoked with three arguments: (value, index, array).
  7737. *
  7738. * @static
  7739. * @memberOf _
  7740. * @since 3.0.0
  7741. * @category Array
  7742. * @param {Array} array The array to query.
  7743. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7744. * @returns {Array} Returns the slice of `array`.
  7745. * @example
  7746. *
  7747. * var users = [
  7748. * { 'user': 'barney', 'active': false },
  7749. * { 'user': 'fred', 'active': false },
  7750. * { 'user': 'pebbles', 'active': true }
  7751. * ];
  7752. *
  7753. * _.dropWhile(users, function(o) { return !o.active; });
  7754. * // => objects for ['pebbles']
  7755. *
  7756. * // The `_.matches` iteratee shorthand.
  7757. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7758. * // => objects for ['fred', 'pebbles']
  7759. *
  7760. * // The `_.matchesProperty` iteratee shorthand.
  7761. * _.dropWhile(users, ['active', false]);
  7762. * // => objects for ['pebbles']
  7763. *
  7764. * // The `_.property` iteratee shorthand.
  7765. * _.dropWhile(users, 'active');
  7766. * // => objects for ['barney', 'fred', 'pebbles']
  7767. */
  7768. function dropWhile(array, predicate) {
  7769. return (array && array.length)
  7770. ? baseWhile(array, getIteratee(predicate, 3), true)
  7771. : [];
  7772. }
  7773. /**
  7774. * Fills elements of `array` with `value` from `start` up to, but not
  7775. * including, `end`.
  7776. *
  7777. * **Note:** This method mutates `array`.
  7778. *
  7779. * @static
  7780. * @memberOf _
  7781. * @since 3.2.0
  7782. * @category Array
  7783. * @param {Array} array The array to fill.
  7784. * @param {*} value The value to fill `array` with.
  7785. * @param {number} [start=0] The start position.
  7786. * @param {number} [end=array.length] The end position.
  7787. * @returns {Array} Returns `array`.
  7788. * @example
  7789. *
  7790. * var array = [1, 2, 3];
  7791. *
  7792. * _.fill(array, 'a');
  7793. * console.log(array);
  7794. * // => ['a', 'a', 'a']
  7795. *
  7796. * _.fill(Array(3), 2);
  7797. * // => [2, 2, 2]
  7798. *
  7799. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7800. * // => [4, '*', '*', 10]
  7801. */
  7802. function fill(array, value, start, end) {
  7803. var length = array == null ? 0 : array.length;
  7804. if (!length) {
  7805. return [];
  7806. }
  7807. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7808. start = 0;
  7809. end = length;
  7810. }
  7811. return baseFill(array, value, start, end);
  7812. }
  7813. /**
  7814. * This method is like `_.find` except that it returns the index of the first
  7815. * element `predicate` returns truthy for instead of the element itself.
  7816. *
  7817. * @static
  7818. * @memberOf _
  7819. * @since 1.1.0
  7820. * @category Array
  7821. * @param {Array} array The array to inspect.
  7822. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7823. * @param {number} [fromIndex=0] The index to search from.
  7824. * @returns {number} Returns the index of the found element, else `-1`.
  7825. * @example
  7826. *
  7827. * var users = [
  7828. * { 'user': 'barney', 'active': false },
  7829. * { 'user': 'fred', 'active': false },
  7830. * { 'user': 'pebbles', 'active': true }
  7831. * ];
  7832. *
  7833. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7834. * // => 0
  7835. *
  7836. * // The `_.matches` iteratee shorthand.
  7837. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7838. * // => 1
  7839. *
  7840. * // The `_.matchesProperty` iteratee shorthand.
  7841. * _.findIndex(users, ['active', false]);
  7842. * // => 0
  7843. *
  7844. * // The `_.property` iteratee shorthand.
  7845. * _.findIndex(users, 'active');
  7846. * // => 2
  7847. */
  7848. function findIndex(array, predicate, fromIndex) {
  7849. var length = array == null ? 0 : array.length;
  7850. if (!length) {
  7851. return -1;
  7852. }
  7853. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7854. if (index < 0) {
  7855. index = nativeMax(length + index, 0);
  7856. }
  7857. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7858. }
  7859. /**
  7860. * This method is like `_.findIndex` except that it iterates over elements
  7861. * of `collection` from right to left.
  7862. *
  7863. * @static
  7864. * @memberOf _
  7865. * @since 2.0.0
  7866. * @category Array
  7867. * @param {Array} array The array to inspect.
  7868. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7869. * @param {number} [fromIndex=array.length-1] The index to search from.
  7870. * @returns {number} Returns the index of the found element, else `-1`.
  7871. * @example
  7872. *
  7873. * var users = [
  7874. * { 'user': 'barney', 'active': true },
  7875. * { 'user': 'fred', 'active': false },
  7876. * { 'user': 'pebbles', 'active': false }
  7877. * ];
  7878. *
  7879. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7880. * // => 2
  7881. *
  7882. * // The `_.matches` iteratee shorthand.
  7883. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7884. * // => 0
  7885. *
  7886. * // The `_.matchesProperty` iteratee shorthand.
  7887. * _.findLastIndex(users, ['active', false]);
  7888. * // => 2
  7889. *
  7890. * // The `_.property` iteratee shorthand.
  7891. * _.findLastIndex(users, 'active');
  7892. * // => 0
  7893. */
  7894. function findLastIndex(array, predicate, fromIndex) {
  7895. var length = array == null ? 0 : array.length;
  7896. if (!length) {
  7897. return -1;
  7898. }
  7899. var index = length - 1;
  7900. if (fromIndex !== undefined) {
  7901. index = toInteger(fromIndex);
  7902. index = fromIndex < 0
  7903. ? nativeMax(length + index, 0)
  7904. : nativeMin(index, length - 1);
  7905. }
  7906. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7907. }
  7908. /**
  7909. * Flattens `array` a single level deep.
  7910. *
  7911. * @static
  7912. * @memberOf _
  7913. * @since 0.1.0
  7914. * @category Array
  7915. * @param {Array} array The array to flatten.
  7916. * @returns {Array} Returns the new flattened array.
  7917. * @example
  7918. *
  7919. * _.flatten([1, [2, [3, [4]], 5]]);
  7920. * // => [1, 2, [3, [4]], 5]
  7921. */
  7922. function flatten(array) {
  7923. var length = array == null ? 0 : array.length;
  7924. return length ? baseFlatten(array, 1) : [];
  7925. }
  7926. /**
  7927. * Recursively flattens `array`.
  7928. *
  7929. * @static
  7930. * @memberOf _
  7931. * @since 3.0.0
  7932. * @category Array
  7933. * @param {Array} array The array to flatten.
  7934. * @returns {Array} Returns the new flattened array.
  7935. * @example
  7936. *
  7937. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7938. * // => [1, 2, 3, 4, 5]
  7939. */
  7940. function flattenDeep(array) {
  7941. var length = array == null ? 0 : array.length;
  7942. return length ? baseFlatten(array, INFINITY) : [];
  7943. }
  7944. /**
  7945. * Recursively flatten `array` up to `depth` times.
  7946. *
  7947. * @static
  7948. * @memberOf _
  7949. * @since 4.4.0
  7950. * @category Array
  7951. * @param {Array} array The array to flatten.
  7952. * @param {number} [depth=1] The maximum recursion depth.
  7953. * @returns {Array} Returns the new flattened array.
  7954. * @example
  7955. *
  7956. * var array = [1, [2, [3, [4]], 5]];
  7957. *
  7958. * _.flattenDepth(array, 1);
  7959. * // => [1, 2, [3, [4]], 5]
  7960. *
  7961. * _.flattenDepth(array, 2);
  7962. * // => [1, 2, 3, [4], 5]
  7963. */
  7964. function flattenDepth(array, depth) {
  7965. var length = array == null ? 0 : array.length;
  7966. if (!length) {
  7967. return [];
  7968. }
  7969. depth = depth === undefined ? 1 : toInteger(depth);
  7970. return baseFlatten(array, depth);
  7971. }
  7972. /**
  7973. * The inverse of `_.toPairs`; this method returns an object composed
  7974. * from key-value `pairs`.
  7975. *
  7976. * @static
  7977. * @memberOf _
  7978. * @since 4.0.0
  7979. * @category Array
  7980. * @param {Array} pairs The key-value pairs.
  7981. * @returns {Object} Returns the new object.
  7982. * @example
  7983. *
  7984. * _.fromPairs([['a', 1], ['b', 2]]);
  7985. * // => { 'a': 1, 'b': 2 }
  7986. */
  7987. function fromPairs(pairs) {
  7988. var index = -1,
  7989. length = pairs == null ? 0 : pairs.length,
  7990. result = {};
  7991. while (++index < length) {
  7992. var pair = pairs[index];
  7993. result[pair[0]] = pair[1];
  7994. }
  7995. return result;
  7996. }
  7997. /**
  7998. * Gets the first element of `array`.
  7999. *
  8000. * @static
  8001. * @memberOf _
  8002. * @since 0.1.0
  8003. * @alias first
  8004. * @category Array
  8005. * @param {Array} array The array to query.
  8006. * @returns {*} Returns the first element of `array`.
  8007. * @example
  8008. *
  8009. * _.head([1, 2, 3]);
  8010. * // => 1
  8011. *
  8012. * _.head([]);
  8013. * // => undefined
  8014. */
  8015. function head(array) {
  8016. return (array && array.length) ? array[0] : undefined;
  8017. }
  8018. /**
  8019. * Gets the index at which the first occurrence of `value` is found in `array`
  8020. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8021. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8022. * offset from the end of `array`.
  8023. *
  8024. * @static
  8025. * @memberOf _
  8026. * @since 0.1.0
  8027. * @category Array
  8028. * @param {Array} array The array to inspect.
  8029. * @param {*} value The value to search for.
  8030. * @param {number} [fromIndex=0] The index to search from.
  8031. * @returns {number} Returns the index of the matched value, else `-1`.
  8032. * @example
  8033. *
  8034. * _.indexOf([1, 2, 1, 2], 2);
  8035. * // => 1
  8036. *
  8037. * // Search from the `fromIndex`.
  8038. * _.indexOf([1, 2, 1, 2], 2, 2);
  8039. * // => 3
  8040. */
  8041. function indexOf(array, value, fromIndex) {
  8042. var length = array == null ? 0 : array.length;
  8043. if (!length) {
  8044. return -1;
  8045. }
  8046. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8047. if (index < 0) {
  8048. index = nativeMax(length + index, 0);
  8049. }
  8050. return baseIndexOf(array, value, index);
  8051. }
  8052. /**
  8053. * Gets all but the last element of `array`.
  8054. *
  8055. * @static
  8056. * @memberOf _
  8057. * @since 0.1.0
  8058. * @category Array
  8059. * @param {Array} array The array to query.
  8060. * @returns {Array} Returns the slice of `array`.
  8061. * @example
  8062. *
  8063. * _.initial([1, 2, 3]);
  8064. * // => [1, 2]
  8065. */
  8066. function initial(array) {
  8067. var length = array == null ? 0 : array.length;
  8068. return length ? baseSlice(array, 0, -1) : [];
  8069. }
  8070. /**
  8071. * Creates an array of unique values that are included in all given arrays
  8072. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8073. * for equality comparisons. The order and references of result values are
  8074. * determined by the first array.
  8075. *
  8076. * @static
  8077. * @memberOf _
  8078. * @since 0.1.0
  8079. * @category Array
  8080. * @param {...Array} [arrays] The arrays to inspect.
  8081. * @returns {Array} Returns the new array of intersecting values.
  8082. * @example
  8083. *
  8084. * _.intersection([2, 1], [2, 3]);
  8085. * // => [2]
  8086. */
  8087. var intersection = baseRest(function(arrays) {
  8088. var mapped = arrayMap(arrays, castArrayLikeObject);
  8089. return (mapped.length && mapped[0] === arrays[0])
  8090. ? baseIntersection(mapped)
  8091. : [];
  8092. });
  8093. /**
  8094. * This method is like `_.intersection` except that it accepts `iteratee`
  8095. * which is invoked for each element of each `arrays` to generate the criterion
  8096. * by which they're compared. The order and references of result values are
  8097. * determined by the first array. The iteratee is invoked with one argument:
  8098. * (value).
  8099. *
  8100. * @static
  8101. * @memberOf _
  8102. * @since 4.0.0
  8103. * @category Array
  8104. * @param {...Array} [arrays] The arrays to inspect.
  8105. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8106. * @returns {Array} Returns the new array of intersecting values.
  8107. * @example
  8108. *
  8109. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8110. * // => [2.1]
  8111. *
  8112. * // The `_.property` iteratee shorthand.
  8113. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8114. * // => [{ 'x': 1 }]
  8115. */
  8116. var intersectionBy = baseRest(function(arrays) {
  8117. var iteratee = last(arrays),
  8118. mapped = arrayMap(arrays, castArrayLikeObject);
  8119. if (iteratee === last(mapped)) {
  8120. iteratee = undefined;
  8121. } else {
  8122. mapped.pop();
  8123. }
  8124. return (mapped.length && mapped[0] === arrays[0])
  8125. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8126. : [];
  8127. });
  8128. /**
  8129. * This method is like `_.intersection` except that it accepts `comparator`
  8130. * which is invoked to compare elements of `arrays`. The order and references
  8131. * of result values are determined by the first array. The comparator is
  8132. * invoked with two arguments: (arrVal, othVal).
  8133. *
  8134. * @static
  8135. * @memberOf _
  8136. * @since 4.0.0
  8137. * @category Array
  8138. * @param {...Array} [arrays] The arrays to inspect.
  8139. * @param {Function} [comparator] The comparator invoked per element.
  8140. * @returns {Array} Returns the new array of intersecting values.
  8141. * @example
  8142. *
  8143. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8144. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8145. *
  8146. * _.intersectionWith(objects, others, _.isEqual);
  8147. * // => [{ 'x': 1, 'y': 2 }]
  8148. */
  8149. var intersectionWith = baseRest(function(arrays) {
  8150. var comparator = last(arrays),
  8151. mapped = arrayMap(arrays, castArrayLikeObject);
  8152. comparator = typeof comparator == 'function' ? comparator : undefined;
  8153. if (comparator) {
  8154. mapped.pop();
  8155. }
  8156. return (mapped.length && mapped[0] === arrays[0])
  8157. ? baseIntersection(mapped, undefined, comparator)
  8158. : [];
  8159. });
  8160. /**
  8161. * Converts all elements in `array` into a string separated by `separator`.
  8162. *
  8163. * @static
  8164. * @memberOf _
  8165. * @since 4.0.0
  8166. * @category Array
  8167. * @param {Array} array The array to convert.
  8168. * @param {string} [separator=','] The element separator.
  8169. * @returns {string} Returns the joined string.
  8170. * @example
  8171. *
  8172. * _.join(['a', 'b', 'c'], '~');
  8173. * // => 'a~b~c'
  8174. */
  8175. function join(array, separator) {
  8176. return array == null ? '' : nativeJoin.call(array, separator);
  8177. }
  8178. /**
  8179. * Gets the last element of `array`.
  8180. *
  8181. * @static
  8182. * @memberOf _
  8183. * @since 0.1.0
  8184. * @category Array
  8185. * @param {Array} array The array to query.
  8186. * @returns {*} Returns the last element of `array`.
  8187. * @example
  8188. *
  8189. * _.last([1, 2, 3]);
  8190. * // => 3
  8191. */
  8192. function last(array) {
  8193. var length = array == null ? 0 : array.length;
  8194. return length ? array[length - 1] : undefined;
  8195. }
  8196. /**
  8197. * This method is like `_.indexOf` except that it iterates over elements of
  8198. * `array` from right to left.
  8199. *
  8200. * @static
  8201. * @memberOf _
  8202. * @since 0.1.0
  8203. * @category Array
  8204. * @param {Array} array The array to inspect.
  8205. * @param {*} value The value to search for.
  8206. * @param {number} [fromIndex=array.length-1] The index to search from.
  8207. * @returns {number} Returns the index of the matched value, else `-1`.
  8208. * @example
  8209. *
  8210. * _.lastIndexOf([1, 2, 1, 2], 2);
  8211. * // => 3
  8212. *
  8213. * // Search from the `fromIndex`.
  8214. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8215. * // => 1
  8216. */
  8217. function lastIndexOf(array, value, fromIndex) {
  8218. var length = array == null ? 0 : array.length;
  8219. if (!length) {
  8220. return -1;
  8221. }
  8222. var index = length;
  8223. if (fromIndex !== undefined) {
  8224. index = toInteger(fromIndex);
  8225. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8226. }
  8227. return value === value
  8228. ? strictLastIndexOf(array, value, index)
  8229. : baseFindIndex(array, baseIsNaN, index, true);
  8230. }
  8231. /**
  8232. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8233. * element from the end is returned.
  8234. *
  8235. * @static
  8236. * @memberOf _
  8237. * @since 4.11.0
  8238. * @category Array
  8239. * @param {Array} array The array to query.
  8240. * @param {number} [n=0] The index of the element to return.
  8241. * @returns {*} Returns the nth element of `array`.
  8242. * @example
  8243. *
  8244. * var array = ['a', 'b', 'c', 'd'];
  8245. *
  8246. * _.nth(array, 1);
  8247. * // => 'b'
  8248. *
  8249. * _.nth(array, -2);
  8250. * // => 'c';
  8251. */
  8252. function nth(array, n) {
  8253. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8254. }
  8255. /**
  8256. * Removes all given values from `array` using
  8257. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8258. * for equality comparisons.
  8259. *
  8260. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8261. * to remove elements from an array by predicate.
  8262. *
  8263. * @static
  8264. * @memberOf _
  8265. * @since 2.0.0
  8266. * @category Array
  8267. * @param {Array} array The array to modify.
  8268. * @param {...*} [values] The values to remove.
  8269. * @returns {Array} Returns `array`.
  8270. * @example
  8271. *
  8272. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8273. *
  8274. * _.pull(array, 'a', 'c');
  8275. * console.log(array);
  8276. * // => ['b', 'b']
  8277. */
  8278. var pull = baseRest(pullAll);
  8279. /**
  8280. * This method is like `_.pull` except that it accepts an array of values to remove.
  8281. *
  8282. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8283. *
  8284. * @static
  8285. * @memberOf _
  8286. * @since 4.0.0
  8287. * @category Array
  8288. * @param {Array} array The array to modify.
  8289. * @param {Array} values The values to remove.
  8290. * @returns {Array} Returns `array`.
  8291. * @example
  8292. *
  8293. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8294. *
  8295. * _.pullAll(array, ['a', 'c']);
  8296. * console.log(array);
  8297. * // => ['b', 'b']
  8298. */
  8299. function pullAll(array, values) {
  8300. return (array && array.length && values && values.length)
  8301. ? basePullAll(array, values)
  8302. : array;
  8303. }
  8304. /**
  8305. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8306. * invoked for each element of `array` and `values` to generate the criterion
  8307. * by which they're compared. The iteratee is invoked with one argument: (value).
  8308. *
  8309. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8310. *
  8311. * @static
  8312. * @memberOf _
  8313. * @since 4.0.0
  8314. * @category Array
  8315. * @param {Array} array The array to modify.
  8316. * @param {Array} values The values to remove.
  8317. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8318. * @returns {Array} Returns `array`.
  8319. * @example
  8320. *
  8321. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8322. *
  8323. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8324. * console.log(array);
  8325. * // => [{ 'x': 2 }]
  8326. */
  8327. function pullAllBy(array, values, iteratee) {
  8328. return (array && array.length && values && values.length)
  8329. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8330. : array;
  8331. }
  8332. /**
  8333. * This method is like `_.pullAll` except that it accepts `comparator` which
  8334. * is invoked to compare elements of `array` to `values`. The comparator is
  8335. * invoked with two arguments: (arrVal, othVal).
  8336. *
  8337. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8338. *
  8339. * @static
  8340. * @memberOf _
  8341. * @since 4.6.0
  8342. * @category Array
  8343. * @param {Array} array The array to modify.
  8344. * @param {Array} values The values to remove.
  8345. * @param {Function} [comparator] The comparator invoked per element.
  8346. * @returns {Array} Returns `array`.
  8347. * @example
  8348. *
  8349. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8350. *
  8351. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8352. * console.log(array);
  8353. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8354. */
  8355. function pullAllWith(array, values, comparator) {
  8356. return (array && array.length && values && values.length)
  8357. ? basePullAll(array, values, undefined, comparator)
  8358. : array;
  8359. }
  8360. /**
  8361. * Removes elements from `array` corresponding to `indexes` and returns an
  8362. * array of removed elements.
  8363. *
  8364. * **Note:** Unlike `_.at`, this method mutates `array`.
  8365. *
  8366. * @static
  8367. * @memberOf _
  8368. * @since 3.0.0
  8369. * @category Array
  8370. * @param {Array} array The array to modify.
  8371. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8372. * @returns {Array} Returns the new array of removed elements.
  8373. * @example
  8374. *
  8375. * var array = ['a', 'b', 'c', 'd'];
  8376. * var pulled = _.pullAt(array, [1, 3]);
  8377. *
  8378. * console.log(array);
  8379. * // => ['a', 'c']
  8380. *
  8381. * console.log(pulled);
  8382. * // => ['b', 'd']
  8383. */
  8384. var pullAt = flatRest(function(array, indexes) {
  8385. var length = array == null ? 0 : array.length,
  8386. result = baseAt(array, indexes);
  8387. basePullAt(array, arrayMap(indexes, function(index) {
  8388. return isIndex(index, length) ? +index : index;
  8389. }).sort(compareAscending));
  8390. return result;
  8391. });
  8392. /**
  8393. * Removes all elements from `array` that `predicate` returns truthy for
  8394. * and returns an array of the removed elements. The predicate is invoked
  8395. * with three arguments: (value, index, array).
  8396. *
  8397. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8398. * to pull elements from an array by value.
  8399. *
  8400. * @static
  8401. * @memberOf _
  8402. * @since 2.0.0
  8403. * @category Array
  8404. * @param {Array} array The array to modify.
  8405. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8406. * @returns {Array} Returns the new array of removed elements.
  8407. * @example
  8408. *
  8409. * var array = [1, 2, 3, 4];
  8410. * var evens = _.remove(array, function(n) {
  8411. * return n % 2 == 0;
  8412. * });
  8413. *
  8414. * console.log(array);
  8415. * // => [1, 3]
  8416. *
  8417. * console.log(evens);
  8418. * // => [2, 4]
  8419. */
  8420. function remove(array, predicate) {
  8421. var result = [];
  8422. if (!(array && array.length)) {
  8423. return result;
  8424. }
  8425. var index = -1,
  8426. indexes = [],
  8427. length = array.length;
  8428. predicate = getIteratee(predicate, 3);
  8429. while (++index < length) {
  8430. var value = array[index];
  8431. if (predicate(value, index, array)) {
  8432. result.push(value);
  8433. indexes.push(index);
  8434. }
  8435. }
  8436. basePullAt(array, indexes);
  8437. return result;
  8438. }
  8439. /**
  8440. * Reverses `array` so that the first element becomes the last, the second
  8441. * element becomes the second to last, and so on.
  8442. *
  8443. * **Note:** This method mutates `array` and is based on
  8444. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8445. *
  8446. * @static
  8447. * @memberOf _
  8448. * @since 4.0.0
  8449. * @category Array
  8450. * @param {Array} array The array to modify.
  8451. * @returns {Array} Returns `array`.
  8452. * @example
  8453. *
  8454. * var array = [1, 2, 3];
  8455. *
  8456. * _.reverse(array);
  8457. * // => [3, 2, 1]
  8458. *
  8459. * console.log(array);
  8460. * // => [3, 2, 1]
  8461. */
  8462. function reverse(array) {
  8463. return array == null ? array : nativeReverse.call(array);
  8464. }
  8465. /**
  8466. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8467. *
  8468. * **Note:** This method is used instead of
  8469. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8470. * returned.
  8471. *
  8472. * @static
  8473. * @memberOf _
  8474. * @since 3.0.0
  8475. * @category Array
  8476. * @param {Array} array The array to slice.
  8477. * @param {number} [start=0] The start position.
  8478. * @param {number} [end=array.length] The end position.
  8479. * @returns {Array} Returns the slice of `array`.
  8480. */
  8481. function slice(array, start, end) {
  8482. var length = array == null ? 0 : array.length;
  8483. if (!length) {
  8484. return [];
  8485. }
  8486. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8487. start = 0;
  8488. end = length;
  8489. }
  8490. else {
  8491. start = start == null ? 0 : toInteger(start);
  8492. end = end === undefined ? length : toInteger(end);
  8493. }
  8494. return baseSlice(array, start, end);
  8495. }
  8496. /**
  8497. * Uses a binary search to determine the lowest index at which `value`
  8498. * should be inserted into `array` in order to maintain its sort order.
  8499. *
  8500. * @static
  8501. * @memberOf _
  8502. * @since 0.1.0
  8503. * @category Array
  8504. * @param {Array} array The sorted array to inspect.
  8505. * @param {*} value The value to evaluate.
  8506. * @returns {number} Returns the index at which `value` should be inserted
  8507. * into `array`.
  8508. * @example
  8509. *
  8510. * _.sortedIndex([30, 50], 40);
  8511. * // => 1
  8512. */
  8513. function sortedIndex(array, value) {
  8514. return baseSortedIndex(array, value);
  8515. }
  8516. /**
  8517. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8518. * which is invoked for `value` and each element of `array` to compute their
  8519. * sort ranking. The iteratee is invoked with one argument: (value).
  8520. *
  8521. * @static
  8522. * @memberOf _
  8523. * @since 4.0.0
  8524. * @category Array
  8525. * @param {Array} array The sorted array to inspect.
  8526. * @param {*} value The value to evaluate.
  8527. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8528. * @returns {number} Returns the index at which `value` should be inserted
  8529. * into `array`.
  8530. * @example
  8531. *
  8532. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8533. *
  8534. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8535. * // => 0
  8536. *
  8537. * // The `_.property` iteratee shorthand.
  8538. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8539. * // => 0
  8540. */
  8541. function sortedIndexBy(array, value, iteratee) {
  8542. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8543. }
  8544. /**
  8545. * This method is like `_.indexOf` except that it performs a binary
  8546. * search on a sorted `array`.
  8547. *
  8548. * @static
  8549. * @memberOf _
  8550. * @since 4.0.0
  8551. * @category Array
  8552. * @param {Array} array The array to inspect.
  8553. * @param {*} value The value to search for.
  8554. * @returns {number} Returns the index of the matched value, else `-1`.
  8555. * @example
  8556. *
  8557. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8558. * // => 1
  8559. */
  8560. function sortedIndexOf(array, value) {
  8561. var length = array == null ? 0 : array.length;
  8562. if (length) {
  8563. var index = baseSortedIndex(array, value);
  8564. if (index < length && eq(array[index], value)) {
  8565. return index;
  8566. }
  8567. }
  8568. return -1;
  8569. }
  8570. /**
  8571. * This method is like `_.sortedIndex` except that it returns the highest
  8572. * index at which `value` should be inserted into `array` in order to
  8573. * maintain its sort order.
  8574. *
  8575. * @static
  8576. * @memberOf _
  8577. * @since 3.0.0
  8578. * @category Array
  8579. * @param {Array} array The sorted array to inspect.
  8580. * @param {*} value The value to evaluate.
  8581. * @returns {number} Returns the index at which `value` should be inserted
  8582. * into `array`.
  8583. * @example
  8584. *
  8585. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8586. * // => 4
  8587. */
  8588. function sortedLastIndex(array, value) {
  8589. return baseSortedIndex(array, value, true);
  8590. }
  8591. /**
  8592. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8593. * which is invoked for `value` and each element of `array` to compute their
  8594. * sort ranking. The iteratee is invoked with one argument: (value).
  8595. *
  8596. * @static
  8597. * @memberOf _
  8598. * @since 4.0.0
  8599. * @category Array
  8600. * @param {Array} array The sorted array to inspect.
  8601. * @param {*} value The value to evaluate.
  8602. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8603. * @returns {number} Returns the index at which `value` should be inserted
  8604. * into `array`.
  8605. * @example
  8606. *
  8607. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8608. *
  8609. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8610. * // => 1
  8611. *
  8612. * // The `_.property` iteratee shorthand.
  8613. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8614. * // => 1
  8615. */
  8616. function sortedLastIndexBy(array, value, iteratee) {
  8617. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8618. }
  8619. /**
  8620. * This method is like `_.lastIndexOf` except that it performs a binary
  8621. * search on a sorted `array`.
  8622. *
  8623. * @static
  8624. * @memberOf _
  8625. * @since 4.0.0
  8626. * @category Array
  8627. * @param {Array} array The array to inspect.
  8628. * @param {*} value The value to search for.
  8629. * @returns {number} Returns the index of the matched value, else `-1`.
  8630. * @example
  8631. *
  8632. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8633. * // => 3
  8634. */
  8635. function sortedLastIndexOf(array, value) {
  8636. var length = array == null ? 0 : array.length;
  8637. if (length) {
  8638. var index = baseSortedIndex(array, value, true) - 1;
  8639. if (eq(array[index], value)) {
  8640. return index;
  8641. }
  8642. }
  8643. return -1;
  8644. }
  8645. /**
  8646. * This method is like `_.uniq` except that it's designed and optimized
  8647. * for sorted arrays.
  8648. *
  8649. * @static
  8650. * @memberOf _
  8651. * @since 4.0.0
  8652. * @category Array
  8653. * @param {Array} array The array to inspect.
  8654. * @returns {Array} Returns the new duplicate free array.
  8655. * @example
  8656. *
  8657. * _.sortedUniq([1, 1, 2]);
  8658. * // => [1, 2]
  8659. */
  8660. function sortedUniq(array) {
  8661. return (array && array.length)
  8662. ? baseSortedUniq(array)
  8663. : [];
  8664. }
  8665. /**
  8666. * This method is like `_.uniqBy` except that it's designed and optimized
  8667. * for sorted arrays.
  8668. *
  8669. * @static
  8670. * @memberOf _
  8671. * @since 4.0.0
  8672. * @category Array
  8673. * @param {Array} array The array to inspect.
  8674. * @param {Function} [iteratee] The iteratee invoked per element.
  8675. * @returns {Array} Returns the new duplicate free array.
  8676. * @example
  8677. *
  8678. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8679. * // => [1.1, 2.3]
  8680. */
  8681. function sortedUniqBy(array, iteratee) {
  8682. return (array && array.length)
  8683. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8684. : [];
  8685. }
  8686. /**
  8687. * Gets all but the first element of `array`.
  8688. *
  8689. * @static
  8690. * @memberOf _
  8691. * @since 4.0.0
  8692. * @category Array
  8693. * @param {Array} array The array to query.
  8694. * @returns {Array} Returns the slice of `array`.
  8695. * @example
  8696. *
  8697. * _.tail([1, 2, 3]);
  8698. * // => [2, 3]
  8699. */
  8700. function tail(array) {
  8701. var length = array == null ? 0 : array.length;
  8702. return length ? baseSlice(array, 1, length) : [];
  8703. }
  8704. /**
  8705. * Creates a slice of `array` with `n` elements taken from the beginning.
  8706. *
  8707. * @static
  8708. * @memberOf _
  8709. * @since 0.1.0
  8710. * @category Array
  8711. * @param {Array} array The array to query.
  8712. * @param {number} [n=1] The number of elements to take.
  8713. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8714. * @returns {Array} Returns the slice of `array`.
  8715. * @example
  8716. *
  8717. * _.take([1, 2, 3]);
  8718. * // => [1]
  8719. *
  8720. * _.take([1, 2, 3], 2);
  8721. * // => [1, 2]
  8722. *
  8723. * _.take([1, 2, 3], 5);
  8724. * // => [1, 2, 3]
  8725. *
  8726. * _.take([1, 2, 3], 0);
  8727. * // => []
  8728. */
  8729. function take(array, n, guard) {
  8730. if (!(array && array.length)) {
  8731. return [];
  8732. }
  8733. n = (guard || n === undefined) ? 1 : toInteger(n);
  8734. return baseSlice(array, 0, n < 0 ? 0 : n);
  8735. }
  8736. /**
  8737. * Creates a slice of `array` with `n` elements taken from the end.
  8738. *
  8739. * @static
  8740. * @memberOf _
  8741. * @since 3.0.0
  8742. * @category Array
  8743. * @param {Array} array The array to query.
  8744. * @param {number} [n=1] The number of elements to take.
  8745. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8746. * @returns {Array} Returns the slice of `array`.
  8747. * @example
  8748. *
  8749. * _.takeRight([1, 2, 3]);
  8750. * // => [3]
  8751. *
  8752. * _.takeRight([1, 2, 3], 2);
  8753. * // => [2, 3]
  8754. *
  8755. * _.takeRight([1, 2, 3], 5);
  8756. * // => [1, 2, 3]
  8757. *
  8758. * _.takeRight([1, 2, 3], 0);
  8759. * // => []
  8760. */
  8761. function takeRight(array, n, guard) {
  8762. var length = array == null ? 0 : array.length;
  8763. if (!length) {
  8764. return [];
  8765. }
  8766. n = (guard || n === undefined) ? 1 : toInteger(n);
  8767. n = length - n;
  8768. return baseSlice(array, n < 0 ? 0 : n, length);
  8769. }
  8770. /**
  8771. * Creates a slice of `array` with elements taken from the end. Elements are
  8772. * taken until `predicate` returns falsey. The predicate is invoked with
  8773. * three arguments: (value, index, array).
  8774. *
  8775. * @static
  8776. * @memberOf _
  8777. * @since 3.0.0
  8778. * @category Array
  8779. * @param {Array} array The array to query.
  8780. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8781. * @returns {Array} Returns the slice of `array`.
  8782. * @example
  8783. *
  8784. * var users = [
  8785. * { 'user': 'barney', 'active': true },
  8786. * { 'user': 'fred', 'active': false },
  8787. * { 'user': 'pebbles', 'active': false }
  8788. * ];
  8789. *
  8790. * _.takeRightWhile(users, function(o) { return !o.active; });
  8791. * // => objects for ['fred', 'pebbles']
  8792. *
  8793. * // The `_.matches` iteratee shorthand.
  8794. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8795. * // => objects for ['pebbles']
  8796. *
  8797. * // The `_.matchesProperty` iteratee shorthand.
  8798. * _.takeRightWhile(users, ['active', false]);
  8799. * // => objects for ['fred', 'pebbles']
  8800. *
  8801. * // The `_.property` iteratee shorthand.
  8802. * _.takeRightWhile(users, 'active');
  8803. * // => []
  8804. */
  8805. function takeRightWhile(array, predicate) {
  8806. return (array && array.length)
  8807. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8808. : [];
  8809. }
  8810. /**
  8811. * Creates a slice of `array` with elements taken from the beginning. Elements
  8812. * are taken until `predicate` returns falsey. The predicate is invoked with
  8813. * three arguments: (value, index, array).
  8814. *
  8815. * @static
  8816. * @memberOf _
  8817. * @since 3.0.0
  8818. * @category Array
  8819. * @param {Array} array The array to query.
  8820. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8821. * @returns {Array} Returns the slice of `array`.
  8822. * @example
  8823. *
  8824. * var users = [
  8825. * { 'user': 'barney', 'active': false },
  8826. * { 'user': 'fred', 'active': false },
  8827. * { 'user': 'pebbles', 'active': true }
  8828. * ];
  8829. *
  8830. * _.takeWhile(users, function(o) { return !o.active; });
  8831. * // => objects for ['barney', 'fred']
  8832. *
  8833. * // The `_.matches` iteratee shorthand.
  8834. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8835. * // => objects for ['barney']
  8836. *
  8837. * // The `_.matchesProperty` iteratee shorthand.
  8838. * _.takeWhile(users, ['active', false]);
  8839. * // => objects for ['barney', 'fred']
  8840. *
  8841. * // The `_.property` iteratee shorthand.
  8842. * _.takeWhile(users, 'active');
  8843. * // => []
  8844. */
  8845. function takeWhile(array, predicate) {
  8846. return (array && array.length)
  8847. ? baseWhile(array, getIteratee(predicate, 3))
  8848. : [];
  8849. }
  8850. /**
  8851. * Creates an array of unique values, in order, from all given arrays using
  8852. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8853. * for equality comparisons.
  8854. *
  8855. * @static
  8856. * @memberOf _
  8857. * @since 0.1.0
  8858. * @category Array
  8859. * @param {...Array} [arrays] The arrays to inspect.
  8860. * @returns {Array} Returns the new array of combined values.
  8861. * @example
  8862. *
  8863. * _.union([2], [1, 2]);
  8864. * // => [2, 1]
  8865. */
  8866. var union = baseRest(function(arrays) {
  8867. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8868. });
  8869. /**
  8870. * This method is like `_.union` except that it accepts `iteratee` which is
  8871. * invoked for each element of each `arrays` to generate the criterion by
  8872. * which uniqueness is computed. Result values are chosen from the first
  8873. * array in which the value occurs. The iteratee is invoked with one argument:
  8874. * (value).
  8875. *
  8876. * @static
  8877. * @memberOf _
  8878. * @since 4.0.0
  8879. * @category Array
  8880. * @param {...Array} [arrays] The arrays to inspect.
  8881. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8882. * @returns {Array} Returns the new array of combined values.
  8883. * @example
  8884. *
  8885. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8886. * // => [2.1, 1.2]
  8887. *
  8888. * // The `_.property` iteratee shorthand.
  8889. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8890. * // => [{ 'x': 1 }, { 'x': 2 }]
  8891. */
  8892. var unionBy = baseRest(function(arrays) {
  8893. var iteratee = last(arrays);
  8894. if (isArrayLikeObject(iteratee)) {
  8895. iteratee = undefined;
  8896. }
  8897. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8898. });
  8899. /**
  8900. * This method is like `_.union` except that it accepts `comparator` which
  8901. * is invoked to compare elements of `arrays`. Result values are chosen from
  8902. * the first array in which the value occurs. The comparator is invoked
  8903. * with two arguments: (arrVal, othVal).
  8904. *
  8905. * @static
  8906. * @memberOf _
  8907. * @since 4.0.0
  8908. * @category Array
  8909. * @param {...Array} [arrays] The arrays to inspect.
  8910. * @param {Function} [comparator] The comparator invoked per element.
  8911. * @returns {Array} Returns the new array of combined values.
  8912. * @example
  8913. *
  8914. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8915. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8916. *
  8917. * _.unionWith(objects, others, _.isEqual);
  8918. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8919. */
  8920. var unionWith = baseRest(function(arrays) {
  8921. var comparator = last(arrays);
  8922. comparator = typeof comparator == 'function' ? comparator : undefined;
  8923. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8924. });
  8925. /**
  8926. * Creates a duplicate-free version of an array, using
  8927. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8928. * for equality comparisons, in which only the first occurrence of each element
  8929. * is kept. The order of result values is determined by the order they occur
  8930. * in the array.
  8931. *
  8932. * @static
  8933. * @memberOf _
  8934. * @since 0.1.0
  8935. * @category Array
  8936. * @param {Array} array The array to inspect.
  8937. * @returns {Array} Returns the new duplicate free array.
  8938. * @example
  8939. *
  8940. * _.uniq([2, 1, 2]);
  8941. * // => [2, 1]
  8942. */
  8943. function uniq(array) {
  8944. return (array && array.length) ? baseUniq(array) : [];
  8945. }
  8946. /**
  8947. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8948. * invoked for each element in `array` to generate the criterion by which
  8949. * uniqueness is computed. The order of result values is determined by the
  8950. * order they occur in the array. The iteratee is invoked with one argument:
  8951. * (value).
  8952. *
  8953. * @static
  8954. * @memberOf _
  8955. * @since 4.0.0
  8956. * @category Array
  8957. * @param {Array} array The array to inspect.
  8958. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8959. * @returns {Array} Returns the new duplicate free array.
  8960. * @example
  8961. *
  8962. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8963. * // => [2.1, 1.2]
  8964. *
  8965. * // The `_.property` iteratee shorthand.
  8966. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8967. * // => [{ 'x': 1 }, { 'x': 2 }]
  8968. */
  8969. function uniqBy(array, iteratee) {
  8970. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8971. }
  8972. /**
  8973. * This method is like `_.uniq` except that it accepts `comparator` which
  8974. * is invoked to compare elements of `array`. The order of result values is
  8975. * determined by the order they occur in the array.The comparator is invoked
  8976. * with two arguments: (arrVal, othVal).
  8977. *
  8978. * @static
  8979. * @memberOf _
  8980. * @since 4.0.0
  8981. * @category Array
  8982. * @param {Array} array The array to inspect.
  8983. * @param {Function} [comparator] The comparator invoked per element.
  8984. * @returns {Array} Returns the new duplicate free array.
  8985. * @example
  8986. *
  8987. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8988. *
  8989. * _.uniqWith(objects, _.isEqual);
  8990. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8991. */
  8992. function uniqWith(array, comparator) {
  8993. comparator = typeof comparator == 'function' ? comparator : undefined;
  8994. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8995. }
  8996. /**
  8997. * This method is like `_.zip` except that it accepts an array of grouped
  8998. * elements and creates an array regrouping the elements to their pre-zip
  8999. * configuration.
  9000. *
  9001. * @static
  9002. * @memberOf _
  9003. * @since 1.2.0
  9004. * @category Array
  9005. * @param {Array} array The array of grouped elements to process.
  9006. * @returns {Array} Returns the new array of regrouped elements.
  9007. * @example
  9008. *
  9009. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9010. * // => [['a', 1, true], ['b', 2, false]]
  9011. *
  9012. * _.unzip(zipped);
  9013. * // => [['a', 'b'], [1, 2], [true, false]]
  9014. */
  9015. function unzip(array) {
  9016. if (!(array && array.length)) {
  9017. return [];
  9018. }
  9019. var length = 0;
  9020. array = arrayFilter(array, function(group) {
  9021. if (isArrayLikeObject(group)) {
  9022. length = nativeMax(group.length, length);
  9023. return true;
  9024. }
  9025. });
  9026. return baseTimes(length, function(index) {
  9027. return arrayMap(array, baseProperty(index));
  9028. });
  9029. }
  9030. /**
  9031. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9032. * how regrouped values should be combined. The iteratee is invoked with the
  9033. * elements of each group: (...group).
  9034. *
  9035. * @static
  9036. * @memberOf _
  9037. * @since 3.8.0
  9038. * @category Array
  9039. * @param {Array} array The array of grouped elements to process.
  9040. * @param {Function} [iteratee=_.identity] The function to combine
  9041. * regrouped values.
  9042. * @returns {Array} Returns the new array of regrouped elements.
  9043. * @example
  9044. *
  9045. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9046. * // => [[1, 10, 100], [2, 20, 200]]
  9047. *
  9048. * _.unzipWith(zipped, _.add);
  9049. * // => [3, 30, 300]
  9050. */
  9051. function unzipWith(array, iteratee) {
  9052. if (!(array && array.length)) {
  9053. return [];
  9054. }
  9055. var result = unzip(array);
  9056. if (iteratee == null) {
  9057. return result;
  9058. }
  9059. return arrayMap(result, function(group) {
  9060. return apply(iteratee, undefined, group);
  9061. });
  9062. }
  9063. /**
  9064. * Creates an array excluding all given values using
  9065. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9066. * for equality comparisons.
  9067. *
  9068. * **Note:** Unlike `_.pull`, this method returns a new array.
  9069. *
  9070. * @static
  9071. * @memberOf _
  9072. * @since 0.1.0
  9073. * @category Array
  9074. * @param {Array} array The array to inspect.
  9075. * @param {...*} [values] The values to exclude.
  9076. * @returns {Array} Returns the new array of filtered values.
  9077. * @see _.difference, _.xor
  9078. * @example
  9079. *
  9080. * _.without([2, 1, 2, 3], 1, 2);
  9081. * // => [3]
  9082. */
  9083. var without = baseRest(function(array, values) {
  9084. return isArrayLikeObject(array)
  9085. ? baseDifference(array, values)
  9086. : [];
  9087. });
  9088. /**
  9089. * Creates an array of unique values that is the
  9090. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9091. * of the given arrays. The order of result values is determined by the order
  9092. * they occur in the arrays.
  9093. *
  9094. * @static
  9095. * @memberOf _
  9096. * @since 2.4.0
  9097. * @category Array
  9098. * @param {...Array} [arrays] The arrays to inspect.
  9099. * @returns {Array} Returns the new array of filtered values.
  9100. * @see _.difference, _.without
  9101. * @example
  9102. *
  9103. * _.xor([2, 1], [2, 3]);
  9104. * // => [1, 3]
  9105. */
  9106. var xor = baseRest(function(arrays) {
  9107. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9108. });
  9109. /**
  9110. * This method is like `_.xor` except that it accepts `iteratee` which is
  9111. * invoked for each element of each `arrays` to generate the criterion by
  9112. * which by which they're compared. The order of result values is determined
  9113. * by the order they occur in the arrays. The iteratee is invoked with one
  9114. * argument: (value).
  9115. *
  9116. * @static
  9117. * @memberOf _
  9118. * @since 4.0.0
  9119. * @category Array
  9120. * @param {...Array} [arrays] The arrays to inspect.
  9121. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9122. * @returns {Array} Returns the new array of filtered values.
  9123. * @example
  9124. *
  9125. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9126. * // => [1.2, 3.4]
  9127. *
  9128. * // The `_.property` iteratee shorthand.
  9129. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9130. * // => [{ 'x': 2 }]
  9131. */
  9132. var xorBy = baseRest(function(arrays) {
  9133. var iteratee = last(arrays);
  9134. if (isArrayLikeObject(iteratee)) {
  9135. iteratee = undefined;
  9136. }
  9137. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9138. });
  9139. /**
  9140. * This method is like `_.xor` except that it accepts `comparator` which is
  9141. * invoked to compare elements of `arrays`. The order of result values is
  9142. * determined by the order they occur in the arrays. The comparator is invoked
  9143. * with two arguments: (arrVal, othVal).
  9144. *
  9145. * @static
  9146. * @memberOf _
  9147. * @since 4.0.0
  9148. * @category Array
  9149. * @param {...Array} [arrays] The arrays to inspect.
  9150. * @param {Function} [comparator] The comparator invoked per element.
  9151. * @returns {Array} Returns the new array of filtered values.
  9152. * @example
  9153. *
  9154. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9155. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9156. *
  9157. * _.xorWith(objects, others, _.isEqual);
  9158. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9159. */
  9160. var xorWith = baseRest(function(arrays) {
  9161. var comparator = last(arrays);
  9162. comparator = typeof comparator == 'function' ? comparator : undefined;
  9163. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9164. });
  9165. /**
  9166. * Creates an array of grouped elements, the first of which contains the
  9167. * first elements of the given arrays, the second of which contains the
  9168. * second elements of the given arrays, and so on.
  9169. *
  9170. * @static
  9171. * @memberOf _
  9172. * @since 0.1.0
  9173. * @category Array
  9174. * @param {...Array} [arrays] The arrays to process.
  9175. * @returns {Array} Returns the new array of grouped elements.
  9176. * @example
  9177. *
  9178. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9179. * // => [['a', 1, true], ['b', 2, false]]
  9180. */
  9181. var zip = baseRest(unzip);
  9182. /**
  9183. * This method is like `_.fromPairs` except that it accepts two arrays,
  9184. * one of property identifiers and one of corresponding values.
  9185. *
  9186. * @static
  9187. * @memberOf _
  9188. * @since 0.4.0
  9189. * @category Array
  9190. * @param {Array} [props=[]] The property identifiers.
  9191. * @param {Array} [values=[]] The property values.
  9192. * @returns {Object} Returns the new object.
  9193. * @example
  9194. *
  9195. * _.zipObject(['a', 'b'], [1, 2]);
  9196. * // => { 'a': 1, 'b': 2 }
  9197. */
  9198. function zipObject(props, values) {
  9199. return baseZipObject(props || [], values || [], assignValue);
  9200. }
  9201. /**
  9202. * This method is like `_.zipObject` except that it supports property paths.
  9203. *
  9204. * @static
  9205. * @memberOf _
  9206. * @since 4.1.0
  9207. * @category Array
  9208. * @param {Array} [props=[]] The property identifiers.
  9209. * @param {Array} [values=[]] The property values.
  9210. * @returns {Object} Returns the new object.
  9211. * @example
  9212. *
  9213. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9214. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9215. */
  9216. function zipObjectDeep(props, values) {
  9217. return baseZipObject(props || [], values || [], baseSet);
  9218. }
  9219. /**
  9220. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9221. * how grouped values should be combined. The iteratee is invoked with the
  9222. * elements of each group: (...group).
  9223. *
  9224. * @static
  9225. * @memberOf _
  9226. * @since 3.8.0
  9227. * @category Array
  9228. * @param {...Array} [arrays] The arrays to process.
  9229. * @param {Function} [iteratee=_.identity] The function to combine
  9230. * grouped values.
  9231. * @returns {Array} Returns the new array of grouped elements.
  9232. * @example
  9233. *
  9234. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9235. * return a + b + c;
  9236. * });
  9237. * // => [111, 222]
  9238. */
  9239. var zipWith = baseRest(function(arrays) {
  9240. var length = arrays.length,
  9241. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9242. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9243. return unzipWith(arrays, iteratee);
  9244. });
  9245. /*------------------------------------------------------------------------*/
  9246. /**
  9247. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9248. * chain sequences enabled. The result of such sequences must be unwrapped
  9249. * with `_#value`.
  9250. *
  9251. * @static
  9252. * @memberOf _
  9253. * @since 1.3.0
  9254. * @category Seq
  9255. * @param {*} value The value to wrap.
  9256. * @returns {Object} Returns the new `lodash` wrapper instance.
  9257. * @example
  9258. *
  9259. * var users = [
  9260. * { 'user': 'barney', 'age': 36 },
  9261. * { 'user': 'fred', 'age': 40 },
  9262. * { 'user': 'pebbles', 'age': 1 }
  9263. * ];
  9264. *
  9265. * var youngest = _
  9266. * .chain(users)
  9267. * .sortBy('age')
  9268. * .map(function(o) {
  9269. * return o.user + ' is ' + o.age;
  9270. * })
  9271. * .head()
  9272. * .value();
  9273. * // => 'pebbles is 1'
  9274. */
  9275. function chain(value) {
  9276. var result = lodash(value);
  9277. result.__chain__ = true;
  9278. return result;
  9279. }
  9280. /**
  9281. * This method invokes `interceptor` and returns `value`. The interceptor
  9282. * is invoked with one argument; (value). The purpose of this method is to
  9283. * "tap into" a method chain sequence in order to modify intermediate results.
  9284. *
  9285. * @static
  9286. * @memberOf _
  9287. * @since 0.1.0
  9288. * @category Seq
  9289. * @param {*} value The value to provide to `interceptor`.
  9290. * @param {Function} interceptor The function to invoke.
  9291. * @returns {*} Returns `value`.
  9292. * @example
  9293. *
  9294. * _([1, 2, 3])
  9295. * .tap(function(array) {
  9296. * // Mutate input array.
  9297. * array.pop();
  9298. * })
  9299. * .reverse()
  9300. * .value();
  9301. * // => [2, 1]
  9302. */
  9303. function tap(value, interceptor) {
  9304. interceptor(value);
  9305. return value;
  9306. }
  9307. /**
  9308. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9309. * The purpose of this method is to "pass thru" values replacing intermediate
  9310. * results in a method chain sequence.
  9311. *
  9312. * @static
  9313. * @memberOf _
  9314. * @since 3.0.0
  9315. * @category Seq
  9316. * @param {*} value The value to provide to `interceptor`.
  9317. * @param {Function} interceptor The function to invoke.
  9318. * @returns {*} Returns the result of `interceptor`.
  9319. * @example
  9320. *
  9321. * _(' abc ')
  9322. * .chain()
  9323. * .trim()
  9324. * .thru(function(value) {
  9325. * return [value];
  9326. * })
  9327. * .value();
  9328. * // => ['abc']
  9329. */
  9330. function thru(value, interceptor) {
  9331. return interceptor(value);
  9332. }
  9333. /**
  9334. * This method is the wrapper version of `_.at`.
  9335. *
  9336. * @name at
  9337. * @memberOf _
  9338. * @since 1.0.0
  9339. * @category Seq
  9340. * @param {...(string|string[])} [paths] The property paths to pick.
  9341. * @returns {Object} Returns the new `lodash` wrapper instance.
  9342. * @example
  9343. *
  9344. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9345. *
  9346. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9347. * // => [3, 4]
  9348. */
  9349. var wrapperAt = flatRest(function(paths) {
  9350. var length = paths.length,
  9351. start = length ? paths[0] : 0,
  9352. value = this.__wrapped__,
  9353. interceptor = function(object) { return baseAt(object, paths); };
  9354. if (length > 1 || this.__actions__.length ||
  9355. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9356. return this.thru(interceptor);
  9357. }
  9358. value = value.slice(start, +start + (length ? 1 : 0));
  9359. value.__actions__.push({
  9360. 'func': thru,
  9361. 'args': [interceptor],
  9362. 'thisArg': undefined
  9363. });
  9364. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9365. if (length && !array.length) {
  9366. array.push(undefined);
  9367. }
  9368. return array;
  9369. });
  9370. });
  9371. /**
  9372. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9373. *
  9374. * @name chain
  9375. * @memberOf _
  9376. * @since 0.1.0
  9377. * @category Seq
  9378. * @returns {Object} Returns the new `lodash` wrapper instance.
  9379. * @example
  9380. *
  9381. * var users = [
  9382. * { 'user': 'barney', 'age': 36 },
  9383. * { 'user': 'fred', 'age': 40 }
  9384. * ];
  9385. *
  9386. * // A sequence without explicit chaining.
  9387. * _(users).head();
  9388. * // => { 'user': 'barney', 'age': 36 }
  9389. *
  9390. * // A sequence with explicit chaining.
  9391. * _(users)
  9392. * .chain()
  9393. * .head()
  9394. * .pick('user')
  9395. * .value();
  9396. * // => { 'user': 'barney' }
  9397. */
  9398. function wrapperChain() {
  9399. return chain(this);
  9400. }
  9401. /**
  9402. * Executes the chain sequence and returns the wrapped result.
  9403. *
  9404. * @name commit
  9405. * @memberOf _
  9406. * @since 3.2.0
  9407. * @category Seq
  9408. * @returns {Object} Returns the new `lodash` wrapper instance.
  9409. * @example
  9410. *
  9411. * var array = [1, 2];
  9412. * var wrapped = _(array).push(3);
  9413. *
  9414. * console.log(array);
  9415. * // => [1, 2]
  9416. *
  9417. * wrapped = wrapped.commit();
  9418. * console.log(array);
  9419. * // => [1, 2, 3]
  9420. *
  9421. * wrapped.last();
  9422. * // => 3
  9423. *
  9424. * console.log(array);
  9425. * // => [1, 2, 3]
  9426. */
  9427. function wrapperCommit() {
  9428. return new LodashWrapper(this.value(), this.__chain__);
  9429. }
  9430. /**
  9431. * Gets the next value on a wrapped object following the
  9432. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9433. *
  9434. * @name next
  9435. * @memberOf _
  9436. * @since 4.0.0
  9437. * @category Seq
  9438. * @returns {Object} Returns the next iterator value.
  9439. * @example
  9440. *
  9441. * var wrapped = _([1, 2]);
  9442. *
  9443. * wrapped.next();
  9444. * // => { 'done': false, 'value': 1 }
  9445. *
  9446. * wrapped.next();
  9447. * // => { 'done': false, 'value': 2 }
  9448. *
  9449. * wrapped.next();
  9450. * // => { 'done': true, 'value': undefined }
  9451. */
  9452. function wrapperNext() {
  9453. if (this.__values__ === undefined) {
  9454. this.__values__ = toArray(this.value());
  9455. }
  9456. var done = this.__index__ >= this.__values__.length,
  9457. value = done ? undefined : this.__values__[this.__index__++];
  9458. return { 'done': done, 'value': value };
  9459. }
  9460. /**
  9461. * Enables the wrapper to be iterable.
  9462. *
  9463. * @name Symbol.iterator
  9464. * @memberOf _
  9465. * @since 4.0.0
  9466. * @category Seq
  9467. * @returns {Object} Returns the wrapper object.
  9468. * @example
  9469. *
  9470. * var wrapped = _([1, 2]);
  9471. *
  9472. * wrapped[Symbol.iterator]() === wrapped;
  9473. * // => true
  9474. *
  9475. * Array.from(wrapped);
  9476. * // => [1, 2]
  9477. */
  9478. function wrapperToIterator() {
  9479. return this;
  9480. }
  9481. /**
  9482. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9483. *
  9484. * @name plant
  9485. * @memberOf _
  9486. * @since 3.2.0
  9487. * @category Seq
  9488. * @param {*} value The value to plant.
  9489. * @returns {Object} Returns the new `lodash` wrapper instance.
  9490. * @example
  9491. *
  9492. * function square(n) {
  9493. * return n * n;
  9494. * }
  9495. *
  9496. * var wrapped = _([1, 2]).map(square);
  9497. * var other = wrapped.plant([3, 4]);
  9498. *
  9499. * other.value();
  9500. * // => [9, 16]
  9501. *
  9502. * wrapped.value();
  9503. * // => [1, 4]
  9504. */
  9505. function wrapperPlant(value) {
  9506. var result,
  9507. parent = this;
  9508. while (parent instanceof baseLodash) {
  9509. var clone = wrapperClone(parent);
  9510. clone.__index__ = 0;
  9511. clone.__values__ = undefined;
  9512. if (result) {
  9513. previous.__wrapped__ = clone;
  9514. } else {
  9515. result = clone;
  9516. }
  9517. var previous = clone;
  9518. parent = parent.__wrapped__;
  9519. }
  9520. previous.__wrapped__ = value;
  9521. return result;
  9522. }
  9523. /**
  9524. * This method is the wrapper version of `_.reverse`.
  9525. *
  9526. * **Note:** This method mutates the wrapped array.
  9527. *
  9528. * @name reverse
  9529. * @memberOf _
  9530. * @since 0.1.0
  9531. * @category Seq
  9532. * @returns {Object} Returns the new `lodash` wrapper instance.
  9533. * @example
  9534. *
  9535. * var array = [1, 2, 3];
  9536. *
  9537. * _(array).reverse().value()
  9538. * // => [3, 2, 1]
  9539. *
  9540. * console.log(array);
  9541. * // => [3, 2, 1]
  9542. */
  9543. function wrapperReverse() {
  9544. var value = this.__wrapped__;
  9545. if (value instanceof LazyWrapper) {
  9546. var wrapped = value;
  9547. if (this.__actions__.length) {
  9548. wrapped = new LazyWrapper(this);
  9549. }
  9550. wrapped = wrapped.reverse();
  9551. wrapped.__actions__.push({
  9552. 'func': thru,
  9553. 'args': [reverse],
  9554. 'thisArg': undefined
  9555. });
  9556. return new LodashWrapper(wrapped, this.__chain__);
  9557. }
  9558. return this.thru(reverse);
  9559. }
  9560. /**
  9561. * Executes the chain sequence to resolve the unwrapped value.
  9562. *
  9563. * @name value
  9564. * @memberOf _
  9565. * @since 0.1.0
  9566. * @alias toJSON, valueOf
  9567. * @category Seq
  9568. * @returns {*} Returns the resolved unwrapped value.
  9569. * @example
  9570. *
  9571. * _([1, 2, 3]).value();
  9572. * // => [1, 2, 3]
  9573. */
  9574. function wrapperValue() {
  9575. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9576. }
  9577. /*------------------------------------------------------------------------*/
  9578. /**
  9579. * Creates an object composed of keys generated from the results of running
  9580. * each element of `collection` thru `iteratee`. The corresponding value of
  9581. * each key is the number of times the key was returned by `iteratee`. The
  9582. * iteratee is invoked with one argument: (value).
  9583. *
  9584. * @static
  9585. * @memberOf _
  9586. * @since 0.5.0
  9587. * @category Collection
  9588. * @param {Array|Object} collection The collection to iterate over.
  9589. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9590. * @returns {Object} Returns the composed aggregate object.
  9591. * @example
  9592. *
  9593. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9594. * // => { '4': 1, '6': 2 }
  9595. *
  9596. * // The `_.property` iteratee shorthand.
  9597. * _.countBy(['one', 'two', 'three'], 'length');
  9598. * // => { '3': 2, '5': 1 }
  9599. */
  9600. var countBy = createAggregator(function(result, value, key) {
  9601. if (hasOwnProperty.call(result, key)) {
  9602. ++result[key];
  9603. } else {
  9604. baseAssignValue(result, key, 1);
  9605. }
  9606. });
  9607. /**
  9608. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9609. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9610. * invoked with three arguments: (value, index|key, collection).
  9611. *
  9612. * **Note:** This method returns `true` for
  9613. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9614. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9615. * elements of empty collections.
  9616. *
  9617. * @static
  9618. * @memberOf _
  9619. * @since 0.1.0
  9620. * @category Collection
  9621. * @param {Array|Object} collection The collection to iterate over.
  9622. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9623. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9624. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9625. * else `false`.
  9626. * @example
  9627. *
  9628. * _.every([true, 1, null, 'yes'], Boolean);
  9629. * // => false
  9630. *
  9631. * var users = [
  9632. * { 'user': 'barney', 'age': 36, 'active': false },
  9633. * { 'user': 'fred', 'age': 40, 'active': false }
  9634. * ];
  9635. *
  9636. * // The `_.matches` iteratee shorthand.
  9637. * _.every(users, { 'user': 'barney', 'active': false });
  9638. * // => false
  9639. *
  9640. * // The `_.matchesProperty` iteratee shorthand.
  9641. * _.every(users, ['active', false]);
  9642. * // => true
  9643. *
  9644. * // The `_.property` iteratee shorthand.
  9645. * _.every(users, 'active');
  9646. * // => false
  9647. */
  9648. function every(collection, predicate, guard) {
  9649. var func = isArray(collection) ? arrayEvery : baseEvery;
  9650. if (guard && isIterateeCall(collection, predicate, guard)) {
  9651. predicate = undefined;
  9652. }
  9653. return func(collection, getIteratee(predicate, 3));
  9654. }
  9655. /**
  9656. * Iterates over elements of `collection`, returning an array of all elements
  9657. * `predicate` returns truthy for. The predicate is invoked with three
  9658. * arguments: (value, index|key, collection).
  9659. *
  9660. * **Note:** Unlike `_.remove`, this method returns a new array.
  9661. *
  9662. * @static
  9663. * @memberOf _
  9664. * @since 0.1.0
  9665. * @category Collection
  9666. * @param {Array|Object} collection The collection to iterate over.
  9667. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9668. * @returns {Array} Returns the new filtered array.
  9669. * @see _.reject
  9670. * @example
  9671. *
  9672. * var users = [
  9673. * { 'user': 'barney', 'age': 36, 'active': true },
  9674. * { 'user': 'fred', 'age': 40, 'active': false }
  9675. * ];
  9676. *
  9677. * _.filter(users, function(o) { return !o.active; });
  9678. * // => objects for ['fred']
  9679. *
  9680. * // The `_.matches` iteratee shorthand.
  9681. * _.filter(users, { 'age': 36, 'active': true });
  9682. * // => objects for ['barney']
  9683. *
  9684. * // The `_.matchesProperty` iteratee shorthand.
  9685. * _.filter(users, ['active', false]);
  9686. * // => objects for ['fred']
  9687. *
  9688. * // The `_.property` iteratee shorthand.
  9689. * _.filter(users, 'active');
  9690. * // => objects for ['barney']
  9691. */
  9692. function filter(collection, predicate) {
  9693. var func = isArray(collection) ? arrayFilter : baseFilter;
  9694. return func(collection, getIteratee(predicate, 3));
  9695. }
  9696. /**
  9697. * Iterates over elements of `collection`, returning the first element
  9698. * `predicate` returns truthy for. The predicate is invoked with three
  9699. * arguments: (value, index|key, collection).
  9700. *
  9701. * @static
  9702. * @memberOf _
  9703. * @since 0.1.0
  9704. * @category Collection
  9705. * @param {Array|Object} collection The collection to inspect.
  9706. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9707. * @param {number} [fromIndex=0] The index to search from.
  9708. * @returns {*} Returns the matched element, else `undefined`.
  9709. * @example
  9710. *
  9711. * var users = [
  9712. * { 'user': 'barney', 'age': 36, 'active': true },
  9713. * { 'user': 'fred', 'age': 40, 'active': false },
  9714. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9715. * ];
  9716. *
  9717. * _.find(users, function(o) { return o.age < 40; });
  9718. * // => object for 'barney'
  9719. *
  9720. * // The `_.matches` iteratee shorthand.
  9721. * _.find(users, { 'age': 1, 'active': true });
  9722. * // => object for 'pebbles'
  9723. *
  9724. * // The `_.matchesProperty` iteratee shorthand.
  9725. * _.find(users, ['active', false]);
  9726. * // => object for 'fred'
  9727. *
  9728. * // The `_.property` iteratee shorthand.
  9729. * _.find(users, 'active');
  9730. * // => object for 'barney'
  9731. */
  9732. var find = createFind(findIndex);
  9733. /**
  9734. * This method is like `_.find` except that it iterates over elements of
  9735. * `collection` from right to left.
  9736. *
  9737. * @static
  9738. * @memberOf _
  9739. * @since 2.0.0
  9740. * @category Collection
  9741. * @param {Array|Object} collection The collection to inspect.
  9742. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9743. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9744. * @returns {*} Returns the matched element, else `undefined`.
  9745. * @example
  9746. *
  9747. * _.findLast([1, 2, 3, 4], function(n) {
  9748. * return n % 2 == 1;
  9749. * });
  9750. * // => 3
  9751. */
  9752. var findLast = createFind(findLastIndex);
  9753. /**
  9754. * Creates a flattened array of values by running each element in `collection`
  9755. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9756. * with three arguments: (value, index|key, collection).
  9757. *
  9758. * @static
  9759. * @memberOf _
  9760. * @since 4.0.0
  9761. * @category Collection
  9762. * @param {Array|Object} collection The collection to iterate over.
  9763. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9764. * @returns {Array} Returns the new flattened array.
  9765. * @example
  9766. *
  9767. * function duplicate(n) {
  9768. * return [n, n];
  9769. * }
  9770. *
  9771. * _.flatMap([1, 2], duplicate);
  9772. * // => [1, 1, 2, 2]
  9773. */
  9774. function flatMap(collection, iteratee) {
  9775. return baseFlatten(map(collection, iteratee), 1);
  9776. }
  9777. /**
  9778. * This method is like `_.flatMap` except that it recursively flattens the
  9779. * mapped results.
  9780. *
  9781. * @static
  9782. * @memberOf _
  9783. * @since 4.7.0
  9784. * @category Collection
  9785. * @param {Array|Object} collection The collection to iterate over.
  9786. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9787. * @returns {Array} Returns the new flattened array.
  9788. * @example
  9789. *
  9790. * function duplicate(n) {
  9791. * return [[[n, n]]];
  9792. * }
  9793. *
  9794. * _.flatMapDeep([1, 2], duplicate);
  9795. * // => [1, 1, 2, 2]
  9796. */
  9797. function flatMapDeep(collection, iteratee) {
  9798. return baseFlatten(map(collection, iteratee), INFINITY);
  9799. }
  9800. /**
  9801. * This method is like `_.flatMap` except that it recursively flattens the
  9802. * mapped results up to `depth` times.
  9803. *
  9804. * @static
  9805. * @memberOf _
  9806. * @since 4.7.0
  9807. * @category Collection
  9808. * @param {Array|Object} collection The collection to iterate over.
  9809. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9810. * @param {number} [depth=1] The maximum recursion depth.
  9811. * @returns {Array} Returns the new flattened array.
  9812. * @example
  9813. *
  9814. * function duplicate(n) {
  9815. * return [[[n, n]]];
  9816. * }
  9817. *
  9818. * _.flatMapDepth([1, 2], duplicate, 2);
  9819. * // => [[1, 1], [2, 2]]
  9820. */
  9821. function flatMapDepth(collection, iteratee, depth) {
  9822. depth = depth === undefined ? 1 : toInteger(depth);
  9823. return baseFlatten(map(collection, iteratee), depth);
  9824. }
  9825. /**
  9826. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9827. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9828. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9829. *
  9830. * **Note:** As with other "Collections" methods, objects with a "length"
  9831. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9832. * or `_.forOwn` for object iteration.
  9833. *
  9834. * @static
  9835. * @memberOf _
  9836. * @since 0.1.0
  9837. * @alias each
  9838. * @category Collection
  9839. * @param {Array|Object} collection The collection to iterate over.
  9840. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9841. * @returns {Array|Object} Returns `collection`.
  9842. * @see _.forEachRight
  9843. * @example
  9844. *
  9845. * _.forEach([1, 2], function(value) {
  9846. * console.log(value);
  9847. * });
  9848. * // => Logs `1` then `2`.
  9849. *
  9850. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9851. * console.log(key);
  9852. * });
  9853. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9854. */
  9855. function forEach(collection, iteratee) {
  9856. var func = isArray(collection) ? arrayEach : baseEach;
  9857. return func(collection, getIteratee(iteratee, 3));
  9858. }
  9859. /**
  9860. * This method is like `_.forEach` except that it iterates over elements of
  9861. * `collection` from right to left.
  9862. *
  9863. * @static
  9864. * @memberOf _
  9865. * @since 2.0.0
  9866. * @alias eachRight
  9867. * @category Collection
  9868. * @param {Array|Object} collection The collection to iterate over.
  9869. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9870. * @returns {Array|Object} Returns `collection`.
  9871. * @see _.forEach
  9872. * @example
  9873. *
  9874. * _.forEachRight([1, 2], function(value) {
  9875. * console.log(value);
  9876. * });
  9877. * // => Logs `2` then `1`.
  9878. */
  9879. function forEachRight(collection, iteratee) {
  9880. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9881. return func(collection, getIteratee(iteratee, 3));
  9882. }
  9883. /**
  9884. * Creates an object composed of keys generated from the results of running
  9885. * each element of `collection` thru `iteratee`. The order of grouped values
  9886. * is determined by the order they occur in `collection`. The corresponding
  9887. * value of each key is an array of elements responsible for generating the
  9888. * key. The iteratee is invoked with one argument: (value).
  9889. *
  9890. * @static
  9891. * @memberOf _
  9892. * @since 0.1.0
  9893. * @category Collection
  9894. * @param {Array|Object} collection The collection to iterate over.
  9895. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9896. * @returns {Object} Returns the composed aggregate object.
  9897. * @example
  9898. *
  9899. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9900. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9901. *
  9902. * // The `_.property` iteratee shorthand.
  9903. * _.groupBy(['one', 'two', 'three'], 'length');
  9904. * // => { '3': ['one', 'two'], '5': ['three'] }
  9905. */
  9906. var groupBy = createAggregator(function(result, value, key) {
  9907. if (hasOwnProperty.call(result, key)) {
  9908. result[key].push(value);
  9909. } else {
  9910. baseAssignValue(result, key, [value]);
  9911. }
  9912. });
  9913. /**
  9914. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9915. * checked for a substring of `value`, otherwise
  9916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9917. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9918. * the offset from the end of `collection`.
  9919. *
  9920. * @static
  9921. * @memberOf _
  9922. * @since 0.1.0
  9923. * @category Collection
  9924. * @param {Array|Object|string} collection The collection to inspect.
  9925. * @param {*} value The value to search for.
  9926. * @param {number} [fromIndex=0] The index to search from.
  9927. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9928. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9929. * @example
  9930. *
  9931. * _.includes([1, 2, 3], 1);
  9932. * // => true
  9933. *
  9934. * _.includes([1, 2, 3], 1, 2);
  9935. * // => false
  9936. *
  9937. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9938. * // => true
  9939. *
  9940. * _.includes('abcd', 'bc');
  9941. * // => true
  9942. */
  9943. function includes(collection, value, fromIndex, guard) {
  9944. collection = isArrayLike(collection) ? collection : values(collection);
  9945. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9946. var length = collection.length;
  9947. if (fromIndex < 0) {
  9948. fromIndex = nativeMax(length + fromIndex, 0);
  9949. }
  9950. return isString(collection)
  9951. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9952. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9953. }
  9954. /**
  9955. * Invokes the method at `path` of each element in `collection`, returning
  9956. * an array of the results of each invoked method. Any additional arguments
  9957. * are provided to each invoked method. If `path` is a function, it's invoked
  9958. * for, and `this` bound to, each element in `collection`.
  9959. *
  9960. * @static
  9961. * @memberOf _
  9962. * @since 4.0.0
  9963. * @category Collection
  9964. * @param {Array|Object} collection The collection to iterate over.
  9965. * @param {Array|Function|string} path The path of the method to invoke or
  9966. * the function invoked per iteration.
  9967. * @param {...*} [args] The arguments to invoke each method with.
  9968. * @returns {Array} Returns the array of results.
  9969. * @example
  9970. *
  9971. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9972. * // => [[1, 5, 7], [1, 2, 3]]
  9973. *
  9974. * _.invokeMap([123, 456], String.prototype.split, '');
  9975. * // => [['1', '2', '3'], ['4', '5', '6']]
  9976. */
  9977. var invokeMap = baseRest(function(collection, path, args) {
  9978. var index = -1,
  9979. isFunc = typeof path == 'function',
  9980. result = isArrayLike(collection) ? Array(collection.length) : [];
  9981. baseEach(collection, function(value) {
  9982. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9983. });
  9984. return result;
  9985. });
  9986. /**
  9987. * Creates an object composed of keys generated from the results of running
  9988. * each element of `collection` thru `iteratee`. The corresponding value of
  9989. * each key is the last element responsible for generating the key. The
  9990. * iteratee is invoked with one argument: (value).
  9991. *
  9992. * @static
  9993. * @memberOf _
  9994. * @since 4.0.0
  9995. * @category Collection
  9996. * @param {Array|Object} collection The collection to iterate over.
  9997. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9998. * @returns {Object} Returns the composed aggregate object.
  9999. * @example
  10000. *
  10001. * var array = [
  10002. * { 'dir': 'left', 'code': 97 },
  10003. * { 'dir': 'right', 'code': 100 }
  10004. * ];
  10005. *
  10006. * _.keyBy(array, function(o) {
  10007. * return String.fromCharCode(o.code);
  10008. * });
  10009. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10010. *
  10011. * _.keyBy(array, 'dir');
  10012. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10013. */
  10014. var keyBy = createAggregator(function(result, value, key) {
  10015. baseAssignValue(result, key, value);
  10016. });
  10017. /**
  10018. * Creates an array of values by running each element in `collection` thru
  10019. * `iteratee`. The iteratee is invoked with three arguments:
  10020. * (value, index|key, collection).
  10021. *
  10022. * Many lodash methods are guarded to work as iteratees for methods like
  10023. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10024. *
  10025. * The guarded methods are:
  10026. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10027. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10028. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10029. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10030. *
  10031. * @static
  10032. * @memberOf _
  10033. * @since 0.1.0
  10034. * @category Collection
  10035. * @param {Array|Object} collection The collection to iterate over.
  10036. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10037. * @returns {Array} Returns the new mapped array.
  10038. * @example
  10039. *
  10040. * function square(n) {
  10041. * return n * n;
  10042. * }
  10043. *
  10044. * _.map([4, 8], square);
  10045. * // => [16, 64]
  10046. *
  10047. * _.map({ 'a': 4, 'b': 8 }, square);
  10048. * // => [16, 64] (iteration order is not guaranteed)
  10049. *
  10050. * var users = [
  10051. * { 'user': 'barney' },
  10052. * { 'user': 'fred' }
  10053. * ];
  10054. *
  10055. * // The `_.property` iteratee shorthand.
  10056. * _.map(users, 'user');
  10057. * // => ['barney', 'fred']
  10058. */
  10059. function map(collection, iteratee) {
  10060. var func = isArray(collection) ? arrayMap : baseMap;
  10061. return func(collection, getIteratee(iteratee, 3));
  10062. }
  10063. /**
  10064. * This method is like `_.sortBy` except that it allows specifying the sort
  10065. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10066. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10067. * descending or "asc" for ascending sort order of corresponding values.
  10068. *
  10069. * @static
  10070. * @memberOf _
  10071. * @since 4.0.0
  10072. * @category Collection
  10073. * @param {Array|Object} collection The collection to iterate over.
  10074. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10075. * The iteratees to sort by.
  10076. * @param {string[]} [orders] The sort orders of `iteratees`.
  10077. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10078. * @returns {Array} Returns the new sorted array.
  10079. * @example
  10080. *
  10081. * var users = [
  10082. * { 'user': 'fred', 'age': 48 },
  10083. * { 'user': 'barney', 'age': 34 },
  10084. * { 'user': 'fred', 'age': 40 },
  10085. * { 'user': 'barney', 'age': 36 }
  10086. * ];
  10087. *
  10088. * // Sort by `user` in ascending order and by `age` in descending order.
  10089. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10090. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10091. */
  10092. function orderBy(collection, iteratees, orders, guard) {
  10093. if (collection == null) {
  10094. return [];
  10095. }
  10096. if (!isArray(iteratees)) {
  10097. iteratees = iteratees == null ? [] : [iteratees];
  10098. }
  10099. orders = guard ? undefined : orders;
  10100. if (!isArray(orders)) {
  10101. orders = orders == null ? [] : [orders];
  10102. }
  10103. return baseOrderBy(collection, iteratees, orders);
  10104. }
  10105. /**
  10106. * Creates an array of elements split into two groups, the first of which
  10107. * contains elements `predicate` returns truthy for, the second of which
  10108. * contains elements `predicate` returns falsey for. The predicate is
  10109. * invoked with one argument: (value).
  10110. *
  10111. * @static
  10112. * @memberOf _
  10113. * @since 3.0.0
  10114. * @category Collection
  10115. * @param {Array|Object} collection The collection to iterate over.
  10116. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10117. * @returns {Array} Returns the array of grouped elements.
  10118. * @example
  10119. *
  10120. * var users = [
  10121. * { 'user': 'barney', 'age': 36, 'active': false },
  10122. * { 'user': 'fred', 'age': 40, 'active': true },
  10123. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10124. * ];
  10125. *
  10126. * _.partition(users, function(o) { return o.active; });
  10127. * // => objects for [['fred'], ['barney', 'pebbles']]
  10128. *
  10129. * // The `_.matches` iteratee shorthand.
  10130. * _.partition(users, { 'age': 1, 'active': false });
  10131. * // => objects for [['pebbles'], ['barney', 'fred']]
  10132. *
  10133. * // The `_.matchesProperty` iteratee shorthand.
  10134. * _.partition(users, ['active', false]);
  10135. * // => objects for [['barney', 'pebbles'], ['fred']]
  10136. *
  10137. * // The `_.property` iteratee shorthand.
  10138. * _.partition(users, 'active');
  10139. * // => objects for [['fred'], ['barney', 'pebbles']]
  10140. */
  10141. var partition = createAggregator(function(result, value, key) {
  10142. result[key ? 0 : 1].push(value);
  10143. }, function() { return [[], []]; });
  10144. /**
  10145. * Reduces `collection` to a value which is the accumulated result of running
  10146. * each element in `collection` thru `iteratee`, where each successive
  10147. * invocation is supplied the return value of the previous. If `accumulator`
  10148. * is not given, the first element of `collection` is used as the initial
  10149. * value. The iteratee is invoked with four arguments:
  10150. * (accumulator, value, index|key, collection).
  10151. *
  10152. * Many lodash methods are guarded to work as iteratees for methods like
  10153. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10154. *
  10155. * The guarded methods are:
  10156. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10157. * and `sortBy`
  10158. *
  10159. * @static
  10160. * @memberOf _
  10161. * @since 0.1.0
  10162. * @category Collection
  10163. * @param {Array|Object} collection The collection to iterate over.
  10164. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10165. * @param {*} [accumulator] The initial value.
  10166. * @returns {*} Returns the accumulated value.
  10167. * @see _.reduceRight
  10168. * @example
  10169. *
  10170. * _.reduce([1, 2], function(sum, n) {
  10171. * return sum + n;
  10172. * }, 0);
  10173. * // => 3
  10174. *
  10175. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10176. * (result[value] || (result[value] = [])).push(key);
  10177. * return result;
  10178. * }, {});
  10179. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10180. */
  10181. function reduce(collection, iteratee, accumulator) {
  10182. var func = isArray(collection) ? arrayReduce : baseReduce,
  10183. initAccum = arguments.length < 3;
  10184. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10185. }
  10186. /**
  10187. * This method is like `_.reduce` except that it iterates over elements of
  10188. * `collection` from right to left.
  10189. *
  10190. * @static
  10191. * @memberOf _
  10192. * @since 0.1.0
  10193. * @category Collection
  10194. * @param {Array|Object} collection The collection to iterate over.
  10195. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10196. * @param {*} [accumulator] The initial value.
  10197. * @returns {*} Returns the accumulated value.
  10198. * @see _.reduce
  10199. * @example
  10200. *
  10201. * var array = [[0, 1], [2, 3], [4, 5]];
  10202. *
  10203. * _.reduceRight(array, function(flattened, other) {
  10204. * return flattened.concat(other);
  10205. * }, []);
  10206. * // => [4, 5, 2, 3, 0, 1]
  10207. */
  10208. function reduceRight(collection, iteratee, accumulator) {
  10209. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10210. initAccum = arguments.length < 3;
  10211. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10212. }
  10213. /**
  10214. * The opposite of `_.filter`; this method returns the elements of `collection`
  10215. * that `predicate` does **not** return truthy for.
  10216. *
  10217. * @static
  10218. * @memberOf _
  10219. * @since 0.1.0
  10220. * @category Collection
  10221. * @param {Array|Object} collection The collection to iterate over.
  10222. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10223. * @returns {Array} Returns the new filtered array.
  10224. * @see _.filter
  10225. * @example
  10226. *
  10227. * var users = [
  10228. * { 'user': 'barney', 'age': 36, 'active': false },
  10229. * { 'user': 'fred', 'age': 40, 'active': true }
  10230. * ];
  10231. *
  10232. * _.reject(users, function(o) { return !o.active; });
  10233. * // => objects for ['fred']
  10234. *
  10235. * // The `_.matches` iteratee shorthand.
  10236. * _.reject(users, { 'age': 40, 'active': true });
  10237. * // => objects for ['barney']
  10238. *
  10239. * // The `_.matchesProperty` iteratee shorthand.
  10240. * _.reject(users, ['active', false]);
  10241. * // => objects for ['fred']
  10242. *
  10243. * // The `_.property` iteratee shorthand.
  10244. * _.reject(users, 'active');
  10245. * // => objects for ['barney']
  10246. */
  10247. function reject(collection, predicate) {
  10248. var func = isArray(collection) ? arrayFilter : baseFilter;
  10249. return func(collection, negate(getIteratee(predicate, 3)));
  10250. }
  10251. /**
  10252. * Gets a random element from `collection`.
  10253. *
  10254. * @static
  10255. * @memberOf _
  10256. * @since 2.0.0
  10257. * @category Collection
  10258. * @param {Array|Object} collection The collection to sample.
  10259. * @returns {*} Returns the random element.
  10260. * @example
  10261. *
  10262. * _.sample([1, 2, 3, 4]);
  10263. * // => 2
  10264. */
  10265. function sample(collection) {
  10266. var func = isArray(collection) ? arraySample : baseSample;
  10267. return func(collection);
  10268. }
  10269. /**
  10270. * Gets `n` random elements at unique keys from `collection` up to the
  10271. * size of `collection`.
  10272. *
  10273. * @static
  10274. * @memberOf _
  10275. * @since 4.0.0
  10276. * @category Collection
  10277. * @param {Array|Object} collection The collection to sample.
  10278. * @param {number} [n=1] The number of elements to sample.
  10279. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10280. * @returns {Array} Returns the random elements.
  10281. * @example
  10282. *
  10283. * _.sampleSize([1, 2, 3], 2);
  10284. * // => [3, 1]
  10285. *
  10286. * _.sampleSize([1, 2, 3], 4);
  10287. * // => [2, 3, 1]
  10288. */
  10289. function sampleSize(collection, n, guard) {
  10290. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10291. n = 1;
  10292. } else {
  10293. n = toInteger(n);
  10294. }
  10295. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10296. return func(collection, n);
  10297. }
  10298. /**
  10299. * Creates an array of shuffled values, using a version of the
  10300. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10301. *
  10302. * @static
  10303. * @memberOf _
  10304. * @since 0.1.0
  10305. * @category Collection
  10306. * @param {Array|Object} collection The collection to shuffle.
  10307. * @returns {Array} Returns the new shuffled array.
  10308. * @example
  10309. *
  10310. * _.shuffle([1, 2, 3, 4]);
  10311. * // => [4, 1, 3, 2]
  10312. */
  10313. function shuffle(collection) {
  10314. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10315. return func(collection);
  10316. }
  10317. /**
  10318. * Gets the size of `collection` by returning its length for array-like
  10319. * values or the number of own enumerable string keyed properties for objects.
  10320. *
  10321. * @static
  10322. * @memberOf _
  10323. * @since 0.1.0
  10324. * @category Collection
  10325. * @param {Array|Object|string} collection The collection to inspect.
  10326. * @returns {number} Returns the collection size.
  10327. * @example
  10328. *
  10329. * _.size([1, 2, 3]);
  10330. * // => 3
  10331. *
  10332. * _.size({ 'a': 1, 'b': 2 });
  10333. * // => 2
  10334. *
  10335. * _.size('pebbles');
  10336. * // => 7
  10337. */
  10338. function size(collection) {
  10339. if (collection == null) {
  10340. return 0;
  10341. }
  10342. if (isArrayLike(collection)) {
  10343. return isString(collection) ? stringSize(collection) : collection.length;
  10344. }
  10345. var tag = getTag(collection);
  10346. if (tag == mapTag || tag == setTag) {
  10347. return collection.size;
  10348. }
  10349. return baseKeys(collection).length;
  10350. }
  10351. /**
  10352. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10353. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10354. * invoked with three arguments: (value, index|key, collection).
  10355. *
  10356. * @static
  10357. * @memberOf _
  10358. * @since 0.1.0
  10359. * @category Collection
  10360. * @param {Array|Object} collection The collection to iterate over.
  10361. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10362. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10363. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10364. * else `false`.
  10365. * @example
  10366. *
  10367. * _.some([null, 0, 'yes', false], Boolean);
  10368. * // => true
  10369. *
  10370. * var users = [
  10371. * { 'user': 'barney', 'active': true },
  10372. * { 'user': 'fred', 'active': false }
  10373. * ];
  10374. *
  10375. * // The `_.matches` iteratee shorthand.
  10376. * _.some(users, { 'user': 'barney', 'active': false });
  10377. * // => false
  10378. *
  10379. * // The `_.matchesProperty` iteratee shorthand.
  10380. * _.some(users, ['active', false]);
  10381. * // => true
  10382. *
  10383. * // The `_.property` iteratee shorthand.
  10384. * _.some(users, 'active');
  10385. * // => true
  10386. */
  10387. function some(collection, predicate, guard) {
  10388. var func = isArray(collection) ? arraySome : baseSome;
  10389. if (guard && isIterateeCall(collection, predicate, guard)) {
  10390. predicate = undefined;
  10391. }
  10392. return func(collection, getIteratee(predicate, 3));
  10393. }
  10394. /**
  10395. * Creates an array of elements, sorted in ascending order by the results of
  10396. * running each element in a collection thru each iteratee. This method
  10397. * performs a stable sort, that is, it preserves the original sort order of
  10398. * equal elements. The iteratees are invoked with one argument: (value).
  10399. *
  10400. * @static
  10401. * @memberOf _
  10402. * @since 0.1.0
  10403. * @category Collection
  10404. * @param {Array|Object} collection The collection to iterate over.
  10405. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10406. * The iteratees to sort by.
  10407. * @returns {Array} Returns the new sorted array.
  10408. * @example
  10409. *
  10410. * var users = [
  10411. * { 'user': 'fred', 'age': 48 },
  10412. * { 'user': 'barney', 'age': 36 },
  10413. * { 'user': 'fred', 'age': 40 },
  10414. * { 'user': 'barney', 'age': 34 }
  10415. * ];
  10416. *
  10417. * _.sortBy(users, [function(o) { return o.user; }]);
  10418. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10419. *
  10420. * _.sortBy(users, ['user', 'age']);
  10421. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  10422. */
  10423. var sortBy = baseRest(function(collection, iteratees) {
  10424. if (collection == null) {
  10425. return [];
  10426. }
  10427. var length = iteratees.length;
  10428. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10429. iteratees = [];
  10430. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10431. iteratees = [iteratees[0]];
  10432. }
  10433. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10434. });
  10435. /*------------------------------------------------------------------------*/
  10436. /**
  10437. * Gets the timestamp of the number of milliseconds that have elapsed since
  10438. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10439. *
  10440. * @static
  10441. * @memberOf _
  10442. * @since 2.4.0
  10443. * @category Date
  10444. * @returns {number} Returns the timestamp.
  10445. * @example
  10446. *
  10447. * _.defer(function(stamp) {
  10448. * console.log(_.now() - stamp);
  10449. * }, _.now());
  10450. * // => Logs the number of milliseconds it took for the deferred invocation.
  10451. */
  10452. var now = ctxNow || function() {
  10453. return root.Date.now();
  10454. };
  10455. /*------------------------------------------------------------------------*/
  10456. /**
  10457. * The opposite of `_.before`; this method creates a function that invokes
  10458. * `func` once it's called `n` or more times.
  10459. *
  10460. * @static
  10461. * @memberOf _
  10462. * @since 0.1.0
  10463. * @category Function
  10464. * @param {number} n The number of calls before `func` is invoked.
  10465. * @param {Function} func The function to restrict.
  10466. * @returns {Function} Returns the new restricted function.
  10467. * @example
  10468. *
  10469. * var saves = ['profile', 'settings'];
  10470. *
  10471. * var done = _.after(saves.length, function() {
  10472. * console.log('done saving!');
  10473. * });
  10474. *
  10475. * _.forEach(saves, function(type) {
  10476. * asyncSave({ 'type': type, 'complete': done });
  10477. * });
  10478. * // => Logs 'done saving!' after the two async saves have completed.
  10479. */
  10480. function after(n, func) {
  10481. if (typeof func != 'function') {
  10482. throw new TypeError(FUNC_ERROR_TEXT);
  10483. }
  10484. n = toInteger(n);
  10485. return function() {
  10486. if (--n < 1) {
  10487. return func.apply(this, arguments);
  10488. }
  10489. };
  10490. }
  10491. /**
  10492. * Creates a function that invokes `func`, with up to `n` arguments,
  10493. * ignoring any additional arguments.
  10494. *
  10495. * @static
  10496. * @memberOf _
  10497. * @since 3.0.0
  10498. * @category Function
  10499. * @param {Function} func The function to cap arguments for.
  10500. * @param {number} [n=func.length] The arity cap.
  10501. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10502. * @returns {Function} Returns the new capped function.
  10503. * @example
  10504. *
  10505. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10506. * // => [6, 8, 10]
  10507. */
  10508. function ary(func, n, guard) {
  10509. n = guard ? undefined : n;
  10510. n = (func && n == null) ? func.length : n;
  10511. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10512. }
  10513. /**
  10514. * Creates a function that invokes `func`, with the `this` binding and arguments
  10515. * of the created function, while it's called less than `n` times. Subsequent
  10516. * calls to the created function return the result of the last `func` invocation.
  10517. *
  10518. * @static
  10519. * @memberOf _
  10520. * @since 3.0.0
  10521. * @category Function
  10522. * @param {number} n The number of calls at which `func` is no longer invoked.
  10523. * @param {Function} func The function to restrict.
  10524. * @returns {Function} Returns the new restricted function.
  10525. * @example
  10526. *
  10527. * jQuery(element).on('click', _.before(5, addContactToList));
  10528. * // => Allows adding up to 4 contacts to the list.
  10529. */
  10530. function before(n, func) {
  10531. var result;
  10532. if (typeof func != 'function') {
  10533. throw new TypeError(FUNC_ERROR_TEXT);
  10534. }
  10535. n = toInteger(n);
  10536. return function() {
  10537. if (--n > 0) {
  10538. result = func.apply(this, arguments);
  10539. }
  10540. if (n <= 1) {
  10541. func = undefined;
  10542. }
  10543. return result;
  10544. };
  10545. }
  10546. /**
  10547. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10548. * and `partials` prepended to the arguments it receives.
  10549. *
  10550. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10551. * may be used as a placeholder for partially applied arguments.
  10552. *
  10553. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10554. * property of bound functions.
  10555. *
  10556. * @static
  10557. * @memberOf _
  10558. * @since 0.1.0
  10559. * @category Function
  10560. * @param {Function} func The function to bind.
  10561. * @param {*} thisArg The `this` binding of `func`.
  10562. * @param {...*} [partials] The arguments to be partially applied.
  10563. * @returns {Function} Returns the new bound function.
  10564. * @example
  10565. *
  10566. * function greet(greeting, punctuation) {
  10567. * return greeting + ' ' + this.user + punctuation;
  10568. * }
  10569. *
  10570. * var object = { 'user': 'fred' };
  10571. *
  10572. * var bound = _.bind(greet, object, 'hi');
  10573. * bound('!');
  10574. * // => 'hi fred!'
  10575. *
  10576. * // Bound with placeholders.
  10577. * var bound = _.bind(greet, object, _, '!');
  10578. * bound('hi');
  10579. * // => 'hi fred!'
  10580. */
  10581. var bind = baseRest(function(func, thisArg, partials) {
  10582. var bitmask = WRAP_BIND_FLAG;
  10583. if (partials.length) {
  10584. var holders = replaceHolders(partials, getHolder(bind));
  10585. bitmask |= WRAP_PARTIAL_FLAG;
  10586. }
  10587. return createWrap(func, bitmask, thisArg, partials, holders);
  10588. });
  10589. /**
  10590. * Creates a function that invokes the method at `object[key]` with `partials`
  10591. * prepended to the arguments it receives.
  10592. *
  10593. * This method differs from `_.bind` by allowing bound functions to reference
  10594. * methods that may be redefined or don't yet exist. See
  10595. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10596. * for more details.
  10597. *
  10598. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10599. * builds, may be used as a placeholder for partially applied arguments.
  10600. *
  10601. * @static
  10602. * @memberOf _
  10603. * @since 0.10.0
  10604. * @category Function
  10605. * @param {Object} object The object to invoke the method on.
  10606. * @param {string} key The key of the method.
  10607. * @param {...*} [partials] The arguments to be partially applied.
  10608. * @returns {Function} Returns the new bound function.
  10609. * @example
  10610. *
  10611. * var object = {
  10612. * 'user': 'fred',
  10613. * 'greet': function(greeting, punctuation) {
  10614. * return greeting + ' ' + this.user + punctuation;
  10615. * }
  10616. * };
  10617. *
  10618. * var bound = _.bindKey(object, 'greet', 'hi');
  10619. * bound('!');
  10620. * // => 'hi fred!'
  10621. *
  10622. * object.greet = function(greeting, punctuation) {
  10623. * return greeting + 'ya ' + this.user + punctuation;
  10624. * };
  10625. *
  10626. * bound('!');
  10627. * // => 'hiya fred!'
  10628. *
  10629. * // Bound with placeholders.
  10630. * var bound = _.bindKey(object, 'greet', _, '!');
  10631. * bound('hi');
  10632. * // => 'hiya fred!'
  10633. */
  10634. var bindKey = baseRest(function(object, key, partials) {
  10635. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10636. if (partials.length) {
  10637. var holders = replaceHolders(partials, getHolder(bindKey));
  10638. bitmask |= WRAP_PARTIAL_FLAG;
  10639. }
  10640. return createWrap(key, bitmask, object, partials, holders);
  10641. });
  10642. /**
  10643. * Creates a function that accepts arguments of `func` and either invokes
  10644. * `func` returning its result, if at least `arity` number of arguments have
  10645. * been provided, or returns a function that accepts the remaining `func`
  10646. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10647. * is not sufficient.
  10648. *
  10649. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10650. * may be used as a placeholder for provided arguments.
  10651. *
  10652. * **Note:** This method doesn't set the "length" property of curried functions.
  10653. *
  10654. * @static
  10655. * @memberOf _
  10656. * @since 2.0.0
  10657. * @category Function
  10658. * @param {Function} func The function to curry.
  10659. * @param {number} [arity=func.length] The arity of `func`.
  10660. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10661. * @returns {Function} Returns the new curried function.
  10662. * @example
  10663. *
  10664. * var abc = function(a, b, c) {
  10665. * return [a, b, c];
  10666. * };
  10667. *
  10668. * var curried = _.curry(abc);
  10669. *
  10670. * curried(1)(2)(3);
  10671. * // => [1, 2, 3]
  10672. *
  10673. * curried(1, 2)(3);
  10674. * // => [1, 2, 3]
  10675. *
  10676. * curried(1, 2, 3);
  10677. * // => [1, 2, 3]
  10678. *
  10679. * // Curried with placeholders.
  10680. * curried(1)(_, 3)(2);
  10681. * // => [1, 2, 3]
  10682. */
  10683. function curry(func, arity, guard) {
  10684. arity = guard ? undefined : arity;
  10685. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10686. result.placeholder = curry.placeholder;
  10687. return result;
  10688. }
  10689. /**
  10690. * This method is like `_.curry` except that arguments are applied to `func`
  10691. * in the manner of `_.partialRight` instead of `_.partial`.
  10692. *
  10693. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10694. * builds, may be used as a placeholder for provided arguments.
  10695. *
  10696. * **Note:** This method doesn't set the "length" property of curried functions.
  10697. *
  10698. * @static
  10699. * @memberOf _
  10700. * @since 3.0.0
  10701. * @category Function
  10702. * @param {Function} func The function to curry.
  10703. * @param {number} [arity=func.length] The arity of `func`.
  10704. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10705. * @returns {Function} Returns the new curried function.
  10706. * @example
  10707. *
  10708. * var abc = function(a, b, c) {
  10709. * return [a, b, c];
  10710. * };
  10711. *
  10712. * var curried = _.curryRight(abc);
  10713. *
  10714. * curried(3)(2)(1);
  10715. * // => [1, 2, 3]
  10716. *
  10717. * curried(2, 3)(1);
  10718. * // => [1, 2, 3]
  10719. *
  10720. * curried(1, 2, 3);
  10721. * // => [1, 2, 3]
  10722. *
  10723. * // Curried with placeholders.
  10724. * curried(3)(1, _)(2);
  10725. * // => [1, 2, 3]
  10726. */
  10727. function curryRight(func, arity, guard) {
  10728. arity = guard ? undefined : arity;
  10729. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10730. result.placeholder = curryRight.placeholder;
  10731. return result;
  10732. }
  10733. /**
  10734. * Creates a debounced function that delays invoking `func` until after `wait`
  10735. * milliseconds have elapsed since the last time the debounced function was
  10736. * invoked. The debounced function comes with a `cancel` method to cancel
  10737. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10738. * Provide `options` to indicate whether `func` should be invoked on the
  10739. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10740. * with the last arguments provided to the debounced function. Subsequent
  10741. * calls to the debounced function return the result of the last `func`
  10742. * invocation.
  10743. *
  10744. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10745. * invoked on the trailing edge of the timeout only if the debounced function
  10746. * is invoked more than once during the `wait` timeout.
  10747. *
  10748. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10749. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10750. *
  10751. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10752. * for details over the differences between `_.debounce` and `_.throttle`.
  10753. *
  10754. * @static
  10755. * @memberOf _
  10756. * @since 0.1.0
  10757. * @category Function
  10758. * @param {Function} func The function to debounce.
  10759. * @param {number} [wait=0] The number of milliseconds to delay.
  10760. * @param {Object} [options={}] The options object.
  10761. * @param {boolean} [options.leading=false]
  10762. * Specify invoking on the leading edge of the timeout.
  10763. * @param {number} [options.maxWait]
  10764. * The maximum time `func` is allowed to be delayed before it's invoked.
  10765. * @param {boolean} [options.trailing=true]
  10766. * Specify invoking on the trailing edge of the timeout.
  10767. * @returns {Function} Returns the new debounced function.
  10768. * @example
  10769. *
  10770. * // Avoid costly calculations while the window size is in flux.
  10771. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10772. *
  10773. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10774. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10775. * 'leading': true,
  10776. * 'trailing': false
  10777. * }));
  10778. *
  10779. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10780. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10781. * var source = new EventSource('/stream');
  10782. * jQuery(source).on('message', debounced);
  10783. *
  10784. * // Cancel the trailing debounced invocation.
  10785. * jQuery(window).on('popstate', debounced.cancel);
  10786. */
  10787. function debounce(func, wait, options) {
  10788. var lastArgs,
  10789. lastThis,
  10790. maxWait,
  10791. result,
  10792. timerId,
  10793. lastCallTime,
  10794. lastInvokeTime = 0,
  10795. leading = false,
  10796. maxing = false,
  10797. trailing = true;
  10798. if (typeof func != 'function') {
  10799. throw new TypeError(FUNC_ERROR_TEXT);
  10800. }
  10801. wait = toNumber(wait) || 0;
  10802. if (isObject(options)) {
  10803. leading = !!options.leading;
  10804. maxing = 'maxWait' in options;
  10805. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10806. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10807. }
  10808. function invokeFunc(time) {
  10809. var args = lastArgs,
  10810. thisArg = lastThis;
  10811. lastArgs = lastThis = undefined;
  10812. lastInvokeTime = time;
  10813. result = func.apply(thisArg, args);
  10814. return result;
  10815. }
  10816. function leadingEdge(time) {
  10817. // Reset any `maxWait` timer.
  10818. lastInvokeTime = time;
  10819. // Start the timer for the trailing edge.
  10820. timerId = setTimeout(timerExpired, wait);
  10821. // Invoke the leading edge.
  10822. return leading ? invokeFunc(time) : result;
  10823. }
  10824. function remainingWait(time) {
  10825. var timeSinceLastCall = time - lastCallTime,
  10826. timeSinceLastInvoke = time - lastInvokeTime,
  10827. timeWaiting = wait - timeSinceLastCall;
  10828. return maxing
  10829. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10830. : timeWaiting;
  10831. }
  10832. function shouldInvoke(time) {
  10833. var timeSinceLastCall = time - lastCallTime,
  10834. timeSinceLastInvoke = time - lastInvokeTime;
  10835. // Either this is the first call, activity has stopped and we're at the
  10836. // trailing edge, the system time has gone backwards and we're treating
  10837. // it as the trailing edge, or we've hit the `maxWait` limit.
  10838. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10839. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10840. }
  10841. function timerExpired() {
  10842. var time = now();
  10843. if (shouldInvoke(time)) {
  10844. return trailingEdge(time);
  10845. }
  10846. // Restart the timer.
  10847. timerId = setTimeout(timerExpired, remainingWait(time));
  10848. }
  10849. function trailingEdge(time) {
  10850. timerId = undefined;
  10851. // Only invoke if we have `lastArgs` which means `func` has been
  10852. // debounced at least once.
  10853. if (trailing && lastArgs) {
  10854. return invokeFunc(time);
  10855. }
  10856. lastArgs = lastThis = undefined;
  10857. return result;
  10858. }
  10859. function cancel() {
  10860. if (timerId !== undefined) {
  10861. clearTimeout(timerId);
  10862. }
  10863. lastInvokeTime = 0;
  10864. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10865. }
  10866. function flush() {
  10867. return timerId === undefined ? result : trailingEdge(now());
  10868. }
  10869. function debounced() {
  10870. var time = now(),
  10871. isInvoking = shouldInvoke(time);
  10872. lastArgs = arguments;
  10873. lastThis = this;
  10874. lastCallTime = time;
  10875. if (isInvoking) {
  10876. if (timerId === undefined) {
  10877. return leadingEdge(lastCallTime);
  10878. }
  10879. if (maxing) {
  10880. // Handle invocations in a tight loop.
  10881. timerId = setTimeout(timerExpired, wait);
  10882. return invokeFunc(lastCallTime);
  10883. }
  10884. }
  10885. if (timerId === undefined) {
  10886. timerId = setTimeout(timerExpired, wait);
  10887. }
  10888. return result;
  10889. }
  10890. debounced.cancel = cancel;
  10891. debounced.flush = flush;
  10892. return debounced;
  10893. }
  10894. /**
  10895. * Defers invoking the `func` until the current call stack has cleared. Any
  10896. * additional arguments are provided to `func` when it's invoked.
  10897. *
  10898. * @static
  10899. * @memberOf _
  10900. * @since 0.1.0
  10901. * @category Function
  10902. * @param {Function} func The function to defer.
  10903. * @param {...*} [args] The arguments to invoke `func` with.
  10904. * @returns {number} Returns the timer id.
  10905. * @example
  10906. *
  10907. * _.defer(function(text) {
  10908. * console.log(text);
  10909. * }, 'deferred');
  10910. * // => Logs 'deferred' after one millisecond.
  10911. */
  10912. var defer = baseRest(function(func, args) {
  10913. return baseDelay(func, 1, args);
  10914. });
  10915. /**
  10916. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10917. * provided to `func` when it's invoked.
  10918. *
  10919. * @static
  10920. * @memberOf _
  10921. * @since 0.1.0
  10922. * @category Function
  10923. * @param {Function} func The function to delay.
  10924. * @param {number} wait The number of milliseconds to delay invocation.
  10925. * @param {...*} [args] The arguments to invoke `func` with.
  10926. * @returns {number} Returns the timer id.
  10927. * @example
  10928. *
  10929. * _.delay(function(text) {
  10930. * console.log(text);
  10931. * }, 1000, 'later');
  10932. * // => Logs 'later' after one second.
  10933. */
  10934. var delay = baseRest(function(func, wait, args) {
  10935. return baseDelay(func, toNumber(wait) || 0, args);
  10936. });
  10937. /**
  10938. * Creates a function that invokes `func` with arguments reversed.
  10939. *
  10940. * @static
  10941. * @memberOf _
  10942. * @since 4.0.0
  10943. * @category Function
  10944. * @param {Function} func The function to flip arguments for.
  10945. * @returns {Function} Returns the new flipped function.
  10946. * @example
  10947. *
  10948. * var flipped = _.flip(function() {
  10949. * return _.toArray(arguments);
  10950. * });
  10951. *
  10952. * flipped('a', 'b', 'c', 'd');
  10953. * // => ['d', 'c', 'b', 'a']
  10954. */
  10955. function flip(func) {
  10956. return createWrap(func, WRAP_FLIP_FLAG);
  10957. }
  10958. /**
  10959. * Creates a function that memoizes the result of `func`. If `resolver` is
  10960. * provided, it determines the cache key for storing the result based on the
  10961. * arguments provided to the memoized function. By default, the first argument
  10962. * provided to the memoized function is used as the map cache key. The `func`
  10963. * is invoked with the `this` binding of the memoized function.
  10964. *
  10965. * **Note:** The cache is exposed as the `cache` property on the memoized
  10966. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10967. * constructor with one whose instances implement the
  10968. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10969. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10970. *
  10971. * @static
  10972. * @memberOf _
  10973. * @since 0.1.0
  10974. * @category Function
  10975. * @param {Function} func The function to have its output memoized.
  10976. * @param {Function} [resolver] The function to resolve the cache key.
  10977. * @returns {Function} Returns the new memoized function.
  10978. * @example
  10979. *
  10980. * var object = { 'a': 1, 'b': 2 };
  10981. * var other = { 'c': 3, 'd': 4 };
  10982. *
  10983. * var values = _.memoize(_.values);
  10984. * values(object);
  10985. * // => [1, 2]
  10986. *
  10987. * values(other);
  10988. * // => [3, 4]
  10989. *
  10990. * object.a = 2;
  10991. * values(object);
  10992. * // => [1, 2]
  10993. *
  10994. * // Modify the result cache.
  10995. * values.cache.set(object, ['a', 'b']);
  10996. * values(object);
  10997. * // => ['a', 'b']
  10998. *
  10999. * // Replace `_.memoize.Cache`.
  11000. * _.memoize.Cache = WeakMap;
  11001. */
  11002. function memoize(func, resolver) {
  11003. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11004. throw new TypeError(FUNC_ERROR_TEXT);
  11005. }
  11006. var memoized = function() {
  11007. var args = arguments,
  11008. key = resolver ? resolver.apply(this, args) : args[0],
  11009. cache = memoized.cache;
  11010. if (cache.has(key)) {
  11011. return cache.get(key);
  11012. }
  11013. var result = func.apply(this, args);
  11014. memoized.cache = cache.set(key, result) || cache;
  11015. return result;
  11016. };
  11017. memoized.cache = new (memoize.Cache || MapCache);
  11018. return memoized;
  11019. }
  11020. // Expose `MapCache`.
  11021. memoize.Cache = MapCache;
  11022. /**
  11023. * Creates a function that negates the result of the predicate `func`. The
  11024. * `func` predicate is invoked with the `this` binding and arguments of the
  11025. * created function.
  11026. *
  11027. * @static
  11028. * @memberOf _
  11029. * @since 3.0.0
  11030. * @category Function
  11031. * @param {Function} predicate The predicate to negate.
  11032. * @returns {Function} Returns the new negated function.
  11033. * @example
  11034. *
  11035. * function isEven(n) {
  11036. * return n % 2 == 0;
  11037. * }
  11038. *
  11039. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11040. * // => [1, 3, 5]
  11041. */
  11042. function negate(predicate) {
  11043. if (typeof predicate != 'function') {
  11044. throw new TypeError(FUNC_ERROR_TEXT);
  11045. }
  11046. return function() {
  11047. var args = arguments;
  11048. switch (args.length) {
  11049. case 0: return !predicate.call(this);
  11050. case 1: return !predicate.call(this, args[0]);
  11051. case 2: return !predicate.call(this, args[0], args[1]);
  11052. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11053. }
  11054. return !predicate.apply(this, args);
  11055. };
  11056. }
  11057. /**
  11058. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11059. * to the function return the value of the first invocation. The `func` is
  11060. * invoked with the `this` binding and arguments of the created function.
  11061. *
  11062. * @static
  11063. * @memberOf _
  11064. * @since 0.1.0
  11065. * @category Function
  11066. * @param {Function} func The function to restrict.
  11067. * @returns {Function} Returns the new restricted function.
  11068. * @example
  11069. *
  11070. * var initialize = _.once(createApplication);
  11071. * initialize();
  11072. * initialize();
  11073. * // => `createApplication` is invoked once
  11074. */
  11075. function once(func) {
  11076. return before(2, func);
  11077. }
  11078. /**
  11079. * Creates a function that invokes `func` with its arguments transformed.
  11080. *
  11081. * @static
  11082. * @since 4.0.0
  11083. * @memberOf _
  11084. * @category Function
  11085. * @param {Function} func The function to wrap.
  11086. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11087. * The argument transforms.
  11088. * @returns {Function} Returns the new function.
  11089. * @example
  11090. *
  11091. * function doubled(n) {
  11092. * return n * 2;
  11093. * }
  11094. *
  11095. * function square(n) {
  11096. * return n * n;
  11097. * }
  11098. *
  11099. * var func = _.overArgs(function(x, y) {
  11100. * return [x, y];
  11101. * }, [square, doubled]);
  11102. *
  11103. * func(9, 3);
  11104. * // => [81, 6]
  11105. *
  11106. * func(10, 5);
  11107. * // => [100, 10]
  11108. */
  11109. var overArgs = castRest(function(func, transforms) {
  11110. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11111. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11112. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11113. var funcsLength = transforms.length;
  11114. return baseRest(function(args) {
  11115. var index = -1,
  11116. length = nativeMin(args.length, funcsLength);
  11117. while (++index < length) {
  11118. args[index] = transforms[index].call(this, args[index]);
  11119. }
  11120. return apply(func, this, args);
  11121. });
  11122. });
  11123. /**
  11124. * Creates a function that invokes `func` with `partials` prepended to the
  11125. * arguments it receives. This method is like `_.bind` except it does **not**
  11126. * alter the `this` binding.
  11127. *
  11128. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11129. * builds, may be used as a placeholder for partially applied arguments.
  11130. *
  11131. * **Note:** This method doesn't set the "length" property of partially
  11132. * applied functions.
  11133. *
  11134. * @static
  11135. * @memberOf _
  11136. * @since 0.2.0
  11137. * @category Function
  11138. * @param {Function} func The function to partially apply arguments to.
  11139. * @param {...*} [partials] The arguments to be partially applied.
  11140. * @returns {Function} Returns the new partially applied function.
  11141. * @example
  11142. *
  11143. * function greet(greeting, name) {
  11144. * return greeting + ' ' + name;
  11145. * }
  11146. *
  11147. * var sayHelloTo = _.partial(greet, 'hello');
  11148. * sayHelloTo('fred');
  11149. * // => 'hello fred'
  11150. *
  11151. * // Partially applied with placeholders.
  11152. * var greetFred = _.partial(greet, _, 'fred');
  11153. * greetFred('hi');
  11154. * // => 'hi fred'
  11155. */
  11156. var partial = baseRest(function(func, partials) {
  11157. var holders = replaceHolders(partials, getHolder(partial));
  11158. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11159. });
  11160. /**
  11161. * This method is like `_.partial` except that partially applied arguments
  11162. * are appended to the arguments it receives.
  11163. *
  11164. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11165. * builds, may be used as a placeholder for partially applied arguments.
  11166. *
  11167. * **Note:** This method doesn't set the "length" property of partially
  11168. * applied functions.
  11169. *
  11170. * @static
  11171. * @memberOf _
  11172. * @since 1.0.0
  11173. * @category Function
  11174. * @param {Function} func The function to partially apply arguments to.
  11175. * @param {...*} [partials] The arguments to be partially applied.
  11176. * @returns {Function} Returns the new partially applied function.
  11177. * @example
  11178. *
  11179. * function greet(greeting, name) {
  11180. * return greeting + ' ' + name;
  11181. * }
  11182. *
  11183. * var greetFred = _.partialRight(greet, 'fred');
  11184. * greetFred('hi');
  11185. * // => 'hi fred'
  11186. *
  11187. * // Partially applied with placeholders.
  11188. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11189. * sayHelloTo('fred');
  11190. * // => 'hello fred'
  11191. */
  11192. var partialRight = baseRest(function(func, partials) {
  11193. var holders = replaceHolders(partials, getHolder(partialRight));
  11194. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11195. });
  11196. /**
  11197. * Creates a function that invokes `func` with arguments arranged according
  11198. * to the specified `indexes` where the argument value at the first index is
  11199. * provided as the first argument, the argument value at the second index is
  11200. * provided as the second argument, and so on.
  11201. *
  11202. * @static
  11203. * @memberOf _
  11204. * @since 3.0.0
  11205. * @category Function
  11206. * @param {Function} func The function to rearrange arguments for.
  11207. * @param {...(number|number[])} indexes The arranged argument indexes.
  11208. * @returns {Function} Returns the new function.
  11209. * @example
  11210. *
  11211. * var rearged = _.rearg(function(a, b, c) {
  11212. * return [a, b, c];
  11213. * }, [2, 0, 1]);
  11214. *
  11215. * rearged('b', 'c', 'a')
  11216. * // => ['a', 'b', 'c']
  11217. */
  11218. var rearg = flatRest(function(func, indexes) {
  11219. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11220. });
  11221. /**
  11222. * Creates a function that invokes `func` with the `this` binding of the
  11223. * created function and arguments from `start` and beyond provided as
  11224. * an array.
  11225. *
  11226. * **Note:** This method is based on the
  11227. * [rest parameter](https://mdn.io/rest_parameters).
  11228. *
  11229. * @static
  11230. * @memberOf _
  11231. * @since 4.0.0
  11232. * @category Function
  11233. * @param {Function} func The function to apply a rest parameter to.
  11234. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11235. * @returns {Function} Returns the new function.
  11236. * @example
  11237. *
  11238. * var say = _.rest(function(what, names) {
  11239. * return what + ' ' + _.initial(names).join(', ') +
  11240. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11241. * });
  11242. *
  11243. * say('hello', 'fred', 'barney', 'pebbles');
  11244. * // => 'hello fred, barney, & pebbles'
  11245. */
  11246. function rest(func, start) {
  11247. if (typeof func != 'function') {
  11248. throw new TypeError(FUNC_ERROR_TEXT);
  11249. }
  11250. start = start === undefined ? start : toInteger(start);
  11251. return baseRest(func, start);
  11252. }
  11253. /**
  11254. * Creates a function that invokes `func` with the `this` binding of the
  11255. * create function and an array of arguments much like
  11256. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11257. *
  11258. * **Note:** This method is based on the
  11259. * [spread operator](https://mdn.io/spread_operator).
  11260. *
  11261. * @static
  11262. * @memberOf _
  11263. * @since 3.2.0
  11264. * @category Function
  11265. * @param {Function} func The function to spread arguments over.
  11266. * @param {number} [start=0] The start position of the spread.
  11267. * @returns {Function} Returns the new function.
  11268. * @example
  11269. *
  11270. * var say = _.spread(function(who, what) {
  11271. * return who + ' says ' + what;
  11272. * });
  11273. *
  11274. * say(['fred', 'hello']);
  11275. * // => 'fred says hello'
  11276. *
  11277. * var numbers = Promise.all([
  11278. * Promise.resolve(40),
  11279. * Promise.resolve(36)
  11280. * ]);
  11281. *
  11282. * numbers.then(_.spread(function(x, y) {
  11283. * return x + y;
  11284. * }));
  11285. * // => a Promise of 76
  11286. */
  11287. function spread(func, start) {
  11288. if (typeof func != 'function') {
  11289. throw new TypeError(FUNC_ERROR_TEXT);
  11290. }
  11291. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11292. return baseRest(function(args) {
  11293. var array = args[start],
  11294. otherArgs = castSlice(args, 0, start);
  11295. if (array) {
  11296. arrayPush(otherArgs, array);
  11297. }
  11298. return apply(func, this, otherArgs);
  11299. });
  11300. }
  11301. /**
  11302. * Creates a throttled function that only invokes `func` at most once per
  11303. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11304. * method to cancel delayed `func` invocations and a `flush` method to
  11305. * immediately invoke them. Provide `options` to indicate whether `func`
  11306. * should be invoked on the leading and/or trailing edge of the `wait`
  11307. * timeout. The `func` is invoked with the last arguments provided to the
  11308. * throttled function. Subsequent calls to the throttled function return the
  11309. * result of the last `func` invocation.
  11310. *
  11311. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11312. * invoked on the trailing edge of the timeout only if the throttled function
  11313. * is invoked more than once during the `wait` timeout.
  11314. *
  11315. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11316. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11317. *
  11318. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11319. * for details over the differences between `_.throttle` and `_.debounce`.
  11320. *
  11321. * @static
  11322. * @memberOf _
  11323. * @since 0.1.0
  11324. * @category Function
  11325. * @param {Function} func The function to throttle.
  11326. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11327. * @param {Object} [options={}] The options object.
  11328. * @param {boolean} [options.leading=true]
  11329. * Specify invoking on the leading edge of the timeout.
  11330. * @param {boolean} [options.trailing=true]
  11331. * Specify invoking on the trailing edge of the timeout.
  11332. * @returns {Function} Returns the new throttled function.
  11333. * @example
  11334. *
  11335. * // Avoid excessively updating the position while scrolling.
  11336. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11337. *
  11338. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11339. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11340. * jQuery(element).on('click', throttled);
  11341. *
  11342. * // Cancel the trailing throttled invocation.
  11343. * jQuery(window).on('popstate', throttled.cancel);
  11344. */
  11345. function throttle(func, wait, options) {
  11346. var leading = true,
  11347. trailing = true;
  11348. if (typeof func != 'function') {
  11349. throw new TypeError(FUNC_ERROR_TEXT);
  11350. }
  11351. if (isObject(options)) {
  11352. leading = 'leading' in options ? !!options.leading : leading;
  11353. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11354. }
  11355. return debounce(func, wait, {
  11356. 'leading': leading,
  11357. 'maxWait': wait,
  11358. 'trailing': trailing
  11359. });
  11360. }
  11361. /**
  11362. * Creates a function that accepts up to one argument, ignoring any
  11363. * additional arguments.
  11364. *
  11365. * @static
  11366. * @memberOf _
  11367. * @since 4.0.0
  11368. * @category Function
  11369. * @param {Function} func The function to cap arguments for.
  11370. * @returns {Function} Returns the new capped function.
  11371. * @example
  11372. *
  11373. * _.map(['6', '8', '10'], _.unary(parseInt));
  11374. * // => [6, 8, 10]
  11375. */
  11376. function unary(func) {
  11377. return ary(func, 1);
  11378. }
  11379. /**
  11380. * Creates a function that provides `value` to `wrapper` as its first
  11381. * argument. Any additional arguments provided to the function are appended
  11382. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11383. * binding of the created function.
  11384. *
  11385. * @static
  11386. * @memberOf _
  11387. * @since 0.1.0
  11388. * @category Function
  11389. * @param {*} value The value to wrap.
  11390. * @param {Function} [wrapper=identity] The wrapper function.
  11391. * @returns {Function} Returns the new function.
  11392. * @example
  11393. *
  11394. * var p = _.wrap(_.escape, function(func, text) {
  11395. * return '<p>' + func(text) + '</p>';
  11396. * });
  11397. *
  11398. * p('fred, barney, & pebbles');
  11399. * // => '<p>fred, barney, &amp; pebbles</p>'
  11400. */
  11401. function wrap(value, wrapper) {
  11402. return partial(castFunction(wrapper), value);
  11403. }
  11404. /*------------------------------------------------------------------------*/
  11405. /**
  11406. * Casts `value` as an array if it's not one.
  11407. *
  11408. * @static
  11409. * @memberOf _
  11410. * @since 4.4.0
  11411. * @category Lang
  11412. * @param {*} value The value to inspect.
  11413. * @returns {Array} Returns the cast array.
  11414. * @example
  11415. *
  11416. * _.castArray(1);
  11417. * // => [1]
  11418. *
  11419. * _.castArray({ 'a': 1 });
  11420. * // => [{ 'a': 1 }]
  11421. *
  11422. * _.castArray('abc');
  11423. * // => ['abc']
  11424. *
  11425. * _.castArray(null);
  11426. * // => [null]
  11427. *
  11428. * _.castArray(undefined);
  11429. * // => [undefined]
  11430. *
  11431. * _.castArray();
  11432. * // => []
  11433. *
  11434. * var array = [1, 2, 3];
  11435. * console.log(_.castArray(array) === array);
  11436. * // => true
  11437. */
  11438. function castArray() {
  11439. if (!arguments.length) {
  11440. return [];
  11441. }
  11442. var value = arguments[0];
  11443. return isArray(value) ? value : [value];
  11444. }
  11445. /**
  11446. * Creates a shallow clone of `value`.
  11447. *
  11448. * **Note:** This method is loosely based on the
  11449. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11450. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11451. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11452. * arrays. The own enumerable properties of `arguments` objects are cloned
  11453. * as plain objects. An empty object is returned for uncloneable values such
  11454. * as error objects, functions, DOM nodes, and WeakMaps.
  11455. *
  11456. * @static
  11457. * @memberOf _
  11458. * @since 0.1.0
  11459. * @category Lang
  11460. * @param {*} value The value to clone.
  11461. * @returns {*} Returns the cloned value.
  11462. * @see _.cloneDeep
  11463. * @example
  11464. *
  11465. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11466. *
  11467. * var shallow = _.clone(objects);
  11468. * console.log(shallow[0] === objects[0]);
  11469. * // => true
  11470. */
  11471. function clone(value) {
  11472. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11473. }
  11474. /**
  11475. * This method is like `_.clone` except that it accepts `customizer` which
  11476. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11477. * cloning is handled by the method instead. The `customizer` is invoked with
  11478. * up to four arguments; (value [, index|key, object, stack]).
  11479. *
  11480. * @static
  11481. * @memberOf _
  11482. * @since 4.0.0
  11483. * @category Lang
  11484. * @param {*} value The value to clone.
  11485. * @param {Function} [customizer] The function to customize cloning.
  11486. * @returns {*} Returns the cloned value.
  11487. * @see _.cloneDeepWith
  11488. * @example
  11489. *
  11490. * function customizer(value) {
  11491. * if (_.isElement(value)) {
  11492. * return value.cloneNode(false);
  11493. * }
  11494. * }
  11495. *
  11496. * var el = _.cloneWith(document.body, customizer);
  11497. *
  11498. * console.log(el === document.body);
  11499. * // => false
  11500. * console.log(el.nodeName);
  11501. * // => 'BODY'
  11502. * console.log(el.childNodes.length);
  11503. * // => 0
  11504. */
  11505. function cloneWith(value, customizer) {
  11506. customizer = typeof customizer == 'function' ? customizer : undefined;
  11507. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11508. }
  11509. /**
  11510. * This method is like `_.clone` except that it recursively clones `value`.
  11511. *
  11512. * @static
  11513. * @memberOf _
  11514. * @since 1.0.0
  11515. * @category Lang
  11516. * @param {*} value The value to recursively clone.
  11517. * @returns {*} Returns the deep cloned value.
  11518. * @see _.clone
  11519. * @example
  11520. *
  11521. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11522. *
  11523. * var deep = _.cloneDeep(objects);
  11524. * console.log(deep[0] === objects[0]);
  11525. * // => false
  11526. */
  11527. function cloneDeep(value) {
  11528. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11529. }
  11530. /**
  11531. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11532. *
  11533. * @static
  11534. * @memberOf _
  11535. * @since 4.0.0
  11536. * @category Lang
  11537. * @param {*} value The value to recursively clone.
  11538. * @param {Function} [customizer] The function to customize cloning.
  11539. * @returns {*} Returns the deep cloned value.
  11540. * @see _.cloneWith
  11541. * @example
  11542. *
  11543. * function customizer(value) {
  11544. * if (_.isElement(value)) {
  11545. * return value.cloneNode(true);
  11546. * }
  11547. * }
  11548. *
  11549. * var el = _.cloneDeepWith(document.body, customizer);
  11550. *
  11551. * console.log(el === document.body);
  11552. * // => false
  11553. * console.log(el.nodeName);
  11554. * // => 'BODY'
  11555. * console.log(el.childNodes.length);
  11556. * // => 20
  11557. */
  11558. function cloneDeepWith(value, customizer) {
  11559. customizer = typeof customizer == 'function' ? customizer : undefined;
  11560. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11561. }
  11562. /**
  11563. * Checks if `object` conforms to `source` by invoking the predicate
  11564. * properties of `source` with the corresponding property values of `object`.
  11565. *
  11566. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11567. * partially applied.
  11568. *
  11569. * @static
  11570. * @memberOf _
  11571. * @since 4.14.0
  11572. * @category Lang
  11573. * @param {Object} object The object to inspect.
  11574. * @param {Object} source The object of property predicates to conform to.
  11575. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11576. * @example
  11577. *
  11578. * var object = { 'a': 1, 'b': 2 };
  11579. *
  11580. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11581. * // => true
  11582. *
  11583. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11584. * // => false
  11585. */
  11586. function conformsTo(object, source) {
  11587. return source == null || baseConformsTo(object, source, keys(source));
  11588. }
  11589. /**
  11590. * Performs a
  11591. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11592. * comparison between two values to determine if they are equivalent.
  11593. *
  11594. * @static
  11595. * @memberOf _
  11596. * @since 4.0.0
  11597. * @category Lang
  11598. * @param {*} value The value to compare.
  11599. * @param {*} other The other value to compare.
  11600. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11601. * @example
  11602. *
  11603. * var object = { 'a': 1 };
  11604. * var other = { 'a': 1 };
  11605. *
  11606. * _.eq(object, object);
  11607. * // => true
  11608. *
  11609. * _.eq(object, other);
  11610. * // => false
  11611. *
  11612. * _.eq('a', 'a');
  11613. * // => true
  11614. *
  11615. * _.eq('a', Object('a'));
  11616. * // => false
  11617. *
  11618. * _.eq(NaN, NaN);
  11619. * // => true
  11620. */
  11621. function eq(value, other) {
  11622. return value === other || (value !== value && other !== other);
  11623. }
  11624. /**
  11625. * Checks if `value` is greater than `other`.
  11626. *
  11627. * @static
  11628. * @memberOf _
  11629. * @since 3.9.0
  11630. * @category Lang
  11631. * @param {*} value The value to compare.
  11632. * @param {*} other The other value to compare.
  11633. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11634. * else `false`.
  11635. * @see _.lt
  11636. * @example
  11637. *
  11638. * _.gt(3, 1);
  11639. * // => true
  11640. *
  11641. * _.gt(3, 3);
  11642. * // => false
  11643. *
  11644. * _.gt(1, 3);
  11645. * // => false
  11646. */
  11647. var gt = createRelationalOperation(baseGt);
  11648. /**
  11649. * Checks if `value` is greater than or equal to `other`.
  11650. *
  11651. * @static
  11652. * @memberOf _
  11653. * @since 3.9.0
  11654. * @category Lang
  11655. * @param {*} value The value to compare.
  11656. * @param {*} other The other value to compare.
  11657. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11658. * `other`, else `false`.
  11659. * @see _.lte
  11660. * @example
  11661. *
  11662. * _.gte(3, 1);
  11663. * // => true
  11664. *
  11665. * _.gte(3, 3);
  11666. * // => true
  11667. *
  11668. * _.gte(1, 3);
  11669. * // => false
  11670. */
  11671. var gte = createRelationalOperation(function(value, other) {
  11672. return value >= other;
  11673. });
  11674. /**
  11675. * Checks if `value` is likely an `arguments` object.
  11676. *
  11677. * @static
  11678. * @memberOf _
  11679. * @since 0.1.0
  11680. * @category Lang
  11681. * @param {*} value The value to check.
  11682. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11683. * else `false`.
  11684. * @example
  11685. *
  11686. * _.isArguments(function() { return arguments; }());
  11687. * // => true
  11688. *
  11689. * _.isArguments([1, 2, 3]);
  11690. * // => false
  11691. */
  11692. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11693. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11694. !propertyIsEnumerable.call(value, 'callee');
  11695. };
  11696. /**
  11697. * Checks if `value` is classified as an `Array` object.
  11698. *
  11699. * @static
  11700. * @memberOf _
  11701. * @since 0.1.0
  11702. * @category Lang
  11703. * @param {*} value The value to check.
  11704. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11705. * @example
  11706. *
  11707. * _.isArray([1, 2, 3]);
  11708. * // => true
  11709. *
  11710. * _.isArray(document.body.children);
  11711. * // => false
  11712. *
  11713. * _.isArray('abc');
  11714. * // => false
  11715. *
  11716. * _.isArray(_.noop);
  11717. * // => false
  11718. */
  11719. var isArray = Array.isArray;
  11720. /**
  11721. * Checks if `value` is classified as an `ArrayBuffer` object.
  11722. *
  11723. * @static
  11724. * @memberOf _
  11725. * @since 4.3.0
  11726. * @category Lang
  11727. * @param {*} value The value to check.
  11728. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11729. * @example
  11730. *
  11731. * _.isArrayBuffer(new ArrayBuffer(2));
  11732. * // => true
  11733. *
  11734. * _.isArrayBuffer(new Array(2));
  11735. * // => false
  11736. */
  11737. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11738. /**
  11739. * Checks if `value` is array-like. A value is considered array-like if it's
  11740. * not a function and has a `value.length` that's an integer greater than or
  11741. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11742. *
  11743. * @static
  11744. * @memberOf _
  11745. * @since 4.0.0
  11746. * @category Lang
  11747. * @param {*} value The value to check.
  11748. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11749. * @example
  11750. *
  11751. * _.isArrayLike([1, 2, 3]);
  11752. * // => true
  11753. *
  11754. * _.isArrayLike(document.body.children);
  11755. * // => true
  11756. *
  11757. * _.isArrayLike('abc');
  11758. * // => true
  11759. *
  11760. * _.isArrayLike(_.noop);
  11761. * // => false
  11762. */
  11763. function isArrayLike(value) {
  11764. return value != null && isLength(value.length) && !isFunction(value);
  11765. }
  11766. /**
  11767. * This method is like `_.isArrayLike` except that it also checks if `value`
  11768. * is an object.
  11769. *
  11770. * @static
  11771. * @memberOf _
  11772. * @since 4.0.0
  11773. * @category Lang
  11774. * @param {*} value The value to check.
  11775. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11776. * else `false`.
  11777. * @example
  11778. *
  11779. * _.isArrayLikeObject([1, 2, 3]);
  11780. * // => true
  11781. *
  11782. * _.isArrayLikeObject(document.body.children);
  11783. * // => true
  11784. *
  11785. * _.isArrayLikeObject('abc');
  11786. * // => false
  11787. *
  11788. * _.isArrayLikeObject(_.noop);
  11789. * // => false
  11790. */
  11791. function isArrayLikeObject(value) {
  11792. return isObjectLike(value) && isArrayLike(value);
  11793. }
  11794. /**
  11795. * Checks if `value` is classified as a boolean primitive or object.
  11796. *
  11797. * @static
  11798. * @memberOf _
  11799. * @since 0.1.0
  11800. * @category Lang
  11801. * @param {*} value The value to check.
  11802. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11803. * @example
  11804. *
  11805. * _.isBoolean(false);
  11806. * // => true
  11807. *
  11808. * _.isBoolean(null);
  11809. * // => false
  11810. */
  11811. function isBoolean(value) {
  11812. return value === true || value === false ||
  11813. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11814. }
  11815. /**
  11816. * Checks if `value` is a buffer.
  11817. *
  11818. * @static
  11819. * @memberOf _
  11820. * @since 4.3.0
  11821. * @category Lang
  11822. * @param {*} value The value to check.
  11823. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11824. * @example
  11825. *
  11826. * _.isBuffer(new Buffer(2));
  11827. * // => true
  11828. *
  11829. * _.isBuffer(new Uint8Array(2));
  11830. * // => false
  11831. */
  11832. var isBuffer = nativeIsBuffer || stubFalse;
  11833. /**
  11834. * Checks if `value` is classified as a `Date` object.
  11835. *
  11836. * @static
  11837. * @memberOf _
  11838. * @since 0.1.0
  11839. * @category Lang
  11840. * @param {*} value The value to check.
  11841. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11842. * @example
  11843. *
  11844. * _.isDate(new Date);
  11845. * // => true
  11846. *
  11847. * _.isDate('Mon April 23 2012');
  11848. * // => false
  11849. */
  11850. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11851. /**
  11852. * Checks if `value` is likely a DOM element.
  11853. *
  11854. * @static
  11855. * @memberOf _
  11856. * @since 0.1.0
  11857. * @category Lang
  11858. * @param {*} value The value to check.
  11859. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11860. * @example
  11861. *
  11862. * _.isElement(document.body);
  11863. * // => true
  11864. *
  11865. * _.isElement('<body>');
  11866. * // => false
  11867. */
  11868. function isElement(value) {
  11869. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11870. }
  11871. /**
  11872. * Checks if `value` is an empty object, collection, map, or set.
  11873. *
  11874. * Objects are considered empty if they have no own enumerable string keyed
  11875. * properties.
  11876. *
  11877. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11878. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11879. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11880. *
  11881. * @static
  11882. * @memberOf _
  11883. * @since 0.1.0
  11884. * @category Lang
  11885. * @param {*} value The value to check.
  11886. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11887. * @example
  11888. *
  11889. * _.isEmpty(null);
  11890. * // => true
  11891. *
  11892. * _.isEmpty(true);
  11893. * // => true
  11894. *
  11895. * _.isEmpty(1);
  11896. * // => true
  11897. *
  11898. * _.isEmpty([1, 2, 3]);
  11899. * // => false
  11900. *
  11901. * _.isEmpty({ 'a': 1 });
  11902. * // => false
  11903. */
  11904. function isEmpty(value) {
  11905. if (value == null) {
  11906. return true;
  11907. }
  11908. if (isArrayLike(value) &&
  11909. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11910. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11911. return !value.length;
  11912. }
  11913. var tag = getTag(value);
  11914. if (tag == mapTag || tag == setTag) {
  11915. return !value.size;
  11916. }
  11917. if (isPrototype(value)) {
  11918. return !baseKeys(value).length;
  11919. }
  11920. for (var key in value) {
  11921. if (hasOwnProperty.call(value, key)) {
  11922. return false;
  11923. }
  11924. }
  11925. return true;
  11926. }
  11927. /**
  11928. * Performs a deep comparison between two values to determine if they are
  11929. * equivalent.
  11930. *
  11931. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11932. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11933. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11934. * by their own, not inherited, enumerable properties. Functions and DOM
  11935. * nodes are compared by strict equality, i.e. `===`.
  11936. *
  11937. * @static
  11938. * @memberOf _
  11939. * @since 0.1.0
  11940. * @category Lang
  11941. * @param {*} value The value to compare.
  11942. * @param {*} other The other value to compare.
  11943. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11944. * @example
  11945. *
  11946. * var object = { 'a': 1 };
  11947. * var other = { 'a': 1 };
  11948. *
  11949. * _.isEqual(object, other);
  11950. * // => true
  11951. *
  11952. * object === other;
  11953. * // => false
  11954. */
  11955. function isEqual(value, other) {
  11956. return baseIsEqual(value, other);
  11957. }
  11958. /**
  11959. * This method is like `_.isEqual` except that it accepts `customizer` which
  11960. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11961. * are handled by the method instead. The `customizer` is invoked with up to
  11962. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11963. *
  11964. * @static
  11965. * @memberOf _
  11966. * @since 4.0.0
  11967. * @category Lang
  11968. * @param {*} value The value to compare.
  11969. * @param {*} other The other value to compare.
  11970. * @param {Function} [customizer] The function to customize comparisons.
  11971. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11972. * @example
  11973. *
  11974. * function isGreeting(value) {
  11975. * return /^h(?:i|ello)$/.test(value);
  11976. * }
  11977. *
  11978. * function customizer(objValue, othValue) {
  11979. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11980. * return true;
  11981. * }
  11982. * }
  11983. *
  11984. * var array = ['hello', 'goodbye'];
  11985. * var other = ['hi', 'goodbye'];
  11986. *
  11987. * _.isEqualWith(array, other, customizer);
  11988. * // => true
  11989. */
  11990. function isEqualWith(value, other, customizer) {
  11991. customizer = typeof customizer == 'function' ? customizer : undefined;
  11992. var result = customizer ? customizer(value, other) : undefined;
  11993. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11994. }
  11995. /**
  11996. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11997. * `SyntaxError`, `TypeError`, or `URIError` object.
  11998. *
  11999. * @static
  12000. * @memberOf _
  12001. * @since 3.0.0
  12002. * @category Lang
  12003. * @param {*} value The value to check.
  12004. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12005. * @example
  12006. *
  12007. * _.isError(new Error);
  12008. * // => true
  12009. *
  12010. * _.isError(Error);
  12011. * // => false
  12012. */
  12013. function isError(value) {
  12014. if (!isObjectLike(value)) {
  12015. return false;
  12016. }
  12017. var tag = baseGetTag(value);
  12018. return tag == errorTag || tag == domExcTag ||
  12019. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12020. }
  12021. /**
  12022. * Checks if `value` is a finite primitive number.
  12023. *
  12024. * **Note:** This method is based on
  12025. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12026. *
  12027. * @static
  12028. * @memberOf _
  12029. * @since 0.1.0
  12030. * @category Lang
  12031. * @param {*} value The value to check.
  12032. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12033. * @example
  12034. *
  12035. * _.isFinite(3);
  12036. * // => true
  12037. *
  12038. * _.isFinite(Number.MIN_VALUE);
  12039. * // => true
  12040. *
  12041. * _.isFinite(Infinity);
  12042. * // => false
  12043. *
  12044. * _.isFinite('3');
  12045. * // => false
  12046. */
  12047. function isFinite(value) {
  12048. return typeof value == 'number' && nativeIsFinite(value);
  12049. }
  12050. /**
  12051. * Checks if `value` is classified as a `Function` object.
  12052. *
  12053. * @static
  12054. * @memberOf _
  12055. * @since 0.1.0
  12056. * @category Lang
  12057. * @param {*} value The value to check.
  12058. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12059. * @example
  12060. *
  12061. * _.isFunction(_);
  12062. * // => true
  12063. *
  12064. * _.isFunction(/abc/);
  12065. * // => false
  12066. */
  12067. function isFunction(value) {
  12068. if (!isObject(value)) {
  12069. return false;
  12070. }
  12071. // The use of `Object#toString` avoids issues with the `typeof` operator
  12072. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12073. var tag = baseGetTag(value);
  12074. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12075. }
  12076. /**
  12077. * Checks if `value` is an integer.
  12078. *
  12079. * **Note:** This method is based on
  12080. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12081. *
  12082. * @static
  12083. * @memberOf _
  12084. * @since 4.0.0
  12085. * @category Lang
  12086. * @param {*} value The value to check.
  12087. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12088. * @example
  12089. *
  12090. * _.isInteger(3);
  12091. * // => true
  12092. *
  12093. * _.isInteger(Number.MIN_VALUE);
  12094. * // => false
  12095. *
  12096. * _.isInteger(Infinity);
  12097. * // => false
  12098. *
  12099. * _.isInteger('3');
  12100. * // => false
  12101. */
  12102. function isInteger(value) {
  12103. return typeof value == 'number' && value == toInteger(value);
  12104. }
  12105. /**
  12106. * Checks if `value` is a valid array-like length.
  12107. *
  12108. * **Note:** This method is loosely based on
  12109. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12110. *
  12111. * @static
  12112. * @memberOf _
  12113. * @since 4.0.0
  12114. * @category Lang
  12115. * @param {*} value The value to check.
  12116. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12117. * @example
  12118. *
  12119. * _.isLength(3);
  12120. * // => true
  12121. *
  12122. * _.isLength(Number.MIN_VALUE);
  12123. * // => false
  12124. *
  12125. * _.isLength(Infinity);
  12126. * // => false
  12127. *
  12128. * _.isLength('3');
  12129. * // => false
  12130. */
  12131. function isLength(value) {
  12132. return typeof value == 'number' &&
  12133. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12134. }
  12135. /**
  12136. * Checks if `value` is the
  12137. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12138. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12139. *
  12140. * @static
  12141. * @memberOf _
  12142. * @since 0.1.0
  12143. * @category Lang
  12144. * @param {*} value The value to check.
  12145. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12146. * @example
  12147. *
  12148. * _.isObject({});
  12149. * // => true
  12150. *
  12151. * _.isObject([1, 2, 3]);
  12152. * // => true
  12153. *
  12154. * _.isObject(_.noop);
  12155. * // => true
  12156. *
  12157. * _.isObject(null);
  12158. * // => false
  12159. */
  12160. function isObject(value) {
  12161. var type = typeof value;
  12162. return value != null && (type == 'object' || type == 'function');
  12163. }
  12164. /**
  12165. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12166. * and has a `typeof` result of "object".
  12167. *
  12168. * @static
  12169. * @memberOf _
  12170. * @since 4.0.0
  12171. * @category Lang
  12172. * @param {*} value The value to check.
  12173. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12174. * @example
  12175. *
  12176. * _.isObjectLike({});
  12177. * // => true
  12178. *
  12179. * _.isObjectLike([1, 2, 3]);
  12180. * // => true
  12181. *
  12182. * _.isObjectLike(_.noop);
  12183. * // => false
  12184. *
  12185. * _.isObjectLike(null);
  12186. * // => false
  12187. */
  12188. function isObjectLike(value) {
  12189. return value != null && typeof value == 'object';
  12190. }
  12191. /**
  12192. * Checks if `value` is classified as a `Map` object.
  12193. *
  12194. * @static
  12195. * @memberOf _
  12196. * @since 4.3.0
  12197. * @category Lang
  12198. * @param {*} value The value to check.
  12199. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12200. * @example
  12201. *
  12202. * _.isMap(new Map);
  12203. * // => true
  12204. *
  12205. * _.isMap(new WeakMap);
  12206. * // => false
  12207. */
  12208. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12209. /**
  12210. * Performs a partial deep comparison between `object` and `source` to
  12211. * determine if `object` contains equivalent property values.
  12212. *
  12213. * **Note:** This method is equivalent to `_.matches` when `source` is
  12214. * partially applied.
  12215. *
  12216. * Partial comparisons will match empty array and empty object `source`
  12217. * values against any array or object value, respectively. See `_.isEqual`
  12218. * for a list of supported value comparisons.
  12219. *
  12220. * @static
  12221. * @memberOf _
  12222. * @since 3.0.0
  12223. * @category Lang
  12224. * @param {Object} object The object to inspect.
  12225. * @param {Object} source The object of property values to match.
  12226. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12227. * @example
  12228. *
  12229. * var object = { 'a': 1, 'b': 2 };
  12230. *
  12231. * _.isMatch(object, { 'b': 2 });
  12232. * // => true
  12233. *
  12234. * _.isMatch(object, { 'b': 1 });
  12235. * // => false
  12236. */
  12237. function isMatch(object, source) {
  12238. return object === source || baseIsMatch(object, source, getMatchData(source));
  12239. }
  12240. /**
  12241. * This method is like `_.isMatch` except that it accepts `customizer` which
  12242. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12243. * are handled by the method instead. The `customizer` is invoked with five
  12244. * arguments: (objValue, srcValue, index|key, object, source).
  12245. *
  12246. * @static
  12247. * @memberOf _
  12248. * @since 4.0.0
  12249. * @category Lang
  12250. * @param {Object} object The object to inspect.
  12251. * @param {Object} source The object of property values to match.
  12252. * @param {Function} [customizer] The function to customize comparisons.
  12253. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12254. * @example
  12255. *
  12256. * function isGreeting(value) {
  12257. * return /^h(?:i|ello)$/.test(value);
  12258. * }
  12259. *
  12260. * function customizer(objValue, srcValue) {
  12261. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12262. * return true;
  12263. * }
  12264. * }
  12265. *
  12266. * var object = { 'greeting': 'hello' };
  12267. * var source = { 'greeting': 'hi' };
  12268. *
  12269. * _.isMatchWith(object, source, customizer);
  12270. * // => true
  12271. */
  12272. function isMatchWith(object, source, customizer) {
  12273. customizer = typeof customizer == 'function' ? customizer : undefined;
  12274. return baseIsMatch(object, source, getMatchData(source), customizer);
  12275. }
  12276. /**
  12277. * Checks if `value` is `NaN`.
  12278. *
  12279. * **Note:** This method is based on
  12280. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12281. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12282. * `undefined` and other non-number values.
  12283. *
  12284. * @static
  12285. * @memberOf _
  12286. * @since 0.1.0
  12287. * @category Lang
  12288. * @param {*} value The value to check.
  12289. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12290. * @example
  12291. *
  12292. * _.isNaN(NaN);
  12293. * // => true
  12294. *
  12295. * _.isNaN(new Number(NaN));
  12296. * // => true
  12297. *
  12298. * isNaN(undefined);
  12299. * // => true
  12300. *
  12301. * _.isNaN(undefined);
  12302. * // => false
  12303. */
  12304. function isNaN(value) {
  12305. // An `NaN` primitive is the only value that is not equal to itself.
  12306. // Perform the `toStringTag` check first to avoid errors with some
  12307. // ActiveX objects in IE.
  12308. return isNumber(value) && value != +value;
  12309. }
  12310. /**
  12311. * Checks if `value` is a pristine native function.
  12312. *
  12313. * **Note:** This method can't reliably detect native functions in the presence
  12314. * of the core-js package because core-js circumvents this kind of detection.
  12315. * Despite multiple requests, the core-js maintainer has made it clear: any
  12316. * attempt to fix the detection will be obstructed. As a result, we're left
  12317. * with little choice but to throw an error. Unfortunately, this also affects
  12318. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12319. * which rely on core-js.
  12320. *
  12321. * @static
  12322. * @memberOf _
  12323. * @since 3.0.0
  12324. * @category Lang
  12325. * @param {*} value The value to check.
  12326. * @returns {boolean} Returns `true` if `value` is a native function,
  12327. * else `false`.
  12328. * @example
  12329. *
  12330. * _.isNative(Array.prototype.push);
  12331. * // => true
  12332. *
  12333. * _.isNative(_);
  12334. * // => false
  12335. */
  12336. function isNative(value) {
  12337. if (isMaskable(value)) {
  12338. throw new Error(CORE_ERROR_TEXT);
  12339. }
  12340. return baseIsNative(value);
  12341. }
  12342. /**
  12343. * Checks if `value` is `null`.
  12344. *
  12345. * @static
  12346. * @memberOf _
  12347. * @since 0.1.0
  12348. * @category Lang
  12349. * @param {*} value The value to check.
  12350. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12351. * @example
  12352. *
  12353. * _.isNull(null);
  12354. * // => true
  12355. *
  12356. * _.isNull(void 0);
  12357. * // => false
  12358. */
  12359. function isNull(value) {
  12360. return value === null;
  12361. }
  12362. /**
  12363. * Checks if `value` is `null` or `undefined`.
  12364. *
  12365. * @static
  12366. * @memberOf _
  12367. * @since 4.0.0
  12368. * @category Lang
  12369. * @param {*} value The value to check.
  12370. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12371. * @example
  12372. *
  12373. * _.isNil(null);
  12374. * // => true
  12375. *
  12376. * _.isNil(void 0);
  12377. * // => true
  12378. *
  12379. * _.isNil(NaN);
  12380. * // => false
  12381. */
  12382. function isNil(value) {
  12383. return value == null;
  12384. }
  12385. /**
  12386. * Checks if `value` is classified as a `Number` primitive or object.
  12387. *
  12388. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12389. * classified as numbers, use the `_.isFinite` method.
  12390. *
  12391. * @static
  12392. * @memberOf _
  12393. * @since 0.1.0
  12394. * @category Lang
  12395. * @param {*} value The value to check.
  12396. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12397. * @example
  12398. *
  12399. * _.isNumber(3);
  12400. * // => true
  12401. *
  12402. * _.isNumber(Number.MIN_VALUE);
  12403. * // => true
  12404. *
  12405. * _.isNumber(Infinity);
  12406. * // => true
  12407. *
  12408. * _.isNumber('3');
  12409. * // => false
  12410. */
  12411. function isNumber(value) {
  12412. return typeof value == 'number' ||
  12413. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12414. }
  12415. /**
  12416. * Checks if `value` is a plain object, that is, an object created by the
  12417. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12418. *
  12419. * @static
  12420. * @memberOf _
  12421. * @since 0.8.0
  12422. * @category Lang
  12423. * @param {*} value The value to check.
  12424. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12425. * @example
  12426. *
  12427. * function Foo() {
  12428. * this.a = 1;
  12429. * }
  12430. *
  12431. * _.isPlainObject(new Foo);
  12432. * // => false
  12433. *
  12434. * _.isPlainObject([1, 2, 3]);
  12435. * // => false
  12436. *
  12437. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12438. * // => true
  12439. *
  12440. * _.isPlainObject(Object.create(null));
  12441. * // => true
  12442. */
  12443. function isPlainObject(value) {
  12444. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12445. return false;
  12446. }
  12447. var proto = getPrototype(value);
  12448. if (proto === null) {
  12449. return true;
  12450. }
  12451. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12452. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12453. funcToString.call(Ctor) == objectCtorString;
  12454. }
  12455. /**
  12456. * Checks if `value` is classified as a `RegExp` object.
  12457. *
  12458. * @static
  12459. * @memberOf _
  12460. * @since 0.1.0
  12461. * @category Lang
  12462. * @param {*} value The value to check.
  12463. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12464. * @example
  12465. *
  12466. * _.isRegExp(/abc/);
  12467. * // => true
  12468. *
  12469. * _.isRegExp('/abc/');
  12470. * // => false
  12471. */
  12472. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12473. /**
  12474. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12475. * double precision number which isn't the result of a rounded unsafe integer.
  12476. *
  12477. * **Note:** This method is based on
  12478. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12479. *
  12480. * @static
  12481. * @memberOf _
  12482. * @since 4.0.0
  12483. * @category Lang
  12484. * @param {*} value The value to check.
  12485. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12486. * @example
  12487. *
  12488. * _.isSafeInteger(3);
  12489. * // => true
  12490. *
  12491. * _.isSafeInteger(Number.MIN_VALUE);
  12492. * // => false
  12493. *
  12494. * _.isSafeInteger(Infinity);
  12495. * // => false
  12496. *
  12497. * _.isSafeInteger('3');
  12498. * // => false
  12499. */
  12500. function isSafeInteger(value) {
  12501. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12502. }
  12503. /**
  12504. * Checks if `value` is classified as a `Set` object.
  12505. *
  12506. * @static
  12507. * @memberOf _
  12508. * @since 4.3.0
  12509. * @category Lang
  12510. * @param {*} value The value to check.
  12511. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12512. * @example
  12513. *
  12514. * _.isSet(new Set);
  12515. * // => true
  12516. *
  12517. * _.isSet(new WeakSet);
  12518. * // => false
  12519. */
  12520. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12521. /**
  12522. * Checks if `value` is classified as a `String` primitive or object.
  12523. *
  12524. * @static
  12525. * @since 0.1.0
  12526. * @memberOf _
  12527. * @category Lang
  12528. * @param {*} value The value to check.
  12529. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12530. * @example
  12531. *
  12532. * _.isString('abc');
  12533. * // => true
  12534. *
  12535. * _.isString(1);
  12536. * // => false
  12537. */
  12538. function isString(value) {
  12539. return typeof value == 'string' ||
  12540. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12541. }
  12542. /**
  12543. * Checks if `value` is classified as a `Symbol` primitive or object.
  12544. *
  12545. * @static
  12546. * @memberOf _
  12547. * @since 4.0.0
  12548. * @category Lang
  12549. * @param {*} value The value to check.
  12550. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12551. * @example
  12552. *
  12553. * _.isSymbol(Symbol.iterator);
  12554. * // => true
  12555. *
  12556. * _.isSymbol('abc');
  12557. * // => false
  12558. */
  12559. function isSymbol(value) {
  12560. return typeof value == 'symbol' ||
  12561. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12562. }
  12563. /**
  12564. * Checks if `value` is classified as a typed array.
  12565. *
  12566. * @static
  12567. * @memberOf _
  12568. * @since 3.0.0
  12569. * @category Lang
  12570. * @param {*} value The value to check.
  12571. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12572. * @example
  12573. *
  12574. * _.isTypedArray(new Uint8Array);
  12575. * // => true
  12576. *
  12577. * _.isTypedArray([]);
  12578. * // => false
  12579. */
  12580. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12581. /**
  12582. * Checks if `value` is `undefined`.
  12583. *
  12584. * @static
  12585. * @since 0.1.0
  12586. * @memberOf _
  12587. * @category Lang
  12588. * @param {*} value The value to check.
  12589. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12590. * @example
  12591. *
  12592. * _.isUndefined(void 0);
  12593. * // => true
  12594. *
  12595. * _.isUndefined(null);
  12596. * // => false
  12597. */
  12598. function isUndefined(value) {
  12599. return value === undefined;
  12600. }
  12601. /**
  12602. * Checks if `value` is classified as a `WeakMap` object.
  12603. *
  12604. * @static
  12605. * @memberOf _
  12606. * @since 4.3.0
  12607. * @category Lang
  12608. * @param {*} value The value to check.
  12609. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12610. * @example
  12611. *
  12612. * _.isWeakMap(new WeakMap);
  12613. * // => true
  12614. *
  12615. * _.isWeakMap(new Map);
  12616. * // => false
  12617. */
  12618. function isWeakMap(value) {
  12619. return isObjectLike(value) && getTag(value) == weakMapTag;
  12620. }
  12621. /**
  12622. * Checks if `value` is classified as a `WeakSet` object.
  12623. *
  12624. * @static
  12625. * @memberOf _
  12626. * @since 4.3.0
  12627. * @category Lang
  12628. * @param {*} value The value to check.
  12629. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12630. * @example
  12631. *
  12632. * _.isWeakSet(new WeakSet);
  12633. * // => true
  12634. *
  12635. * _.isWeakSet(new Set);
  12636. * // => false
  12637. */
  12638. function isWeakSet(value) {
  12639. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12640. }
  12641. /**
  12642. * Checks if `value` is less than `other`.
  12643. *
  12644. * @static
  12645. * @memberOf _
  12646. * @since 3.9.0
  12647. * @category Lang
  12648. * @param {*} value The value to compare.
  12649. * @param {*} other The other value to compare.
  12650. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12651. * else `false`.
  12652. * @see _.gt
  12653. * @example
  12654. *
  12655. * _.lt(1, 3);
  12656. * // => true
  12657. *
  12658. * _.lt(3, 3);
  12659. * // => false
  12660. *
  12661. * _.lt(3, 1);
  12662. * // => false
  12663. */
  12664. var lt = createRelationalOperation(baseLt);
  12665. /**
  12666. * Checks if `value` is less than or equal to `other`.
  12667. *
  12668. * @static
  12669. * @memberOf _
  12670. * @since 3.9.0
  12671. * @category Lang
  12672. * @param {*} value The value to compare.
  12673. * @param {*} other The other value to compare.
  12674. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12675. * `other`, else `false`.
  12676. * @see _.gte
  12677. * @example
  12678. *
  12679. * _.lte(1, 3);
  12680. * // => true
  12681. *
  12682. * _.lte(3, 3);
  12683. * // => true
  12684. *
  12685. * _.lte(3, 1);
  12686. * // => false
  12687. */
  12688. var lte = createRelationalOperation(function(value, other) {
  12689. return value <= other;
  12690. });
  12691. /**
  12692. * Converts `value` to an array.
  12693. *
  12694. * @static
  12695. * @since 0.1.0
  12696. * @memberOf _
  12697. * @category Lang
  12698. * @param {*} value The value to convert.
  12699. * @returns {Array} Returns the converted array.
  12700. * @example
  12701. *
  12702. * _.toArray({ 'a': 1, 'b': 2 });
  12703. * // => [1, 2]
  12704. *
  12705. * _.toArray('abc');
  12706. * // => ['a', 'b', 'c']
  12707. *
  12708. * _.toArray(1);
  12709. * // => []
  12710. *
  12711. * _.toArray(null);
  12712. * // => []
  12713. */
  12714. function toArray(value) {
  12715. if (!value) {
  12716. return [];
  12717. }
  12718. if (isArrayLike(value)) {
  12719. return isString(value) ? stringToArray(value) : copyArray(value);
  12720. }
  12721. if (symIterator && value[symIterator]) {
  12722. return iteratorToArray(value[symIterator]());
  12723. }
  12724. var tag = getTag(value),
  12725. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12726. return func(value);
  12727. }
  12728. /**
  12729. * Converts `value` to a finite number.
  12730. *
  12731. * @static
  12732. * @memberOf _
  12733. * @since 4.12.0
  12734. * @category Lang
  12735. * @param {*} value The value to convert.
  12736. * @returns {number} Returns the converted number.
  12737. * @example
  12738. *
  12739. * _.toFinite(3.2);
  12740. * // => 3.2
  12741. *
  12742. * _.toFinite(Number.MIN_VALUE);
  12743. * // => 5e-324
  12744. *
  12745. * _.toFinite(Infinity);
  12746. * // => 1.7976931348623157e+308
  12747. *
  12748. * _.toFinite('3.2');
  12749. * // => 3.2
  12750. */
  12751. function toFinite(value) {
  12752. if (!value) {
  12753. return value === 0 ? value : 0;
  12754. }
  12755. value = toNumber(value);
  12756. if (value === INFINITY || value === -INFINITY) {
  12757. var sign = (value < 0 ? -1 : 1);
  12758. return sign * MAX_INTEGER;
  12759. }
  12760. return value === value ? value : 0;
  12761. }
  12762. /**
  12763. * Converts `value` to an integer.
  12764. *
  12765. * **Note:** This method is loosely based on
  12766. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12767. *
  12768. * @static
  12769. * @memberOf _
  12770. * @since 4.0.0
  12771. * @category Lang
  12772. * @param {*} value The value to convert.
  12773. * @returns {number} Returns the converted integer.
  12774. * @example
  12775. *
  12776. * _.toInteger(3.2);
  12777. * // => 3
  12778. *
  12779. * _.toInteger(Number.MIN_VALUE);
  12780. * // => 0
  12781. *
  12782. * _.toInteger(Infinity);
  12783. * // => 1.7976931348623157e+308
  12784. *
  12785. * _.toInteger('3.2');
  12786. * // => 3
  12787. */
  12788. function toInteger(value) {
  12789. var result = toFinite(value),
  12790. remainder = result % 1;
  12791. return result === result ? (remainder ? result - remainder : result) : 0;
  12792. }
  12793. /**
  12794. * Converts `value` to an integer suitable for use as the length of an
  12795. * array-like object.
  12796. *
  12797. * **Note:** This method is based on
  12798. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12799. *
  12800. * @static
  12801. * @memberOf _
  12802. * @since 4.0.0
  12803. * @category Lang
  12804. * @param {*} value The value to convert.
  12805. * @returns {number} Returns the converted integer.
  12806. * @example
  12807. *
  12808. * _.toLength(3.2);
  12809. * // => 3
  12810. *
  12811. * _.toLength(Number.MIN_VALUE);
  12812. * // => 0
  12813. *
  12814. * _.toLength(Infinity);
  12815. * // => 4294967295
  12816. *
  12817. * _.toLength('3.2');
  12818. * // => 3
  12819. */
  12820. function toLength(value) {
  12821. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12822. }
  12823. /**
  12824. * Converts `value` to a number.
  12825. *
  12826. * @static
  12827. * @memberOf _
  12828. * @since 4.0.0
  12829. * @category Lang
  12830. * @param {*} value The value to process.
  12831. * @returns {number} Returns the number.
  12832. * @example
  12833. *
  12834. * _.toNumber(3.2);
  12835. * // => 3.2
  12836. *
  12837. * _.toNumber(Number.MIN_VALUE);
  12838. * // => 5e-324
  12839. *
  12840. * _.toNumber(Infinity);
  12841. * // => Infinity
  12842. *
  12843. * _.toNumber('3.2');
  12844. * // => 3.2
  12845. */
  12846. function toNumber(value) {
  12847. if (typeof value == 'number') {
  12848. return value;
  12849. }
  12850. if (isSymbol(value)) {
  12851. return NAN;
  12852. }
  12853. if (isObject(value)) {
  12854. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12855. value = isObject(other) ? (other + '') : other;
  12856. }
  12857. if (typeof value != 'string') {
  12858. return value === 0 ? value : +value;
  12859. }
  12860. value = value.replace(reTrim, '');
  12861. var isBinary = reIsBinary.test(value);
  12862. return (isBinary || reIsOctal.test(value))
  12863. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12864. : (reIsBadHex.test(value) ? NAN : +value);
  12865. }
  12866. /**
  12867. * Converts `value` to a plain object flattening inherited enumerable string
  12868. * keyed properties of `value` to own properties of the plain object.
  12869. *
  12870. * @static
  12871. * @memberOf _
  12872. * @since 3.0.0
  12873. * @category Lang
  12874. * @param {*} value The value to convert.
  12875. * @returns {Object} Returns the converted plain object.
  12876. * @example
  12877. *
  12878. * function Foo() {
  12879. * this.b = 2;
  12880. * }
  12881. *
  12882. * Foo.prototype.c = 3;
  12883. *
  12884. * _.assign({ 'a': 1 }, new Foo);
  12885. * // => { 'a': 1, 'b': 2 }
  12886. *
  12887. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12888. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12889. */
  12890. function toPlainObject(value) {
  12891. return copyObject(value, keysIn(value));
  12892. }
  12893. /**
  12894. * Converts `value` to a safe integer. A safe integer can be compared and
  12895. * represented correctly.
  12896. *
  12897. * @static
  12898. * @memberOf _
  12899. * @since 4.0.0
  12900. * @category Lang
  12901. * @param {*} value The value to convert.
  12902. * @returns {number} Returns the converted integer.
  12903. * @example
  12904. *
  12905. * _.toSafeInteger(3.2);
  12906. * // => 3
  12907. *
  12908. * _.toSafeInteger(Number.MIN_VALUE);
  12909. * // => 0
  12910. *
  12911. * _.toSafeInteger(Infinity);
  12912. * // => 9007199254740991
  12913. *
  12914. * _.toSafeInteger('3.2');
  12915. * // => 3
  12916. */
  12917. function toSafeInteger(value) {
  12918. return value
  12919. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12920. : (value === 0 ? value : 0);
  12921. }
  12922. /**
  12923. * Converts `value` to a string. An empty string is returned for `null`
  12924. * and `undefined` values. The sign of `-0` is preserved.
  12925. *
  12926. * @static
  12927. * @memberOf _
  12928. * @since 4.0.0
  12929. * @category Lang
  12930. * @param {*} value The value to convert.
  12931. * @returns {string} Returns the converted string.
  12932. * @example
  12933. *
  12934. * _.toString(null);
  12935. * // => ''
  12936. *
  12937. * _.toString(-0);
  12938. * // => '-0'
  12939. *
  12940. * _.toString([1, 2, 3]);
  12941. * // => '1,2,3'
  12942. */
  12943. function toString(value) {
  12944. return value == null ? '' : baseToString(value);
  12945. }
  12946. /*------------------------------------------------------------------------*/
  12947. /**
  12948. * Assigns own enumerable string keyed properties of source objects to the
  12949. * destination object. Source objects are applied from left to right.
  12950. * Subsequent sources overwrite property assignments of previous sources.
  12951. *
  12952. * **Note:** This method mutates `object` and is loosely based on
  12953. * [`Object.assign`](https://mdn.io/Object/assign).
  12954. *
  12955. * @static
  12956. * @memberOf _
  12957. * @since 0.10.0
  12958. * @category Object
  12959. * @param {Object} object The destination object.
  12960. * @param {...Object} [sources] The source objects.
  12961. * @returns {Object} Returns `object`.
  12962. * @see _.assignIn
  12963. * @example
  12964. *
  12965. * function Foo() {
  12966. * this.a = 1;
  12967. * }
  12968. *
  12969. * function Bar() {
  12970. * this.c = 3;
  12971. * }
  12972. *
  12973. * Foo.prototype.b = 2;
  12974. * Bar.prototype.d = 4;
  12975. *
  12976. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12977. * // => { 'a': 1, 'c': 3 }
  12978. */
  12979. var assign = createAssigner(function(object, source) {
  12980. if (isPrototype(source) || isArrayLike(source)) {
  12981. copyObject(source, keys(source), object);
  12982. return;
  12983. }
  12984. for (var key in source) {
  12985. if (hasOwnProperty.call(source, key)) {
  12986. assignValue(object, key, source[key]);
  12987. }
  12988. }
  12989. });
  12990. /**
  12991. * This method is like `_.assign` except that it iterates over own and
  12992. * inherited source properties.
  12993. *
  12994. * **Note:** This method mutates `object`.
  12995. *
  12996. * @static
  12997. * @memberOf _
  12998. * @since 4.0.0
  12999. * @alias extend
  13000. * @category Object
  13001. * @param {Object} object The destination object.
  13002. * @param {...Object} [sources] The source objects.
  13003. * @returns {Object} Returns `object`.
  13004. * @see _.assign
  13005. * @example
  13006. *
  13007. * function Foo() {
  13008. * this.a = 1;
  13009. * }
  13010. *
  13011. * function Bar() {
  13012. * this.c = 3;
  13013. * }
  13014. *
  13015. * Foo.prototype.b = 2;
  13016. * Bar.prototype.d = 4;
  13017. *
  13018. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13019. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13020. */
  13021. var assignIn = createAssigner(function(object, source) {
  13022. copyObject(source, keysIn(source), object);
  13023. });
  13024. /**
  13025. * This method is like `_.assignIn` except that it accepts `customizer`
  13026. * which is invoked to produce the assigned values. If `customizer` returns
  13027. * `undefined`, assignment is handled by the method instead. The `customizer`
  13028. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13029. *
  13030. * **Note:** This method mutates `object`.
  13031. *
  13032. * @static
  13033. * @memberOf _
  13034. * @since 4.0.0
  13035. * @alias extendWith
  13036. * @category Object
  13037. * @param {Object} object The destination object.
  13038. * @param {...Object} sources The source objects.
  13039. * @param {Function} [customizer] The function to customize assigned values.
  13040. * @returns {Object} Returns `object`.
  13041. * @see _.assignWith
  13042. * @example
  13043. *
  13044. * function customizer(objValue, srcValue) {
  13045. * return _.isUndefined(objValue) ? srcValue : objValue;
  13046. * }
  13047. *
  13048. * var defaults = _.partialRight(_.assignInWith, customizer);
  13049. *
  13050. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13051. * // => { 'a': 1, 'b': 2 }
  13052. */
  13053. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13054. copyObject(source, keysIn(source), object, customizer);
  13055. });
  13056. /**
  13057. * This method is like `_.assign` except that it accepts `customizer`
  13058. * which is invoked to produce the assigned values. If `customizer` returns
  13059. * `undefined`, assignment is handled by the method instead. The `customizer`
  13060. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13061. *
  13062. * **Note:** This method mutates `object`.
  13063. *
  13064. * @static
  13065. * @memberOf _
  13066. * @since 4.0.0
  13067. * @category Object
  13068. * @param {Object} object The destination object.
  13069. * @param {...Object} sources The source objects.
  13070. * @param {Function} [customizer] The function to customize assigned values.
  13071. * @returns {Object} Returns `object`.
  13072. * @see _.assignInWith
  13073. * @example
  13074. *
  13075. * function customizer(objValue, srcValue) {
  13076. * return _.isUndefined(objValue) ? srcValue : objValue;
  13077. * }
  13078. *
  13079. * var defaults = _.partialRight(_.assignWith, customizer);
  13080. *
  13081. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13082. * // => { 'a': 1, 'b': 2 }
  13083. */
  13084. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13085. copyObject(source, keys(source), object, customizer);
  13086. });
  13087. /**
  13088. * Creates an array of values corresponding to `paths` of `object`.
  13089. *
  13090. * @static
  13091. * @memberOf _
  13092. * @since 1.0.0
  13093. * @category Object
  13094. * @param {Object} object The object to iterate over.
  13095. * @param {...(string|string[])} [paths] The property paths to pick.
  13096. * @returns {Array} Returns the picked values.
  13097. * @example
  13098. *
  13099. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13100. *
  13101. * _.at(object, ['a[0].b.c', 'a[1]']);
  13102. * // => [3, 4]
  13103. */
  13104. var at = flatRest(baseAt);
  13105. /**
  13106. * Creates an object that inherits from the `prototype` object. If a
  13107. * `properties` object is given, its own enumerable string keyed properties
  13108. * are assigned to the created object.
  13109. *
  13110. * @static
  13111. * @memberOf _
  13112. * @since 2.3.0
  13113. * @category Object
  13114. * @param {Object} prototype The object to inherit from.
  13115. * @param {Object} [properties] The properties to assign to the object.
  13116. * @returns {Object} Returns the new object.
  13117. * @example
  13118. *
  13119. * function Shape() {
  13120. * this.x = 0;
  13121. * this.y = 0;
  13122. * }
  13123. *
  13124. * function Circle() {
  13125. * Shape.call(this);
  13126. * }
  13127. *
  13128. * Circle.prototype = _.create(Shape.prototype, {
  13129. * 'constructor': Circle
  13130. * });
  13131. *
  13132. * var circle = new Circle;
  13133. * circle instanceof Circle;
  13134. * // => true
  13135. *
  13136. * circle instanceof Shape;
  13137. * // => true
  13138. */
  13139. function create(prototype, properties) {
  13140. var result = baseCreate(prototype);
  13141. return properties == null ? result : baseAssign(result, properties);
  13142. }
  13143. /**
  13144. * Assigns own and inherited enumerable string keyed properties of source
  13145. * objects to the destination object for all destination properties that
  13146. * resolve to `undefined`. Source objects are applied from left to right.
  13147. * Once a property is set, additional values of the same property are ignored.
  13148. *
  13149. * **Note:** This method mutates `object`.
  13150. *
  13151. * @static
  13152. * @since 0.1.0
  13153. * @memberOf _
  13154. * @category Object
  13155. * @param {Object} object The destination object.
  13156. * @param {...Object} [sources] The source objects.
  13157. * @returns {Object} Returns `object`.
  13158. * @see _.defaultsDeep
  13159. * @example
  13160. *
  13161. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13162. * // => { 'a': 1, 'b': 2 }
  13163. */
  13164. var defaults = baseRest(function(object, sources) {
  13165. object = Object(object);
  13166. var index = -1;
  13167. var length = sources.length;
  13168. var guard = length > 2 ? sources[2] : undefined;
  13169. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13170. length = 1;
  13171. }
  13172. while (++index < length) {
  13173. var source = sources[index];
  13174. var props = keysIn(source);
  13175. var propsIndex = -1;
  13176. var propsLength = props.length;
  13177. while (++propsIndex < propsLength) {
  13178. var key = props[propsIndex];
  13179. var value = object[key];
  13180. if (value === undefined ||
  13181. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13182. object[key] = source[key];
  13183. }
  13184. }
  13185. }
  13186. return object;
  13187. });
  13188. /**
  13189. * This method is like `_.defaults` except that it recursively assigns
  13190. * default properties.
  13191. *
  13192. * **Note:** This method mutates `object`.
  13193. *
  13194. * @static
  13195. * @memberOf _
  13196. * @since 3.10.0
  13197. * @category Object
  13198. * @param {Object} object The destination object.
  13199. * @param {...Object} [sources] The source objects.
  13200. * @returns {Object} Returns `object`.
  13201. * @see _.defaults
  13202. * @example
  13203. *
  13204. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13205. * // => { 'a': { 'b': 2, 'c': 3 } }
  13206. */
  13207. var defaultsDeep = baseRest(function(args) {
  13208. args.push(undefined, customDefaultsMerge);
  13209. return apply(mergeWith, undefined, args);
  13210. });
  13211. /**
  13212. * This method is like `_.find` except that it returns the key of the first
  13213. * element `predicate` returns truthy for instead of the element itself.
  13214. *
  13215. * @static
  13216. * @memberOf _
  13217. * @since 1.1.0
  13218. * @category Object
  13219. * @param {Object} object The object to inspect.
  13220. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13221. * @returns {string|undefined} Returns the key of the matched element,
  13222. * else `undefined`.
  13223. * @example
  13224. *
  13225. * var users = {
  13226. * 'barney': { 'age': 36, 'active': true },
  13227. * 'fred': { 'age': 40, 'active': false },
  13228. * 'pebbles': { 'age': 1, 'active': true }
  13229. * };
  13230. *
  13231. * _.findKey(users, function(o) { return o.age < 40; });
  13232. * // => 'barney' (iteration order is not guaranteed)
  13233. *
  13234. * // The `_.matches` iteratee shorthand.
  13235. * _.findKey(users, { 'age': 1, 'active': true });
  13236. * // => 'pebbles'
  13237. *
  13238. * // The `_.matchesProperty` iteratee shorthand.
  13239. * _.findKey(users, ['active', false]);
  13240. * // => 'fred'
  13241. *
  13242. * // The `_.property` iteratee shorthand.
  13243. * _.findKey(users, 'active');
  13244. * // => 'barney'
  13245. */
  13246. function findKey(object, predicate) {
  13247. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13248. }
  13249. /**
  13250. * This method is like `_.findKey` except that it iterates over elements of
  13251. * a collection in the opposite order.
  13252. *
  13253. * @static
  13254. * @memberOf _
  13255. * @since 2.0.0
  13256. * @category Object
  13257. * @param {Object} object The object to inspect.
  13258. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13259. * @returns {string|undefined} Returns the key of the matched element,
  13260. * else `undefined`.
  13261. * @example
  13262. *
  13263. * var users = {
  13264. * 'barney': { 'age': 36, 'active': true },
  13265. * 'fred': { 'age': 40, 'active': false },
  13266. * 'pebbles': { 'age': 1, 'active': true }
  13267. * };
  13268. *
  13269. * _.findLastKey(users, function(o) { return o.age < 40; });
  13270. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13271. *
  13272. * // The `_.matches` iteratee shorthand.
  13273. * _.findLastKey(users, { 'age': 36, 'active': true });
  13274. * // => 'barney'
  13275. *
  13276. * // The `_.matchesProperty` iteratee shorthand.
  13277. * _.findLastKey(users, ['active', false]);
  13278. * // => 'fred'
  13279. *
  13280. * // The `_.property` iteratee shorthand.
  13281. * _.findLastKey(users, 'active');
  13282. * // => 'pebbles'
  13283. */
  13284. function findLastKey(object, predicate) {
  13285. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13286. }
  13287. /**
  13288. * Iterates over own and inherited enumerable string keyed properties of an
  13289. * object and invokes `iteratee` for each property. The iteratee is invoked
  13290. * with three arguments: (value, key, object). Iteratee functions may exit
  13291. * iteration early by explicitly returning `false`.
  13292. *
  13293. * @static
  13294. * @memberOf _
  13295. * @since 0.3.0
  13296. * @category Object
  13297. * @param {Object} object The object to iterate over.
  13298. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13299. * @returns {Object} Returns `object`.
  13300. * @see _.forInRight
  13301. * @example
  13302. *
  13303. * function Foo() {
  13304. * this.a = 1;
  13305. * this.b = 2;
  13306. * }
  13307. *
  13308. * Foo.prototype.c = 3;
  13309. *
  13310. * _.forIn(new Foo, function(value, key) {
  13311. * console.log(key);
  13312. * });
  13313. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13314. */
  13315. function forIn(object, iteratee) {
  13316. return object == null
  13317. ? object
  13318. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13319. }
  13320. /**
  13321. * This method is like `_.forIn` except that it iterates over properties of
  13322. * `object` in the opposite order.
  13323. *
  13324. * @static
  13325. * @memberOf _
  13326. * @since 2.0.0
  13327. * @category Object
  13328. * @param {Object} object The object to iterate over.
  13329. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13330. * @returns {Object} Returns `object`.
  13331. * @see _.forIn
  13332. * @example
  13333. *
  13334. * function Foo() {
  13335. * this.a = 1;
  13336. * this.b = 2;
  13337. * }
  13338. *
  13339. * Foo.prototype.c = 3;
  13340. *
  13341. * _.forInRight(new Foo, function(value, key) {
  13342. * console.log(key);
  13343. * });
  13344. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13345. */
  13346. function forInRight(object, iteratee) {
  13347. return object == null
  13348. ? object
  13349. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13350. }
  13351. /**
  13352. * Iterates over own enumerable string keyed properties of an object and
  13353. * invokes `iteratee` for each property. The iteratee is invoked with three
  13354. * arguments: (value, key, object). Iteratee functions may exit iteration
  13355. * early by explicitly returning `false`.
  13356. *
  13357. * @static
  13358. * @memberOf _
  13359. * @since 0.3.0
  13360. * @category Object
  13361. * @param {Object} object The object to iterate over.
  13362. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13363. * @returns {Object} Returns `object`.
  13364. * @see _.forOwnRight
  13365. * @example
  13366. *
  13367. * function Foo() {
  13368. * this.a = 1;
  13369. * this.b = 2;
  13370. * }
  13371. *
  13372. * Foo.prototype.c = 3;
  13373. *
  13374. * _.forOwn(new Foo, function(value, key) {
  13375. * console.log(key);
  13376. * });
  13377. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13378. */
  13379. function forOwn(object, iteratee) {
  13380. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13381. }
  13382. /**
  13383. * This method is like `_.forOwn` except that it iterates over properties of
  13384. * `object` in the opposite order.
  13385. *
  13386. * @static
  13387. * @memberOf _
  13388. * @since 2.0.0
  13389. * @category Object
  13390. * @param {Object} object The object to iterate over.
  13391. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13392. * @returns {Object} Returns `object`.
  13393. * @see _.forOwn
  13394. * @example
  13395. *
  13396. * function Foo() {
  13397. * this.a = 1;
  13398. * this.b = 2;
  13399. * }
  13400. *
  13401. * Foo.prototype.c = 3;
  13402. *
  13403. * _.forOwnRight(new Foo, function(value, key) {
  13404. * console.log(key);
  13405. * });
  13406. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13407. */
  13408. function forOwnRight(object, iteratee) {
  13409. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13410. }
  13411. /**
  13412. * Creates an array of function property names from own enumerable properties
  13413. * of `object`.
  13414. *
  13415. * @static
  13416. * @since 0.1.0
  13417. * @memberOf _
  13418. * @category Object
  13419. * @param {Object} object The object to inspect.
  13420. * @returns {Array} Returns the function names.
  13421. * @see _.functionsIn
  13422. * @example
  13423. *
  13424. * function Foo() {
  13425. * this.a = _.constant('a');
  13426. * this.b = _.constant('b');
  13427. * }
  13428. *
  13429. * Foo.prototype.c = _.constant('c');
  13430. *
  13431. * _.functions(new Foo);
  13432. * // => ['a', 'b']
  13433. */
  13434. function functions(object) {
  13435. return object == null ? [] : baseFunctions(object, keys(object));
  13436. }
  13437. /**
  13438. * Creates an array of function property names from own and inherited
  13439. * enumerable properties of `object`.
  13440. *
  13441. * @static
  13442. * @memberOf _
  13443. * @since 4.0.0
  13444. * @category Object
  13445. * @param {Object} object The object to inspect.
  13446. * @returns {Array} Returns the function names.
  13447. * @see _.functions
  13448. * @example
  13449. *
  13450. * function Foo() {
  13451. * this.a = _.constant('a');
  13452. * this.b = _.constant('b');
  13453. * }
  13454. *
  13455. * Foo.prototype.c = _.constant('c');
  13456. *
  13457. * _.functionsIn(new Foo);
  13458. * // => ['a', 'b', 'c']
  13459. */
  13460. function functionsIn(object) {
  13461. return object == null ? [] : baseFunctions(object, keysIn(object));
  13462. }
  13463. /**
  13464. * Gets the value at `path` of `object`. If the resolved value is
  13465. * `undefined`, the `defaultValue` is returned in its place.
  13466. *
  13467. * @static
  13468. * @memberOf _
  13469. * @since 3.7.0
  13470. * @category Object
  13471. * @param {Object} object The object to query.
  13472. * @param {Array|string} path The path of the property to get.
  13473. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13474. * @returns {*} Returns the resolved value.
  13475. * @example
  13476. *
  13477. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13478. *
  13479. * _.get(object, 'a[0].b.c');
  13480. * // => 3
  13481. *
  13482. * _.get(object, ['a', '0', 'b', 'c']);
  13483. * // => 3
  13484. *
  13485. * _.get(object, 'a.b.c', 'default');
  13486. * // => 'default'
  13487. */
  13488. function get(object, path, defaultValue) {
  13489. var result = object == null ? undefined : baseGet(object, path);
  13490. return result === undefined ? defaultValue : result;
  13491. }
  13492. /**
  13493. * Checks if `path` is a direct property of `object`.
  13494. *
  13495. * @static
  13496. * @since 0.1.0
  13497. * @memberOf _
  13498. * @category Object
  13499. * @param {Object} object The object to query.
  13500. * @param {Array|string} path The path to check.
  13501. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13502. * @example
  13503. *
  13504. * var object = { 'a': { 'b': 2 } };
  13505. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13506. *
  13507. * _.has(object, 'a');
  13508. * // => true
  13509. *
  13510. * _.has(object, 'a.b');
  13511. * // => true
  13512. *
  13513. * _.has(object, ['a', 'b']);
  13514. * // => true
  13515. *
  13516. * _.has(other, 'a');
  13517. * // => false
  13518. */
  13519. function has(object, path) {
  13520. return object != null && hasPath(object, path, baseHas);
  13521. }
  13522. /**
  13523. * Checks if `path` is a direct or inherited property of `object`.
  13524. *
  13525. * @static
  13526. * @memberOf _
  13527. * @since 4.0.0
  13528. * @category Object
  13529. * @param {Object} object The object to query.
  13530. * @param {Array|string} path The path to check.
  13531. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13532. * @example
  13533. *
  13534. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13535. *
  13536. * _.hasIn(object, 'a');
  13537. * // => true
  13538. *
  13539. * _.hasIn(object, 'a.b');
  13540. * // => true
  13541. *
  13542. * _.hasIn(object, ['a', 'b']);
  13543. * // => true
  13544. *
  13545. * _.hasIn(object, 'b');
  13546. * // => false
  13547. */
  13548. function hasIn(object, path) {
  13549. return object != null && hasPath(object, path, baseHasIn);
  13550. }
  13551. /**
  13552. * Creates an object composed of the inverted keys and values of `object`.
  13553. * If `object` contains duplicate values, subsequent values overwrite
  13554. * property assignments of previous values.
  13555. *
  13556. * @static
  13557. * @memberOf _
  13558. * @since 0.7.0
  13559. * @category Object
  13560. * @param {Object} object The object to invert.
  13561. * @returns {Object} Returns the new inverted object.
  13562. * @example
  13563. *
  13564. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13565. *
  13566. * _.invert(object);
  13567. * // => { '1': 'c', '2': 'b' }
  13568. */
  13569. var invert = createInverter(function(result, value, key) {
  13570. if (value != null &&
  13571. typeof value.toString != 'function') {
  13572. value = nativeObjectToString.call(value);
  13573. }
  13574. result[value] = key;
  13575. }, constant(identity));
  13576. /**
  13577. * This method is like `_.invert` except that the inverted object is generated
  13578. * from the results of running each element of `object` thru `iteratee`. The
  13579. * corresponding inverted value of each inverted key is an array of keys
  13580. * responsible for generating the inverted value. The iteratee is invoked
  13581. * with one argument: (value).
  13582. *
  13583. * @static
  13584. * @memberOf _
  13585. * @since 4.1.0
  13586. * @category Object
  13587. * @param {Object} object The object to invert.
  13588. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13589. * @returns {Object} Returns the new inverted object.
  13590. * @example
  13591. *
  13592. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13593. *
  13594. * _.invertBy(object);
  13595. * // => { '1': ['a', 'c'], '2': ['b'] }
  13596. *
  13597. * _.invertBy(object, function(value) {
  13598. * return 'group' + value;
  13599. * });
  13600. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13601. */
  13602. var invertBy = createInverter(function(result, value, key) {
  13603. if (value != null &&
  13604. typeof value.toString != 'function') {
  13605. value = nativeObjectToString.call(value);
  13606. }
  13607. if (hasOwnProperty.call(result, value)) {
  13608. result[value].push(key);
  13609. } else {
  13610. result[value] = [key];
  13611. }
  13612. }, getIteratee);
  13613. /**
  13614. * Invokes the method at `path` of `object`.
  13615. *
  13616. * @static
  13617. * @memberOf _
  13618. * @since 4.0.0
  13619. * @category Object
  13620. * @param {Object} object The object to query.
  13621. * @param {Array|string} path The path of the method to invoke.
  13622. * @param {...*} [args] The arguments to invoke the method with.
  13623. * @returns {*} Returns the result of the invoked method.
  13624. * @example
  13625. *
  13626. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13627. *
  13628. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13629. * // => [2, 3]
  13630. */
  13631. var invoke = baseRest(baseInvoke);
  13632. /**
  13633. * Creates an array of the own enumerable property names of `object`.
  13634. *
  13635. * **Note:** Non-object values are coerced to objects. See the
  13636. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13637. * for more details.
  13638. *
  13639. * @static
  13640. * @since 0.1.0
  13641. * @memberOf _
  13642. * @category Object
  13643. * @param {Object} object The object to query.
  13644. * @returns {Array} Returns the array of property names.
  13645. * @example
  13646. *
  13647. * function Foo() {
  13648. * this.a = 1;
  13649. * this.b = 2;
  13650. * }
  13651. *
  13652. * Foo.prototype.c = 3;
  13653. *
  13654. * _.keys(new Foo);
  13655. * // => ['a', 'b'] (iteration order is not guaranteed)
  13656. *
  13657. * _.keys('hi');
  13658. * // => ['0', '1']
  13659. */
  13660. function keys(object) {
  13661. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13662. }
  13663. /**
  13664. * Creates an array of the own and inherited enumerable property names of `object`.
  13665. *
  13666. * **Note:** Non-object values are coerced to objects.
  13667. *
  13668. * @static
  13669. * @memberOf _
  13670. * @since 3.0.0
  13671. * @category Object
  13672. * @param {Object} object The object to query.
  13673. * @returns {Array} Returns the array of property names.
  13674. * @example
  13675. *
  13676. * function Foo() {
  13677. * this.a = 1;
  13678. * this.b = 2;
  13679. * }
  13680. *
  13681. * Foo.prototype.c = 3;
  13682. *
  13683. * _.keysIn(new Foo);
  13684. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13685. */
  13686. function keysIn(object) {
  13687. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13688. }
  13689. /**
  13690. * The opposite of `_.mapValues`; this method creates an object with the
  13691. * same values as `object` and keys generated by running each own enumerable
  13692. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13693. * with three arguments: (value, key, object).
  13694. *
  13695. * @static
  13696. * @memberOf _
  13697. * @since 3.8.0
  13698. * @category Object
  13699. * @param {Object} object The object to iterate over.
  13700. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13701. * @returns {Object} Returns the new mapped object.
  13702. * @see _.mapValues
  13703. * @example
  13704. *
  13705. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13706. * return key + value;
  13707. * });
  13708. * // => { 'a1': 1, 'b2': 2 }
  13709. */
  13710. function mapKeys(object, iteratee) {
  13711. var result = {};
  13712. iteratee = getIteratee(iteratee, 3);
  13713. baseForOwn(object, function(value, key, object) {
  13714. baseAssignValue(result, iteratee(value, key, object), value);
  13715. });
  13716. return result;
  13717. }
  13718. /**
  13719. * Creates an object with the same keys as `object` and values generated
  13720. * by running each own enumerable string keyed property of `object` thru
  13721. * `iteratee`. The iteratee is invoked with three arguments:
  13722. * (value, key, object).
  13723. *
  13724. * @static
  13725. * @memberOf _
  13726. * @since 2.4.0
  13727. * @category Object
  13728. * @param {Object} object The object to iterate over.
  13729. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13730. * @returns {Object} Returns the new mapped object.
  13731. * @see _.mapKeys
  13732. * @example
  13733. *
  13734. * var users = {
  13735. * 'fred': { 'user': 'fred', 'age': 40 },
  13736. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13737. * };
  13738. *
  13739. * _.mapValues(users, function(o) { return o.age; });
  13740. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13741. *
  13742. * // The `_.property` iteratee shorthand.
  13743. * _.mapValues(users, 'age');
  13744. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13745. */
  13746. function mapValues(object, iteratee) {
  13747. var result = {};
  13748. iteratee = getIteratee(iteratee, 3);
  13749. baseForOwn(object, function(value, key, object) {
  13750. baseAssignValue(result, key, iteratee(value, key, object));
  13751. });
  13752. return result;
  13753. }
  13754. /**
  13755. * This method is like `_.assign` except that it recursively merges own and
  13756. * inherited enumerable string keyed properties of source objects into the
  13757. * destination object. Source properties that resolve to `undefined` are
  13758. * skipped if a destination value exists. Array and plain object properties
  13759. * are merged recursively. Other objects and value types are overridden by
  13760. * assignment. Source objects are applied from left to right. Subsequent
  13761. * sources overwrite property assignments of previous sources.
  13762. *
  13763. * **Note:** This method mutates `object`.
  13764. *
  13765. * @static
  13766. * @memberOf _
  13767. * @since 0.5.0
  13768. * @category Object
  13769. * @param {Object} object The destination object.
  13770. * @param {...Object} [sources] The source objects.
  13771. * @returns {Object} Returns `object`.
  13772. * @example
  13773. *
  13774. * var object = {
  13775. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13776. * };
  13777. *
  13778. * var other = {
  13779. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13780. * };
  13781. *
  13782. * _.merge(object, other);
  13783. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13784. */
  13785. var merge = createAssigner(function(object, source, srcIndex) {
  13786. baseMerge(object, source, srcIndex);
  13787. });
  13788. /**
  13789. * This method is like `_.merge` except that it accepts `customizer` which
  13790. * is invoked to produce the merged values of the destination and source
  13791. * properties. If `customizer` returns `undefined`, merging is handled by the
  13792. * method instead. The `customizer` is invoked with six arguments:
  13793. * (objValue, srcValue, key, object, source, stack).
  13794. *
  13795. * **Note:** This method mutates `object`.
  13796. *
  13797. * @static
  13798. * @memberOf _
  13799. * @since 4.0.0
  13800. * @category Object
  13801. * @param {Object} object The destination object.
  13802. * @param {...Object} sources The source objects.
  13803. * @param {Function} customizer The function to customize assigned values.
  13804. * @returns {Object} Returns `object`.
  13805. * @example
  13806. *
  13807. * function customizer(objValue, srcValue) {
  13808. * if (_.isArray(objValue)) {
  13809. * return objValue.concat(srcValue);
  13810. * }
  13811. * }
  13812. *
  13813. * var object = { 'a': [1], 'b': [2] };
  13814. * var other = { 'a': [3], 'b': [4] };
  13815. *
  13816. * _.mergeWith(object, other, customizer);
  13817. * // => { 'a': [1, 3], 'b': [2, 4] }
  13818. */
  13819. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13820. baseMerge(object, source, srcIndex, customizer);
  13821. });
  13822. /**
  13823. * The opposite of `_.pick`; this method creates an object composed of the
  13824. * own and inherited enumerable property paths of `object` that are not omitted.
  13825. *
  13826. * **Note:** This method is considerably slower than `_.pick`.
  13827. *
  13828. * @static
  13829. * @since 0.1.0
  13830. * @memberOf _
  13831. * @category Object
  13832. * @param {Object} object The source object.
  13833. * @param {...(string|string[])} [paths] The property paths to omit.
  13834. * @returns {Object} Returns the new object.
  13835. * @example
  13836. *
  13837. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13838. *
  13839. * _.omit(object, ['a', 'c']);
  13840. * // => { 'b': '2' }
  13841. */
  13842. var omit = flatRest(function(object, paths) {
  13843. var result = {};
  13844. if (object == null) {
  13845. return result;
  13846. }
  13847. var isDeep = false;
  13848. paths = arrayMap(paths, function(path) {
  13849. path = castPath(path, object);
  13850. isDeep || (isDeep = path.length > 1);
  13851. return path;
  13852. });
  13853. copyObject(object, getAllKeysIn(object), result);
  13854. if (isDeep) {
  13855. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13856. }
  13857. var length = paths.length;
  13858. while (length--) {
  13859. baseUnset(result, paths[length]);
  13860. }
  13861. return result;
  13862. });
  13863. /**
  13864. * The opposite of `_.pickBy`; this method creates an object composed of
  13865. * the own and inherited enumerable string keyed properties of `object` that
  13866. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13867. * arguments: (value, key).
  13868. *
  13869. * @static
  13870. * @memberOf _
  13871. * @since 4.0.0
  13872. * @category Object
  13873. * @param {Object} object The source object.
  13874. * @param {Function} [predicate=_.identity] The function invoked per property.
  13875. * @returns {Object} Returns the new object.
  13876. * @example
  13877. *
  13878. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13879. *
  13880. * _.omitBy(object, _.isNumber);
  13881. * // => { 'b': '2' }
  13882. */
  13883. function omitBy(object, predicate) {
  13884. return pickBy(object, negate(getIteratee(predicate)));
  13885. }
  13886. /**
  13887. * Creates an object composed of the picked `object` properties.
  13888. *
  13889. * @static
  13890. * @since 0.1.0
  13891. * @memberOf _
  13892. * @category Object
  13893. * @param {Object} object The source object.
  13894. * @param {...(string|string[])} [paths] The property paths to pick.
  13895. * @returns {Object} Returns the new object.
  13896. * @example
  13897. *
  13898. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13899. *
  13900. * _.pick(object, ['a', 'c']);
  13901. * // => { 'a': 1, 'c': 3 }
  13902. */
  13903. var pick = flatRest(function(object, paths) {
  13904. return object == null ? {} : basePick(object, paths);
  13905. });
  13906. /**
  13907. * Creates an object composed of the `object` properties `predicate` returns
  13908. * truthy for. The predicate is invoked with two arguments: (value, key).
  13909. *
  13910. * @static
  13911. * @memberOf _
  13912. * @since 4.0.0
  13913. * @category Object
  13914. * @param {Object} object The source object.
  13915. * @param {Function} [predicate=_.identity] The function invoked per property.
  13916. * @returns {Object} Returns the new object.
  13917. * @example
  13918. *
  13919. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13920. *
  13921. * _.pickBy(object, _.isNumber);
  13922. * // => { 'a': 1, 'c': 3 }
  13923. */
  13924. function pickBy(object, predicate) {
  13925. if (object == null) {
  13926. return {};
  13927. }
  13928. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13929. return [prop];
  13930. });
  13931. predicate = getIteratee(predicate);
  13932. return basePickBy(object, props, function(value, path) {
  13933. return predicate(value, path[0]);
  13934. });
  13935. }
  13936. /**
  13937. * This method is like `_.get` except that if the resolved value is a
  13938. * function it's invoked with the `this` binding of its parent object and
  13939. * its result is returned.
  13940. *
  13941. * @static
  13942. * @since 0.1.0
  13943. * @memberOf _
  13944. * @category Object
  13945. * @param {Object} object The object to query.
  13946. * @param {Array|string} path The path of the property to resolve.
  13947. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13948. * @returns {*} Returns the resolved value.
  13949. * @example
  13950. *
  13951. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13952. *
  13953. * _.result(object, 'a[0].b.c1');
  13954. * // => 3
  13955. *
  13956. * _.result(object, 'a[0].b.c2');
  13957. * // => 4
  13958. *
  13959. * _.result(object, 'a[0].b.c3', 'default');
  13960. * // => 'default'
  13961. *
  13962. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13963. * // => 'default'
  13964. */
  13965. function result(object, path, defaultValue) {
  13966. path = castPath(path, object);
  13967. var index = -1,
  13968. length = path.length;
  13969. // Ensure the loop is entered when path is empty.
  13970. if (!length) {
  13971. length = 1;
  13972. object = undefined;
  13973. }
  13974. while (++index < length) {
  13975. var value = object == null ? undefined : object[toKey(path[index])];
  13976. if (value === undefined) {
  13977. index = length;
  13978. value = defaultValue;
  13979. }
  13980. object = isFunction(value) ? value.call(object) : value;
  13981. }
  13982. return object;
  13983. }
  13984. /**
  13985. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13986. * it's created. Arrays are created for missing index properties while objects
  13987. * are created for all other missing properties. Use `_.setWith` to customize
  13988. * `path` creation.
  13989. *
  13990. * **Note:** This method mutates `object`.
  13991. *
  13992. * @static
  13993. * @memberOf _
  13994. * @since 3.7.0
  13995. * @category Object
  13996. * @param {Object} object The object to modify.
  13997. * @param {Array|string} path The path of the property to set.
  13998. * @param {*} value The value to set.
  13999. * @returns {Object} Returns `object`.
  14000. * @example
  14001. *
  14002. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14003. *
  14004. * _.set(object, 'a[0].b.c', 4);
  14005. * console.log(object.a[0].b.c);
  14006. * // => 4
  14007. *
  14008. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14009. * console.log(object.x[0].y.z);
  14010. * // => 5
  14011. */
  14012. function set(object, path, value) {
  14013. return object == null ? object : baseSet(object, path, value);
  14014. }
  14015. /**
  14016. * This method is like `_.set` except that it accepts `customizer` which is
  14017. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14018. * path creation is handled by the method instead. The `customizer` is invoked
  14019. * with three arguments: (nsValue, key, nsObject).
  14020. *
  14021. * **Note:** This method mutates `object`.
  14022. *
  14023. * @static
  14024. * @memberOf _
  14025. * @since 4.0.0
  14026. * @category Object
  14027. * @param {Object} object The object to modify.
  14028. * @param {Array|string} path The path of the property to set.
  14029. * @param {*} value The value to set.
  14030. * @param {Function} [customizer] The function to customize assigned values.
  14031. * @returns {Object} Returns `object`.
  14032. * @example
  14033. *
  14034. * var object = {};
  14035. *
  14036. * _.setWith(object, '[0][1]', 'a', Object);
  14037. * // => { '0': { '1': 'a' } }
  14038. */
  14039. function setWith(object, path, value, customizer) {
  14040. customizer = typeof customizer == 'function' ? customizer : undefined;
  14041. return object == null ? object : baseSet(object, path, value, customizer);
  14042. }
  14043. /**
  14044. * Creates an array of own enumerable string keyed-value pairs for `object`
  14045. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14046. * entries are returned.
  14047. *
  14048. * @static
  14049. * @memberOf _
  14050. * @since 4.0.0
  14051. * @alias entries
  14052. * @category Object
  14053. * @param {Object} object The object to query.
  14054. * @returns {Array} Returns the key-value pairs.
  14055. * @example
  14056. *
  14057. * function Foo() {
  14058. * this.a = 1;
  14059. * this.b = 2;
  14060. * }
  14061. *
  14062. * Foo.prototype.c = 3;
  14063. *
  14064. * _.toPairs(new Foo);
  14065. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14066. */
  14067. var toPairs = createToPairs(keys);
  14068. /**
  14069. * Creates an array of own and inherited enumerable string keyed-value pairs
  14070. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14071. * or set, its entries are returned.
  14072. *
  14073. * @static
  14074. * @memberOf _
  14075. * @since 4.0.0
  14076. * @alias entriesIn
  14077. * @category Object
  14078. * @param {Object} object The object to query.
  14079. * @returns {Array} Returns the key-value pairs.
  14080. * @example
  14081. *
  14082. * function Foo() {
  14083. * this.a = 1;
  14084. * this.b = 2;
  14085. * }
  14086. *
  14087. * Foo.prototype.c = 3;
  14088. *
  14089. * _.toPairsIn(new Foo);
  14090. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14091. */
  14092. var toPairsIn = createToPairs(keysIn);
  14093. /**
  14094. * An alternative to `_.reduce`; this method transforms `object` to a new
  14095. * `accumulator` object which is the result of running each of its own
  14096. * enumerable string keyed properties thru `iteratee`, with each invocation
  14097. * potentially mutating the `accumulator` object. If `accumulator` is not
  14098. * provided, a new object with the same `[[Prototype]]` will be used. The
  14099. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14100. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14101. *
  14102. * @static
  14103. * @memberOf _
  14104. * @since 1.3.0
  14105. * @category Object
  14106. * @param {Object} object The object to iterate over.
  14107. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14108. * @param {*} [accumulator] The custom accumulator value.
  14109. * @returns {*} Returns the accumulated value.
  14110. * @example
  14111. *
  14112. * _.transform([2, 3, 4], function(result, n) {
  14113. * result.push(n *= n);
  14114. * return n % 2 == 0;
  14115. * }, []);
  14116. * // => [4, 9]
  14117. *
  14118. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14119. * (result[value] || (result[value] = [])).push(key);
  14120. * }, {});
  14121. * // => { '1': ['a', 'c'], '2': ['b'] }
  14122. */
  14123. function transform(object, iteratee, accumulator) {
  14124. var isArr = isArray(object),
  14125. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14126. iteratee = getIteratee(iteratee, 4);
  14127. if (accumulator == null) {
  14128. var Ctor = object && object.constructor;
  14129. if (isArrLike) {
  14130. accumulator = isArr ? new Ctor : [];
  14131. }
  14132. else if (isObject(object)) {
  14133. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14134. }
  14135. else {
  14136. accumulator = {};
  14137. }
  14138. }
  14139. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14140. return iteratee(accumulator, value, index, object);
  14141. });
  14142. return accumulator;
  14143. }
  14144. /**
  14145. * Removes the property at `path` of `object`.
  14146. *
  14147. * **Note:** This method mutates `object`.
  14148. *
  14149. * @static
  14150. * @memberOf _
  14151. * @since 4.0.0
  14152. * @category Object
  14153. * @param {Object} object The object to modify.
  14154. * @param {Array|string} path The path of the property to unset.
  14155. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14156. * @example
  14157. *
  14158. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14159. * _.unset(object, 'a[0].b.c');
  14160. * // => true
  14161. *
  14162. * console.log(object);
  14163. * // => { 'a': [{ 'b': {} }] };
  14164. *
  14165. * _.unset(object, ['a', '0', 'b', 'c']);
  14166. * // => true
  14167. *
  14168. * console.log(object);
  14169. * // => { 'a': [{ 'b': {} }] };
  14170. */
  14171. function unset(object, path) {
  14172. return object == null ? true : baseUnset(object, path);
  14173. }
  14174. /**
  14175. * This method is like `_.set` except that accepts `updater` to produce the
  14176. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14177. * is invoked with one argument: (value).
  14178. *
  14179. * **Note:** This method mutates `object`.
  14180. *
  14181. * @static
  14182. * @memberOf _
  14183. * @since 4.6.0
  14184. * @category Object
  14185. * @param {Object} object The object to modify.
  14186. * @param {Array|string} path The path of the property to set.
  14187. * @param {Function} updater The function to produce the updated value.
  14188. * @returns {Object} Returns `object`.
  14189. * @example
  14190. *
  14191. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14192. *
  14193. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14194. * console.log(object.a[0].b.c);
  14195. * // => 9
  14196. *
  14197. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14198. * console.log(object.x[0].y.z);
  14199. * // => 0
  14200. */
  14201. function update(object, path, updater) {
  14202. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14203. }
  14204. /**
  14205. * This method is like `_.update` except that it accepts `customizer` which is
  14206. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14207. * path creation is handled by the method instead. The `customizer` is invoked
  14208. * with three arguments: (nsValue, key, nsObject).
  14209. *
  14210. * **Note:** This method mutates `object`.
  14211. *
  14212. * @static
  14213. * @memberOf _
  14214. * @since 4.6.0
  14215. * @category Object
  14216. * @param {Object} object The object to modify.
  14217. * @param {Array|string} path The path of the property to set.
  14218. * @param {Function} updater The function to produce the updated value.
  14219. * @param {Function} [customizer] The function to customize assigned values.
  14220. * @returns {Object} Returns `object`.
  14221. * @example
  14222. *
  14223. * var object = {};
  14224. *
  14225. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14226. * // => { '0': { '1': 'a' } }
  14227. */
  14228. function updateWith(object, path, updater, customizer) {
  14229. customizer = typeof customizer == 'function' ? customizer : undefined;
  14230. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14231. }
  14232. /**
  14233. * Creates an array of the own enumerable string keyed property values of `object`.
  14234. *
  14235. * **Note:** Non-object values are coerced to objects.
  14236. *
  14237. * @static
  14238. * @since 0.1.0
  14239. * @memberOf _
  14240. * @category Object
  14241. * @param {Object} object The object to query.
  14242. * @returns {Array} Returns the array of property values.
  14243. * @example
  14244. *
  14245. * function Foo() {
  14246. * this.a = 1;
  14247. * this.b = 2;
  14248. * }
  14249. *
  14250. * Foo.prototype.c = 3;
  14251. *
  14252. * _.values(new Foo);
  14253. * // => [1, 2] (iteration order is not guaranteed)
  14254. *
  14255. * _.values('hi');
  14256. * // => ['h', 'i']
  14257. */
  14258. function values(object) {
  14259. return object == null ? [] : baseValues(object, keys(object));
  14260. }
  14261. /**
  14262. * Creates an array of the own and inherited enumerable string keyed property
  14263. * values of `object`.
  14264. *
  14265. * **Note:** Non-object values are coerced to objects.
  14266. *
  14267. * @static
  14268. * @memberOf _
  14269. * @since 3.0.0
  14270. * @category Object
  14271. * @param {Object} object The object to query.
  14272. * @returns {Array} Returns the array of property values.
  14273. * @example
  14274. *
  14275. * function Foo() {
  14276. * this.a = 1;
  14277. * this.b = 2;
  14278. * }
  14279. *
  14280. * Foo.prototype.c = 3;
  14281. *
  14282. * _.valuesIn(new Foo);
  14283. * // => [1, 2, 3] (iteration order is not guaranteed)
  14284. */
  14285. function valuesIn(object) {
  14286. return object == null ? [] : baseValues(object, keysIn(object));
  14287. }
  14288. /*------------------------------------------------------------------------*/
  14289. /**
  14290. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14291. *
  14292. * @static
  14293. * @memberOf _
  14294. * @since 4.0.0
  14295. * @category Number
  14296. * @param {number} number The number to clamp.
  14297. * @param {number} [lower] The lower bound.
  14298. * @param {number} upper The upper bound.
  14299. * @returns {number} Returns the clamped number.
  14300. * @example
  14301. *
  14302. * _.clamp(-10, -5, 5);
  14303. * // => -5
  14304. *
  14305. * _.clamp(10, -5, 5);
  14306. * // => 5
  14307. */
  14308. function clamp(number, lower, upper) {
  14309. if (upper === undefined) {
  14310. upper = lower;
  14311. lower = undefined;
  14312. }
  14313. if (upper !== undefined) {
  14314. upper = toNumber(upper);
  14315. upper = upper === upper ? upper : 0;
  14316. }
  14317. if (lower !== undefined) {
  14318. lower = toNumber(lower);
  14319. lower = lower === lower ? lower : 0;
  14320. }
  14321. return baseClamp(toNumber(number), lower, upper);
  14322. }
  14323. /**
  14324. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14325. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14326. * If `start` is greater than `end` the params are swapped to support
  14327. * negative ranges.
  14328. *
  14329. * @static
  14330. * @memberOf _
  14331. * @since 3.3.0
  14332. * @category Number
  14333. * @param {number} number The number to check.
  14334. * @param {number} [start=0] The start of the range.
  14335. * @param {number} end The end of the range.
  14336. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14337. * @see _.range, _.rangeRight
  14338. * @example
  14339. *
  14340. * _.inRange(3, 2, 4);
  14341. * // => true
  14342. *
  14343. * _.inRange(4, 8);
  14344. * // => true
  14345. *
  14346. * _.inRange(4, 2);
  14347. * // => false
  14348. *
  14349. * _.inRange(2, 2);
  14350. * // => false
  14351. *
  14352. * _.inRange(1.2, 2);
  14353. * // => true
  14354. *
  14355. * _.inRange(5.2, 4);
  14356. * // => false
  14357. *
  14358. * _.inRange(-3, -2, -6);
  14359. * // => true
  14360. */
  14361. function inRange(number, start, end) {
  14362. start = toFinite(start);
  14363. if (end === undefined) {
  14364. end = start;
  14365. start = 0;
  14366. } else {
  14367. end = toFinite(end);
  14368. }
  14369. number = toNumber(number);
  14370. return baseInRange(number, start, end);
  14371. }
  14372. /**
  14373. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14374. * If only one argument is provided a number between `0` and the given number
  14375. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14376. * floats, a floating-point number is returned instead of an integer.
  14377. *
  14378. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14379. * floating-point values which can produce unexpected results.
  14380. *
  14381. * @static
  14382. * @memberOf _
  14383. * @since 0.7.0
  14384. * @category Number
  14385. * @param {number} [lower=0] The lower bound.
  14386. * @param {number} [upper=1] The upper bound.
  14387. * @param {boolean} [floating] Specify returning a floating-point number.
  14388. * @returns {number} Returns the random number.
  14389. * @example
  14390. *
  14391. * _.random(0, 5);
  14392. * // => an integer between 0 and 5
  14393. *
  14394. * _.random(5);
  14395. * // => also an integer between 0 and 5
  14396. *
  14397. * _.random(5, true);
  14398. * // => a floating-point number between 0 and 5
  14399. *
  14400. * _.random(1.2, 5.2);
  14401. * // => a floating-point number between 1.2 and 5.2
  14402. */
  14403. function random(lower, upper, floating) {
  14404. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14405. upper = floating = undefined;
  14406. }
  14407. if (floating === undefined) {
  14408. if (typeof upper == 'boolean') {
  14409. floating = upper;
  14410. upper = undefined;
  14411. }
  14412. else if (typeof lower == 'boolean') {
  14413. floating = lower;
  14414. lower = undefined;
  14415. }
  14416. }
  14417. if (lower === undefined && upper === undefined) {
  14418. lower = 0;
  14419. upper = 1;
  14420. }
  14421. else {
  14422. lower = toFinite(lower);
  14423. if (upper === undefined) {
  14424. upper = lower;
  14425. lower = 0;
  14426. } else {
  14427. upper = toFinite(upper);
  14428. }
  14429. }
  14430. if (lower > upper) {
  14431. var temp = lower;
  14432. lower = upper;
  14433. upper = temp;
  14434. }
  14435. if (floating || lower % 1 || upper % 1) {
  14436. var rand = nativeRandom();
  14437. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14438. }
  14439. return baseRandom(lower, upper);
  14440. }
  14441. /*------------------------------------------------------------------------*/
  14442. /**
  14443. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14444. *
  14445. * @static
  14446. * @memberOf _
  14447. * @since 3.0.0
  14448. * @category String
  14449. * @param {string} [string=''] The string to convert.
  14450. * @returns {string} Returns the camel cased string.
  14451. * @example
  14452. *
  14453. * _.camelCase('Foo Bar');
  14454. * // => 'fooBar'
  14455. *
  14456. * _.camelCase('--foo-bar--');
  14457. * // => 'fooBar'
  14458. *
  14459. * _.camelCase('__FOO_BAR__');
  14460. * // => 'fooBar'
  14461. */
  14462. var camelCase = createCompounder(function(result, word, index) {
  14463. word = word.toLowerCase();
  14464. return result + (index ? capitalize(word) : word);
  14465. });
  14466. /**
  14467. * Converts the first character of `string` to upper case and the remaining
  14468. * to lower case.
  14469. *
  14470. * @static
  14471. * @memberOf _
  14472. * @since 3.0.0
  14473. * @category String
  14474. * @param {string} [string=''] The string to capitalize.
  14475. * @returns {string} Returns the capitalized string.
  14476. * @example
  14477. *
  14478. * _.capitalize('FRED');
  14479. * // => 'Fred'
  14480. */
  14481. function capitalize(string) {
  14482. return upperFirst(toString(string).toLowerCase());
  14483. }
  14484. /**
  14485. * Deburrs `string` by converting
  14486. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14487. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14488. * letters to basic Latin letters and removing
  14489. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14490. *
  14491. * @static
  14492. * @memberOf _
  14493. * @since 3.0.0
  14494. * @category String
  14495. * @param {string} [string=''] The string to deburr.
  14496. * @returns {string} Returns the deburred string.
  14497. * @example
  14498. *
  14499. * _.deburr('déjà vu');
  14500. * // => 'deja vu'
  14501. */
  14502. function deburr(string) {
  14503. string = toString(string);
  14504. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14505. }
  14506. /**
  14507. * Checks if `string` ends with the given target string.
  14508. *
  14509. * @static
  14510. * @memberOf _
  14511. * @since 3.0.0
  14512. * @category String
  14513. * @param {string} [string=''] The string to inspect.
  14514. * @param {string} [target] The string to search for.
  14515. * @param {number} [position=string.length] The position to search up to.
  14516. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14517. * else `false`.
  14518. * @example
  14519. *
  14520. * _.endsWith('abc', 'c');
  14521. * // => true
  14522. *
  14523. * _.endsWith('abc', 'b');
  14524. * // => false
  14525. *
  14526. * _.endsWith('abc', 'b', 2);
  14527. * // => true
  14528. */
  14529. function endsWith(string, target, position) {
  14530. string = toString(string);
  14531. target = baseToString(target);
  14532. var length = string.length;
  14533. position = position === undefined
  14534. ? length
  14535. : baseClamp(toInteger(position), 0, length);
  14536. var end = position;
  14537. position -= target.length;
  14538. return position >= 0 && string.slice(position, end) == target;
  14539. }
  14540. /**
  14541. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14542. * corresponding HTML entities.
  14543. *
  14544. * **Note:** No other characters are escaped. To escape additional
  14545. * characters use a third-party library like [_he_](https://mths.be/he).
  14546. *
  14547. * Though the ">" character is escaped for symmetry, characters like
  14548. * ">" and "/" don't need escaping in HTML and have no special meaning
  14549. * unless they're part of a tag or unquoted attribute value. See
  14550. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14551. * (under "semi-related fun fact") for more details.
  14552. *
  14553. * When working with HTML you should always
  14554. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14555. * XSS vectors.
  14556. *
  14557. * @static
  14558. * @since 0.1.0
  14559. * @memberOf _
  14560. * @category String
  14561. * @param {string} [string=''] The string to escape.
  14562. * @returns {string} Returns the escaped string.
  14563. * @example
  14564. *
  14565. * _.escape('fred, barney, & pebbles');
  14566. * // => 'fred, barney, &amp; pebbles'
  14567. */
  14568. function escape(string) {
  14569. string = toString(string);
  14570. return (string && reHasUnescapedHtml.test(string))
  14571. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14572. : string;
  14573. }
  14574. /**
  14575. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14576. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14577. *
  14578. * @static
  14579. * @memberOf _
  14580. * @since 3.0.0
  14581. * @category String
  14582. * @param {string} [string=''] The string to escape.
  14583. * @returns {string} Returns the escaped string.
  14584. * @example
  14585. *
  14586. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14587. * // => '\[lodash\]\(https://lodash\.com/\)'
  14588. */
  14589. function escapeRegExp(string) {
  14590. string = toString(string);
  14591. return (string && reHasRegExpChar.test(string))
  14592. ? string.replace(reRegExpChar, '\\$&')
  14593. : string;
  14594. }
  14595. /**
  14596. * Converts `string` to
  14597. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14598. *
  14599. * @static
  14600. * @memberOf _
  14601. * @since 3.0.0
  14602. * @category String
  14603. * @param {string} [string=''] The string to convert.
  14604. * @returns {string} Returns the kebab cased string.
  14605. * @example
  14606. *
  14607. * _.kebabCase('Foo Bar');
  14608. * // => 'foo-bar'
  14609. *
  14610. * _.kebabCase('fooBar');
  14611. * // => 'foo-bar'
  14612. *
  14613. * _.kebabCase('__FOO_BAR__');
  14614. * // => 'foo-bar'
  14615. */
  14616. var kebabCase = createCompounder(function(result, word, index) {
  14617. return result + (index ? '-' : '') + word.toLowerCase();
  14618. });
  14619. /**
  14620. * Converts `string`, as space separated words, to lower case.
  14621. *
  14622. * @static
  14623. * @memberOf _
  14624. * @since 4.0.0
  14625. * @category String
  14626. * @param {string} [string=''] The string to convert.
  14627. * @returns {string} Returns the lower cased string.
  14628. * @example
  14629. *
  14630. * _.lowerCase('--Foo-Bar--');
  14631. * // => 'foo bar'
  14632. *
  14633. * _.lowerCase('fooBar');
  14634. * // => 'foo bar'
  14635. *
  14636. * _.lowerCase('__FOO_BAR__');
  14637. * // => 'foo bar'
  14638. */
  14639. var lowerCase = createCompounder(function(result, word, index) {
  14640. return result + (index ? ' ' : '') + word.toLowerCase();
  14641. });
  14642. /**
  14643. * Converts the first character of `string` to lower case.
  14644. *
  14645. * @static
  14646. * @memberOf _
  14647. * @since 4.0.0
  14648. * @category String
  14649. * @param {string} [string=''] The string to convert.
  14650. * @returns {string} Returns the converted string.
  14651. * @example
  14652. *
  14653. * _.lowerFirst('Fred');
  14654. * // => 'fred'
  14655. *
  14656. * _.lowerFirst('FRED');
  14657. * // => 'fRED'
  14658. */
  14659. var lowerFirst = createCaseFirst('toLowerCase');
  14660. /**
  14661. * Pads `string` on the left and right sides if it's shorter than `length`.
  14662. * Padding characters are truncated if they can't be evenly divided by `length`.
  14663. *
  14664. * @static
  14665. * @memberOf _
  14666. * @since 3.0.0
  14667. * @category String
  14668. * @param {string} [string=''] The string to pad.
  14669. * @param {number} [length=0] The padding length.
  14670. * @param {string} [chars=' '] The string used as padding.
  14671. * @returns {string} Returns the padded string.
  14672. * @example
  14673. *
  14674. * _.pad('abc', 8);
  14675. * // => ' abc '
  14676. *
  14677. * _.pad('abc', 8, '_-');
  14678. * // => '_-abc_-_'
  14679. *
  14680. * _.pad('abc', 3);
  14681. * // => 'abc'
  14682. */
  14683. function pad(string, length, chars) {
  14684. string = toString(string);
  14685. length = toInteger(length);
  14686. var strLength = length ? stringSize(string) : 0;
  14687. if (!length || strLength >= length) {
  14688. return string;
  14689. }
  14690. var mid = (length - strLength) / 2;
  14691. return (
  14692. createPadding(nativeFloor(mid), chars) +
  14693. string +
  14694. createPadding(nativeCeil(mid), chars)
  14695. );
  14696. }
  14697. /**
  14698. * Pads `string` on the right side if it's shorter than `length`. Padding
  14699. * characters are truncated if they exceed `length`.
  14700. *
  14701. * @static
  14702. * @memberOf _
  14703. * @since 4.0.0
  14704. * @category String
  14705. * @param {string} [string=''] The string to pad.
  14706. * @param {number} [length=0] The padding length.
  14707. * @param {string} [chars=' '] The string used as padding.
  14708. * @returns {string} Returns the padded string.
  14709. * @example
  14710. *
  14711. * _.padEnd('abc', 6);
  14712. * // => 'abc '
  14713. *
  14714. * _.padEnd('abc', 6, '_-');
  14715. * // => 'abc_-_'
  14716. *
  14717. * _.padEnd('abc', 3);
  14718. * // => 'abc'
  14719. */
  14720. function padEnd(string, length, chars) {
  14721. string = toString(string);
  14722. length = toInteger(length);
  14723. var strLength = length ? stringSize(string) : 0;
  14724. return (length && strLength < length)
  14725. ? (string + createPadding(length - strLength, chars))
  14726. : string;
  14727. }
  14728. /**
  14729. * Pads `string` on the left side if it's shorter than `length`. Padding
  14730. * characters are truncated if they exceed `length`.
  14731. *
  14732. * @static
  14733. * @memberOf _
  14734. * @since 4.0.0
  14735. * @category String
  14736. * @param {string} [string=''] The string to pad.
  14737. * @param {number} [length=0] The padding length.
  14738. * @param {string} [chars=' '] The string used as padding.
  14739. * @returns {string} Returns the padded string.
  14740. * @example
  14741. *
  14742. * _.padStart('abc', 6);
  14743. * // => ' abc'
  14744. *
  14745. * _.padStart('abc', 6, '_-');
  14746. * // => '_-_abc'
  14747. *
  14748. * _.padStart('abc', 3);
  14749. * // => 'abc'
  14750. */
  14751. function padStart(string, length, chars) {
  14752. string = toString(string);
  14753. length = toInteger(length);
  14754. var strLength = length ? stringSize(string) : 0;
  14755. return (length && strLength < length)
  14756. ? (createPadding(length - strLength, chars) + string)
  14757. : string;
  14758. }
  14759. /**
  14760. * Converts `string` to an integer of the specified radix. If `radix` is
  14761. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14762. * hexadecimal, in which case a `radix` of `16` is used.
  14763. *
  14764. * **Note:** This method aligns with the
  14765. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14766. *
  14767. * @static
  14768. * @memberOf _
  14769. * @since 1.1.0
  14770. * @category String
  14771. * @param {string} string The string to convert.
  14772. * @param {number} [radix=10] The radix to interpret `value` by.
  14773. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14774. * @returns {number} Returns the converted integer.
  14775. * @example
  14776. *
  14777. * _.parseInt('08');
  14778. * // => 8
  14779. *
  14780. * _.map(['6', '08', '10'], _.parseInt);
  14781. * // => [6, 8, 10]
  14782. */
  14783. function parseInt(string, radix, guard) {
  14784. if (guard || radix == null) {
  14785. radix = 0;
  14786. } else if (radix) {
  14787. radix = +radix;
  14788. }
  14789. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14790. }
  14791. /**
  14792. * Repeats the given string `n` times.
  14793. *
  14794. * @static
  14795. * @memberOf _
  14796. * @since 3.0.0
  14797. * @category String
  14798. * @param {string} [string=''] The string to repeat.
  14799. * @param {number} [n=1] The number of times to repeat the string.
  14800. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14801. * @returns {string} Returns the repeated string.
  14802. * @example
  14803. *
  14804. * _.repeat('*', 3);
  14805. * // => '***'
  14806. *
  14807. * _.repeat('abc', 2);
  14808. * // => 'abcabc'
  14809. *
  14810. * _.repeat('abc', 0);
  14811. * // => ''
  14812. */
  14813. function repeat(string, n, guard) {
  14814. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14815. n = 1;
  14816. } else {
  14817. n = toInteger(n);
  14818. }
  14819. return baseRepeat(toString(string), n);
  14820. }
  14821. /**
  14822. * Replaces matches for `pattern` in `string` with `replacement`.
  14823. *
  14824. * **Note:** This method is based on
  14825. * [`String#replace`](https://mdn.io/String/replace).
  14826. *
  14827. * @static
  14828. * @memberOf _
  14829. * @since 4.0.0
  14830. * @category String
  14831. * @param {string} [string=''] The string to modify.
  14832. * @param {RegExp|string} pattern The pattern to replace.
  14833. * @param {Function|string} replacement The match replacement.
  14834. * @returns {string} Returns the modified string.
  14835. * @example
  14836. *
  14837. * _.replace('Hi Fred', 'Fred', 'Barney');
  14838. * // => 'Hi Barney'
  14839. */
  14840. function replace() {
  14841. var args = arguments,
  14842. string = toString(args[0]);
  14843. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14844. }
  14845. /**
  14846. * Converts `string` to
  14847. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14848. *
  14849. * @static
  14850. * @memberOf _
  14851. * @since 3.0.0
  14852. * @category String
  14853. * @param {string} [string=''] The string to convert.
  14854. * @returns {string} Returns the snake cased string.
  14855. * @example
  14856. *
  14857. * _.snakeCase('Foo Bar');
  14858. * // => 'foo_bar'
  14859. *
  14860. * _.snakeCase('fooBar');
  14861. * // => 'foo_bar'
  14862. *
  14863. * _.snakeCase('--FOO-BAR--');
  14864. * // => 'foo_bar'
  14865. */
  14866. var snakeCase = createCompounder(function(result, word, index) {
  14867. return result + (index ? '_' : '') + word.toLowerCase();
  14868. });
  14869. /**
  14870. * Splits `string` by `separator`.
  14871. *
  14872. * **Note:** This method is based on
  14873. * [`String#split`](https://mdn.io/String/split).
  14874. *
  14875. * @static
  14876. * @memberOf _
  14877. * @since 4.0.0
  14878. * @category String
  14879. * @param {string} [string=''] The string to split.
  14880. * @param {RegExp|string} separator The separator pattern to split by.
  14881. * @param {number} [limit] The length to truncate results to.
  14882. * @returns {Array} Returns the string segments.
  14883. * @example
  14884. *
  14885. * _.split('a-b-c', '-', 2);
  14886. * // => ['a', 'b']
  14887. */
  14888. function split(string, separator, limit) {
  14889. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14890. separator = limit = undefined;
  14891. }
  14892. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14893. if (!limit) {
  14894. return [];
  14895. }
  14896. string = toString(string);
  14897. if (string && (
  14898. typeof separator == 'string' ||
  14899. (separator != null && !isRegExp(separator))
  14900. )) {
  14901. separator = baseToString(separator);
  14902. if (!separator && hasUnicode(string)) {
  14903. return castSlice(stringToArray(string), 0, limit);
  14904. }
  14905. }
  14906. return string.split(separator, limit);
  14907. }
  14908. /**
  14909. * Converts `string` to
  14910. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14911. *
  14912. * @static
  14913. * @memberOf _
  14914. * @since 3.1.0
  14915. * @category String
  14916. * @param {string} [string=''] The string to convert.
  14917. * @returns {string} Returns the start cased string.
  14918. * @example
  14919. *
  14920. * _.startCase('--foo-bar--');
  14921. * // => 'Foo Bar'
  14922. *
  14923. * _.startCase('fooBar');
  14924. * // => 'Foo Bar'
  14925. *
  14926. * _.startCase('__FOO_BAR__');
  14927. * // => 'FOO BAR'
  14928. */
  14929. var startCase = createCompounder(function(result, word, index) {
  14930. return result + (index ? ' ' : '') + upperFirst(word);
  14931. });
  14932. /**
  14933. * Checks if `string` starts with the given target string.
  14934. *
  14935. * @static
  14936. * @memberOf _
  14937. * @since 3.0.0
  14938. * @category String
  14939. * @param {string} [string=''] The string to inspect.
  14940. * @param {string} [target] The string to search for.
  14941. * @param {number} [position=0] The position to search from.
  14942. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14943. * else `false`.
  14944. * @example
  14945. *
  14946. * _.startsWith('abc', 'a');
  14947. * // => true
  14948. *
  14949. * _.startsWith('abc', 'b');
  14950. * // => false
  14951. *
  14952. * _.startsWith('abc', 'b', 1);
  14953. * // => true
  14954. */
  14955. function startsWith(string, target, position) {
  14956. string = toString(string);
  14957. position = position == null
  14958. ? 0
  14959. : baseClamp(toInteger(position), 0, string.length);
  14960. target = baseToString(target);
  14961. return string.slice(position, position + target.length) == target;
  14962. }
  14963. /**
  14964. * Creates a compiled template function that can interpolate data properties
  14965. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14966. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14967. * properties may be accessed as free variables in the template. If a setting
  14968. * object is given, it takes precedence over `_.templateSettings` values.
  14969. *
  14970. * **Note:** In the development build `_.template` utilizes
  14971. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14972. * for easier debugging.
  14973. *
  14974. * For more information on precompiling templates see
  14975. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14976. *
  14977. * For more information on Chrome extension sandboxes see
  14978. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14979. *
  14980. * @static
  14981. * @since 0.1.0
  14982. * @memberOf _
  14983. * @category String
  14984. * @param {string} [string=''] The template string.
  14985. * @param {Object} [options={}] The options object.
  14986. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14987. * The HTML "escape" delimiter.
  14988. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14989. * The "evaluate" delimiter.
  14990. * @param {Object} [options.imports=_.templateSettings.imports]
  14991. * An object to import into the template as free variables.
  14992. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14993. * The "interpolate" delimiter.
  14994. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14995. * The sourceURL of the compiled template.
  14996. * @param {string} [options.variable='obj']
  14997. * The data object variable name.
  14998. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14999. * @returns {Function} Returns the compiled template function.
  15000. * @example
  15001. *
  15002. * // Use the "interpolate" delimiter to create a compiled template.
  15003. * var compiled = _.template('hello <%= user %>!');
  15004. * compiled({ 'user': 'fred' });
  15005. * // => 'hello fred!'
  15006. *
  15007. * // Use the HTML "escape" delimiter to escape data property values.
  15008. * var compiled = _.template('<b><%- value %></b>');
  15009. * compiled({ 'value': '<script>' });
  15010. * // => '<b>&lt;script&gt;</b>'
  15011. *
  15012. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15013. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15014. * compiled({ 'users': ['fred', 'barney'] });
  15015. * // => '<li>fred</li><li>barney</li>'
  15016. *
  15017. * // Use the internal `print` function in "evaluate" delimiters.
  15018. * var compiled = _.template('<% print("hello " + user); %>!');
  15019. * compiled({ 'user': 'barney' });
  15020. * // => 'hello barney!'
  15021. *
  15022. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15023. * // Disable support by replacing the "interpolate" delimiter.
  15024. * var compiled = _.template('hello ${ user }!');
  15025. * compiled({ 'user': 'pebbles' });
  15026. * // => 'hello pebbles!'
  15027. *
  15028. * // Use backslashes to treat delimiters as plain text.
  15029. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15030. * compiled({ 'value': 'ignored' });
  15031. * // => '<%- value %>'
  15032. *
  15033. * // Use the `imports` option to import `jQuery` as `jq`.
  15034. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15035. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15036. * compiled({ 'users': ['fred', 'barney'] });
  15037. * // => '<li>fred</li><li>barney</li>'
  15038. *
  15039. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15040. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15041. * compiled(data);
  15042. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15043. *
  15044. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15045. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15046. * compiled.source;
  15047. * // => function(data) {
  15048. * // var __t, __p = '';
  15049. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15050. * // return __p;
  15051. * // }
  15052. *
  15053. * // Use custom template delimiters.
  15054. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15055. * var compiled = _.template('hello {{ user }}!');
  15056. * compiled({ 'user': 'mustache' });
  15057. * // => 'hello mustache!'
  15058. *
  15059. * // Use the `source` property to inline compiled templates for meaningful
  15060. * // line numbers in error messages and stack traces.
  15061. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15062. * var JST = {\
  15063. * "main": ' + _.template(mainText).source + '\
  15064. * };\
  15065. * ');
  15066. */
  15067. function template(string, options, guard) {
  15068. // Based on John Resig's `tmpl` implementation
  15069. // (http://ejohn.org/blog/javascript-micro-templating/)
  15070. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15071. var settings = lodash.templateSettings;
  15072. if (guard && isIterateeCall(string, options, guard)) {
  15073. options = undefined;
  15074. }
  15075. string = toString(string);
  15076. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15077. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15078. importsKeys = keys(imports),
  15079. importsValues = baseValues(imports, importsKeys);
  15080. var isEscaping,
  15081. isEvaluating,
  15082. index = 0,
  15083. interpolate = options.interpolate || reNoMatch,
  15084. source = "__p += '";
  15085. // Compile the regexp to match each delimiter.
  15086. var reDelimiters = RegExp(
  15087. (options.escape || reNoMatch).source + '|' +
  15088. interpolate.source + '|' +
  15089. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15090. (options.evaluate || reNoMatch).source + '|$'
  15091. , 'g');
  15092. // Use a sourceURL for easier debugging.
  15093. var sourceURL = '//# sourceURL=' +
  15094. ('sourceURL' in options
  15095. ? options.sourceURL
  15096. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15097. ) + '\n';
  15098. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15099. interpolateValue || (interpolateValue = esTemplateValue);
  15100. // Escape characters that can't be included in string literals.
  15101. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15102. // Replace delimiters with snippets.
  15103. if (escapeValue) {
  15104. isEscaping = true;
  15105. source += "' +\n__e(" + escapeValue + ") +\n'";
  15106. }
  15107. if (evaluateValue) {
  15108. isEvaluating = true;
  15109. source += "';\n" + evaluateValue + ";\n__p += '";
  15110. }
  15111. if (interpolateValue) {
  15112. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15113. }
  15114. index = offset + match.length;
  15115. // The JS engine embedded in Adobe products needs `match` returned in
  15116. // order to produce the correct `offset` value.
  15117. return match;
  15118. });
  15119. source += "';\n";
  15120. // If `variable` is not specified wrap a with-statement around the generated
  15121. // code to add the data object to the top of the scope chain.
  15122. var variable = options.variable;
  15123. if (!variable) {
  15124. source = 'with (obj) {\n' + source + '\n}\n';
  15125. }
  15126. // Cleanup code by stripping empty strings.
  15127. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15128. .replace(reEmptyStringMiddle, '$1')
  15129. .replace(reEmptyStringTrailing, '$1;');
  15130. // Frame code as the function body.
  15131. source = 'function(' + (variable || 'obj') + ') {\n' +
  15132. (variable
  15133. ? ''
  15134. : 'obj || (obj = {});\n'
  15135. ) +
  15136. "var __t, __p = ''" +
  15137. (isEscaping
  15138. ? ', __e = _.escape'
  15139. : ''
  15140. ) +
  15141. (isEvaluating
  15142. ? ', __j = Array.prototype.join;\n' +
  15143. "function print() { __p += __j.call(arguments, '') }\n"
  15144. : ';\n'
  15145. ) +
  15146. source +
  15147. 'return __p\n}';
  15148. var result = attempt(function() {
  15149. return Function(importsKeys, sourceURL + 'return ' + source)
  15150. .apply(undefined, importsValues);
  15151. });
  15152. // Provide the compiled function's source by its `toString` method or
  15153. // the `source` property as a convenience for inlining compiled templates.
  15154. result.source = source;
  15155. if (isError(result)) {
  15156. throw result;
  15157. }
  15158. return result;
  15159. }
  15160. /**
  15161. * Converts `string`, as a whole, to lower case just like
  15162. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15163. *
  15164. * @static
  15165. * @memberOf _
  15166. * @since 4.0.0
  15167. * @category String
  15168. * @param {string} [string=''] The string to convert.
  15169. * @returns {string} Returns the lower cased string.
  15170. * @example
  15171. *
  15172. * _.toLower('--Foo-Bar--');
  15173. * // => '--foo-bar--'
  15174. *
  15175. * _.toLower('fooBar');
  15176. * // => 'foobar'
  15177. *
  15178. * _.toLower('__FOO_BAR__');
  15179. * // => '__foo_bar__'
  15180. */
  15181. function toLower(value) {
  15182. return toString(value).toLowerCase();
  15183. }
  15184. /**
  15185. * Converts `string`, as a whole, to upper case just like
  15186. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15187. *
  15188. * @static
  15189. * @memberOf _
  15190. * @since 4.0.0
  15191. * @category String
  15192. * @param {string} [string=''] The string to convert.
  15193. * @returns {string} Returns the upper cased string.
  15194. * @example
  15195. *
  15196. * _.toUpper('--foo-bar--');
  15197. * // => '--FOO-BAR--'
  15198. *
  15199. * _.toUpper('fooBar');
  15200. * // => 'FOOBAR'
  15201. *
  15202. * _.toUpper('__foo_bar__');
  15203. * // => '__FOO_BAR__'
  15204. */
  15205. function toUpper(value) {
  15206. return toString(value).toUpperCase();
  15207. }
  15208. /**
  15209. * Removes leading and trailing whitespace or specified characters from `string`.
  15210. *
  15211. * @static
  15212. * @memberOf _
  15213. * @since 3.0.0
  15214. * @category String
  15215. * @param {string} [string=''] The string to trim.
  15216. * @param {string} [chars=whitespace] The characters to trim.
  15217. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15218. * @returns {string} Returns the trimmed string.
  15219. * @example
  15220. *
  15221. * _.trim(' abc ');
  15222. * // => 'abc'
  15223. *
  15224. * _.trim('-_-abc-_-', '_-');
  15225. * // => 'abc'
  15226. *
  15227. * _.map([' foo ', ' bar '], _.trim);
  15228. * // => ['foo', 'bar']
  15229. */
  15230. function trim(string, chars, guard) {
  15231. string = toString(string);
  15232. if (string && (guard || chars === undefined)) {
  15233. return string.replace(reTrim, '');
  15234. }
  15235. if (!string || !(chars = baseToString(chars))) {
  15236. return string;
  15237. }
  15238. var strSymbols = stringToArray(string),
  15239. chrSymbols = stringToArray(chars),
  15240. start = charsStartIndex(strSymbols, chrSymbols),
  15241. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15242. return castSlice(strSymbols, start, end).join('');
  15243. }
  15244. /**
  15245. * Removes trailing whitespace or specified characters from `string`.
  15246. *
  15247. * @static
  15248. * @memberOf _
  15249. * @since 4.0.0
  15250. * @category String
  15251. * @param {string} [string=''] The string to trim.
  15252. * @param {string} [chars=whitespace] The characters to trim.
  15253. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15254. * @returns {string} Returns the trimmed string.
  15255. * @example
  15256. *
  15257. * _.trimEnd(' abc ');
  15258. * // => ' abc'
  15259. *
  15260. * _.trimEnd('-_-abc-_-', '_-');
  15261. * // => '-_-abc'
  15262. */
  15263. function trimEnd(string, chars, guard) {
  15264. string = toString(string);
  15265. if (string && (guard || chars === undefined)) {
  15266. return string.replace(reTrimEnd, '');
  15267. }
  15268. if (!string || !(chars = baseToString(chars))) {
  15269. return string;
  15270. }
  15271. var strSymbols = stringToArray(string),
  15272. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15273. return castSlice(strSymbols, 0, end).join('');
  15274. }
  15275. /**
  15276. * Removes leading whitespace or specified characters from `string`.
  15277. *
  15278. * @static
  15279. * @memberOf _
  15280. * @since 4.0.0
  15281. * @category String
  15282. * @param {string} [string=''] The string to trim.
  15283. * @param {string} [chars=whitespace] The characters to trim.
  15284. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15285. * @returns {string} Returns the trimmed string.
  15286. * @example
  15287. *
  15288. * _.trimStart(' abc ');
  15289. * // => 'abc '
  15290. *
  15291. * _.trimStart('-_-abc-_-', '_-');
  15292. * // => 'abc-_-'
  15293. */
  15294. function trimStart(string, chars, guard) {
  15295. string = toString(string);
  15296. if (string && (guard || chars === undefined)) {
  15297. return string.replace(reTrimStart, '');
  15298. }
  15299. if (!string || !(chars = baseToString(chars))) {
  15300. return string;
  15301. }
  15302. var strSymbols = stringToArray(string),
  15303. start = charsStartIndex(strSymbols, stringToArray(chars));
  15304. return castSlice(strSymbols, start).join('');
  15305. }
  15306. /**
  15307. * Truncates `string` if it's longer than the given maximum string length.
  15308. * The last characters of the truncated string are replaced with the omission
  15309. * string which defaults to "...".
  15310. *
  15311. * @static
  15312. * @memberOf _
  15313. * @since 4.0.0
  15314. * @category String
  15315. * @param {string} [string=''] The string to truncate.
  15316. * @param {Object} [options={}] The options object.
  15317. * @param {number} [options.length=30] The maximum string length.
  15318. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15319. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15320. * @returns {string} Returns the truncated string.
  15321. * @example
  15322. *
  15323. * _.truncate('hi-diddly-ho there, neighborino');
  15324. * // => 'hi-diddly-ho there, neighbo...'
  15325. *
  15326. * _.truncate('hi-diddly-ho there, neighborino', {
  15327. * 'length': 24,
  15328. * 'separator': ' '
  15329. * });
  15330. * // => 'hi-diddly-ho there,...'
  15331. *
  15332. * _.truncate('hi-diddly-ho there, neighborino', {
  15333. * 'length': 24,
  15334. * 'separator': /,? +/
  15335. * });
  15336. * // => 'hi-diddly-ho there...'
  15337. *
  15338. * _.truncate('hi-diddly-ho there, neighborino', {
  15339. * 'omission': ' [...]'
  15340. * });
  15341. * // => 'hi-diddly-ho there, neig [...]'
  15342. */
  15343. function truncate(string, options) {
  15344. var length = DEFAULT_TRUNC_LENGTH,
  15345. omission = DEFAULT_TRUNC_OMISSION;
  15346. if (isObject(options)) {
  15347. var separator = 'separator' in options ? options.separator : separator;
  15348. length = 'length' in options ? toInteger(options.length) : length;
  15349. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15350. }
  15351. string = toString(string);
  15352. var strLength = string.length;
  15353. if (hasUnicode(string)) {
  15354. var strSymbols = stringToArray(string);
  15355. strLength = strSymbols.length;
  15356. }
  15357. if (length >= strLength) {
  15358. return string;
  15359. }
  15360. var end = length - stringSize(omission);
  15361. if (end < 1) {
  15362. return omission;
  15363. }
  15364. var result = strSymbols
  15365. ? castSlice(strSymbols, 0, end).join('')
  15366. : string.slice(0, end);
  15367. if (separator === undefined) {
  15368. return result + omission;
  15369. }
  15370. if (strSymbols) {
  15371. end += (result.length - end);
  15372. }
  15373. if (isRegExp(separator)) {
  15374. if (string.slice(end).search(separator)) {
  15375. var match,
  15376. substring = result;
  15377. if (!separator.global) {
  15378. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15379. }
  15380. separator.lastIndex = 0;
  15381. while ((match = separator.exec(substring))) {
  15382. var newEnd = match.index;
  15383. }
  15384. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15385. }
  15386. } else if (string.indexOf(baseToString(separator), end) != end) {
  15387. var index = result.lastIndexOf(separator);
  15388. if (index > -1) {
  15389. result = result.slice(0, index);
  15390. }
  15391. }
  15392. return result + omission;
  15393. }
  15394. /**
  15395. * The inverse of `_.escape`; this method converts the HTML entities
  15396. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15397. * their corresponding characters.
  15398. *
  15399. * **Note:** No other HTML entities are unescaped. To unescape additional
  15400. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15401. *
  15402. * @static
  15403. * @memberOf _
  15404. * @since 0.6.0
  15405. * @category String
  15406. * @param {string} [string=''] The string to unescape.
  15407. * @returns {string} Returns the unescaped string.
  15408. * @example
  15409. *
  15410. * _.unescape('fred, barney, &amp; pebbles');
  15411. * // => 'fred, barney, & pebbles'
  15412. */
  15413. function unescape(string) {
  15414. string = toString(string);
  15415. return (string && reHasEscapedHtml.test(string))
  15416. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15417. : string;
  15418. }
  15419. /**
  15420. * Converts `string`, as space separated words, to upper case.
  15421. *
  15422. * @static
  15423. * @memberOf _
  15424. * @since 4.0.0
  15425. * @category String
  15426. * @param {string} [string=''] The string to convert.
  15427. * @returns {string} Returns the upper cased string.
  15428. * @example
  15429. *
  15430. * _.upperCase('--foo-bar');
  15431. * // => 'FOO BAR'
  15432. *
  15433. * _.upperCase('fooBar');
  15434. * // => 'FOO BAR'
  15435. *
  15436. * _.upperCase('__foo_bar__');
  15437. * // => 'FOO BAR'
  15438. */
  15439. var upperCase = createCompounder(function(result, word, index) {
  15440. return result + (index ? ' ' : '') + word.toUpperCase();
  15441. });
  15442. /**
  15443. * Converts the first character of `string` to upper case.
  15444. *
  15445. * @static
  15446. * @memberOf _
  15447. * @since 4.0.0
  15448. * @category String
  15449. * @param {string} [string=''] The string to convert.
  15450. * @returns {string} Returns the converted string.
  15451. * @example
  15452. *
  15453. * _.upperFirst('fred');
  15454. * // => 'Fred'
  15455. *
  15456. * _.upperFirst('FRED');
  15457. * // => 'FRED'
  15458. */
  15459. var upperFirst = createCaseFirst('toUpperCase');
  15460. /**
  15461. * Splits `string` into an array of its words.
  15462. *
  15463. * @static
  15464. * @memberOf _
  15465. * @since 3.0.0
  15466. * @category String
  15467. * @param {string} [string=''] The string to inspect.
  15468. * @param {RegExp|string} [pattern] The pattern to match words.
  15469. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15470. * @returns {Array} Returns the words of `string`.
  15471. * @example
  15472. *
  15473. * _.words('fred, barney, & pebbles');
  15474. * // => ['fred', 'barney', 'pebbles']
  15475. *
  15476. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15477. * // => ['fred', 'barney', '&', 'pebbles']
  15478. */
  15479. function words(string, pattern, guard) {
  15480. string = toString(string);
  15481. pattern = guard ? undefined : pattern;
  15482. if (pattern === undefined) {
  15483. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15484. }
  15485. return string.match(pattern) || [];
  15486. }
  15487. /*------------------------------------------------------------------------*/
  15488. /**
  15489. * Attempts to invoke `func`, returning either the result or the caught error
  15490. * object. Any additional arguments are provided to `func` when it's invoked.
  15491. *
  15492. * @static
  15493. * @memberOf _
  15494. * @since 3.0.0
  15495. * @category Util
  15496. * @param {Function} func The function to attempt.
  15497. * @param {...*} [args] The arguments to invoke `func` with.
  15498. * @returns {*} Returns the `func` result or error object.
  15499. * @example
  15500. *
  15501. * // Avoid throwing errors for invalid selectors.
  15502. * var elements = _.attempt(function(selector) {
  15503. * return document.querySelectorAll(selector);
  15504. * }, '>_>');
  15505. *
  15506. * if (_.isError(elements)) {
  15507. * elements = [];
  15508. * }
  15509. */
  15510. var attempt = baseRest(function(func, args) {
  15511. try {
  15512. return apply(func, undefined, args);
  15513. } catch (e) {
  15514. return isError(e) ? e : new Error(e);
  15515. }
  15516. });
  15517. /**
  15518. * Binds methods of an object to the object itself, overwriting the existing
  15519. * method.
  15520. *
  15521. * **Note:** This method doesn't set the "length" property of bound functions.
  15522. *
  15523. * @static
  15524. * @since 0.1.0
  15525. * @memberOf _
  15526. * @category Util
  15527. * @param {Object} object The object to bind and assign the bound methods to.
  15528. * @param {...(string|string[])} methodNames The object method names to bind.
  15529. * @returns {Object} Returns `object`.
  15530. * @example
  15531. *
  15532. * var view = {
  15533. * 'label': 'docs',
  15534. * 'click': function() {
  15535. * console.log('clicked ' + this.label);
  15536. * }
  15537. * };
  15538. *
  15539. * _.bindAll(view, ['click']);
  15540. * jQuery(element).on('click', view.click);
  15541. * // => Logs 'clicked docs' when clicked.
  15542. */
  15543. var bindAll = flatRest(function(object, methodNames) {
  15544. arrayEach(methodNames, function(key) {
  15545. key = toKey(key);
  15546. baseAssignValue(object, key, bind(object[key], object));
  15547. });
  15548. return object;
  15549. });
  15550. /**
  15551. * Creates a function that iterates over `pairs` and invokes the corresponding
  15552. * function of the first predicate to return truthy. The predicate-function
  15553. * pairs are invoked with the `this` binding and arguments of the created
  15554. * function.
  15555. *
  15556. * @static
  15557. * @memberOf _
  15558. * @since 4.0.0
  15559. * @category Util
  15560. * @param {Array} pairs The predicate-function pairs.
  15561. * @returns {Function} Returns the new composite function.
  15562. * @example
  15563. *
  15564. * var func = _.cond([
  15565. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15566. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15567. * [_.stubTrue, _.constant('no match')]
  15568. * ]);
  15569. *
  15570. * func({ 'a': 1, 'b': 2 });
  15571. * // => 'matches A'
  15572. *
  15573. * func({ 'a': 0, 'b': 1 });
  15574. * // => 'matches B'
  15575. *
  15576. * func({ 'a': '1', 'b': '2' });
  15577. * // => 'no match'
  15578. */
  15579. function cond(pairs) {
  15580. var length = pairs == null ? 0 : pairs.length,
  15581. toIteratee = getIteratee();
  15582. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15583. if (typeof pair[1] != 'function') {
  15584. throw new TypeError(FUNC_ERROR_TEXT);
  15585. }
  15586. return [toIteratee(pair[0]), pair[1]];
  15587. });
  15588. return baseRest(function(args) {
  15589. var index = -1;
  15590. while (++index < length) {
  15591. var pair = pairs[index];
  15592. if (apply(pair[0], this, args)) {
  15593. return apply(pair[1], this, args);
  15594. }
  15595. }
  15596. });
  15597. }
  15598. /**
  15599. * Creates a function that invokes the predicate properties of `source` with
  15600. * the corresponding property values of a given object, returning `true` if
  15601. * all predicates return truthy, else `false`.
  15602. *
  15603. * **Note:** The created function is equivalent to `_.conformsTo` with
  15604. * `source` partially applied.
  15605. *
  15606. * @static
  15607. * @memberOf _
  15608. * @since 4.0.0
  15609. * @category Util
  15610. * @param {Object} source The object of property predicates to conform to.
  15611. * @returns {Function} Returns the new spec function.
  15612. * @example
  15613. *
  15614. * var objects = [
  15615. * { 'a': 2, 'b': 1 },
  15616. * { 'a': 1, 'b': 2 }
  15617. * ];
  15618. *
  15619. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15620. * // => [{ 'a': 1, 'b': 2 }]
  15621. */
  15622. function conforms(source) {
  15623. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15624. }
  15625. /**
  15626. * Creates a function that returns `value`.
  15627. *
  15628. * @static
  15629. * @memberOf _
  15630. * @since 2.4.0
  15631. * @category Util
  15632. * @param {*} value The value to return from the new function.
  15633. * @returns {Function} Returns the new constant function.
  15634. * @example
  15635. *
  15636. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15637. *
  15638. * console.log(objects);
  15639. * // => [{ 'a': 1 }, { 'a': 1 }]
  15640. *
  15641. * console.log(objects[0] === objects[1]);
  15642. * // => true
  15643. */
  15644. function constant(value) {
  15645. return function() {
  15646. return value;
  15647. };
  15648. }
  15649. /**
  15650. * Checks `value` to determine whether a default value should be returned in
  15651. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15652. * or `undefined`.
  15653. *
  15654. * @static
  15655. * @memberOf _
  15656. * @since 4.14.0
  15657. * @category Util
  15658. * @param {*} value The value to check.
  15659. * @param {*} defaultValue The default value.
  15660. * @returns {*} Returns the resolved value.
  15661. * @example
  15662. *
  15663. * _.defaultTo(1, 10);
  15664. * // => 1
  15665. *
  15666. * _.defaultTo(undefined, 10);
  15667. * // => 10
  15668. */
  15669. function defaultTo(value, defaultValue) {
  15670. return (value == null || value !== value) ? defaultValue : value;
  15671. }
  15672. /**
  15673. * Creates a function that returns the result of invoking the given functions
  15674. * with the `this` binding of the created function, where each successive
  15675. * invocation is supplied the return value of the previous.
  15676. *
  15677. * @static
  15678. * @memberOf _
  15679. * @since 3.0.0
  15680. * @category Util
  15681. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15682. * @returns {Function} Returns the new composite function.
  15683. * @see _.flowRight
  15684. * @example
  15685. *
  15686. * function square(n) {
  15687. * return n * n;
  15688. * }
  15689. *
  15690. * var addSquare = _.flow([_.add, square]);
  15691. * addSquare(1, 2);
  15692. * // => 9
  15693. */
  15694. var flow = createFlow();
  15695. /**
  15696. * This method is like `_.flow` except that it creates a function that
  15697. * invokes the given functions from right to left.
  15698. *
  15699. * @static
  15700. * @since 3.0.0
  15701. * @memberOf _
  15702. * @category Util
  15703. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15704. * @returns {Function} Returns the new composite function.
  15705. * @see _.flow
  15706. * @example
  15707. *
  15708. * function square(n) {
  15709. * return n * n;
  15710. * }
  15711. *
  15712. * var addSquare = _.flowRight([square, _.add]);
  15713. * addSquare(1, 2);
  15714. * // => 9
  15715. */
  15716. var flowRight = createFlow(true);
  15717. /**
  15718. * This method returns the first argument it receives.
  15719. *
  15720. * @static
  15721. * @since 0.1.0
  15722. * @memberOf _
  15723. * @category Util
  15724. * @param {*} value Any value.
  15725. * @returns {*} Returns `value`.
  15726. * @example
  15727. *
  15728. * var object = { 'a': 1 };
  15729. *
  15730. * console.log(_.identity(object) === object);
  15731. * // => true
  15732. */
  15733. function identity(value) {
  15734. return value;
  15735. }
  15736. /**
  15737. * Creates a function that invokes `func` with the arguments of the created
  15738. * function. If `func` is a property name, the created function returns the
  15739. * property value for a given element. If `func` is an array or object, the
  15740. * created function returns `true` for elements that contain the equivalent
  15741. * source properties, otherwise it returns `false`.
  15742. *
  15743. * @static
  15744. * @since 4.0.0
  15745. * @memberOf _
  15746. * @category Util
  15747. * @param {*} [func=_.identity] The value to convert to a callback.
  15748. * @returns {Function} Returns the callback.
  15749. * @example
  15750. *
  15751. * var users = [
  15752. * { 'user': 'barney', 'age': 36, 'active': true },
  15753. * { 'user': 'fred', 'age': 40, 'active': false }
  15754. * ];
  15755. *
  15756. * // The `_.matches` iteratee shorthand.
  15757. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15758. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15759. *
  15760. * // The `_.matchesProperty` iteratee shorthand.
  15761. * _.filter(users, _.iteratee(['user', 'fred']));
  15762. * // => [{ 'user': 'fred', 'age': 40 }]
  15763. *
  15764. * // The `_.property` iteratee shorthand.
  15765. * _.map(users, _.iteratee('user'));
  15766. * // => ['barney', 'fred']
  15767. *
  15768. * // Create custom iteratee shorthands.
  15769. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15770. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15771. * return func.test(string);
  15772. * };
  15773. * });
  15774. *
  15775. * _.filter(['abc', 'def'], /ef/);
  15776. * // => ['def']
  15777. */
  15778. function iteratee(func) {
  15779. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15780. }
  15781. /**
  15782. * Creates a function that performs a partial deep comparison between a given
  15783. * object and `source`, returning `true` if the given object has equivalent
  15784. * property values, else `false`.
  15785. *
  15786. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15787. * partially applied.
  15788. *
  15789. * Partial comparisons will match empty array and empty object `source`
  15790. * values against any array or object value, respectively. See `_.isEqual`
  15791. * for a list of supported value comparisons.
  15792. *
  15793. * @static
  15794. * @memberOf _
  15795. * @since 3.0.0
  15796. * @category Util
  15797. * @param {Object} source The object of property values to match.
  15798. * @returns {Function} Returns the new spec function.
  15799. * @example
  15800. *
  15801. * var objects = [
  15802. * { 'a': 1, 'b': 2, 'c': 3 },
  15803. * { 'a': 4, 'b': 5, 'c': 6 }
  15804. * ];
  15805. *
  15806. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15807. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15808. */
  15809. function matches(source) {
  15810. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15811. }
  15812. /**
  15813. * Creates a function that performs a partial deep comparison between the
  15814. * value at `path` of a given object to `srcValue`, returning `true` if the
  15815. * object value is equivalent, else `false`.
  15816. *
  15817. * **Note:** Partial comparisons will match empty array and empty object
  15818. * `srcValue` values against any array or object value, respectively. See
  15819. * `_.isEqual` for a list of supported value comparisons.
  15820. *
  15821. * @static
  15822. * @memberOf _
  15823. * @since 3.2.0
  15824. * @category Util
  15825. * @param {Array|string} path The path of the property to get.
  15826. * @param {*} srcValue The value to match.
  15827. * @returns {Function} Returns the new spec function.
  15828. * @example
  15829. *
  15830. * var objects = [
  15831. * { 'a': 1, 'b': 2, 'c': 3 },
  15832. * { 'a': 4, 'b': 5, 'c': 6 }
  15833. * ];
  15834. *
  15835. * _.find(objects, _.matchesProperty('a', 4));
  15836. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15837. */
  15838. function matchesProperty(path, srcValue) {
  15839. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15840. }
  15841. /**
  15842. * Creates a function that invokes the method at `path` of a given object.
  15843. * Any additional arguments are provided to the invoked method.
  15844. *
  15845. * @static
  15846. * @memberOf _
  15847. * @since 3.7.0
  15848. * @category Util
  15849. * @param {Array|string} path The path of the method to invoke.
  15850. * @param {...*} [args] The arguments to invoke the method with.
  15851. * @returns {Function} Returns the new invoker function.
  15852. * @example
  15853. *
  15854. * var objects = [
  15855. * { 'a': { 'b': _.constant(2) } },
  15856. * { 'a': { 'b': _.constant(1) } }
  15857. * ];
  15858. *
  15859. * _.map(objects, _.method('a.b'));
  15860. * // => [2, 1]
  15861. *
  15862. * _.map(objects, _.method(['a', 'b']));
  15863. * // => [2, 1]
  15864. */
  15865. var method = baseRest(function(path, args) {
  15866. return function(object) {
  15867. return baseInvoke(object, path, args);
  15868. };
  15869. });
  15870. /**
  15871. * The opposite of `_.method`; this method creates a function that invokes
  15872. * the method at a given path of `object`. Any additional arguments are
  15873. * provided to the invoked method.
  15874. *
  15875. * @static
  15876. * @memberOf _
  15877. * @since 3.7.0
  15878. * @category Util
  15879. * @param {Object} object The object to query.
  15880. * @param {...*} [args] The arguments to invoke the method with.
  15881. * @returns {Function} Returns the new invoker function.
  15882. * @example
  15883. *
  15884. * var array = _.times(3, _.constant),
  15885. * object = { 'a': array, 'b': array, 'c': array };
  15886. *
  15887. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15888. * // => [2, 0]
  15889. *
  15890. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15891. * // => [2, 0]
  15892. */
  15893. var methodOf = baseRest(function(object, args) {
  15894. return function(path) {
  15895. return baseInvoke(object, path, args);
  15896. };
  15897. });
  15898. /**
  15899. * Adds all own enumerable string keyed function properties of a source
  15900. * object to the destination object. If `object` is a function, then methods
  15901. * are added to its prototype as well.
  15902. *
  15903. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15904. * avoid conflicts caused by modifying the original.
  15905. *
  15906. * @static
  15907. * @since 0.1.0
  15908. * @memberOf _
  15909. * @category Util
  15910. * @param {Function|Object} [object=lodash] The destination object.
  15911. * @param {Object} source The object of functions to add.
  15912. * @param {Object} [options={}] The options object.
  15913. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15914. * @returns {Function|Object} Returns `object`.
  15915. * @example
  15916. *
  15917. * function vowels(string) {
  15918. * return _.filter(string, function(v) {
  15919. * return /[aeiou]/i.test(v);
  15920. * });
  15921. * }
  15922. *
  15923. * _.mixin({ 'vowels': vowels });
  15924. * _.vowels('fred');
  15925. * // => ['e']
  15926. *
  15927. * _('fred').vowels().value();
  15928. * // => ['e']
  15929. *
  15930. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15931. * _('fred').vowels();
  15932. * // => ['e']
  15933. */
  15934. function mixin(object, source, options) {
  15935. var props = keys(source),
  15936. methodNames = baseFunctions(source, props);
  15937. if (options == null &&
  15938. !(isObject(source) && (methodNames.length || !props.length))) {
  15939. options = source;
  15940. source = object;
  15941. object = this;
  15942. methodNames = baseFunctions(source, keys(source));
  15943. }
  15944. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15945. isFunc = isFunction(object);
  15946. arrayEach(methodNames, function(methodName) {
  15947. var func = source[methodName];
  15948. object[methodName] = func;
  15949. if (isFunc) {
  15950. object.prototype[methodName] = function() {
  15951. var chainAll = this.__chain__;
  15952. if (chain || chainAll) {
  15953. var result = object(this.__wrapped__),
  15954. actions = result.__actions__ = copyArray(this.__actions__);
  15955. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15956. result.__chain__ = chainAll;
  15957. return result;
  15958. }
  15959. return func.apply(object, arrayPush([this.value()], arguments));
  15960. };
  15961. }
  15962. });
  15963. return object;
  15964. }
  15965. /**
  15966. * Reverts the `_` variable to its previous value and returns a reference to
  15967. * the `lodash` function.
  15968. *
  15969. * @static
  15970. * @since 0.1.0
  15971. * @memberOf _
  15972. * @category Util
  15973. * @returns {Function} Returns the `lodash` function.
  15974. * @example
  15975. *
  15976. * var lodash = _.noConflict();
  15977. */
  15978. function noConflict() {
  15979. if (root._ === this) {
  15980. root._ = oldDash;
  15981. }
  15982. return this;
  15983. }
  15984. /**
  15985. * This method returns `undefined`.
  15986. *
  15987. * @static
  15988. * @memberOf _
  15989. * @since 2.3.0
  15990. * @category Util
  15991. * @example
  15992. *
  15993. * _.times(2, _.noop);
  15994. * // => [undefined, undefined]
  15995. */
  15996. function noop() {
  15997. // No operation performed.
  15998. }
  15999. /**
  16000. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16001. * the nth argument from the end is returned.
  16002. *
  16003. * @static
  16004. * @memberOf _
  16005. * @since 4.0.0
  16006. * @category Util
  16007. * @param {number} [n=0] The index of the argument to return.
  16008. * @returns {Function} Returns the new pass-thru function.
  16009. * @example
  16010. *
  16011. * var func = _.nthArg(1);
  16012. * func('a', 'b', 'c', 'd');
  16013. * // => 'b'
  16014. *
  16015. * var func = _.nthArg(-2);
  16016. * func('a', 'b', 'c', 'd');
  16017. * // => 'c'
  16018. */
  16019. function nthArg(n) {
  16020. n = toInteger(n);
  16021. return baseRest(function(args) {
  16022. return baseNth(args, n);
  16023. });
  16024. }
  16025. /**
  16026. * Creates a function that invokes `iteratees` with the arguments it receives
  16027. * and returns their results.
  16028. *
  16029. * @static
  16030. * @memberOf _
  16031. * @since 4.0.0
  16032. * @category Util
  16033. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16034. * The iteratees to invoke.
  16035. * @returns {Function} Returns the new function.
  16036. * @example
  16037. *
  16038. * var func = _.over([Math.max, Math.min]);
  16039. *
  16040. * func(1, 2, 3, 4);
  16041. * // => [4, 1]
  16042. */
  16043. var over = createOver(arrayMap);
  16044. /**
  16045. * Creates a function that checks if **all** of the `predicates` return
  16046. * truthy when invoked with the arguments it receives.
  16047. *
  16048. * @static
  16049. * @memberOf _
  16050. * @since 4.0.0
  16051. * @category Util
  16052. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16053. * The predicates to check.
  16054. * @returns {Function} Returns the new function.
  16055. * @example
  16056. *
  16057. * var func = _.overEvery([Boolean, isFinite]);
  16058. *
  16059. * func('1');
  16060. * // => true
  16061. *
  16062. * func(null);
  16063. * // => false
  16064. *
  16065. * func(NaN);
  16066. * // => false
  16067. */
  16068. var overEvery = createOver(arrayEvery);
  16069. /**
  16070. * Creates a function that checks if **any** of the `predicates` return
  16071. * truthy when invoked with the arguments it receives.
  16072. *
  16073. * @static
  16074. * @memberOf _
  16075. * @since 4.0.0
  16076. * @category Util
  16077. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16078. * The predicates to check.
  16079. * @returns {Function} Returns the new function.
  16080. * @example
  16081. *
  16082. * var func = _.overSome([Boolean, isFinite]);
  16083. *
  16084. * func('1');
  16085. * // => true
  16086. *
  16087. * func(null);
  16088. * // => true
  16089. *
  16090. * func(NaN);
  16091. * // => false
  16092. */
  16093. var overSome = createOver(arraySome);
  16094. /**
  16095. * Creates a function that returns the value at `path` of a given object.
  16096. *
  16097. * @static
  16098. * @memberOf _
  16099. * @since 2.4.0
  16100. * @category Util
  16101. * @param {Array|string} path The path of the property to get.
  16102. * @returns {Function} Returns the new accessor function.
  16103. * @example
  16104. *
  16105. * var objects = [
  16106. * { 'a': { 'b': 2 } },
  16107. * { 'a': { 'b': 1 } }
  16108. * ];
  16109. *
  16110. * _.map(objects, _.property('a.b'));
  16111. * // => [2, 1]
  16112. *
  16113. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16114. * // => [1, 2]
  16115. */
  16116. function property(path) {
  16117. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16118. }
  16119. /**
  16120. * The opposite of `_.property`; this method creates a function that returns
  16121. * the value at a given path of `object`.
  16122. *
  16123. * @static
  16124. * @memberOf _
  16125. * @since 3.0.0
  16126. * @category Util
  16127. * @param {Object} object The object to query.
  16128. * @returns {Function} Returns the new accessor function.
  16129. * @example
  16130. *
  16131. * var array = [0, 1, 2],
  16132. * object = { 'a': array, 'b': array, 'c': array };
  16133. *
  16134. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16135. * // => [2, 0]
  16136. *
  16137. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16138. * // => [2, 0]
  16139. */
  16140. function propertyOf(object) {
  16141. return function(path) {
  16142. return object == null ? undefined : baseGet(object, path);
  16143. };
  16144. }
  16145. /**
  16146. * Creates an array of numbers (positive and/or negative) progressing from
  16147. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16148. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16149. * it's set to `start` with `start` then set to `0`.
  16150. *
  16151. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16152. * floating-point values which can produce unexpected results.
  16153. *
  16154. * @static
  16155. * @since 0.1.0
  16156. * @memberOf _
  16157. * @category Util
  16158. * @param {number} [start=0] The start of the range.
  16159. * @param {number} end The end of the range.
  16160. * @param {number} [step=1] The value to increment or decrement by.
  16161. * @returns {Array} Returns the range of numbers.
  16162. * @see _.inRange, _.rangeRight
  16163. * @example
  16164. *
  16165. * _.range(4);
  16166. * // => [0, 1, 2, 3]
  16167. *
  16168. * _.range(-4);
  16169. * // => [0, -1, -2, -3]
  16170. *
  16171. * _.range(1, 5);
  16172. * // => [1, 2, 3, 4]
  16173. *
  16174. * _.range(0, 20, 5);
  16175. * // => [0, 5, 10, 15]
  16176. *
  16177. * _.range(0, -4, -1);
  16178. * // => [0, -1, -2, -3]
  16179. *
  16180. * _.range(1, 4, 0);
  16181. * // => [1, 1, 1]
  16182. *
  16183. * _.range(0);
  16184. * // => []
  16185. */
  16186. var range = createRange();
  16187. /**
  16188. * This method is like `_.range` except that it populates values in
  16189. * descending order.
  16190. *
  16191. * @static
  16192. * @memberOf _
  16193. * @since 4.0.0
  16194. * @category Util
  16195. * @param {number} [start=0] The start of the range.
  16196. * @param {number} end The end of the range.
  16197. * @param {number} [step=1] The value to increment or decrement by.
  16198. * @returns {Array} Returns the range of numbers.
  16199. * @see _.inRange, _.range
  16200. * @example
  16201. *
  16202. * _.rangeRight(4);
  16203. * // => [3, 2, 1, 0]
  16204. *
  16205. * _.rangeRight(-4);
  16206. * // => [-3, -2, -1, 0]
  16207. *
  16208. * _.rangeRight(1, 5);
  16209. * // => [4, 3, 2, 1]
  16210. *
  16211. * _.rangeRight(0, 20, 5);
  16212. * // => [15, 10, 5, 0]
  16213. *
  16214. * _.rangeRight(0, -4, -1);
  16215. * // => [-3, -2, -1, 0]
  16216. *
  16217. * _.rangeRight(1, 4, 0);
  16218. * // => [1, 1, 1]
  16219. *
  16220. * _.rangeRight(0);
  16221. * // => []
  16222. */
  16223. var rangeRight = createRange(true);
  16224. /**
  16225. * This method returns a new empty array.
  16226. *
  16227. * @static
  16228. * @memberOf _
  16229. * @since 4.13.0
  16230. * @category Util
  16231. * @returns {Array} Returns the new empty array.
  16232. * @example
  16233. *
  16234. * var arrays = _.times(2, _.stubArray);
  16235. *
  16236. * console.log(arrays);
  16237. * // => [[], []]
  16238. *
  16239. * console.log(arrays[0] === arrays[1]);
  16240. * // => false
  16241. */
  16242. function stubArray() {
  16243. return [];
  16244. }
  16245. /**
  16246. * This method returns `false`.
  16247. *
  16248. * @static
  16249. * @memberOf _
  16250. * @since 4.13.0
  16251. * @category Util
  16252. * @returns {boolean} Returns `false`.
  16253. * @example
  16254. *
  16255. * _.times(2, _.stubFalse);
  16256. * // => [false, false]
  16257. */
  16258. function stubFalse() {
  16259. return false;
  16260. }
  16261. /**
  16262. * This method returns a new empty object.
  16263. *
  16264. * @static
  16265. * @memberOf _
  16266. * @since 4.13.0
  16267. * @category Util
  16268. * @returns {Object} Returns the new empty object.
  16269. * @example
  16270. *
  16271. * var objects = _.times(2, _.stubObject);
  16272. *
  16273. * console.log(objects);
  16274. * // => [{}, {}]
  16275. *
  16276. * console.log(objects[0] === objects[1]);
  16277. * // => false
  16278. */
  16279. function stubObject() {
  16280. return {};
  16281. }
  16282. /**
  16283. * This method returns an empty string.
  16284. *
  16285. * @static
  16286. * @memberOf _
  16287. * @since 4.13.0
  16288. * @category Util
  16289. * @returns {string} Returns the empty string.
  16290. * @example
  16291. *
  16292. * _.times(2, _.stubString);
  16293. * // => ['', '']
  16294. */
  16295. function stubString() {
  16296. return '';
  16297. }
  16298. /**
  16299. * This method returns `true`.
  16300. *
  16301. * @static
  16302. * @memberOf _
  16303. * @since 4.13.0
  16304. * @category Util
  16305. * @returns {boolean} Returns `true`.
  16306. * @example
  16307. *
  16308. * _.times(2, _.stubTrue);
  16309. * // => [true, true]
  16310. */
  16311. function stubTrue() {
  16312. return true;
  16313. }
  16314. /**
  16315. * Invokes the iteratee `n` times, returning an array of the results of
  16316. * each invocation. The iteratee is invoked with one argument; (index).
  16317. *
  16318. * @static
  16319. * @since 0.1.0
  16320. * @memberOf _
  16321. * @category Util
  16322. * @param {number} n The number of times to invoke `iteratee`.
  16323. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16324. * @returns {Array} Returns the array of results.
  16325. * @example
  16326. *
  16327. * _.times(3, String);
  16328. * // => ['0', '1', '2']
  16329. *
  16330. * _.times(4, _.constant(0));
  16331. * // => [0, 0, 0, 0]
  16332. */
  16333. function times(n, iteratee) {
  16334. n = toInteger(n);
  16335. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16336. return [];
  16337. }
  16338. var index = MAX_ARRAY_LENGTH,
  16339. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16340. iteratee = getIteratee(iteratee);
  16341. n -= MAX_ARRAY_LENGTH;
  16342. var result = baseTimes(length, iteratee);
  16343. while (++index < n) {
  16344. iteratee(index);
  16345. }
  16346. return result;
  16347. }
  16348. /**
  16349. * Converts `value` to a property path array.
  16350. *
  16351. * @static
  16352. * @memberOf _
  16353. * @since 4.0.0
  16354. * @category Util
  16355. * @param {*} value The value to convert.
  16356. * @returns {Array} Returns the new property path array.
  16357. * @example
  16358. *
  16359. * _.toPath('a.b.c');
  16360. * // => ['a', 'b', 'c']
  16361. *
  16362. * _.toPath('a[0].b.c');
  16363. * // => ['a', '0', 'b', 'c']
  16364. */
  16365. function toPath(value) {
  16366. if (isArray(value)) {
  16367. return arrayMap(value, toKey);
  16368. }
  16369. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16370. }
  16371. /**
  16372. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16373. *
  16374. * @static
  16375. * @since 0.1.0
  16376. * @memberOf _
  16377. * @category Util
  16378. * @param {string} [prefix=''] The value to prefix the ID with.
  16379. * @returns {string} Returns the unique ID.
  16380. * @example
  16381. *
  16382. * _.uniqueId('contact_');
  16383. * // => 'contact_104'
  16384. *
  16385. * _.uniqueId();
  16386. * // => '105'
  16387. */
  16388. function uniqueId(prefix) {
  16389. var id = ++idCounter;
  16390. return toString(prefix) + id;
  16391. }
  16392. /*------------------------------------------------------------------------*/
  16393. /**
  16394. * Adds two numbers.
  16395. *
  16396. * @static
  16397. * @memberOf _
  16398. * @since 3.4.0
  16399. * @category Math
  16400. * @param {number} augend The first number in an addition.
  16401. * @param {number} addend The second number in an addition.
  16402. * @returns {number} Returns the total.
  16403. * @example
  16404. *
  16405. * _.add(6, 4);
  16406. * // => 10
  16407. */
  16408. var add = createMathOperation(function(augend, addend) {
  16409. return augend + addend;
  16410. }, 0);
  16411. /**
  16412. * Computes `number` rounded up to `precision`.
  16413. *
  16414. * @static
  16415. * @memberOf _
  16416. * @since 3.10.0
  16417. * @category Math
  16418. * @param {number} number The number to round up.
  16419. * @param {number} [precision=0] The precision to round up to.
  16420. * @returns {number} Returns the rounded up number.
  16421. * @example
  16422. *
  16423. * _.ceil(4.006);
  16424. * // => 5
  16425. *
  16426. * _.ceil(6.004, 2);
  16427. * // => 6.01
  16428. *
  16429. * _.ceil(6040, -2);
  16430. * // => 6100
  16431. */
  16432. var ceil = createRound('ceil');
  16433. /**
  16434. * Divide two numbers.
  16435. *
  16436. * @static
  16437. * @memberOf _
  16438. * @since 4.7.0
  16439. * @category Math
  16440. * @param {number} dividend The first number in a division.
  16441. * @param {number} divisor The second number in a division.
  16442. * @returns {number} Returns the quotient.
  16443. * @example
  16444. *
  16445. * _.divide(6, 4);
  16446. * // => 1.5
  16447. */
  16448. var divide = createMathOperation(function(dividend, divisor) {
  16449. return dividend / divisor;
  16450. }, 1);
  16451. /**
  16452. * Computes `number` rounded down to `precision`.
  16453. *
  16454. * @static
  16455. * @memberOf _
  16456. * @since 3.10.0
  16457. * @category Math
  16458. * @param {number} number The number to round down.
  16459. * @param {number} [precision=0] The precision to round down to.
  16460. * @returns {number} Returns the rounded down number.
  16461. * @example
  16462. *
  16463. * _.floor(4.006);
  16464. * // => 4
  16465. *
  16466. * _.floor(0.046, 2);
  16467. * // => 0.04
  16468. *
  16469. * _.floor(4060, -2);
  16470. * // => 4000
  16471. */
  16472. var floor = createRound('floor');
  16473. /**
  16474. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16475. * `undefined` is returned.
  16476. *
  16477. * @static
  16478. * @since 0.1.0
  16479. * @memberOf _
  16480. * @category Math
  16481. * @param {Array} array The array to iterate over.
  16482. * @returns {*} Returns the maximum value.
  16483. * @example
  16484. *
  16485. * _.max([4, 2, 8, 6]);
  16486. * // => 8
  16487. *
  16488. * _.max([]);
  16489. * // => undefined
  16490. */
  16491. function max(array) {
  16492. return (array && array.length)
  16493. ? baseExtremum(array, identity, baseGt)
  16494. : undefined;
  16495. }
  16496. /**
  16497. * This method is like `_.max` except that it accepts `iteratee` which is
  16498. * invoked for each element in `array` to generate the criterion by which
  16499. * the value is ranked. The iteratee is invoked with one argument: (value).
  16500. *
  16501. * @static
  16502. * @memberOf _
  16503. * @since 4.0.0
  16504. * @category Math
  16505. * @param {Array} array The array to iterate over.
  16506. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16507. * @returns {*} Returns the maximum value.
  16508. * @example
  16509. *
  16510. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16511. *
  16512. * _.maxBy(objects, function(o) { return o.n; });
  16513. * // => { 'n': 2 }
  16514. *
  16515. * // The `_.property` iteratee shorthand.
  16516. * _.maxBy(objects, 'n');
  16517. * // => { 'n': 2 }
  16518. */
  16519. function maxBy(array, iteratee) {
  16520. return (array && array.length)
  16521. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16522. : undefined;
  16523. }
  16524. /**
  16525. * Computes the mean of the values in `array`.
  16526. *
  16527. * @static
  16528. * @memberOf _
  16529. * @since 4.0.0
  16530. * @category Math
  16531. * @param {Array} array The array to iterate over.
  16532. * @returns {number} Returns the mean.
  16533. * @example
  16534. *
  16535. * _.mean([4, 2, 8, 6]);
  16536. * // => 5
  16537. */
  16538. function mean(array) {
  16539. return baseMean(array, identity);
  16540. }
  16541. /**
  16542. * This method is like `_.mean` except that it accepts `iteratee` which is
  16543. * invoked for each element in `array` to generate the value to be averaged.
  16544. * The iteratee is invoked with one argument: (value).
  16545. *
  16546. * @static
  16547. * @memberOf _
  16548. * @since 4.7.0
  16549. * @category Math
  16550. * @param {Array} array The array to iterate over.
  16551. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16552. * @returns {number} Returns the mean.
  16553. * @example
  16554. *
  16555. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16556. *
  16557. * _.meanBy(objects, function(o) { return o.n; });
  16558. * // => 5
  16559. *
  16560. * // The `_.property` iteratee shorthand.
  16561. * _.meanBy(objects, 'n');
  16562. * // => 5
  16563. */
  16564. function meanBy(array, iteratee) {
  16565. return baseMean(array, getIteratee(iteratee, 2));
  16566. }
  16567. /**
  16568. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16569. * `undefined` is returned.
  16570. *
  16571. * @static
  16572. * @since 0.1.0
  16573. * @memberOf _
  16574. * @category Math
  16575. * @param {Array} array The array to iterate over.
  16576. * @returns {*} Returns the minimum value.
  16577. * @example
  16578. *
  16579. * _.min([4, 2, 8, 6]);
  16580. * // => 2
  16581. *
  16582. * _.min([]);
  16583. * // => undefined
  16584. */
  16585. function min(array) {
  16586. return (array && array.length)
  16587. ? baseExtremum(array, identity, baseLt)
  16588. : undefined;
  16589. }
  16590. /**
  16591. * This method is like `_.min` except that it accepts `iteratee` which is
  16592. * invoked for each element in `array` to generate the criterion by which
  16593. * the value is ranked. The iteratee is invoked with one argument: (value).
  16594. *
  16595. * @static
  16596. * @memberOf _
  16597. * @since 4.0.0
  16598. * @category Math
  16599. * @param {Array} array The array to iterate over.
  16600. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16601. * @returns {*} Returns the minimum value.
  16602. * @example
  16603. *
  16604. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16605. *
  16606. * _.minBy(objects, function(o) { return o.n; });
  16607. * // => { 'n': 1 }
  16608. *
  16609. * // The `_.property` iteratee shorthand.
  16610. * _.minBy(objects, 'n');
  16611. * // => { 'n': 1 }
  16612. */
  16613. function minBy(array, iteratee) {
  16614. return (array && array.length)
  16615. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16616. : undefined;
  16617. }
  16618. /**
  16619. * Multiply two numbers.
  16620. *
  16621. * @static
  16622. * @memberOf _
  16623. * @since 4.7.0
  16624. * @category Math
  16625. * @param {number} multiplier The first number in a multiplication.
  16626. * @param {number} multiplicand The second number in a multiplication.
  16627. * @returns {number} Returns the product.
  16628. * @example
  16629. *
  16630. * _.multiply(6, 4);
  16631. * // => 24
  16632. */
  16633. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16634. return multiplier * multiplicand;
  16635. }, 1);
  16636. /**
  16637. * Computes `number` rounded to `precision`.
  16638. *
  16639. * @static
  16640. * @memberOf _
  16641. * @since 3.10.0
  16642. * @category Math
  16643. * @param {number} number The number to round.
  16644. * @param {number} [precision=0] The precision to round to.
  16645. * @returns {number} Returns the rounded number.
  16646. * @example
  16647. *
  16648. * _.round(4.006);
  16649. * // => 4
  16650. *
  16651. * _.round(4.006, 2);
  16652. * // => 4.01
  16653. *
  16654. * _.round(4060, -2);
  16655. * // => 4100
  16656. */
  16657. var round = createRound('round');
  16658. /**
  16659. * Subtract two numbers.
  16660. *
  16661. * @static
  16662. * @memberOf _
  16663. * @since 4.0.0
  16664. * @category Math
  16665. * @param {number} minuend The first number in a subtraction.
  16666. * @param {number} subtrahend The second number in a subtraction.
  16667. * @returns {number} Returns the difference.
  16668. * @example
  16669. *
  16670. * _.subtract(6, 4);
  16671. * // => 2
  16672. */
  16673. var subtract = createMathOperation(function(minuend, subtrahend) {
  16674. return minuend - subtrahend;
  16675. }, 0);
  16676. /**
  16677. * Computes the sum of the values in `array`.
  16678. *
  16679. * @static
  16680. * @memberOf _
  16681. * @since 3.4.0
  16682. * @category Math
  16683. * @param {Array} array The array to iterate over.
  16684. * @returns {number} Returns the sum.
  16685. * @example
  16686. *
  16687. * _.sum([4, 2, 8, 6]);
  16688. * // => 20
  16689. */
  16690. function sum(array) {
  16691. return (array && array.length)
  16692. ? baseSum(array, identity)
  16693. : 0;
  16694. }
  16695. /**
  16696. * This method is like `_.sum` except that it accepts `iteratee` which is
  16697. * invoked for each element in `array` to generate the value to be summed.
  16698. * The iteratee is invoked with one argument: (value).
  16699. *
  16700. * @static
  16701. * @memberOf _
  16702. * @since 4.0.0
  16703. * @category Math
  16704. * @param {Array} array The array to iterate over.
  16705. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16706. * @returns {number} Returns the sum.
  16707. * @example
  16708. *
  16709. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16710. *
  16711. * _.sumBy(objects, function(o) { return o.n; });
  16712. * // => 20
  16713. *
  16714. * // The `_.property` iteratee shorthand.
  16715. * _.sumBy(objects, 'n');
  16716. * // => 20
  16717. */
  16718. function sumBy(array, iteratee) {
  16719. return (array && array.length)
  16720. ? baseSum(array, getIteratee(iteratee, 2))
  16721. : 0;
  16722. }
  16723. /*------------------------------------------------------------------------*/
  16724. // Add methods that return wrapped values in chain sequences.
  16725. lodash.after = after;
  16726. lodash.ary = ary;
  16727. lodash.assign = assign;
  16728. lodash.assignIn = assignIn;
  16729. lodash.assignInWith = assignInWith;
  16730. lodash.assignWith = assignWith;
  16731. lodash.at = at;
  16732. lodash.before = before;
  16733. lodash.bind = bind;
  16734. lodash.bindAll = bindAll;
  16735. lodash.bindKey = bindKey;
  16736. lodash.castArray = castArray;
  16737. lodash.chain = chain;
  16738. lodash.chunk = chunk;
  16739. lodash.compact = compact;
  16740. lodash.concat = concat;
  16741. lodash.cond = cond;
  16742. lodash.conforms = conforms;
  16743. lodash.constant = constant;
  16744. lodash.countBy = countBy;
  16745. lodash.create = create;
  16746. lodash.curry = curry;
  16747. lodash.curryRight = curryRight;
  16748. lodash.debounce = debounce;
  16749. lodash.defaults = defaults;
  16750. lodash.defaultsDeep = defaultsDeep;
  16751. lodash.defer = defer;
  16752. lodash.delay = delay;
  16753. lodash.difference = difference;
  16754. lodash.differenceBy = differenceBy;
  16755. lodash.differenceWith = differenceWith;
  16756. lodash.drop = drop;
  16757. lodash.dropRight = dropRight;
  16758. lodash.dropRightWhile = dropRightWhile;
  16759. lodash.dropWhile = dropWhile;
  16760. lodash.fill = fill;
  16761. lodash.filter = filter;
  16762. lodash.flatMap = flatMap;
  16763. lodash.flatMapDeep = flatMapDeep;
  16764. lodash.flatMapDepth = flatMapDepth;
  16765. lodash.flatten = flatten;
  16766. lodash.flattenDeep = flattenDeep;
  16767. lodash.flattenDepth = flattenDepth;
  16768. lodash.flip = flip;
  16769. lodash.flow = flow;
  16770. lodash.flowRight = flowRight;
  16771. lodash.fromPairs = fromPairs;
  16772. lodash.functions = functions;
  16773. lodash.functionsIn = functionsIn;
  16774. lodash.groupBy = groupBy;
  16775. lodash.initial = initial;
  16776. lodash.intersection = intersection;
  16777. lodash.intersectionBy = intersectionBy;
  16778. lodash.intersectionWith = intersectionWith;
  16779. lodash.invert = invert;
  16780. lodash.invertBy = invertBy;
  16781. lodash.invokeMap = invokeMap;
  16782. lodash.iteratee = iteratee;
  16783. lodash.keyBy = keyBy;
  16784. lodash.keys = keys;
  16785. lodash.keysIn = keysIn;
  16786. lodash.map = map;
  16787. lodash.mapKeys = mapKeys;
  16788. lodash.mapValues = mapValues;
  16789. lodash.matches = matches;
  16790. lodash.matchesProperty = matchesProperty;
  16791. lodash.memoize = memoize;
  16792. lodash.merge = merge;
  16793. lodash.mergeWith = mergeWith;
  16794. lodash.method = method;
  16795. lodash.methodOf = methodOf;
  16796. lodash.mixin = mixin;
  16797. lodash.negate = negate;
  16798. lodash.nthArg = nthArg;
  16799. lodash.omit = omit;
  16800. lodash.omitBy = omitBy;
  16801. lodash.once = once;
  16802. lodash.orderBy = orderBy;
  16803. lodash.over = over;
  16804. lodash.overArgs = overArgs;
  16805. lodash.overEvery = overEvery;
  16806. lodash.overSome = overSome;
  16807. lodash.partial = partial;
  16808. lodash.partialRight = partialRight;
  16809. lodash.partition = partition;
  16810. lodash.pick = pick;
  16811. lodash.pickBy = pickBy;
  16812. lodash.property = property;
  16813. lodash.propertyOf = propertyOf;
  16814. lodash.pull = pull;
  16815. lodash.pullAll = pullAll;
  16816. lodash.pullAllBy = pullAllBy;
  16817. lodash.pullAllWith = pullAllWith;
  16818. lodash.pullAt = pullAt;
  16819. lodash.range = range;
  16820. lodash.rangeRight = rangeRight;
  16821. lodash.rearg = rearg;
  16822. lodash.reject = reject;
  16823. lodash.remove = remove;
  16824. lodash.rest = rest;
  16825. lodash.reverse = reverse;
  16826. lodash.sampleSize = sampleSize;
  16827. lodash.set = set;
  16828. lodash.setWith = setWith;
  16829. lodash.shuffle = shuffle;
  16830. lodash.slice = slice;
  16831. lodash.sortBy = sortBy;
  16832. lodash.sortedUniq = sortedUniq;
  16833. lodash.sortedUniqBy = sortedUniqBy;
  16834. lodash.split = split;
  16835. lodash.spread = spread;
  16836. lodash.tail = tail;
  16837. lodash.take = take;
  16838. lodash.takeRight = takeRight;
  16839. lodash.takeRightWhile = takeRightWhile;
  16840. lodash.takeWhile = takeWhile;
  16841. lodash.tap = tap;
  16842. lodash.throttle = throttle;
  16843. lodash.thru = thru;
  16844. lodash.toArray = toArray;
  16845. lodash.toPairs = toPairs;
  16846. lodash.toPairsIn = toPairsIn;
  16847. lodash.toPath = toPath;
  16848. lodash.toPlainObject = toPlainObject;
  16849. lodash.transform = transform;
  16850. lodash.unary = unary;
  16851. lodash.union = union;
  16852. lodash.unionBy = unionBy;
  16853. lodash.unionWith = unionWith;
  16854. lodash.uniq = uniq;
  16855. lodash.uniqBy = uniqBy;
  16856. lodash.uniqWith = uniqWith;
  16857. lodash.unset = unset;
  16858. lodash.unzip = unzip;
  16859. lodash.unzipWith = unzipWith;
  16860. lodash.update = update;
  16861. lodash.updateWith = updateWith;
  16862. lodash.values = values;
  16863. lodash.valuesIn = valuesIn;
  16864. lodash.without = without;
  16865. lodash.words = words;
  16866. lodash.wrap = wrap;
  16867. lodash.xor = xor;
  16868. lodash.xorBy = xorBy;
  16869. lodash.xorWith = xorWith;
  16870. lodash.zip = zip;
  16871. lodash.zipObject = zipObject;
  16872. lodash.zipObjectDeep = zipObjectDeep;
  16873. lodash.zipWith = zipWith;
  16874. // Add aliases.
  16875. lodash.entries = toPairs;
  16876. lodash.entriesIn = toPairsIn;
  16877. lodash.extend = assignIn;
  16878. lodash.extendWith = assignInWith;
  16879. // Add methods to `lodash.prototype`.
  16880. mixin(lodash, lodash);
  16881. /*------------------------------------------------------------------------*/
  16882. // Add methods that return unwrapped values in chain sequences.
  16883. lodash.add = add;
  16884. lodash.attempt = attempt;
  16885. lodash.camelCase = camelCase;
  16886. lodash.capitalize = capitalize;
  16887. lodash.ceil = ceil;
  16888. lodash.clamp = clamp;
  16889. lodash.clone = clone;
  16890. lodash.cloneDeep = cloneDeep;
  16891. lodash.cloneDeepWith = cloneDeepWith;
  16892. lodash.cloneWith = cloneWith;
  16893. lodash.conformsTo = conformsTo;
  16894. lodash.deburr = deburr;
  16895. lodash.defaultTo = defaultTo;
  16896. lodash.divide = divide;
  16897. lodash.endsWith = endsWith;
  16898. lodash.eq = eq;
  16899. lodash.escape = escape;
  16900. lodash.escapeRegExp = escapeRegExp;
  16901. lodash.every = every;
  16902. lodash.find = find;
  16903. lodash.findIndex = findIndex;
  16904. lodash.findKey = findKey;
  16905. lodash.findLast = findLast;
  16906. lodash.findLastIndex = findLastIndex;
  16907. lodash.findLastKey = findLastKey;
  16908. lodash.floor = floor;
  16909. lodash.forEach = forEach;
  16910. lodash.forEachRight = forEachRight;
  16911. lodash.forIn = forIn;
  16912. lodash.forInRight = forInRight;
  16913. lodash.forOwn = forOwn;
  16914. lodash.forOwnRight = forOwnRight;
  16915. lodash.get = get;
  16916. lodash.gt = gt;
  16917. lodash.gte = gte;
  16918. lodash.has = has;
  16919. lodash.hasIn = hasIn;
  16920. lodash.head = head;
  16921. lodash.identity = identity;
  16922. lodash.includes = includes;
  16923. lodash.indexOf = indexOf;
  16924. lodash.inRange = inRange;
  16925. lodash.invoke = invoke;
  16926. lodash.isArguments = isArguments;
  16927. lodash.isArray = isArray;
  16928. lodash.isArrayBuffer = isArrayBuffer;
  16929. lodash.isArrayLike = isArrayLike;
  16930. lodash.isArrayLikeObject = isArrayLikeObject;
  16931. lodash.isBoolean = isBoolean;
  16932. lodash.isBuffer = isBuffer;
  16933. lodash.isDate = isDate;
  16934. lodash.isElement = isElement;
  16935. lodash.isEmpty = isEmpty;
  16936. lodash.isEqual = isEqual;
  16937. lodash.isEqualWith = isEqualWith;
  16938. lodash.isError = isError;
  16939. lodash.isFinite = isFinite;
  16940. lodash.isFunction = isFunction;
  16941. lodash.isInteger = isInteger;
  16942. lodash.isLength = isLength;
  16943. lodash.isMap = isMap;
  16944. lodash.isMatch = isMatch;
  16945. lodash.isMatchWith = isMatchWith;
  16946. lodash.isNaN = isNaN;
  16947. lodash.isNative = isNative;
  16948. lodash.isNil = isNil;
  16949. lodash.isNull = isNull;
  16950. lodash.isNumber = isNumber;
  16951. lodash.isObject = isObject;
  16952. lodash.isObjectLike = isObjectLike;
  16953. lodash.isPlainObject = isPlainObject;
  16954. lodash.isRegExp = isRegExp;
  16955. lodash.isSafeInteger = isSafeInteger;
  16956. lodash.isSet = isSet;
  16957. lodash.isString = isString;
  16958. lodash.isSymbol = isSymbol;
  16959. lodash.isTypedArray = isTypedArray;
  16960. lodash.isUndefined = isUndefined;
  16961. lodash.isWeakMap = isWeakMap;
  16962. lodash.isWeakSet = isWeakSet;
  16963. lodash.join = join;
  16964. lodash.kebabCase = kebabCase;
  16965. lodash.last = last;
  16966. lodash.lastIndexOf = lastIndexOf;
  16967. lodash.lowerCase = lowerCase;
  16968. lodash.lowerFirst = lowerFirst;
  16969. lodash.lt = lt;
  16970. lodash.lte = lte;
  16971. lodash.max = max;
  16972. lodash.maxBy = maxBy;
  16973. lodash.mean = mean;
  16974. lodash.meanBy = meanBy;
  16975. lodash.min = min;
  16976. lodash.minBy = minBy;
  16977. lodash.stubArray = stubArray;
  16978. lodash.stubFalse = stubFalse;
  16979. lodash.stubObject = stubObject;
  16980. lodash.stubString = stubString;
  16981. lodash.stubTrue = stubTrue;
  16982. lodash.multiply = multiply;
  16983. lodash.nth = nth;
  16984. lodash.noConflict = noConflict;
  16985. lodash.noop = noop;
  16986. lodash.now = now;
  16987. lodash.pad = pad;
  16988. lodash.padEnd = padEnd;
  16989. lodash.padStart = padStart;
  16990. lodash.parseInt = parseInt;
  16991. lodash.random = random;
  16992. lodash.reduce = reduce;
  16993. lodash.reduceRight = reduceRight;
  16994. lodash.repeat = repeat;
  16995. lodash.replace = replace;
  16996. lodash.result = result;
  16997. lodash.round = round;
  16998. lodash.runInContext = runInContext;
  16999. lodash.sample = sample;
  17000. lodash.size = size;
  17001. lodash.snakeCase = snakeCase;
  17002. lodash.some = some;
  17003. lodash.sortedIndex = sortedIndex;
  17004. lodash.sortedIndexBy = sortedIndexBy;
  17005. lodash.sortedIndexOf = sortedIndexOf;
  17006. lodash.sortedLastIndex = sortedLastIndex;
  17007. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17008. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17009. lodash.startCase = startCase;
  17010. lodash.startsWith = startsWith;
  17011. lodash.subtract = subtract;
  17012. lodash.sum = sum;
  17013. lodash.sumBy = sumBy;
  17014. lodash.template = template;
  17015. lodash.times = times;
  17016. lodash.toFinite = toFinite;
  17017. lodash.toInteger = toInteger;
  17018. lodash.toLength = toLength;
  17019. lodash.toLower = toLower;
  17020. lodash.toNumber = toNumber;
  17021. lodash.toSafeInteger = toSafeInteger;
  17022. lodash.toString = toString;
  17023. lodash.toUpper = toUpper;
  17024. lodash.trim = trim;
  17025. lodash.trimEnd = trimEnd;
  17026. lodash.trimStart = trimStart;
  17027. lodash.truncate = truncate;
  17028. lodash.unescape = unescape;
  17029. lodash.uniqueId = uniqueId;
  17030. lodash.upperCase = upperCase;
  17031. lodash.upperFirst = upperFirst;
  17032. // Add aliases.
  17033. lodash.each = forEach;
  17034. lodash.eachRight = forEachRight;
  17035. lodash.first = head;
  17036. mixin(lodash, (function() {
  17037. var source = {};
  17038. baseForOwn(lodash, function(func, methodName) {
  17039. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17040. source[methodName] = func;
  17041. }
  17042. });
  17043. return source;
  17044. }()), { 'chain': false });
  17045. /*------------------------------------------------------------------------*/
  17046. /**
  17047. * The semantic version number.
  17048. *
  17049. * @static
  17050. * @memberOf _
  17051. * @type {string}
  17052. */
  17053. lodash.VERSION = VERSION;
  17054. // Assign default placeholders.
  17055. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17056. lodash[methodName].placeholder = lodash;
  17057. });
  17058. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17059. arrayEach(['drop', 'take'], function(methodName, index) {
  17060. LazyWrapper.prototype[methodName] = function(n) {
  17061. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17062. var result = (this.__filtered__ && !index)
  17063. ? new LazyWrapper(this)
  17064. : this.clone();
  17065. if (result.__filtered__) {
  17066. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17067. } else {
  17068. result.__views__.push({
  17069. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17070. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17071. });
  17072. }
  17073. return result;
  17074. };
  17075. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17076. return this.reverse()[methodName](n).reverse();
  17077. };
  17078. });
  17079. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17080. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17081. var type = index + 1,
  17082. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17083. LazyWrapper.prototype[methodName] = function(iteratee) {
  17084. var result = this.clone();
  17085. result.__iteratees__.push({
  17086. 'iteratee': getIteratee(iteratee, 3),
  17087. 'type': type
  17088. });
  17089. result.__filtered__ = result.__filtered__ || isFilter;
  17090. return result;
  17091. };
  17092. });
  17093. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17094. arrayEach(['head', 'last'], function(methodName, index) {
  17095. var takeName = 'take' + (index ? 'Right' : '');
  17096. LazyWrapper.prototype[methodName] = function() {
  17097. return this[takeName](1).value()[0];
  17098. };
  17099. });
  17100. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17101. arrayEach(['initial', 'tail'], function(methodName, index) {
  17102. var dropName = 'drop' + (index ? '' : 'Right');
  17103. LazyWrapper.prototype[methodName] = function() {
  17104. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17105. };
  17106. });
  17107. LazyWrapper.prototype.compact = function() {
  17108. return this.filter(identity);
  17109. };
  17110. LazyWrapper.prototype.find = function(predicate) {
  17111. return this.filter(predicate).head();
  17112. };
  17113. LazyWrapper.prototype.findLast = function(predicate) {
  17114. return this.reverse().find(predicate);
  17115. };
  17116. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17117. if (typeof path == 'function') {
  17118. return new LazyWrapper(this);
  17119. }
  17120. return this.map(function(value) {
  17121. return baseInvoke(value, path, args);
  17122. });
  17123. });
  17124. LazyWrapper.prototype.reject = function(predicate) {
  17125. return this.filter(negate(getIteratee(predicate)));
  17126. };
  17127. LazyWrapper.prototype.slice = function(start, end) {
  17128. start = toInteger(start);
  17129. var result = this;
  17130. if (result.__filtered__ && (start > 0 || end < 0)) {
  17131. return new LazyWrapper(result);
  17132. }
  17133. if (start < 0) {
  17134. result = result.takeRight(-start);
  17135. } else if (start) {
  17136. result = result.drop(start);
  17137. }
  17138. if (end !== undefined) {
  17139. end = toInteger(end);
  17140. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17141. }
  17142. return result;
  17143. };
  17144. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17145. return this.reverse().takeWhile(predicate).reverse();
  17146. };
  17147. LazyWrapper.prototype.toArray = function() {
  17148. return this.take(MAX_ARRAY_LENGTH);
  17149. };
  17150. // Add `LazyWrapper` methods to `lodash.prototype`.
  17151. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17152. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17153. isTaker = /^(?:head|last)$/.test(methodName),
  17154. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17155. retUnwrapped = isTaker || /^find/.test(methodName);
  17156. if (!lodashFunc) {
  17157. return;
  17158. }
  17159. lodash.prototype[methodName] = function() {
  17160. var value = this.__wrapped__,
  17161. args = isTaker ? [1] : arguments,
  17162. isLazy = value instanceof LazyWrapper,
  17163. iteratee = args[0],
  17164. useLazy = isLazy || isArray(value);
  17165. var interceptor = function(value) {
  17166. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17167. return (isTaker && chainAll) ? result[0] : result;
  17168. };
  17169. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17170. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17171. isLazy = useLazy = false;
  17172. }
  17173. var chainAll = this.__chain__,
  17174. isHybrid = !!this.__actions__.length,
  17175. isUnwrapped = retUnwrapped && !chainAll,
  17176. onlyLazy = isLazy && !isHybrid;
  17177. if (!retUnwrapped && useLazy) {
  17178. value = onlyLazy ? value : new LazyWrapper(this);
  17179. var result = func.apply(value, args);
  17180. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17181. return new LodashWrapper(result, chainAll);
  17182. }
  17183. if (isUnwrapped && onlyLazy) {
  17184. return func.apply(this, args);
  17185. }
  17186. result = this.thru(interceptor);
  17187. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17188. };
  17189. });
  17190. // Add `Array` methods to `lodash.prototype`.
  17191. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17192. var func = arrayProto[methodName],
  17193. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17194. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17195. lodash.prototype[methodName] = function() {
  17196. var args = arguments;
  17197. if (retUnwrapped && !this.__chain__) {
  17198. var value = this.value();
  17199. return func.apply(isArray(value) ? value : [], args);
  17200. }
  17201. return this[chainName](function(value) {
  17202. return func.apply(isArray(value) ? value : [], args);
  17203. });
  17204. };
  17205. });
  17206. // Map minified method names to their real names.
  17207. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17208. var lodashFunc = lodash[methodName];
  17209. if (lodashFunc) {
  17210. var key = (lodashFunc.name + ''),
  17211. names = realNames[key] || (realNames[key] = []);
  17212. names.push({ 'name': methodName, 'func': lodashFunc });
  17213. }
  17214. });
  17215. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17216. 'name': 'wrapper',
  17217. 'func': undefined
  17218. }];
  17219. // Add methods to `LazyWrapper`.
  17220. LazyWrapper.prototype.clone = lazyClone;
  17221. LazyWrapper.prototype.reverse = lazyReverse;
  17222. LazyWrapper.prototype.value = lazyValue;
  17223. // Add chain sequence methods to the `lodash` wrapper.
  17224. lodash.prototype.at = wrapperAt;
  17225. lodash.prototype.chain = wrapperChain;
  17226. lodash.prototype.commit = wrapperCommit;
  17227. lodash.prototype.next = wrapperNext;
  17228. lodash.prototype.plant = wrapperPlant;
  17229. lodash.prototype.reverse = wrapperReverse;
  17230. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17231. // Add lazy aliases.
  17232. lodash.prototype.first = lodash.prototype.head;
  17233. if (symIterator) {
  17234. lodash.prototype[symIterator] = wrapperToIterator;
  17235. }
  17236. return lodash;
  17237. });
  17238. /*--------------------------------------------------------------------------*/
  17239. // Export lodash.
  17240. var _ = runInContext();
  17241. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17242. if (typeof undefined == 'function' && typeof undefined.amd == 'object' && undefined.amd) {
  17243. // Expose Lodash on the global object to prevent errors when Lodash is
  17244. // loaded by a script tag in the presence of an AMD loader.
  17245. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17246. // Use `_.noConflict` to remove Lodash from the global object.
  17247. root._ = _;
  17248. // Define as an anonymous module so, through path mapping, it can be
  17249. // referenced as the "underscore" module.
  17250. undefined(function() {
  17251. return _;
  17252. });
  17253. }
  17254. // Check for `exports` after `define` in case a build optimizer adds it.
  17255. else if (freeModule) {
  17256. // Export for Node.js.
  17257. (freeModule.exports = _)._ = _;
  17258. // Export for CommonJS support.
  17259. freeExports._ = _;
  17260. }
  17261. else {
  17262. // Export to the global object.
  17263. root._ = _;
  17264. }
  17265. }.call(commonjsGlobal));
  17266. });
  17267. var slice$3 = lib.prototypes.string.slice;
  17268. var typeOf$1 = lib.typeOf;
  17269. var valueToString$4 = lib.valueToString;
  17270. var iterableToString = function iterableToString(obj) {
  17271. var representation = "";
  17272. function stringify(item) {
  17273. return typeof item === "string"
  17274. ? "'" + item + "'"
  17275. : valueToString$4(item);
  17276. }
  17277. function mapToString(map) {
  17278. /* eslint-disable-next-line local-rules/no-prototype-methods */
  17279. map.forEach(function(value, key) {
  17280. representation +=
  17281. "[" + stringify(key) + "," + stringify(value) + "],";
  17282. });
  17283. representation = slice$3(representation, 0, -1);
  17284. return representation;
  17285. }
  17286. function genericIterableToString(iterable) {
  17287. /* eslint-disable-next-line local-rules/no-prototype-methods */
  17288. iterable.forEach(function(value) {
  17289. representation += stringify(value) + ",";
  17290. });
  17291. representation = slice$3(representation, 0, -1);
  17292. return representation;
  17293. }
  17294. if (typeOf$1(obj) === "map") {
  17295. return mapToString(obj);
  17296. }
  17297. return genericIterableToString(obj);
  17298. };
  17299. var arrayProto$3 = lib.prototypes.array;
  17300. var deepEqual$1 = deepEqual.use(match); // eslint-disable-line no-use-before-define
  17301. var every$3 = lib.every;
  17302. var functionName$2 = lib.functionName;
  17303. var get = lodash.get;
  17304. var objectProto = lib.prototypes.object;
  17305. var stringProto = lib.prototypes.string;
  17306. var typeOf$2 = lib.typeOf;
  17307. var valueToString$5 = lib.valueToString;
  17308. var arrayIndexOf = arrayProto$3.indexOf;
  17309. var arrayEvery = arrayProto$3.every;
  17310. var join$2 = arrayProto$3.join;
  17311. var map = arrayProto$3.map;
  17312. var some = arrayProto$3.some;
  17313. var hasOwnProperty$3 = objectProto.hasOwnProperty;
  17314. var isPrototypeOf = objectProto.isPrototypeOf;
  17315. var stringIndexOf = stringProto.indexOf;
  17316. function assertType(value, type, name) {
  17317. var actual = typeOf$2(value);
  17318. if (actual !== type) {
  17319. throw new TypeError(
  17320. "Expected type of " +
  17321. name +
  17322. " to be " +
  17323. type +
  17324. ", but was " +
  17325. actual
  17326. );
  17327. }
  17328. }
  17329. function assertMethodExists(value, method, name, methodPath) {
  17330. if (value[method] == null) {
  17331. throw new TypeError(
  17332. "Expected " + name + " to have method " + methodPath
  17333. );
  17334. }
  17335. }
  17336. var matcher = {
  17337. toString: function() {
  17338. return this.message;
  17339. }
  17340. };
  17341. function isMatcher(object) {
  17342. return isPrototypeOf(matcher, object);
  17343. }
  17344. function matchObject(actual, expectation) {
  17345. if (actual === null || actual === undefined) {
  17346. return false;
  17347. }
  17348. return arrayEvery(Object.keys(expectation), function(key) {
  17349. var exp = expectation[key];
  17350. var act = actual[key];
  17351. if (isMatcher(exp)) {
  17352. if (!exp.test(act)) {
  17353. return false;
  17354. }
  17355. } else if (typeOf$2(exp) === "object") {
  17356. if (!matchObject(act, exp)) {
  17357. return false;
  17358. }
  17359. } else if (!deepEqual$1(act, exp)) {
  17360. return false;
  17361. }
  17362. return true;
  17363. });
  17364. }
  17365. var TYPE_MAP = {
  17366. function: function(m, expectation, message) {
  17367. m.test = expectation;
  17368. m.message = message || "match(" + functionName$2(expectation) + ")";
  17369. },
  17370. number: function(m, expectation) {
  17371. m.test = function(actual) {
  17372. // we need type coercion here
  17373. return expectation == actual; // eslint-disable-line eqeqeq
  17374. };
  17375. },
  17376. object: function(m, expectation) {
  17377. var array = [];
  17378. if (typeof expectation.test === "function") {
  17379. m.test = function(actual) {
  17380. return expectation.test(actual) === true;
  17381. };
  17382. m.message = "match(" + functionName$2(expectation.test) + ")";
  17383. return m;
  17384. }
  17385. array = map(Object.keys(expectation), function(key) {
  17386. return key + ": " + valueToString$5(expectation[key]);
  17387. });
  17388. m.test = function(actual) {
  17389. return matchObject(actual, expectation);
  17390. };
  17391. m.message = "match(" + join$2(array, ", ") + ")";
  17392. return m;
  17393. },
  17394. regexp: function(m, expectation) {
  17395. m.test = function(actual) {
  17396. return typeof actual === "string" && expectation.test(actual);
  17397. };
  17398. },
  17399. string: function(m, expectation) {
  17400. m.test = function(actual) {
  17401. return (
  17402. typeof actual === "string" &&
  17403. stringIndexOf(actual, expectation) !== -1
  17404. );
  17405. };
  17406. m.message = 'match("' + expectation + '")';
  17407. }
  17408. };
  17409. function match(expectation, message) {
  17410. var m = Object.create(matcher);
  17411. var type = typeOf$2(expectation);
  17412. if (type in TYPE_MAP) {
  17413. TYPE_MAP[type](m, expectation, message);
  17414. } else {
  17415. m.test = function(actual) {
  17416. return deepEqual$1(actual, expectation);
  17417. };
  17418. }
  17419. if (!m.message) {
  17420. m.message = "match(" + valueToString$5(expectation) + ")";
  17421. }
  17422. return m;
  17423. }
  17424. matcher.or = function(m2) {
  17425. if (!arguments.length) {
  17426. throw new TypeError("Matcher expected");
  17427. } else if (!isMatcher(m2)) {
  17428. m2 = match(m2);
  17429. }
  17430. var m1 = this;
  17431. var or = Object.create(matcher);
  17432. or.test = function(actual) {
  17433. return m1.test(actual) || m2.test(actual);
  17434. };
  17435. or.message = m1.message + ".or(" + m2.message + ")";
  17436. return or;
  17437. };
  17438. matcher.and = function(m2) {
  17439. if (!arguments.length) {
  17440. throw new TypeError("Matcher expected");
  17441. } else if (!isMatcher(m2)) {
  17442. m2 = match(m2);
  17443. }
  17444. var m1 = this;
  17445. var and = Object.create(matcher);
  17446. and.test = function(actual) {
  17447. return m1.test(actual) && m2.test(actual);
  17448. };
  17449. and.message = m1.message + ".and(" + m2.message + ")";
  17450. return and;
  17451. };
  17452. match.isMatcher = isMatcher;
  17453. match.any = match(function() {
  17454. return true;
  17455. }, "any");
  17456. match.defined = match(function(actual) {
  17457. return actual !== null && actual !== undefined;
  17458. }, "defined");
  17459. match.truthy = match(function(actual) {
  17460. return !!actual;
  17461. }, "truthy");
  17462. match.falsy = match(function(actual) {
  17463. return !actual;
  17464. }, "falsy");
  17465. match.same = function(expectation) {
  17466. return match(function(actual) {
  17467. return expectation === actual;
  17468. }, "same(" + valueToString$5(expectation) + ")");
  17469. };
  17470. match.in = function(arrayOfExpectations) {
  17471. if (typeOf$2(arrayOfExpectations) !== "array") {
  17472. throw new TypeError("array expected");
  17473. }
  17474. return match(function(actual) {
  17475. return some(arrayOfExpectations, function(expectation) {
  17476. return expectation === actual;
  17477. });
  17478. }, "in(" + valueToString$5(arrayOfExpectations) + ")");
  17479. };
  17480. match.typeOf = function(type) {
  17481. assertType(type, "string", "type");
  17482. return match(function(actual) {
  17483. return typeOf$2(actual) === type;
  17484. }, 'typeOf("' + type + '")');
  17485. };
  17486. match.instanceOf = function(type) {
  17487. if (
  17488. typeof Symbol === "undefined" ||
  17489. typeof Symbol.hasInstance === "undefined"
  17490. ) {
  17491. assertType(type, "function", "type");
  17492. } else {
  17493. assertMethodExists(
  17494. type,
  17495. Symbol.hasInstance,
  17496. "type",
  17497. "[Symbol.hasInstance]"
  17498. );
  17499. }
  17500. return match(function(actual) {
  17501. return actual instanceof type;
  17502. }, "instanceOf(" +
  17503. (functionName$2(type) || Object.prototype.toString.call(type)) +
  17504. ")");
  17505. };
  17506. function createPropertyMatcher(propertyTest, messagePrefix) {
  17507. return function(property, value) {
  17508. assertType(property, "string", "property");
  17509. var onlyProperty = arguments.length === 1;
  17510. var message = messagePrefix + '("' + property + '"';
  17511. if (!onlyProperty) {
  17512. message += ", " + valueToString$5(value);
  17513. }
  17514. message += ")";
  17515. return match(function(actual) {
  17516. if (
  17517. actual === undefined ||
  17518. actual === null ||
  17519. !propertyTest(actual, property)
  17520. ) {
  17521. return false;
  17522. }
  17523. return onlyProperty || deepEqual$1(actual[property], value);
  17524. }, message);
  17525. };
  17526. }
  17527. match.has = createPropertyMatcher(function(actual, property) {
  17528. if (typeof actual === "object") {
  17529. return property in actual;
  17530. }
  17531. return actual[property] !== undefined;
  17532. }, "has");
  17533. match.hasOwn = createPropertyMatcher(function(actual, property) {
  17534. return hasOwnProperty$3(actual, property);
  17535. }, "hasOwn");
  17536. match.hasNested = function(property, value) {
  17537. assertType(property, "string", "property");
  17538. var onlyProperty = arguments.length === 1;
  17539. var message = 'hasNested("' + property + '"';
  17540. if (!onlyProperty) {
  17541. message += ", " + valueToString$5(value);
  17542. }
  17543. message += ")";
  17544. return match(function(actual) {
  17545. if (
  17546. actual === undefined ||
  17547. actual === null ||
  17548. get(actual, property) === undefined
  17549. ) {
  17550. return false;
  17551. }
  17552. return onlyProperty || deepEqual$1(get(actual, property), value);
  17553. }, message);
  17554. };
  17555. match.every = function(predicate) {
  17556. if (!isMatcher(predicate)) {
  17557. throw new TypeError("Matcher expected");
  17558. }
  17559. return match(function(actual) {
  17560. if (typeOf$2(actual) === "object") {
  17561. return every$3(Object.keys(actual), function(key) {
  17562. return predicate.test(actual[key]);
  17563. });
  17564. }
  17565. return (
  17566. !!actual &&
  17567. typeOf$2(actual.forEach) === "function" &&
  17568. every$3(actual, function(element) {
  17569. return predicate.test(element);
  17570. })
  17571. );
  17572. }, "every(" + predicate.message + ")");
  17573. };
  17574. match.some = function(predicate) {
  17575. if (!isMatcher(predicate)) {
  17576. throw new TypeError("Matcher expected");
  17577. }
  17578. return match(function(actual) {
  17579. if (typeOf$2(actual) === "object") {
  17580. return !every$3(Object.keys(actual), function(key) {
  17581. return !predicate.test(actual[key]);
  17582. });
  17583. }
  17584. return (
  17585. !!actual &&
  17586. typeOf$2(actual.forEach) === "function" &&
  17587. !every$3(actual, function(element) {
  17588. return !predicate.test(element);
  17589. })
  17590. );
  17591. }, "some(" + predicate.message + ")");
  17592. };
  17593. match.array = match.typeOf("array");
  17594. match.array.deepEquals = function(expectation) {
  17595. return match(function(actual) {
  17596. // Comparing lengths is the fastest way to spot a difference before iterating through every item
  17597. var sameLength = actual.length === expectation.length;
  17598. return (
  17599. typeOf$2(actual) === "array" &&
  17600. sameLength &&
  17601. every$3(actual, function(element, index) {
  17602. var expected = expectation[index];
  17603. return typeOf$2(expected) === "array" &&
  17604. typeOf$2(element) === "array"
  17605. ? match.array.deepEquals(expected).test(element)
  17606. : deepEqual$1(expected, element);
  17607. })
  17608. );
  17609. }, "deepEquals([" + iterableToString(expectation) + "])");
  17610. };
  17611. match.array.startsWith = function(expectation) {
  17612. return match(function(actual) {
  17613. return (
  17614. typeOf$2(actual) === "array" &&
  17615. every$3(expectation, function(expectedElement, index) {
  17616. return actual[index] === expectedElement;
  17617. })
  17618. );
  17619. }, "startsWith([" + iterableToString(expectation) + "])");
  17620. };
  17621. match.array.endsWith = function(expectation) {
  17622. return match(function(actual) {
  17623. // This indicates the index in which we should start matching
  17624. var offset = actual.length - expectation.length;
  17625. return (
  17626. typeOf$2(actual) === "array" &&
  17627. every$3(expectation, function(expectedElement, index) {
  17628. return actual[offset + index] === expectedElement;
  17629. })
  17630. );
  17631. }, "endsWith([" + iterableToString(expectation) + "])");
  17632. };
  17633. match.array.contains = function(expectation) {
  17634. return match(function(actual) {
  17635. return (
  17636. typeOf$2(actual) === "array" &&
  17637. every$3(expectation, function(expectedElement) {
  17638. return arrayIndexOf(actual, expectedElement) !== -1;
  17639. })
  17640. );
  17641. }, "contains([" + iterableToString(expectation) + "])");
  17642. };
  17643. match.map = match.typeOf("map");
  17644. match.map.deepEquals = function mapDeepEquals(expectation) {
  17645. return match(function(actual) {
  17646. // Comparing lengths is the fastest way to spot a difference before iterating through every item
  17647. var sameLength = actual.size === expectation.size;
  17648. return (
  17649. typeOf$2(actual) === "map" &&
  17650. sameLength &&
  17651. every$3(actual, function(element, key) {
  17652. return expectation.has(key) && expectation.get(key) === element;
  17653. })
  17654. );
  17655. }, "deepEquals(Map[" + iterableToString(expectation) + "])");
  17656. };
  17657. match.map.contains = function mapContains(expectation) {
  17658. return match(function(actual) {
  17659. return (
  17660. typeOf$2(actual) === "map" &&
  17661. every$3(expectation, function(element, key) {
  17662. return actual.has(key) && actual.get(key) === element;
  17663. })
  17664. );
  17665. }, "contains(Map[" + iterableToString(expectation) + "])");
  17666. };
  17667. match.set = match.typeOf("set");
  17668. match.set.deepEquals = function setDeepEquals(expectation) {
  17669. return match(function(actual) {
  17670. // Comparing lengths is the fastest way to spot a difference before iterating through every item
  17671. var sameLength = actual.size === expectation.size;
  17672. return (
  17673. typeOf$2(actual) === "set" &&
  17674. sameLength &&
  17675. every$3(actual, function(element) {
  17676. return expectation.has(element);
  17677. })
  17678. );
  17679. }, "deepEquals(Set[" + iterableToString(expectation) + "])");
  17680. };
  17681. match.set.contains = function setContains(expectation) {
  17682. return match(function(actual) {
  17683. return (
  17684. typeOf$2(actual) === "set" &&
  17685. every$3(expectation, function(element) {
  17686. return actual.has(element);
  17687. })
  17688. );
  17689. }, "contains(Set[" + iterableToString(expectation) + "])");
  17690. };
  17691. match.bool = match.typeOf("boolean");
  17692. match.number = match.typeOf("number");
  17693. match.string = match.typeOf("string");
  17694. match.object = match.typeOf("object");
  17695. match.func = match.typeOf("function");
  17696. match.regexp = match.typeOf("regexp");
  17697. match.date = match.typeOf("date");
  17698. match.symbol = match.typeOf("symbol");
  17699. var matcher_1 = match;
  17700. var valueToString$6 = lib.valueToString;
  17701. var deepEqual$2 = deepEqual.use(match$1); // eslint-disable-line no-use-before-define
  17702. function arrayContains(array, subset, compare) {
  17703. if (subset.length === 0) {
  17704. return true;
  17705. }
  17706. var i, l, j, k;
  17707. for (i = 0, l = array.length; i < l; ++i) {
  17708. if (compare(array[i], subset[0])) {
  17709. for (j = 0, k = subset.length; j < k; ++j) {
  17710. if (i + j >= l) {
  17711. return false;
  17712. }
  17713. if (!compare(array[i + j], subset[j])) {
  17714. return false;
  17715. }
  17716. }
  17717. return true;
  17718. }
  17719. }
  17720. return false;
  17721. }
  17722. /**
  17723. * @name samsam.match
  17724. * @param Object object
  17725. * @param Object matcher
  17726. *
  17727. * Compare arbitrary value ``object`` with matcher.
  17728. */
  17729. function match$1(object, matcher) {
  17730. if (matcher && typeof matcher.test === "function") {
  17731. return matcher.test(object);
  17732. }
  17733. if (typeof matcher === "function") {
  17734. return matcher(object) === true;
  17735. }
  17736. if (typeof matcher === "string") {
  17737. matcher = matcher.toLowerCase();
  17738. var notNull = typeof object === "string" || !!object;
  17739. return (
  17740. notNull &&
  17741. valueToString$6(object)
  17742. .toLowerCase()
  17743. .indexOf(matcher) >= 0
  17744. );
  17745. }
  17746. if (typeof matcher === "number") {
  17747. return matcher === object;
  17748. }
  17749. if (typeof matcher === "boolean") {
  17750. return matcher === object;
  17751. }
  17752. if (typeof matcher === "undefined") {
  17753. return typeof object === "undefined";
  17754. }
  17755. if (matcher === null) {
  17756. return object === null;
  17757. }
  17758. if (object === null) {
  17759. return false;
  17760. }
  17761. if (isSet_1(object)) {
  17762. return isSubset_1(matcher, object, match$1);
  17763. }
  17764. if (getClass_1(object) === "Array" && getClass_1(matcher) === "Array") {
  17765. return arrayContains(object, matcher, match$1);
  17766. }
  17767. if (isDate_1(matcher)) {
  17768. return isDate_1(object) && object.getTime() === matcher.getTime();
  17769. }
  17770. if (matcher && typeof matcher === "object") {
  17771. if (matcher === object) {
  17772. return true;
  17773. }
  17774. if (typeof object !== "object") {
  17775. return false;
  17776. }
  17777. var prop;
  17778. // eslint-disable-next-line guard-for-in
  17779. for (prop in matcher) {
  17780. var value = object[prop];
  17781. if (
  17782. typeof value === "undefined" &&
  17783. typeof object.getAttribute === "function"
  17784. ) {
  17785. value = object.getAttribute(prop);
  17786. }
  17787. if (
  17788. matcher[prop] === null ||
  17789. typeof matcher[prop] === "undefined"
  17790. ) {
  17791. if (value !== matcher[prop]) {
  17792. return false;
  17793. }
  17794. } else if (
  17795. typeof value === "undefined" ||
  17796. !deepEqual$2(value, matcher[prop])
  17797. ) {
  17798. return false;
  17799. }
  17800. }
  17801. return true;
  17802. }
  17803. throw new Error(
  17804. "Matcher was not a string, a number, a " +
  17805. "function, a boolean or an object"
  17806. );
  17807. }
  17808. Object.keys(matcher_1).forEach(function(key) {
  17809. match$1[key] = matcher_1[key];
  17810. });
  17811. var match_1 = match$1;
  17812. var deepEqualCyclic$1 = deepEqual.use(match_1);
  17813. var samsam = {
  17814. createMatcher: matcher_1,
  17815. deepEqual: deepEqualCyclic$1,
  17816. identical: identical_1,
  17817. isArguments: isArguments_1,
  17818. isElement: isElement_1,
  17819. isNegZero: isNegZero_1,
  17820. isSet: isSet_1,
  17821. match: match_1
  17822. };
  17823. var array$1 = [null, "once", "twice", "thrice"];
  17824. var timesInWords = function timesInWords(count) {
  17825. return array$1[count] || (count || 0) + " times";
  17826. };
  17827. var formatio = {
  17828. excludeConstructors: ["Object", /^.$/],
  17829. quoteStrings: true,
  17830. limitChildrenCount: 0
  17831. };
  17832. var specialObjects = [];
  17833. if (typeof commonjsGlobal !== "undefined") {
  17834. specialObjects.push({ object: commonjsGlobal, value: "[object global]" });
  17835. }
  17836. if (typeof document !== "undefined") {
  17837. specialObjects.push({
  17838. object: document,
  17839. value: "[object HTMLDocument]"
  17840. });
  17841. }
  17842. if (typeof window !== "undefined") {
  17843. specialObjects.push({ object: window, value: "[object Window]" });
  17844. }
  17845. function functionName$3(func) {
  17846. if (!func) { return ""; }
  17847. if (func.displayName) { return func.displayName; }
  17848. if (func.name) { return func.name; }
  17849. var matches = func.toString().match(/function\s+([^\(]+)/m);
  17850. return (matches && matches[1]) || "";
  17851. }
  17852. function constructorName(f, object) {
  17853. var name = functionName$3(object && object.constructor);
  17854. var excludes = f.excludeConstructors ||
  17855. formatio.excludeConstructors || [];
  17856. var i, l;
  17857. for (i = 0, l = excludes.length; i < l; ++i) {
  17858. if (typeof excludes[i] === "string" && excludes[i] === name) {
  17859. return "";
  17860. } else if (excludes[i].test && excludes[i].test(name)) {
  17861. return "";
  17862. }
  17863. }
  17864. return name;
  17865. }
  17866. function isCircular(object, objects) {
  17867. if (typeof object !== "object") { return false; }
  17868. var i, l;
  17869. for (i = 0, l = objects.length; i < l; ++i) {
  17870. if (objects[i] === object) { return true; }
  17871. }
  17872. return false;
  17873. }
  17874. function ascii(f, object, processed, indent) {
  17875. if (typeof object === "string") {
  17876. if (object.length === 0) { return "(empty string)"; }
  17877. var qs = f.quoteStrings;
  17878. var quote = typeof qs !== "boolean" || qs;
  17879. return processed || quote ? "\"" + object + "\"" : object;
  17880. }
  17881. if (typeof object === "function" && !(object instanceof RegExp)) {
  17882. return ascii.func(object);
  17883. }
  17884. processed = processed || [];
  17885. if (isCircular(object, processed)) { return "[Circular]"; }
  17886. if (Object.prototype.toString.call(object) === "[object Array]") {
  17887. return ascii.array.call(f, object, processed);
  17888. }
  17889. if (!object) { return String((1 / object) === -Infinity ? "-0" : object); }
  17890. if (samsam.isElement(object)) { return ascii.element(object); }
  17891. if (typeof object.toString === "function" &&
  17892. object.toString !== Object.prototype.toString) {
  17893. return object.toString();
  17894. }
  17895. var i, l;
  17896. for (i = 0, l = specialObjects.length; i < l; i++) {
  17897. if (object === specialObjects[i].object) {
  17898. return specialObjects[i].value;
  17899. }
  17900. }
  17901. if (typeof Set !== "undefined" && object instanceof Set) {
  17902. return ascii.set.call(f, object, processed);
  17903. }
  17904. return ascii.object.call(f, object, processed, indent);
  17905. }
  17906. ascii.func = function (func) {
  17907. return "function " + functionName$3(func) + "() {}";
  17908. };
  17909. function delimit(str, delimiters) {
  17910. delimiters = delimiters || ["[", "]"];
  17911. return delimiters[0] + str + delimiters[1];
  17912. }
  17913. ascii.array = function (array, processed, delimiters) {
  17914. processed = processed || [];
  17915. processed.push(array);
  17916. var pieces = [];
  17917. var i, l;
  17918. l = (this.limitChildrenCount > 0) ?
  17919. Math.min(this.limitChildrenCount, array.length) : array.length;
  17920. for (i = 0; i < l; ++i) {
  17921. pieces.push(ascii(this, array[i], processed));
  17922. }
  17923. if (l < array.length) {
  17924. pieces.push("[... " + (array.length - l) + " more elements]");
  17925. }
  17926. return delimit(pieces.join(", "), delimiters);
  17927. };
  17928. ascii.set = function (set, processed) {
  17929. return ascii.array.call(this, Array.from(set), processed, ["Set {", "}"]);
  17930. };
  17931. ascii.object = function (object, processed, indent) {
  17932. processed = processed || [];
  17933. processed.push(object);
  17934. indent = indent || 0;
  17935. var pieces = [];
  17936. var properties = Object.keys(object).sort();
  17937. var length = 3;
  17938. var prop, str, obj, i, k, l;
  17939. l = (this.limitChildrenCount > 0) ?
  17940. Math.min(this.limitChildrenCount, properties.length) : properties.length;
  17941. for (i = 0; i < l; ++i) {
  17942. prop = properties[i];
  17943. obj = object[prop];
  17944. if (isCircular(obj, processed)) {
  17945. str = "[Circular]";
  17946. } else {
  17947. str = ascii(this, obj, processed, indent + 2);
  17948. }
  17949. str = (/\s/.test(prop) ? "\"" + prop + "\"" : prop) + ": " + str;
  17950. length += str.length;
  17951. pieces.push(str);
  17952. }
  17953. var cons = constructorName(this, object);
  17954. var prefix = cons ? "[" + cons + "] " : "";
  17955. var is = "";
  17956. for (i = 0, k = indent; i < k; ++i) { is += " "; }
  17957. if (l < properties.length)
  17958. {pieces.push("[... " + (properties.length - l) + " more elements]");}
  17959. if (length + indent > 80) {
  17960. return prefix + "{\n " + is + pieces.join(",\n " + is) + "\n" +
  17961. is + "}";
  17962. }
  17963. return prefix + "{ " + pieces.join(", ") + " }";
  17964. };
  17965. ascii.element = function (element) {
  17966. var tagName = element.tagName.toLowerCase();
  17967. var attrs = element.attributes;
  17968. var pairs = [];
  17969. var attr, attrName, i, l, val;
  17970. for (i = 0, l = attrs.length; i < l; ++i) {
  17971. attr = attrs.item(i);
  17972. attrName = attr.nodeName.toLowerCase().replace("html:", "");
  17973. val = attr.nodeValue;
  17974. if (attrName !== "contenteditable" || val !== "inherit") {
  17975. if (val) { pairs.push(attrName + "=\"" + val + "\""); }
  17976. }
  17977. }
  17978. var formatted = "<" + tagName + (pairs.length > 0 ? " " : "");
  17979. // SVG elements have undefined innerHTML
  17980. var content = element.innerHTML || "";
  17981. if (content.length > 20) {
  17982. content = content.substr(0, 20) + "[...]";
  17983. }
  17984. var res = formatted + pairs.join(" ") + ">" + content +
  17985. "</" + tagName + ">";
  17986. return res.replace(/ contentEditable="inherit"/, "");
  17987. };
  17988. function Formatio(options) {
  17989. // eslint-disable-next-line guard-for-in
  17990. for (var opt in options) {
  17991. this[opt] = options[opt];
  17992. }
  17993. }
  17994. Formatio.prototype = {
  17995. functionName: functionName$3,
  17996. configure: function (options) {
  17997. return new Formatio(options);
  17998. },
  17999. constructorName: function (object) {
  18000. return constructorName(this, object);
  18001. },
  18002. ascii: function (object, processed, indent) {
  18003. return ascii(this, object, processed, indent);
  18004. }
  18005. };
  18006. var formatio_1 = Formatio.prototype;
  18007. var formatter = formatio_1.configure({
  18008. quoteStrings: false,
  18009. limitChildrenCount: 250
  18010. });
  18011. var customFormatter;
  18012. function format() {
  18013. if (customFormatter) {
  18014. return customFormatter.apply(null, arguments);
  18015. }
  18016. return formatter.ascii.apply(formatter, arguments);
  18017. }
  18018. format.setFormatter = function(aCustomFormatter) {
  18019. if (typeof aCustomFormatter !== "function") {
  18020. throw new Error("format.setFormatter must be called with a function");
  18021. }
  18022. customFormatter = aCustomFormatter;
  18023. };
  18024. var format_1 = format;
  18025. var arrayProto$4 = lib.prototypes.array;
  18026. var calledInOrder$1 = lib.calledInOrder;
  18027. var createMatcher = samsam.createMatcher;
  18028. var orderByFirstCall$1 = lib.orderByFirstCall;
  18029. var stringSlice = lib.prototypes.string.slice;
  18030. var arraySlice = arrayProto$4.slice;
  18031. var concat$1 = arrayProto$4.concat;
  18032. var forEach$1 = arrayProto$4.forEach;
  18033. var join$3 = arrayProto$4.join;
  18034. var splice = arrayProto$4.splice;
  18035. var assert;
  18036. function verifyIsStub() {
  18037. var args = arraySlice(arguments);
  18038. forEach$1(args, function(method) {
  18039. if (!method) {
  18040. assert.fail("fake is not a spy");
  18041. }
  18042. if (method.proxy && method.proxy.isSinonProxy) {
  18043. verifyIsStub(method.proxy);
  18044. } else {
  18045. if (typeof method !== "function") {
  18046. assert.fail(method + " is not a function");
  18047. }
  18048. if (typeof method.getCall !== "function") {
  18049. assert.fail(method + " is not stubbed");
  18050. }
  18051. }
  18052. });
  18053. }
  18054. function verifyIsValidAssertion(assertionMethod, assertionArgs) {
  18055. switch (assertionMethod) {
  18056. case "notCalled":
  18057. case "called":
  18058. case "calledOnce":
  18059. case "calledTwice":
  18060. case "calledThrice":
  18061. if (assertionArgs.length !== 0) {
  18062. assert.fail(
  18063. assertionMethod +
  18064. " takes 1 argument but was called with " +
  18065. (assertionArgs.length + 1) +
  18066. " arguments"
  18067. );
  18068. }
  18069. break;
  18070. default:
  18071. break;
  18072. }
  18073. }
  18074. function failAssertion(object, msg) {
  18075. var obj = object || commonjsGlobal;
  18076. var failMethod = obj.fail || assert.fail;
  18077. failMethod.call(obj, msg);
  18078. }
  18079. function mirrorPropAsAssertion(name, method, message) {
  18080. var msg = message;
  18081. var meth = method;
  18082. if (arguments.length === 2) {
  18083. msg = method;
  18084. meth = name;
  18085. }
  18086. assert[name] = function(fake) {
  18087. verifyIsStub(fake);
  18088. var args = arraySlice(arguments, 1);
  18089. var failed = false;
  18090. verifyIsValidAssertion(name, args);
  18091. if (typeof meth === "function") {
  18092. failed = !meth(fake);
  18093. } else {
  18094. failed = typeof fake[meth] === "function" ? !fake[meth].apply(fake, args) : !fake[meth];
  18095. }
  18096. if (failed) {
  18097. failAssertion(this, (fake.printf || fake.proxy.printf).apply(fake, concat$1([msg], args)));
  18098. } else {
  18099. assert.pass(name);
  18100. }
  18101. };
  18102. }
  18103. function exposedName(prefix, prop) {
  18104. return !prefix || /^fail/.test(prop) ? prop : prefix + stringSlice(prop, 0, 1).toUpperCase() + stringSlice(prop, 1);
  18105. }
  18106. assert = {
  18107. failException: "AssertError",
  18108. fail: function fail(message) {
  18109. var error = new Error(message);
  18110. error.name = this.failException || assert.failException;
  18111. throw error;
  18112. },
  18113. pass: function pass() {
  18114. return;
  18115. },
  18116. callOrder: function assertCallOrder() {
  18117. verifyIsStub.apply(null, arguments);
  18118. var expected = "";
  18119. var actual = "";
  18120. if (!calledInOrder$1(arguments)) {
  18121. try {
  18122. expected = join$3(arguments, ", ");
  18123. var calls = arraySlice(arguments);
  18124. var i = calls.length;
  18125. while (i) {
  18126. if (!calls[--i].called) {
  18127. splice(calls, i, 1);
  18128. }
  18129. }
  18130. actual = join$3(orderByFirstCall$1(calls), ", ");
  18131. } catch (e) {
  18132. // If this fails, we'll just fall back to the blank string
  18133. }
  18134. failAssertion(this, "expected " + expected + " to be called in order but were called as " + actual);
  18135. } else {
  18136. assert.pass("callOrder");
  18137. }
  18138. },
  18139. callCount: function assertCallCount(method, count) {
  18140. verifyIsStub(method);
  18141. if (method.callCount !== count) {
  18142. var msg = "expected %n to be called " + timesInWords(count) + " but was called %c%C";
  18143. failAssertion(this, method.printf(msg));
  18144. } else {
  18145. assert.pass("callCount");
  18146. }
  18147. },
  18148. expose: function expose(target, options) {
  18149. if (!target) {
  18150. throw new TypeError("target is null or undefined");
  18151. }
  18152. var o = options || {};
  18153. var prefix = (typeof o.prefix === "undefined" && "assert") || o.prefix;
  18154. var includeFail = typeof o.includeFail === "undefined" || Boolean(o.includeFail);
  18155. var instance = this;
  18156. forEach$1(Object.keys(instance), function(method) {
  18157. if (method !== "expose" && (includeFail || !/^(fail)/.test(method))) {
  18158. target[exposedName(prefix, method)] = instance[method];
  18159. }
  18160. });
  18161. return target;
  18162. },
  18163. match: function match(actual, expectation) {
  18164. var matcher = createMatcher(expectation);
  18165. if (matcher.test(actual)) {
  18166. assert.pass("match");
  18167. } else {
  18168. var formatted = [
  18169. "expected value to match",
  18170. " expected = " + format_1(expectation),
  18171. " actual = " + format_1(actual)
  18172. ];
  18173. failAssertion(this, join$3(formatted, "\n"));
  18174. }
  18175. }
  18176. };
  18177. mirrorPropAsAssertion("called", "expected %n to have been called at least once but was never called");
  18178. mirrorPropAsAssertion(
  18179. "notCalled",
  18180. function(spy) {
  18181. return !spy.called;
  18182. },
  18183. "expected %n to not have been called but was called %c%C"
  18184. );
  18185. mirrorPropAsAssertion("calledOnce", "expected %n to be called once but was called %c%C");
  18186. mirrorPropAsAssertion("calledTwice", "expected %n to be called twice but was called %c%C");
  18187. mirrorPropAsAssertion("calledThrice", "expected %n to be called thrice but was called %c%C");
  18188. mirrorPropAsAssertion("calledOn", "expected %n to be called with %1 as this but was called with %t");
  18189. mirrorPropAsAssertion("alwaysCalledOn", "expected %n to always be called with %1 as this but was called with %t");
  18190. mirrorPropAsAssertion("calledWithNew", "expected %n to be called with new");
  18191. mirrorPropAsAssertion("alwaysCalledWithNew", "expected %n to always be called with new");
  18192. mirrorPropAsAssertion("calledWith", "expected %n to be called with arguments %D");
  18193. mirrorPropAsAssertion("calledWithMatch", "expected %n to be called with match %D");
  18194. mirrorPropAsAssertion("alwaysCalledWith", "expected %n to always be called with arguments %D");
  18195. mirrorPropAsAssertion("alwaysCalledWithMatch", "expected %n to always be called with match %D");
  18196. mirrorPropAsAssertion("calledWithExactly", "expected %n to be called with exact arguments %D");
  18197. mirrorPropAsAssertion("alwaysCalledWithExactly", "expected %n to always be called with exact arguments %D");
  18198. mirrorPropAsAssertion("neverCalledWith", "expected %n to never be called with arguments %*%C");
  18199. mirrorPropAsAssertion("neverCalledWithMatch", "expected %n to never be called with match %*%C");
  18200. mirrorPropAsAssertion("threw", "%n did not throw exception%C");
  18201. mirrorPropAsAssertion("alwaysThrew", "%n did not always throw exception%C");
  18202. var assert_1 = assert;
  18203. var lolex = createCommonjsModule(function (module, exports) {
  18204. (function(f){{module.exports=f();}})(function(){return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof commonjsRequire&&commonjsRequire;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t);}return n[i].exports}for(var u="function"==typeof commonjsRequire&&commonjsRequire,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  18205. (function (global){
  18206. function withGlobal(_global) {
  18207. var userAgent = _global.navigator && _global.navigator.userAgent;
  18208. var isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1;
  18209. var maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint
  18210. // Make properties writable in IE, as per
  18211. // http://www.adequatelygood.com/Replacing-setTimeout-Globally.html
  18212. if (isRunningInIE) {
  18213. _global.setTimeout = _global.setTimeout;
  18214. _global.clearTimeout = _global.clearTimeout;
  18215. _global.setInterval = _global.setInterval;
  18216. _global.clearInterval = _global.clearInterval;
  18217. _global.Date = _global.Date;
  18218. }
  18219. // setImmediate is not a standard function
  18220. // avoid adding the prop to the window object if not present
  18221. if (_global.setImmediate !== undefined) {
  18222. _global.setImmediate = _global.setImmediate;
  18223. _global.clearImmediate = _global.clearImmediate;
  18224. }
  18225. // node expects setTimeout/setInterval to return a fn object w/ .ref()/.unref()
  18226. // browsers, a number.
  18227. // see https://github.com/cjohansen/Sinon.JS/pull/436
  18228. var NOOP = function () { return undefined; };
  18229. var timeoutResult = _global.setTimeout(NOOP, 0);
  18230. var addTimerReturnsObject = typeof timeoutResult === "object";
  18231. var hrtimePresent = (_global.process && typeof _global.process.hrtime === "function");
  18232. var nextTickPresent = (_global.process && typeof _global.process.nextTick === "function");
  18233. var performancePresent = (_global.performance && typeof _global.performance.now === "function");
  18234. var hasPerformancePrototype = (_global.Performance && (typeof _global.Performance).match(/^(function|object)$/));
  18235. var queueMicrotaskPresent = (typeof _global.queueMicrotask === "function");
  18236. var requestAnimationFramePresent = (
  18237. _global.requestAnimationFrame && typeof _global.requestAnimationFrame === "function"
  18238. );
  18239. var cancelAnimationFramePresent = (
  18240. _global.cancelAnimationFrame && typeof _global.cancelAnimationFrame === "function"
  18241. );
  18242. var requestIdleCallbackPresent = (
  18243. _global.requestIdleCallback && typeof _global.requestIdleCallback === "function"
  18244. );
  18245. var cancelIdleCallbackPresent = (
  18246. _global.cancelIdleCallback && typeof _global.cancelIdleCallback === "function"
  18247. );
  18248. _global.clearTimeout(timeoutResult);
  18249. var NativeDate = _global.Date;
  18250. var uniqueTimerId = 1;
  18251. function isNumberFinite(num) {
  18252. if (Number.isFinite) {
  18253. return Number.isFinite(num);
  18254. }
  18255. if (typeof num !== "number") {
  18256. return false;
  18257. }
  18258. return isFinite(num);
  18259. }
  18260. /**
  18261. * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into
  18262. * number of milliseconds. This is used to support human-readable strings passed
  18263. * to clock.tick()
  18264. */
  18265. function parseTime(str) {
  18266. if (!str) {
  18267. return 0;
  18268. }
  18269. var strings = str.split(":");
  18270. var l = strings.length;
  18271. var i = l;
  18272. var ms = 0;
  18273. var parsed;
  18274. if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
  18275. throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");
  18276. }
  18277. while (i--) {
  18278. parsed = parseInt(strings[i], 10);
  18279. if (parsed >= 60) {
  18280. throw new Error("Invalid time " + str);
  18281. }
  18282. ms += parsed * Math.pow(60, (l - i - 1));
  18283. }
  18284. return ms * 1000;
  18285. }
  18286. /**
  18287. * Get the decimal part of the millisecond value as nanoseconds
  18288. *
  18289. * @param {Number} msFloat the number of milliseconds
  18290. * @returns {Number} an integer number of nanoseconds in the range [0,1e6)
  18291. *
  18292. * Example: nanoRemainer(123.456789) -> 456789
  18293. */
  18294. function nanoRemainder(msFloat) {
  18295. var modulo = 1e6;
  18296. var remainder = (msFloat * 1e6) % modulo;
  18297. var positiveRemainder = remainder < 0 ? remainder + modulo : remainder;
  18298. return Math.floor(positiveRemainder);
  18299. }
  18300. /**
  18301. * Used to grok the `now` parameter to createClock.
  18302. * @param epoch {Date|number} the system time
  18303. */
  18304. function getEpoch(epoch) {
  18305. if (!epoch) { return 0; }
  18306. if (typeof epoch.getTime === "function") { return epoch.getTime(); }
  18307. if (typeof epoch === "number") { return epoch; }
  18308. throw new TypeError("now should be milliseconds since UNIX epoch");
  18309. }
  18310. function inRange(from, to, timer) {
  18311. return timer && timer.callAt >= from && timer.callAt <= to;
  18312. }
  18313. function mirrorDateProperties(target, source) {
  18314. var prop;
  18315. for (prop in source) {
  18316. if (source.hasOwnProperty(prop)) {
  18317. target[prop] = source[prop];
  18318. }
  18319. }
  18320. // set special now implementation
  18321. if (source.now) {
  18322. target.now = function now() {
  18323. return target.clock.now;
  18324. };
  18325. } else {
  18326. delete target.now;
  18327. }
  18328. // set special toSource implementation
  18329. if (source.toSource) {
  18330. target.toSource = function toSource() {
  18331. return source.toSource();
  18332. };
  18333. } else {
  18334. delete target.toSource;
  18335. }
  18336. // set special toString implementation
  18337. target.toString = function toString() {
  18338. return source.toString();
  18339. };
  18340. target.prototype = source.prototype;
  18341. target.parse = source.parse;
  18342. target.UTC = source.UTC;
  18343. target.prototype.toUTCString = source.prototype.toUTCString;
  18344. return target;
  18345. }
  18346. function createDate() {
  18347. function ClockDate(year, month, date, hour, minute, second, ms) {
  18348. // Defensive and verbose to avoid potential harm in passing
  18349. // explicit undefined when user does not pass argument
  18350. switch (arguments.length) {
  18351. case 0:
  18352. return new NativeDate(ClockDate.clock.now);
  18353. case 1:
  18354. return new NativeDate(year);
  18355. case 2:
  18356. return new NativeDate(year, month);
  18357. case 3:
  18358. return new NativeDate(year, month, date);
  18359. case 4:
  18360. return new NativeDate(year, month, date, hour);
  18361. case 5:
  18362. return new NativeDate(year, month, date, hour, minute);
  18363. case 6:
  18364. return new NativeDate(year, month, date, hour, minute, second);
  18365. default:
  18366. return new NativeDate(year, month, date, hour, minute, second, ms);
  18367. }
  18368. }
  18369. return mirrorDateProperties(ClockDate, NativeDate);
  18370. }
  18371. function enqueueJob(clock, job) {
  18372. // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob
  18373. if (!clock.jobs) {
  18374. clock.jobs = [];
  18375. }
  18376. clock.jobs.push(job);
  18377. }
  18378. function runJobs(clock) {
  18379. // runs all microtick-deferred tasks - ecma262/#sec-runjobs
  18380. if (!clock.jobs) {
  18381. return;
  18382. }
  18383. for (var i = 0; i < clock.jobs.length; i++) {
  18384. var job = clock.jobs[i];
  18385. job.func.apply(null, job.args);
  18386. if (clock.loopLimit && i > clock.loopLimit) {
  18387. throw new Error("Aborting after running " + clock.loopLimit + " timers, assuming an infinite loop!");
  18388. }
  18389. }
  18390. clock.jobs = [];
  18391. }
  18392. function addTimer(clock, timer) {
  18393. if (timer.func === undefined) {
  18394. throw new Error("Callback must be provided to timer calls");
  18395. }
  18396. timer.type = timer.immediate ? "Immediate" : "Timeout";
  18397. if (timer.hasOwnProperty("delay")) {
  18398. if (!isNumberFinite(timer.delay)) {
  18399. timer.delay = 0;
  18400. }
  18401. timer.delay = timer.delay > maxTimeout ? 1 : timer.delay;
  18402. timer.delay = Math.max(0, timer.delay);
  18403. }
  18404. if (timer.hasOwnProperty("interval")) {
  18405. timer.type = "Interval";
  18406. timer.interval = timer.interval > maxTimeout ? 1 : timer.interval;
  18407. }
  18408. if (timer.hasOwnProperty("animation")) {
  18409. timer.type = "AnimationFrame";
  18410. timer.animation = true;
  18411. }
  18412. if (!clock.timers) {
  18413. clock.timers = {};
  18414. }
  18415. timer.id = uniqueTimerId++;
  18416. timer.createdAt = clock.now;
  18417. timer.callAt = clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0));
  18418. clock.timers[timer.id] = timer;
  18419. if (addTimerReturnsObject) {
  18420. var res = {
  18421. id: timer.id,
  18422. ref: function () { return res; },
  18423. unref: function () { return res; },
  18424. refresh: function () { return res; }
  18425. };
  18426. return res;
  18427. }
  18428. return timer.id;
  18429. }
  18430. /* eslint consistent-return: "off" */
  18431. function compareTimers(a, b) {
  18432. // Sort first by absolute timing
  18433. if (a.callAt < b.callAt) {
  18434. return -1;
  18435. }
  18436. if (a.callAt > b.callAt) {
  18437. return 1;
  18438. }
  18439. // Sort next by immediate, immediate timers take precedence
  18440. if (a.immediate && !b.immediate) {
  18441. return -1;
  18442. }
  18443. if (!a.immediate && b.immediate) {
  18444. return 1;
  18445. }
  18446. // Sort next by creation time, earlier-created timers take precedence
  18447. if (a.createdAt < b.createdAt) {
  18448. return -1;
  18449. }
  18450. if (a.createdAt > b.createdAt) {
  18451. return 1;
  18452. }
  18453. // Sort next by id, lower-id timers take precedence
  18454. if (a.id < b.id) {
  18455. return -1;
  18456. }
  18457. if (a.id > b.id) {
  18458. return 1;
  18459. }
  18460. // As timer ids are unique, no fallback `0` is necessary
  18461. }
  18462. function firstTimerInRange(clock, from, to) {
  18463. var timers = clock.timers;
  18464. var timer = null;
  18465. var id, isInRange;
  18466. for (id in timers) {
  18467. if (timers.hasOwnProperty(id)) {
  18468. isInRange = inRange(from, to, timers[id]);
  18469. if (isInRange && (!timer || compareTimers(timer, timers[id]) === 1)) {
  18470. timer = timers[id];
  18471. }
  18472. }
  18473. }
  18474. return timer;
  18475. }
  18476. function firstTimer(clock) {
  18477. var timers = clock.timers;
  18478. var timer = null;
  18479. var id;
  18480. for (id in timers) {
  18481. if (timers.hasOwnProperty(id)) {
  18482. if (!timer || compareTimers(timer, timers[id]) === 1) {
  18483. timer = timers[id];
  18484. }
  18485. }
  18486. }
  18487. return timer;
  18488. }
  18489. function lastTimer(clock) {
  18490. var timers = clock.timers;
  18491. var timer = null;
  18492. var id;
  18493. for (id in timers) {
  18494. if (timers.hasOwnProperty(id)) {
  18495. if (!timer || compareTimers(timer, timers[id]) === -1) {
  18496. timer = timers[id];
  18497. }
  18498. }
  18499. }
  18500. return timer;
  18501. }
  18502. function callTimer(clock, timer) {
  18503. if (typeof timer.interval === "number") {
  18504. clock.timers[timer.id].callAt += timer.interval;
  18505. } else {
  18506. delete clock.timers[timer.id];
  18507. }
  18508. if (typeof timer.func === "function") {
  18509. timer.func.apply(null, timer.args);
  18510. } else {
  18511. /* eslint no-eval: "off" */
  18512. eval(timer.func);
  18513. }
  18514. }
  18515. function clearTimer(clock, timerId, ttype) {
  18516. if (!timerId) {
  18517. // null appears to be allowed in most browsers, and appears to be
  18518. // relied upon by some libraries, like Bootstrap carousel
  18519. return;
  18520. }
  18521. if (!clock.timers) {
  18522. clock.timers = {};
  18523. }
  18524. // in Node, timerId is an object with .ref()/.unref(), and
  18525. // its .id field is the actual timer id.
  18526. if (typeof timerId === "object") {
  18527. timerId = timerId.id;
  18528. }
  18529. if (clock.timers.hasOwnProperty(timerId)) {
  18530. // check that the ID matches a timer of the correct type
  18531. var timer = clock.timers[timerId];
  18532. if (timer.type === ttype) {
  18533. delete clock.timers[timerId];
  18534. } else {
  18535. var clear = ttype === "AnimationFrame" ? "cancelAnimationFrame" : "clear" + ttype;
  18536. var schedule = timer.type === "AnimationFrame" ? "requestAnimationFrame" : "set" + timer.type;
  18537. throw new Error("Cannot clear timer: timer created with " + schedule
  18538. + "() but cleared with " + clear + "()");
  18539. }
  18540. }
  18541. }
  18542. function uninstall(clock, target, config) {
  18543. var method,
  18544. i,
  18545. l;
  18546. var installedHrTime = "_hrtime";
  18547. var installedNextTick = "_nextTick";
  18548. for (i = 0, l = clock.methods.length; i < l; i++) {
  18549. method = clock.methods[i];
  18550. if (method === "hrtime" && target.process) {
  18551. target.process.hrtime = clock[installedHrTime];
  18552. } else if (method === "nextTick" && target.process) {
  18553. target.process.nextTick = clock[installedNextTick];
  18554. } else if (method === "performance") {
  18555. target[method] = clock["_" + method];
  18556. } else {
  18557. if (target[method] && target[method].hadOwnProperty) {
  18558. target[method] = clock["_" + method];
  18559. if (method === "clearInterval" && config.shouldAdvanceTime === true) {
  18560. target[method](clock.attachedInterval);
  18561. }
  18562. } else {
  18563. try {
  18564. delete target[method];
  18565. } catch (ignore) { /* eslint empty-block: "off" */ }
  18566. }
  18567. }
  18568. }
  18569. // Prevent multiple executions which will completely remove these props
  18570. clock.methods = [];
  18571. // return pending timers, to enable checking what timers remained on uninstall
  18572. if (!clock.timers) {
  18573. return [];
  18574. }
  18575. return Object.keys(clock.timers).map(function mapper(key) {
  18576. return clock.timers[key];
  18577. });
  18578. }
  18579. function hijackMethod(target, method, clock) {
  18580. var prop;
  18581. clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(target, method);
  18582. clock["_" + method] = target[method];
  18583. if (method === "Date") {
  18584. var date = mirrorDateProperties(clock[method], target[method]);
  18585. target[method] = date;
  18586. } else if (method === "performance") {
  18587. target[method] = clock[method];
  18588. } else {
  18589. target[method] = function () {
  18590. return clock[method].apply(clock, arguments);
  18591. };
  18592. for (prop in clock[method]) {
  18593. if (clock[method].hasOwnProperty(prop)) {
  18594. target[method][prop] = clock[method][prop];
  18595. }
  18596. }
  18597. }
  18598. target[method].clock = clock;
  18599. }
  18600. function doIntervalTick(clock, advanceTimeDelta) {
  18601. clock.tick(advanceTimeDelta);
  18602. }
  18603. var timers = {
  18604. setTimeout: _global.setTimeout,
  18605. clearTimeout: _global.clearTimeout,
  18606. setImmediate: _global.setImmediate,
  18607. clearImmediate: _global.clearImmediate,
  18608. setInterval: _global.setInterval,
  18609. clearInterval: _global.clearInterval,
  18610. Date: _global.Date
  18611. };
  18612. if (hrtimePresent) {
  18613. timers.hrtime = _global.process.hrtime;
  18614. }
  18615. if (nextTickPresent) {
  18616. timers.nextTick = _global.process.nextTick;
  18617. }
  18618. if (performancePresent) {
  18619. timers.performance = _global.performance;
  18620. }
  18621. if (requestAnimationFramePresent) {
  18622. timers.requestAnimationFrame = _global.requestAnimationFrame;
  18623. }
  18624. if (queueMicrotaskPresent) {
  18625. timers.queueMicrotask = _global.queueMicrotask;
  18626. }
  18627. if (cancelAnimationFramePresent) {
  18628. timers.cancelAnimationFrame = _global.cancelAnimationFrame;
  18629. }
  18630. if (requestIdleCallbackPresent) {
  18631. timers.requestIdleCallback = _global.requestIdleCallback;
  18632. }
  18633. if (cancelIdleCallbackPresent) {
  18634. timers.cancelIdleCallback = _global.cancelIdleCallback;
  18635. }
  18636. var keys = Object.keys || function (obj) {
  18637. var ks = [];
  18638. var key;
  18639. for (key in obj) {
  18640. if (obj.hasOwnProperty(key)) {
  18641. ks.push(key);
  18642. }
  18643. }
  18644. return ks;
  18645. };
  18646. /**
  18647. * @param start {Date|number} the system time - non-integer values are floored
  18648. * @param loopLimit {number} maximum number of timers that will be run when calling runAll()
  18649. */
  18650. function createClock(start, loopLimit) {
  18651. start = Math.floor(getEpoch(start));
  18652. loopLimit = loopLimit || 1000;
  18653. var nanos = 0;
  18654. var adjustedSystemTime = [0, 0]; // [millis, nanoremainder]
  18655. if (NativeDate === undefined) {
  18656. throw new Error("The global scope doesn't have a `Date` object"
  18657. + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)");
  18658. }
  18659. var clock = {
  18660. now: start,
  18661. timeouts: {},
  18662. Date: createDate(),
  18663. loopLimit: loopLimit
  18664. };
  18665. clock.Date.clock = clock;
  18666. function getTimeToNextFrame() {
  18667. return 16 - ((clock.now - start) % 16);
  18668. }
  18669. function hrtime(prev) {
  18670. var millisSinceStart = clock.now - adjustedSystemTime[0] - start;
  18671. var secsSinceStart = Math.floor( millisSinceStart / 1000);
  18672. var remainderInNanos = (millisSinceStart - secsSinceStart * 1e3 ) * 1e6 + nanos - adjustedSystemTime[1];
  18673. if (Array.isArray(prev)) {
  18674. if ( prev[1] > 1e9 ) {
  18675. throw new TypeError("Number of nanoseconds can't exceed a billion");
  18676. }
  18677. var oldSecs = prev[0];
  18678. var nanoDiff = remainderInNanos - prev[1];
  18679. var secDiff = secsSinceStart - oldSecs;
  18680. if (nanoDiff < 0) {
  18681. nanoDiff += 1e9;
  18682. secDiff -= 1;
  18683. }
  18684. return [secDiff, nanoDiff];
  18685. }
  18686. return [secsSinceStart, remainderInNanos];
  18687. }
  18688. clock.requestIdleCallback = function requestIdleCallback(func, timeout) {
  18689. var timeToNextIdlePeriod = 0;
  18690. if (clock.countTimers() > 0) {
  18691. timeToNextIdlePeriod = 50; // const for now
  18692. }
  18693. var result = addTimer(clock, {
  18694. func: func,
  18695. args: Array.prototype.slice.call(arguments, 2),
  18696. delay: typeof timeout === "undefined" ? timeToNextIdlePeriod : Math.min(timeout, timeToNextIdlePeriod)
  18697. });
  18698. return result.id || result;
  18699. };
  18700. clock.cancelIdleCallback = function cancelIdleCallback(timerId) {
  18701. return clearTimer(clock, timerId, "Timeout");
  18702. };
  18703. clock.setTimeout = function setTimeout(func, timeout) {
  18704. return addTimer(clock, {
  18705. func: func,
  18706. args: Array.prototype.slice.call(arguments, 2),
  18707. delay: timeout
  18708. });
  18709. };
  18710. clock.clearTimeout = function clearTimeout(timerId) {
  18711. return clearTimer(clock, timerId, "Timeout");
  18712. };
  18713. clock.nextTick = function nextTick(func) {
  18714. return enqueueJob(clock, {
  18715. func: func,
  18716. args: Array.prototype.slice.call(arguments, 1)
  18717. });
  18718. };
  18719. clock.queueMicrotask = function queueMicrotask(func) {
  18720. return clock.nextTick(func); // explicitly drop additional arguments
  18721. };
  18722. clock.setInterval = function setInterval(func, timeout) {
  18723. timeout = parseInt(timeout, 10);
  18724. return addTimer(clock, {
  18725. func: func,
  18726. args: Array.prototype.slice.call(arguments, 2),
  18727. delay: timeout,
  18728. interval: timeout
  18729. });
  18730. };
  18731. clock.clearInterval = function clearInterval(timerId) {
  18732. return clearTimer(clock, timerId, "Interval");
  18733. };
  18734. clock.setImmediate = function setImmediate(func) {
  18735. return addTimer(clock, {
  18736. func: func,
  18737. args: Array.prototype.slice.call(arguments, 1),
  18738. immediate: true
  18739. });
  18740. };
  18741. clock.clearImmediate = function clearImmediate(timerId) {
  18742. return clearTimer(clock, timerId, "Immediate");
  18743. };
  18744. clock.countTimers = function countTimers() {
  18745. return Object.keys(clock.timers || {}).length;
  18746. };
  18747. clock.requestAnimationFrame = function requestAnimationFrame(func) {
  18748. var result = addTimer(clock, {
  18749. func: func,
  18750. delay: getTimeToNextFrame(),
  18751. args: [clock.now + getTimeToNextFrame()],
  18752. animation: true
  18753. });
  18754. return result.id || result;
  18755. };
  18756. clock.cancelAnimationFrame = function cancelAnimationFrame(timerId) {
  18757. return clearTimer(clock, timerId, "AnimationFrame");
  18758. };
  18759. clock.runMicrotasks = function runMicrotasks() {
  18760. runJobs(clock);
  18761. };
  18762. /**
  18763. * @param {tickValue} {String|Number} number of milliseconds or a human-readable value like "01:11:15"
  18764. */
  18765. clock.tick = function tick(tickValue) {
  18766. var msFloat = typeof tickValue === "number" ? tickValue : parseTime(tickValue);
  18767. var ms = Math.floor(msFloat);
  18768. var remainder = nanoRemainder(msFloat);
  18769. var nanosTotal = nanos + remainder;
  18770. var tickTo = clock.now + ms;
  18771. if (msFloat < 0) {
  18772. throw new TypeError("Negative ticks are not supported");
  18773. }
  18774. // adjust for positive overflow
  18775. if (nanosTotal >= 1e6) {
  18776. tickTo += 1;
  18777. nanosTotal -= 1e6;
  18778. }
  18779. nanos = nanosTotal;
  18780. var tickFrom = clock.now;
  18781. var previous = clock.now;
  18782. var timer, firstException, oldNow;
  18783. clock.duringTick = true;
  18784. // perform microtasks
  18785. oldNow = clock.now;
  18786. runJobs(clock);
  18787. if (oldNow !== clock.now) {
  18788. // compensate for any setSystemTime() call during microtask callback
  18789. tickFrom += clock.now - oldNow;
  18790. tickTo += clock.now - oldNow;
  18791. }
  18792. // perform each timer in the requested range
  18793. timer = firstTimerInRange(clock, tickFrom, tickTo);
  18794. while (timer && tickFrom <= tickTo) {
  18795. if (clock.timers[timer.id]) {
  18796. tickFrom = timer.callAt;
  18797. clock.now = timer.callAt;
  18798. oldNow = clock.now;
  18799. try {
  18800. runJobs(clock);
  18801. callTimer(clock, timer);
  18802. } catch (e) {
  18803. firstException = firstException || e;
  18804. }
  18805. // compensate for any setSystemTime() call during timer callback
  18806. if (oldNow !== clock.now) {
  18807. tickFrom += clock.now - oldNow;
  18808. tickTo += clock.now - oldNow;
  18809. previous += clock.now - oldNow;
  18810. }
  18811. }
  18812. timer = firstTimerInRange(clock, previous, tickTo);
  18813. previous = tickFrom;
  18814. }
  18815. // perform process.nextTick()s again
  18816. oldNow = clock.now;
  18817. runJobs(clock);
  18818. if (oldNow !== clock.now) {
  18819. // compensate for any setSystemTime() call during process.nextTick() callback
  18820. tickFrom += clock.now - oldNow;
  18821. tickTo += clock.now - oldNow;
  18822. }
  18823. clock.duringTick = false;
  18824. // corner case: during runJobs, new timers were scheduled which could be in the range [clock.now, tickTo]
  18825. timer = firstTimerInRange(clock, tickFrom, tickTo);
  18826. if (timer) {
  18827. try {
  18828. clock.tick(tickTo - clock.now); // do it all again - for the remainder of the requested range
  18829. } catch (e) {
  18830. firstException = firstException || e;
  18831. }
  18832. } else {
  18833. // no timers remaining in the requested range: move the clock all the way to the end
  18834. clock.now = tickTo;
  18835. // update nanos
  18836. nanos = nanosTotal;
  18837. }
  18838. if (firstException) {
  18839. throw firstException;
  18840. }
  18841. return clock.now;
  18842. };
  18843. clock.next = function next() {
  18844. runJobs(clock);
  18845. var timer = firstTimer(clock);
  18846. if (!timer) {
  18847. return clock.now;
  18848. }
  18849. clock.duringTick = true;
  18850. try {
  18851. clock.now = timer.callAt;
  18852. callTimer(clock, timer);
  18853. runJobs(clock);
  18854. return clock.now;
  18855. } finally {
  18856. clock.duringTick = false;
  18857. }
  18858. };
  18859. clock.runAll = function runAll() {
  18860. var numTimers, i;
  18861. runJobs(clock);
  18862. for (i = 0; i < clock.loopLimit; i++) {
  18863. if (!clock.timers) {
  18864. return clock.now;
  18865. }
  18866. numTimers = keys(clock.timers).length;
  18867. if (numTimers === 0) {
  18868. return clock.now;
  18869. }
  18870. clock.next();
  18871. }
  18872. throw new Error("Aborting after running " + clock.loopLimit + " timers, assuming an infinite loop!");
  18873. };
  18874. clock.runToFrame = function runToFrame() {
  18875. return clock.tick(getTimeToNextFrame());
  18876. };
  18877. clock.runToLast = function runToLast() {
  18878. var timer = lastTimer(clock);
  18879. if (!timer) {
  18880. runJobs(clock);
  18881. return clock.now;
  18882. }
  18883. return clock.tick(timer.callAt - clock.now);
  18884. };
  18885. clock.reset = function reset() {
  18886. nanos = 0;
  18887. clock.timers = {};
  18888. clock.jobs = [];
  18889. clock.now = start;
  18890. };
  18891. clock.setSystemTime = function setSystemTime(systemTime) {
  18892. // determine time difference
  18893. var newNow = getEpoch(systemTime);
  18894. var difference = newNow - clock.now;
  18895. var id, timer;
  18896. adjustedSystemTime[0] = difference;
  18897. adjustedSystemTime[1] = nanos;
  18898. // update 'system clock'
  18899. clock.now = newNow;
  18900. nanos = 0;
  18901. // update timers and intervals to keep them stable
  18902. for (id in clock.timers) {
  18903. if (clock.timers.hasOwnProperty(id)) {
  18904. timer = clock.timers[id];
  18905. timer.createdAt += difference;
  18906. timer.callAt += difference;
  18907. }
  18908. }
  18909. };
  18910. if (performancePresent) {
  18911. clock.performance = Object.create(null);
  18912. if (hasPerformancePrototype) {
  18913. var proto = _global.Performance.prototype;
  18914. Object
  18915. .getOwnPropertyNames(proto)
  18916. .forEach(function (name) {
  18917. clock.performance[name] = NOOP;
  18918. });
  18919. }
  18920. clock.performance.now = function lolexNow() {
  18921. var hrt = hrtime();
  18922. var millis = (hrt[0] * 1000 + hrt[1] / 1e6);
  18923. return millis;
  18924. };
  18925. }
  18926. if (hrtimePresent) {
  18927. clock.hrtime = hrtime;
  18928. }
  18929. return clock;
  18930. }
  18931. /**
  18932. * @param config {Object} optional config
  18933. * @param config.target {Object} the target to install timers in (default `window`)
  18934. * @param config.now {number|Date} a number (in milliseconds) or a Date object (default epoch)
  18935. * @param config.toFake {string[]} names of the methods that should be faked.
  18936. * @param config.loopLimit {number} the maximum number of timers that will be run when calling runAll()
  18937. * @param config.shouldAdvanceTime {Boolean} tells lolex to increment mocked time automatically (default false)
  18938. * @param config.advanceTimeDelta {Number} increment mocked time every <<advanceTimeDelta>> ms (default: 20ms)
  18939. */
  18940. function install(config) {
  18941. if ( arguments.length > 1 || config instanceof Date || Array.isArray(config) || typeof config === "number") {
  18942. throw new TypeError("lolex.install called with " + String(config) +
  18943. " lolex 2.0+ requires an object parameter - see https://github.com/sinonjs/lolex");
  18944. }
  18945. config = typeof config !== "undefined" ? config : {};
  18946. config.shouldAdvanceTime = config.shouldAdvanceTime || false;
  18947. config.advanceTimeDelta = config.advanceTimeDelta || 20;
  18948. var i, l;
  18949. var target = config.target || _global;
  18950. var clock = createClock(config.now, config.loopLimit);
  18951. clock.uninstall = function () {
  18952. return uninstall(clock, target, config);
  18953. };
  18954. clock.methods = config.toFake || [];
  18955. if (clock.methods.length === 0) {
  18956. // do not fake nextTick by default - GitHub#126
  18957. clock.methods = keys(timers).filter(function (key) {return key !== "nextTick";});
  18958. }
  18959. for (i = 0, l = clock.methods.length; i < l; i++) {
  18960. if (clock.methods[i] === "hrtime") {
  18961. if (target.process && typeof target.process.hrtime === "function") {
  18962. hijackMethod(target.process, clock.methods[i], clock);
  18963. }
  18964. } else if (clock.methods[i] === "nextTick") {
  18965. if (target.process && typeof target.process.nextTick === "function") {
  18966. hijackMethod(target.process, clock.methods[i], clock);
  18967. }
  18968. } else {
  18969. if (clock.methods[i] === "setInterval" && config.shouldAdvanceTime === true) {
  18970. var intervalTick = doIntervalTick.bind(null, clock, config.advanceTimeDelta);
  18971. var intervalId = target[clock.methods[i]](
  18972. intervalTick,
  18973. config.advanceTimeDelta);
  18974. clock.attachedInterval = intervalId;
  18975. }
  18976. hijackMethod(target, clock.methods[i], clock);
  18977. }
  18978. }
  18979. return clock;
  18980. }
  18981. return {
  18982. timers: timers,
  18983. createClock: createClock,
  18984. install: install,
  18985. withGlobal: withGlobal
  18986. };
  18987. }
  18988. var defaultImplementation = withGlobal(global || window);
  18989. exports.timers = defaultImplementation.timers;
  18990. exports.createClock = defaultImplementation.createClock;
  18991. exports.install = defaultImplementation.install;
  18992. exports.withGlobal = withGlobal;
  18993. }).call(this,typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  18994. },{}]},{},[1])(1)
  18995. });
  18996. });
  18997. function createClock(config, globalCtx) {
  18998. var llxCtx = lolex;
  18999. if (globalCtx !== null && typeof globalCtx === "object") {
  19000. llxCtx = lolex.withGlobal(globalCtx);
  19001. }
  19002. var clock = llxCtx.install(config);
  19003. clock.restore = clock.uninstall;
  19004. return clock;
  19005. }
  19006. /**
  19007. * @param {number|Date|Object} dateOrConfig The unix epoch value to install with (default 0)
  19008. * @returns {Object} Returns a lolex clock instance
  19009. */
  19010. var useFakeTimers = function(dateOrConfig) {
  19011. var hasArguments = typeof dateOrConfig !== "undefined";
  19012. var argumentIsDateLike =
  19013. (typeof dateOrConfig === "number" || dateOrConfig instanceof Date) && arguments.length === 1;
  19014. var argumentIsObject = dateOrConfig !== null && typeof dateOrConfig === "object" && arguments.length === 1;
  19015. if (!hasArguments) {
  19016. return createClock({
  19017. now: 0
  19018. });
  19019. }
  19020. if (argumentIsDateLike) {
  19021. return createClock({
  19022. now: dateOrConfig
  19023. });
  19024. }
  19025. if (argumentIsObject) {
  19026. var config = extend.nonEnum({}, dateOrConfig);
  19027. var globalCtx = config.global;
  19028. delete config.global;
  19029. return createClock(config, globalCtx);
  19030. }
  19031. throw new TypeError("useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon");
  19032. };
  19033. var clock = {
  19034. create: function(now) {
  19035. return lolex.createClock(now);
  19036. }
  19037. };
  19038. var timers = {
  19039. setTimeout: setTimeout,
  19040. clearTimeout: clearTimeout,
  19041. setImmediate: typeof setImmediate !== "undefined" ? setImmediate : undefined,
  19042. clearImmediate: typeof clearImmediate !== "undefined" ? clearImmediate : undefined,
  19043. setInterval: setInterval,
  19044. clearInterval: clearInterval,
  19045. Date: Date
  19046. };
  19047. var fakeTimers = {
  19048. useFakeTimers: useFakeTimers,
  19049. clock: clock,
  19050. timers: timers
  19051. };
  19052. var functionToString = function toString() {
  19053. var i, prop, thisValue;
  19054. if (this.getCall && this.callCount) {
  19055. i = this.callCount;
  19056. while (i--) {
  19057. thisValue = this.getCall(i).thisValue;
  19058. for (prop in thisValue) {
  19059. if (thisValue[prop] === this) {
  19060. return prop;
  19061. }
  19062. }
  19063. }
  19064. }
  19065. return this.displayName || "sinon fake";
  19066. };
  19067. var arrayProto$5 = lib.prototypes.array;
  19068. var match$2 = samsam.createMatcher;
  19069. var deepEqual$3 = samsam.deepEqual;
  19070. var functionName$4 = lib.functionName;
  19071. var valueToString$7 = lib.valueToString;
  19072. var concat$2 = arrayProto$5.concat;
  19073. var filter = arrayProto$5.filter;
  19074. var join$4 = arrayProto$5.join;
  19075. var map$1 = arrayProto$5.map;
  19076. var reduce$1 = arrayProto$5.reduce;
  19077. var slice$4 = arrayProto$5.slice;
  19078. function throwYieldError(proxy, text, args) {
  19079. var msg = functionName$4(proxy) + text;
  19080. if (args.length) {
  19081. msg += " Received [" + join$4(slice$4(args), ", ") + "]";
  19082. }
  19083. throw new Error(msg);
  19084. }
  19085. var callProto = {
  19086. calledOn: function calledOn(thisValue) {
  19087. if (match$2.isMatcher(thisValue)) {
  19088. return thisValue.test(this.thisValue);
  19089. }
  19090. return this.thisValue === thisValue;
  19091. },
  19092. calledWith: function calledWith() {
  19093. var self = this;
  19094. var calledWithArgs = slice$4(arguments);
  19095. if (calledWithArgs.length > self.args.length) {
  19096. return false;
  19097. }
  19098. return reduce$1(
  19099. calledWithArgs,
  19100. function(prev, arg, i) {
  19101. return prev && deepEqual$3(self.args[i], arg);
  19102. },
  19103. true
  19104. );
  19105. },
  19106. calledWithMatch: function calledWithMatch() {
  19107. var self = this;
  19108. var calledWithMatchArgs = slice$4(arguments);
  19109. if (calledWithMatchArgs.length > self.args.length) {
  19110. return false;
  19111. }
  19112. return reduce$1(
  19113. calledWithMatchArgs,
  19114. function(prev, expectation, i) {
  19115. var actual = self.args[i];
  19116. return prev && match$2(expectation).test(actual);
  19117. },
  19118. true
  19119. );
  19120. },
  19121. calledWithExactly: function calledWithExactly() {
  19122. return arguments.length === this.args.length && this.calledWith.apply(this, arguments);
  19123. },
  19124. notCalledWith: function notCalledWith() {
  19125. return !this.calledWith.apply(this, arguments);
  19126. },
  19127. notCalledWithMatch: function notCalledWithMatch() {
  19128. return !this.calledWithMatch.apply(this, arguments);
  19129. },
  19130. returned: function returned(value) {
  19131. return deepEqual$3(this.returnValue, value);
  19132. },
  19133. threw: function threw(error) {
  19134. if (typeof error === "undefined" || !this.exception) {
  19135. return Boolean(this.exception);
  19136. }
  19137. return this.exception === error || this.exception.name === error;
  19138. },
  19139. calledWithNew: function calledWithNew() {
  19140. return this.proxy.prototype && this.thisValue instanceof this.proxy;
  19141. },
  19142. calledBefore: function(other) {
  19143. return this.callId < other.callId;
  19144. },
  19145. calledAfter: function(other) {
  19146. return this.callId > other.callId;
  19147. },
  19148. calledImmediatelyBefore: function(other) {
  19149. return this.callId === other.callId - 1;
  19150. },
  19151. calledImmediatelyAfter: function(other) {
  19152. return this.callId === other.callId + 1;
  19153. },
  19154. callArg: function(pos) {
  19155. this.ensureArgIsAFunction(pos);
  19156. return this.args[pos]();
  19157. },
  19158. callArgOn: function(pos, thisValue) {
  19159. this.ensureArgIsAFunction(pos);
  19160. return this.args[pos].apply(thisValue);
  19161. },
  19162. callArgWith: function(pos) {
  19163. return this.callArgOnWith.apply(this, concat$2([pos, null], slice$4(arguments, 1)));
  19164. },
  19165. callArgOnWith: function(pos, thisValue) {
  19166. this.ensureArgIsAFunction(pos);
  19167. var args = slice$4(arguments, 2);
  19168. return this.args[pos].apply(thisValue, args);
  19169. },
  19170. throwArg: function(pos) {
  19171. if (pos > this.args.length) {
  19172. throw new TypeError("Not enough arguments: " + pos + " required but only " + this.args.length + " present");
  19173. }
  19174. throw this.args[pos];
  19175. },
  19176. yield: function() {
  19177. return this.yieldOn.apply(this, concat$2([null], slice$4(arguments, 0)));
  19178. },
  19179. yieldOn: function(thisValue) {
  19180. var args = slice$4(this.args);
  19181. var yieldFn = filter(args, function(arg) {
  19182. return typeof arg === "function";
  19183. })[0];
  19184. if (!yieldFn) {
  19185. throwYieldError(this.proxy, " cannot yield since no callback was passed.", args);
  19186. }
  19187. return yieldFn.apply(thisValue, slice$4(arguments, 1));
  19188. },
  19189. yieldTo: function(prop) {
  19190. return this.yieldToOn.apply(this, concat$2([prop, null], slice$4(arguments, 1)));
  19191. },
  19192. yieldToOn: function(prop, thisValue) {
  19193. var args = slice$4(this.args);
  19194. var yieldArg = filter(args, function(arg) {
  19195. return arg && typeof arg[prop] === "function";
  19196. })[0];
  19197. var yieldFn = yieldArg && yieldArg[prop];
  19198. if (!yieldFn) {
  19199. throwYieldError(
  19200. this.proxy,
  19201. " cannot yield to '" + valueToString$7(prop) + "' since no callback was passed.",
  19202. args
  19203. );
  19204. }
  19205. return yieldFn.apply(thisValue, slice$4(arguments, 2));
  19206. },
  19207. toString: function() {
  19208. var callStr = this.proxy ? String(this.proxy) + "(" : "";
  19209. var formattedArgs;
  19210. if (!this.args) {
  19211. return ":(";
  19212. }
  19213. formattedArgs = map$1(this.args, function(arg) {
  19214. return format_1(arg);
  19215. });
  19216. callStr = callStr + join$4(formattedArgs, ", ") + ")";
  19217. if (typeof this.returnValue !== "undefined") {
  19218. callStr += " => " + format_1(this.returnValue);
  19219. }
  19220. if (this.exception) {
  19221. callStr += " !" + this.exception.name;
  19222. if (this.exception.message) {
  19223. callStr += "(" + this.exception.message + ")";
  19224. }
  19225. }
  19226. if (this.stack) {
  19227. // Omit the error message and the two top stack frames in sinon itself:
  19228. callStr += (this.stack.split("\n")[3] || "unknown").replace(/^\s*(?:at\s+|@)?/, " at ");
  19229. }
  19230. return callStr;
  19231. },
  19232. ensureArgIsAFunction: function(pos) {
  19233. if (typeof this.args[pos] !== "function") {
  19234. throw new TypeError(
  19235. "Expected argument at position " + pos + " to be a Function, but was " + typeof this.args[pos]
  19236. );
  19237. }
  19238. }
  19239. };
  19240. Object.defineProperty(callProto, "stack", {
  19241. enumerable: true,
  19242. configurable: true,
  19243. get: function() {
  19244. return (this.errorWithCallStack && this.errorWithCallStack.stack) || "";
  19245. }
  19246. });
  19247. callProto.invokeCallback = callProto.yield;
  19248. function createSpyCall(spy, thisValue, args, returnValue, exception, id, errorWithCallStack) {
  19249. if (typeof id !== "number") {
  19250. throw new TypeError("Call id is not a number");
  19251. }
  19252. var proxyCall = Object.create(callProto);
  19253. var lastArg = (args.length > 0 && args[args.length - 1]) || undefined;
  19254. var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined;
  19255. proxyCall.proxy = spy;
  19256. proxyCall.thisValue = thisValue;
  19257. proxyCall.args = args;
  19258. proxyCall.lastArg = lastArg;
  19259. proxyCall.callback = callback;
  19260. proxyCall.returnValue = returnValue;
  19261. proxyCall.exception = exception;
  19262. proxyCall.callId = id;
  19263. proxyCall.errorWithCallStack = errorWithCallStack;
  19264. return proxyCall;
  19265. }
  19266. createSpyCall.toString = callProto.toString; // used by mocks
  19267. var call$1 = createSpyCall;
  19268. var hasOwnProperty$4 = lib.prototypes.object.hasOwnProperty;
  19269. var valueToString$8 = lib.valueToString;
  19270. function isFunction(obj) {
  19271. return typeof obj === "function" || Boolean(obj && obj.constructor && obj.call && obj.apply);
  19272. }
  19273. function mirrorProperties(target, source) {
  19274. for (var prop in source) {
  19275. if (!hasOwnProperty$4(target, prop)) {
  19276. target[prop] = source[prop];
  19277. }
  19278. }
  19279. }
  19280. // Cheap way to detect if we have ES5 support.
  19281. var hasES5Support = "keys" in Object;
  19282. var wrapMethod = function wrapMethod(object, property, method) {
  19283. if (!object) {
  19284. throw new TypeError("Should wrap property of object");
  19285. }
  19286. if (typeof method !== "function" && typeof method !== "object") {
  19287. throw new TypeError("Method wrapper should be a function or a property descriptor");
  19288. }
  19289. function checkWrappedMethod(wrappedMethod) {
  19290. var error;
  19291. if (!isFunction(wrappedMethod)) {
  19292. error = new TypeError(
  19293. "Attempted to wrap " + typeof wrappedMethod + " property " + valueToString$8(property) + " as function"
  19294. );
  19295. } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) {
  19296. error = new TypeError("Attempted to wrap " + valueToString$8(property) + " which is already wrapped");
  19297. } else if (wrappedMethod.calledBefore) {
  19298. var verb = wrappedMethod.returns ? "stubbed" : "spied on";
  19299. error = new TypeError("Attempted to wrap " + valueToString$8(property) + " which is already " + verb);
  19300. }
  19301. if (error) {
  19302. if (wrappedMethod && wrappedMethod.stackTraceError) {
  19303. error.stack += "\n--------------\n" + wrappedMethod.stackTraceError.stack;
  19304. }
  19305. throw error;
  19306. }
  19307. }
  19308. var error, wrappedMethod, i, wrappedMethodDesc;
  19309. function simplePropertyAssignment() {
  19310. wrappedMethod = object[property];
  19311. checkWrappedMethod(wrappedMethod);
  19312. object[property] = method;
  19313. method.displayName = property;
  19314. }
  19315. // Firefox has a problem when using hasOwn.call on objects from other frames.
  19316. /* eslint-disable-next-line local-rules/no-prototype-methods */
  19317. var owned = object.hasOwnProperty ? object.hasOwnProperty(property) : hasOwnProperty$4(object, property);
  19318. if (hasES5Support) {
  19319. var methodDesc = typeof method === "function" ? { value: method } : method;
  19320. wrappedMethodDesc = getPropertyDescriptor(object, property);
  19321. if (!wrappedMethodDesc) {
  19322. error = new TypeError(
  19323. "Attempted to wrap " + typeof wrappedMethod + " property " + property + " as function"
  19324. );
  19325. } else if (wrappedMethodDesc.restore && wrappedMethodDesc.restore.sinon) {
  19326. error = new TypeError("Attempted to wrap " + property + " which is already wrapped");
  19327. }
  19328. if (error) {
  19329. if (wrappedMethodDesc && wrappedMethodDesc.stackTraceError) {
  19330. error.stack += "\n--------------\n" + wrappedMethodDesc.stackTraceError.stack;
  19331. }
  19332. throw error;
  19333. }
  19334. var types = Object.keys(methodDesc);
  19335. for (i = 0; i < types.length; i++) {
  19336. wrappedMethod = wrappedMethodDesc[types[i]];
  19337. checkWrappedMethod(wrappedMethod);
  19338. }
  19339. mirrorProperties(methodDesc, wrappedMethodDesc);
  19340. for (i = 0; i < types.length; i++) {
  19341. mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]);
  19342. }
  19343. Object.defineProperty(object, property, methodDesc);
  19344. // catch failing assignment
  19345. // this is the converse of the check in `.restore` below
  19346. if (typeof method === "function" && object[property] !== method) {
  19347. // correct any wrongdoings caused by the defineProperty call above,
  19348. // such as adding new items (if object was a Storage object)
  19349. delete object[property];
  19350. simplePropertyAssignment();
  19351. }
  19352. } else {
  19353. simplePropertyAssignment();
  19354. }
  19355. extend.nonEnum(method, {
  19356. displayName: property,
  19357. // Set up an Error object for a stack trace which can be used later to find what line of
  19358. // code the original method was created on.
  19359. stackTraceError: new Error("Stack Trace for original"),
  19360. restore: function() {
  19361. // For prototype properties try to reset by delete first.
  19362. // If this fails (ex: localStorage on mobile safari) then force a reset
  19363. // via direct assignment.
  19364. if (!owned) {
  19365. // In some cases `delete` may throw an error
  19366. try {
  19367. delete object[property];
  19368. } catch (e) {} // eslint-disable-line no-empty
  19369. // For native code functions `delete` fails without throwing an error
  19370. // on Chrome < 43, PhantomJS, etc.
  19371. } else if (hasES5Support) {
  19372. Object.defineProperty(object, property, wrappedMethodDesc);
  19373. }
  19374. if (hasES5Support) {
  19375. var descriptor = getPropertyDescriptor(object, property);
  19376. if (descriptor && descriptor.value === method) {
  19377. object[property] = wrappedMethod;
  19378. }
  19379. } else {
  19380. // Use strict equality comparison to check failures then force a reset
  19381. // via direct assignment.
  19382. if (object[property] === method) {
  19383. object[property] = wrappedMethod;
  19384. }
  19385. }
  19386. }
  19387. });
  19388. method.wrappedMethod = wrappedMethod;
  19389. method.restore.sinon = true;
  19390. if (!hasES5Support) {
  19391. mirrorProperties(method, wrappedMethod);
  19392. }
  19393. return method;
  19394. };
  19395. var global$1 = (typeof global !== "undefined" ? global :
  19396. typeof self !== "undefined" ? self :
  19397. typeof window !== "undefined" ? window : {});
  19398. // shim for using process in browser
  19399. // based off https://github.com/defunctzombie/node-process/blob/master/browser.js
  19400. function defaultSetTimout() {
  19401. throw new Error('setTimeout has not been defined');
  19402. }
  19403. function defaultClearTimeout () {
  19404. throw new Error('clearTimeout has not been defined');
  19405. }
  19406. var cachedSetTimeout = defaultSetTimout;
  19407. var cachedClearTimeout = defaultClearTimeout;
  19408. if (typeof global$1.setTimeout === 'function') {
  19409. cachedSetTimeout = setTimeout;
  19410. }
  19411. if (typeof global$1.clearTimeout === 'function') {
  19412. cachedClearTimeout = clearTimeout;
  19413. }
  19414. function runTimeout(fun) {
  19415. if (cachedSetTimeout === setTimeout) {
  19416. //normal enviroments in sane situations
  19417. return setTimeout(fun, 0);
  19418. }
  19419. // if setTimeout wasn't available but was latter defined
  19420. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  19421. cachedSetTimeout = setTimeout;
  19422. return setTimeout(fun, 0);
  19423. }
  19424. try {
  19425. // when when somebody has screwed with setTimeout but no I.E. maddness
  19426. return cachedSetTimeout(fun, 0);
  19427. } catch(e){
  19428. try {
  19429. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  19430. return cachedSetTimeout.call(null, fun, 0);
  19431. } catch(e){
  19432. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  19433. return cachedSetTimeout.call(this, fun, 0);
  19434. }
  19435. }
  19436. }
  19437. function runClearTimeout(marker) {
  19438. if (cachedClearTimeout === clearTimeout) {
  19439. //normal enviroments in sane situations
  19440. return clearTimeout(marker);
  19441. }
  19442. // if clearTimeout wasn't available but was latter defined
  19443. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  19444. cachedClearTimeout = clearTimeout;
  19445. return clearTimeout(marker);
  19446. }
  19447. try {
  19448. // when when somebody has screwed with setTimeout but no I.E. maddness
  19449. return cachedClearTimeout(marker);
  19450. } catch (e){
  19451. try {
  19452. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  19453. return cachedClearTimeout.call(null, marker);
  19454. } catch (e){
  19455. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  19456. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  19457. return cachedClearTimeout.call(this, marker);
  19458. }
  19459. }
  19460. }
  19461. var queue = [];
  19462. var draining = false;
  19463. var currentQueue;
  19464. var queueIndex = -1;
  19465. function cleanUpNextTick() {
  19466. if (!draining || !currentQueue) {
  19467. return;
  19468. }
  19469. draining = false;
  19470. if (currentQueue.length) {
  19471. queue = currentQueue.concat(queue);
  19472. } else {
  19473. queueIndex = -1;
  19474. }
  19475. if (queue.length) {
  19476. drainQueue();
  19477. }
  19478. }
  19479. function drainQueue() {
  19480. if (draining) {
  19481. return;
  19482. }
  19483. var timeout = runTimeout(cleanUpNextTick);
  19484. draining = true;
  19485. var len = queue.length;
  19486. while(len) {
  19487. currentQueue = queue;
  19488. queue = [];
  19489. while (++queueIndex < len) {
  19490. if (currentQueue) {
  19491. currentQueue[queueIndex].run();
  19492. }
  19493. }
  19494. queueIndex = -1;
  19495. len = queue.length;
  19496. }
  19497. currentQueue = null;
  19498. draining = false;
  19499. runClearTimeout(timeout);
  19500. }
  19501. function nextTick$2(fun) {
  19502. var args = new Array(arguments.length - 1);
  19503. if (arguments.length > 1) {
  19504. for (var i = 1; i < arguments.length; i++) {
  19505. args[i - 1] = arguments[i];
  19506. }
  19507. }
  19508. queue.push(new Item(fun, args));
  19509. if (queue.length === 1 && !draining) {
  19510. runTimeout(drainQueue);
  19511. }
  19512. }
  19513. // v8 likes predictible objects
  19514. function Item(fun, array) {
  19515. this.fun = fun;
  19516. this.array = array;
  19517. }
  19518. Item.prototype.run = function () {
  19519. this.fun.apply(null, this.array);
  19520. };
  19521. var title = 'browser';
  19522. var platform = 'browser';
  19523. var browser = true;
  19524. var env = {};
  19525. var argv = [];
  19526. var version = ''; // empty string to avoid regexp issues
  19527. var versions = {};
  19528. var release = {};
  19529. var config = {};
  19530. function noop() {}
  19531. var on = noop;
  19532. var addListener = noop;
  19533. var once = noop;
  19534. var off = noop;
  19535. var removeListener = noop;
  19536. var removeAllListeners = noop;
  19537. var emit = noop;
  19538. function binding(name) {
  19539. throw new Error('process.binding is not supported');
  19540. }
  19541. function cwd () { return '/' }
  19542. function chdir (dir) {
  19543. throw new Error('process.chdir is not supported');
  19544. }function umask() { return 0; }
  19545. // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
  19546. var performance = global$1.performance || {};
  19547. var performanceNow =
  19548. performance.now ||
  19549. performance.mozNow ||
  19550. performance.msNow ||
  19551. performance.oNow ||
  19552. performance.webkitNow ||
  19553. function(){ return (new Date()).getTime() };
  19554. // generate timestamp or delta
  19555. // see http://nodejs.org/api/process.html#process_process_hrtime
  19556. function hrtime(previousTimestamp){
  19557. var clocktime = performanceNow.call(performance)*1e-3;
  19558. var seconds = Math.floor(clocktime);
  19559. var nanoseconds = Math.floor((clocktime%1)*1e9);
  19560. if (previousTimestamp) {
  19561. seconds = seconds - previousTimestamp[0];
  19562. nanoseconds = nanoseconds - previousTimestamp[1];
  19563. if (nanoseconds<0) {
  19564. seconds--;
  19565. nanoseconds += 1e9;
  19566. }
  19567. }
  19568. return [seconds,nanoseconds]
  19569. }
  19570. var startTime = new Date();
  19571. function uptime() {
  19572. var currentTime = new Date();
  19573. var dif = currentTime - startTime;
  19574. return dif / 1000;
  19575. }
  19576. var process = {
  19577. nextTick: nextTick$2,
  19578. title: title,
  19579. browser: browser,
  19580. env: env,
  19581. argv: argv,
  19582. version: version,
  19583. versions: versions,
  19584. on: on,
  19585. addListener: addListener,
  19586. once: once,
  19587. off: off,
  19588. removeListener: removeListener,
  19589. removeAllListeners: removeAllListeners,
  19590. emit: emit,
  19591. binding: binding,
  19592. cwd: cwd,
  19593. chdir: chdir,
  19594. umask: umask,
  19595. hrtime: hrtime,
  19596. platform: platform,
  19597. release: release,
  19598. config: config,
  19599. uptime: uptime
  19600. };
  19601. var hasFlag = (flag, argv$$1) => {
  19602. argv$$1 = argv$$1 || process.argv;
  19603. const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
  19604. const pos = argv$$1.indexOf(prefix + flag);
  19605. const terminatorPos = argv$$1.indexOf('--');
  19606. return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
  19607. };
  19608. const env$1 = process.env;
  19609. let forceColor;
  19610. if (hasFlag('no-color') ||
  19611. hasFlag('no-colors') ||
  19612. hasFlag('color=false')) {
  19613. forceColor = false;
  19614. } else if (hasFlag('color') ||
  19615. hasFlag('colors') ||
  19616. hasFlag('color=true') ||
  19617. hasFlag('color=always')) {
  19618. forceColor = true;
  19619. }
  19620. if ('FORCE_COLOR' in env$1) {
  19621. forceColor = env$1.FORCE_COLOR.length === 0 || parseInt(env$1.FORCE_COLOR, 10) !== 0;
  19622. }
  19623. function translateLevel(level) {
  19624. if (level === 0) {
  19625. return false;
  19626. }
  19627. return {
  19628. level,
  19629. hasBasic: true,
  19630. has256: level >= 2,
  19631. has16m: level >= 3
  19632. };
  19633. }
  19634. function supportsColor(stream) {
  19635. if (forceColor === false) {
  19636. return 0;
  19637. }
  19638. if (hasFlag('color=16m') ||
  19639. hasFlag('color=full') ||
  19640. hasFlag('color=truecolor')) {
  19641. return 3;
  19642. }
  19643. if (hasFlag('color=256')) {
  19644. return 2;
  19645. }
  19646. if (stream && !stream.isTTY && forceColor !== true) {
  19647. return 0;
  19648. }
  19649. const min = forceColor ? 1 : 0;
  19650. if ('CI' in env$1) {
  19651. if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env$1) || env$1.CI_NAME === 'codeship') {
  19652. return 1;
  19653. }
  19654. return min;
  19655. }
  19656. if ('TEAMCITY_VERSION' in env$1) {
  19657. return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env$1.TEAMCITY_VERSION) ? 1 : 0;
  19658. }
  19659. if (env$1.COLORTERM === 'truecolor') {
  19660. return 3;
  19661. }
  19662. if ('TERM_PROGRAM' in env$1) {
  19663. const version$$1 = parseInt((env$1.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
  19664. switch (env$1.TERM_PROGRAM) {
  19665. case 'iTerm.app':
  19666. return version$$1 >= 3 ? 3 : 2;
  19667. case 'Apple_Terminal':
  19668. return 2;
  19669. // No default
  19670. }
  19671. }
  19672. if (/-256(color)?$/i.test(env$1.TERM)) {
  19673. return 2;
  19674. }
  19675. if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env$1.TERM)) {
  19676. return 1;
  19677. }
  19678. if ('COLORTERM' in env$1) {
  19679. return 1;
  19680. }
  19681. if (env$1.TERM === 'dumb') {
  19682. return min;
  19683. }
  19684. return min;
  19685. }
  19686. function getSupportLevel(stream) {
  19687. const level = supportsColor(stream);
  19688. return translateLevel(level);
  19689. }
  19690. var supportsColor_1 = {
  19691. supportsColor: getSupportLevel,
  19692. stdout: getSupportLevel(process.stdout),
  19693. stderr: getSupportLevel(process.stderr)
  19694. };
  19695. function colorize(str, color) {
  19696. if (supportsColor_1.stdout === false) {
  19697. return str;
  19698. }
  19699. return "\x1b[" + color + "m" + str + "\x1b[0m";
  19700. }
  19701. var red = function(str) {
  19702. return colorize(str, 31);
  19703. };
  19704. var green = function(str) {
  19705. return colorize(str, 32);
  19706. };
  19707. var cyan = function(str) {
  19708. return colorize(str, 96);
  19709. };
  19710. var white = function(str) {
  19711. return colorize(str, 39);
  19712. };
  19713. var bold = function(str) {
  19714. return colorize(str, 1);
  19715. };
  19716. var color = {
  19717. red: red,
  19718. green: green,
  19719. cyan: cyan,
  19720. white: white,
  19721. bold: bold
  19722. };
  19723. var base = createCommonjsModule(function (module, exports) {
  19724. exports.__esModule = true;
  19725. exports['default'] = /*istanbul ignore end*/Diff;
  19726. function Diff() {}
  19727. Diff.prototype = {
  19728. /*istanbul ignore start*/ /*istanbul ignore end*/diff: function diff(oldString, newString) {
  19729. /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19730. var callback = options.callback;
  19731. if (typeof options === 'function') {
  19732. callback = options;
  19733. options = {};
  19734. }
  19735. this.options = options;
  19736. var self = this;
  19737. function done(value) {
  19738. if (callback) {
  19739. setTimeout(function () {
  19740. callback(undefined, value);
  19741. }, 0);
  19742. return true;
  19743. } else {
  19744. return value;
  19745. }
  19746. }
  19747. // Allow subclasses to massage the input prior to running
  19748. oldString = this.castInput(oldString);
  19749. newString = this.castInput(newString);
  19750. oldString = this.removeEmpty(this.tokenize(oldString));
  19751. newString = this.removeEmpty(this.tokenize(newString));
  19752. var newLen = newString.length,
  19753. oldLen = oldString.length;
  19754. var editLength = 1;
  19755. var maxEditLength = newLen + oldLen;
  19756. var bestPath = [{ newPos: -1, components: [] }];
  19757. // Seed editLength = 0, i.e. the content starts with the same values
  19758. var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
  19759. if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
  19760. // Identity per the equality and tokenizer
  19761. return done([{ value: this.join(newString), count: newString.length }]);
  19762. }
  19763. // Main worker method. checks all permutations of a given edit length for acceptance.
  19764. function execEditLength() {
  19765. for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
  19766. var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
  19767. var addPath = bestPath[diagonalPath - 1],
  19768. removePath = bestPath[diagonalPath + 1],
  19769. _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
  19770. if (addPath) {
  19771. // No one else is going to attempt to use this value, clear it
  19772. bestPath[diagonalPath - 1] = undefined;
  19773. }
  19774. var canAdd = addPath && addPath.newPos + 1 < newLen,
  19775. canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
  19776. if (!canAdd && !canRemove) {
  19777. // If this path is a terminal then prune
  19778. bestPath[diagonalPath] = undefined;
  19779. continue;
  19780. }
  19781. // Select the diagonal that we want to branch from. We select the prior
  19782. // path whose position in the new string is the farthest from the origin
  19783. // and does not pass the bounds of the diff graph
  19784. if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
  19785. basePath = clonePath(removePath);
  19786. self.pushComponent(basePath.components, undefined, true);
  19787. } else {
  19788. basePath = addPath; // No need to clone, we've pulled it from the list
  19789. basePath.newPos++;
  19790. self.pushComponent(basePath.components, true, undefined);
  19791. }
  19792. _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
  19793. // If we have hit the end of both strings, then we are done
  19794. if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
  19795. return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
  19796. } else {
  19797. // Otherwise track this path as a potential candidate and continue.
  19798. bestPath[diagonalPath] = basePath;
  19799. }
  19800. }
  19801. editLength++;
  19802. }
  19803. // Performs the length of edit iteration. Is a bit fugly as this has to support the
  19804. // sync and async mode which is never fun. Loops over execEditLength until a value
  19805. // is produced.
  19806. if (callback) {
  19807. (function exec() {
  19808. setTimeout(function () {
  19809. // This should not happen, but we want to be safe.
  19810. /* istanbul ignore next */
  19811. if (editLength > maxEditLength) {
  19812. return callback();
  19813. }
  19814. if (!execEditLength()) {
  19815. exec();
  19816. }
  19817. }, 0);
  19818. })();
  19819. } else {
  19820. while (editLength <= maxEditLength) {
  19821. var ret = execEditLength();
  19822. if (ret) {
  19823. return ret;
  19824. }
  19825. }
  19826. }
  19827. },
  19828. /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) {
  19829. var last = components[components.length - 1];
  19830. if (last && last.added === added && last.removed === removed) {
  19831. // We need to clone here as the component clone operation is just
  19832. // as shallow array clone
  19833. components[components.length - 1] = { count: last.count + 1, added: added, removed: removed };
  19834. } else {
  19835. components.push({ count: 1, added: added, removed: removed });
  19836. }
  19837. },
  19838. /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
  19839. var newLen = newString.length,
  19840. oldLen = oldString.length,
  19841. newPos = basePath.newPos,
  19842. oldPos = newPos - diagonalPath,
  19843. commonCount = 0;
  19844. while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
  19845. newPos++;
  19846. oldPos++;
  19847. commonCount++;
  19848. }
  19849. if (commonCount) {
  19850. basePath.components.push({ count: commonCount });
  19851. }
  19852. basePath.newPos = newPos;
  19853. return oldPos;
  19854. },
  19855. /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) {
  19856. if (this.options.comparator) {
  19857. return this.options.comparator(left, right);
  19858. } else {
  19859. return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
  19860. }
  19861. },
  19862. /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) {
  19863. var ret = [];
  19864. for (var i = 0; i < array.length; i++) {
  19865. if (array[i]) {
  19866. ret.push(array[i]);
  19867. }
  19868. }
  19869. return ret;
  19870. },
  19871. /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) {
  19872. return value;
  19873. },
  19874. /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) {
  19875. return value.split('');
  19876. },
  19877. /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) {
  19878. return chars.join('');
  19879. }
  19880. };
  19881. function buildValues(diff, components, newString, oldString, useLongestToken) {
  19882. var componentPos = 0,
  19883. componentLen = components.length,
  19884. newPos = 0,
  19885. oldPos = 0;
  19886. for (; componentPos < componentLen; componentPos++) {
  19887. var component = components[componentPos];
  19888. if (!component.removed) {
  19889. if (!component.added && useLongestToken) {
  19890. var value = newString.slice(newPos, newPos + component.count);
  19891. value = value.map(function (value, i) {
  19892. var oldValue = oldString[oldPos + i];
  19893. return oldValue.length > value.length ? oldValue : value;
  19894. });
  19895. component.value = diff.join(value);
  19896. } else {
  19897. component.value = diff.join(newString.slice(newPos, newPos + component.count));
  19898. }
  19899. newPos += component.count;
  19900. // Common case
  19901. if (!component.added) {
  19902. oldPos += component.count;
  19903. }
  19904. } else {
  19905. component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
  19906. oldPos += component.count;
  19907. // Reverse add and remove so removes are output first to match common convention
  19908. // The diffing algorithm is tied to add then remove output and this is the simplest
  19909. // route to get the desired output with minimal overhead.
  19910. if (componentPos && components[componentPos - 1].added) {
  19911. var tmp = components[componentPos - 1];
  19912. components[componentPos - 1] = components[componentPos];
  19913. components[componentPos] = tmp;
  19914. }
  19915. }
  19916. }
  19917. // Special case handle for when one terminal is ignored (i.e. whitespace).
  19918. // For this case we merge the terminal into the prior string and drop the change.
  19919. // This is only available for string mode.
  19920. var lastComponent = components[componentLen - 1];
  19921. if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
  19922. components[componentLen - 2].value += lastComponent.value;
  19923. components.pop();
  19924. }
  19925. return components;
  19926. }
  19927. function clonePath(path) {
  19928. return { newPos: path.newPos, components: path.components.slice(0) };
  19929. }
  19930. });
  19931. unwrapExports(base);
  19932. var character = createCommonjsModule(function (module, exports) {
  19933. exports.__esModule = true;
  19934. exports.characterDiff = undefined;
  19935. exports. /*istanbul ignore end*/diffChars = diffChars;
  19936. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  19937. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  19938. /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
  19939. function diffChars(oldStr, newStr, options) {
  19940. return characterDiff.diff(oldStr, newStr, options);
  19941. }
  19942. });
  19943. unwrapExports(character);
  19944. var character_1 = character.characterDiff;
  19945. var character_2 = character.diffChars;
  19946. var params = createCommonjsModule(function (module, exports) {
  19947. exports.__esModule = true;
  19948. exports. /*istanbul ignore end*/generateOptions = generateOptions;
  19949. function generateOptions(options, defaults) {
  19950. if (typeof options === 'function') {
  19951. defaults.callback = options;
  19952. } else if (options) {
  19953. for (var name in options) {
  19954. /* istanbul ignore else */
  19955. if (options.hasOwnProperty(name)) {
  19956. defaults[name] = options[name];
  19957. }
  19958. }
  19959. }
  19960. return defaults;
  19961. }
  19962. });
  19963. unwrapExports(params);
  19964. var params_1 = params.generateOptions;
  19965. var word = createCommonjsModule(function (module, exports) {
  19966. exports.__esModule = true;
  19967. exports.wordDiff = undefined;
  19968. exports. /*istanbul ignore end*/diffWords = diffWords;
  19969. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace;
  19970. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  19971. /*istanbul ignore end*/
  19972. /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  19973. /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
  19974. //
  19975. // Ranges and exceptions:
  19976. // Latin-1 Supplement, 0080–00FF
  19977. // - U+00D7 × Multiplication sign
  19978. // - U+00F7 ÷ Division sign
  19979. // Latin Extended-A, 0100–017F
  19980. // Latin Extended-B, 0180–024F
  19981. // IPA Extensions, 0250–02AF
  19982. // Spacing Modifier Letters, 02B0–02FF
  19983. // - U+02C7 ˇ &#711; Caron
  19984. // - U+02D8 ˘ &#728; Breve
  19985. // - U+02D9 ˙ &#729; Dot Above
  19986. // - U+02DA ˚ &#730; Ring Above
  19987. // - U+02DB ˛ &#731; Ogonek
  19988. // - U+02DC ˜ &#732; Small Tilde
  19989. // - U+02DD ˝ &#733; Double Acute Accent
  19990. // Latin Extended Additional, 1E00–1EFF
  19991. var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
  19992. var reWhitespace = /\S/;
  19993. var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
  19994. wordDiff.equals = function (left, right) {
  19995. if (this.options.ignoreCase) {
  19996. left = left.toLowerCase();
  19997. right = right.toLowerCase();
  19998. }
  19999. return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
  20000. };
  20001. wordDiff.tokenize = function (value) {
  20002. var tokens = value.split(/(\s+|\b)/);
  20003. // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
  20004. for (var i = 0; i < tokens.length - 1; i++) {
  20005. // If we have an empty string in the next field and we have only word chars before and after, merge
  20006. if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
  20007. tokens[i] += tokens[i + 2];
  20008. tokens.splice(i + 1, 2);
  20009. i--;
  20010. }
  20011. }
  20012. return tokens;
  20013. };
  20014. function diffWords(oldStr, newStr, options) {
  20015. options = /*istanbul ignore start*/(0, params.generateOptions) /*istanbul ignore end*/(options, { ignoreWhitespace: true });
  20016. return wordDiff.diff(oldStr, newStr, options);
  20017. }
  20018. function diffWordsWithSpace(oldStr, newStr, options) {
  20019. return wordDiff.diff(oldStr, newStr, options);
  20020. }
  20021. });
  20022. unwrapExports(word);
  20023. var word_1 = word.wordDiff;
  20024. var word_2 = word.diffWords;
  20025. var word_3 = word.diffWordsWithSpace;
  20026. var line = createCommonjsModule(function (module, exports) {
  20027. exports.__esModule = true;
  20028. exports.lineDiff = undefined;
  20029. exports. /*istanbul ignore end*/diffLines = diffLines;
  20030. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines;
  20031. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  20032. /*istanbul ignore end*/
  20033. /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  20034. /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
  20035. lineDiff.tokenize = function (value) {
  20036. var retLines = [],
  20037. linesAndNewlines = value.split(/(\n|\r\n)/);
  20038. // Ignore the final empty token that occurs if the string ends with a new line
  20039. if (!linesAndNewlines[linesAndNewlines.length - 1]) {
  20040. linesAndNewlines.pop();
  20041. }
  20042. // Merge the content and line separators into single tokens
  20043. for (var i = 0; i < linesAndNewlines.length; i++) {
  20044. var line = linesAndNewlines[i];
  20045. if (i % 2 && !this.options.newlineIsToken) {
  20046. retLines[retLines.length - 1] += line;
  20047. } else {
  20048. if (this.options.ignoreWhitespace) {
  20049. line = line.trim();
  20050. }
  20051. retLines.push(line);
  20052. }
  20053. }
  20054. return retLines;
  20055. };
  20056. function diffLines(oldStr, newStr, callback) {
  20057. return lineDiff.diff(oldStr, newStr, callback);
  20058. }
  20059. function diffTrimmedLines(oldStr, newStr, callback) {
  20060. var options = /*istanbul ignore start*/(0, params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
  20061. return lineDiff.diff(oldStr, newStr, options);
  20062. }
  20063. });
  20064. unwrapExports(line);
  20065. var line_1 = line.lineDiff;
  20066. var line_2 = line.diffLines;
  20067. var line_3 = line.diffTrimmedLines;
  20068. var sentence = createCommonjsModule(function (module, exports) {
  20069. exports.__esModule = true;
  20070. exports.sentenceDiff = undefined;
  20071. exports. /*istanbul ignore end*/diffSentences = diffSentences;
  20072. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  20073. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  20074. /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
  20075. sentenceDiff.tokenize = function (value) {
  20076. return value.split(/(\S.+?[.!?])(?=\s+|$)/);
  20077. };
  20078. function diffSentences(oldStr, newStr, callback) {
  20079. return sentenceDiff.diff(oldStr, newStr, callback);
  20080. }
  20081. });
  20082. unwrapExports(sentence);
  20083. var sentence_1 = sentence.sentenceDiff;
  20084. var sentence_2 = sentence.diffSentences;
  20085. var css = createCommonjsModule(function (module, exports) {
  20086. exports.__esModule = true;
  20087. exports.cssDiff = undefined;
  20088. exports. /*istanbul ignore end*/diffCss = diffCss;
  20089. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  20090. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  20091. /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
  20092. cssDiff.tokenize = function (value) {
  20093. return value.split(/([{}:;,]|\s+)/);
  20094. };
  20095. function diffCss(oldStr, newStr, callback) {
  20096. return cssDiff.diff(oldStr, newStr, callback);
  20097. }
  20098. });
  20099. unwrapExports(css);
  20100. var css_1 = css.cssDiff;
  20101. var css_2 = css.diffCss;
  20102. var json = createCommonjsModule(function (module, exports) {
  20103. exports.__esModule = true;
  20104. exports.jsonDiff = undefined;
  20105. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  20106. exports. /*istanbul ignore end*/diffJson = diffJson;
  20107. /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize;
  20108. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  20109. /*istanbul ignore end*/
  20110. /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  20111. /*istanbul ignore end*/var objectPrototypeToString = Object.prototype.toString;
  20112. var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
  20113. // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
  20114. // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
  20115. jsonDiff.useLongestToken = true;
  20116. jsonDiff.tokenize = /*istanbul ignore start*/line.lineDiff /*istanbul ignore end*/.tokenize;
  20117. jsonDiff.castInput = function (value) {
  20118. /*istanbul ignore start*/var _options = /*istanbul ignore end*/this.options,
  20119. undefinedReplacement = _options.undefinedReplacement,
  20120. _options$stringifyRep = _options.stringifyReplacer,
  20121. stringifyReplacer = _options$stringifyRep === undefined ? function (k, v) /*istanbul ignore start*/{
  20122. return (/*istanbul ignore end*/typeof v === 'undefined' ? undefinedReplacement : v
  20123. );
  20124. } : _options$stringifyRep;
  20125. return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' ');
  20126. };
  20127. jsonDiff.equals = function (left, right) {
  20128. return (/*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'))
  20129. );
  20130. };
  20131. function diffJson(oldObj, newObj, options) {
  20132. return jsonDiff.diff(oldObj, newObj, options);
  20133. }
  20134. // This function handles the presence of circular references by bailing out when encountering an
  20135. // object that is already on the "stack" of items being processed. Accepts an optional replacer
  20136. function canonicalize(obj, stack, replacementStack, replacer, key) {
  20137. stack = stack || [];
  20138. replacementStack = replacementStack || [];
  20139. if (replacer) {
  20140. obj = replacer(key, obj);
  20141. }
  20142. var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
  20143. for (i = 0; i < stack.length; i += 1) {
  20144. if (stack[i] === obj) {
  20145. return replacementStack[i];
  20146. }
  20147. }
  20148. var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
  20149. if ('[object Array]' === objectPrototypeToString.call(obj)) {
  20150. stack.push(obj);
  20151. canonicalizedObj = new Array(obj.length);
  20152. replacementStack.push(canonicalizedObj);
  20153. for (i = 0; i < obj.length; i += 1) {
  20154. canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
  20155. }
  20156. stack.pop();
  20157. replacementStack.pop();
  20158. return canonicalizedObj;
  20159. }
  20160. if (obj && obj.toJSON) {
  20161. obj = obj.toJSON();
  20162. }
  20163. if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) {
  20164. stack.push(obj);
  20165. canonicalizedObj = {};
  20166. replacementStack.push(canonicalizedObj);
  20167. var sortedKeys = [],
  20168. _key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
  20169. for (_key in obj) {
  20170. /* istanbul ignore else */
  20171. if (obj.hasOwnProperty(_key)) {
  20172. sortedKeys.push(_key);
  20173. }
  20174. }
  20175. sortedKeys.sort();
  20176. for (i = 0; i < sortedKeys.length; i += 1) {
  20177. _key = sortedKeys[i];
  20178. canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
  20179. }
  20180. stack.pop();
  20181. replacementStack.pop();
  20182. } else {
  20183. canonicalizedObj = obj;
  20184. }
  20185. return canonicalizedObj;
  20186. }
  20187. });
  20188. unwrapExports(json);
  20189. var json_1 = json.jsonDiff;
  20190. var json_2 = json.diffJson;
  20191. var json_3 = json.canonicalize;
  20192. var array$2 = createCommonjsModule(function (module, exports) {
  20193. exports.__esModule = true;
  20194. exports.arrayDiff = undefined;
  20195. exports. /*istanbul ignore end*/diffArrays = diffArrays;
  20196. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  20197. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  20198. /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
  20199. arrayDiff.tokenize = function (value) {
  20200. return value.slice();
  20201. };
  20202. arrayDiff.join = arrayDiff.removeEmpty = function (value) {
  20203. return value;
  20204. };
  20205. function diffArrays(oldArr, newArr, callback) {
  20206. return arrayDiff.diff(oldArr, newArr, callback);
  20207. }
  20208. });
  20209. unwrapExports(array$2);
  20210. var array_1 = array$2.arrayDiff;
  20211. var array_2 = array$2.diffArrays;
  20212. var parse = createCommonjsModule(function (module, exports) {
  20213. exports.__esModule = true;
  20214. exports. /*istanbul ignore end*/parsePatch = parsePatch;
  20215. function parsePatch(uniDiff) {
  20216. /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  20217. var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
  20218. delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
  20219. list = [],
  20220. i = 0;
  20221. function parseIndex() {
  20222. var index = {};
  20223. list.push(index);
  20224. // Parse diff metadata
  20225. while (i < diffstr.length) {
  20226. var line = diffstr[i];
  20227. // File header found, end parsing diff metadata
  20228. if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
  20229. break;
  20230. }
  20231. // Diff index
  20232. var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
  20233. if (header) {
  20234. index.index = header[1];
  20235. }
  20236. i++;
  20237. }
  20238. // Parse file headers if they are defined. Unified diff requires them, but
  20239. // there's no technical issues to have an isolated hunk without file header
  20240. parseFileHeader(index);
  20241. parseFileHeader(index);
  20242. // Parse hunks
  20243. index.hunks = [];
  20244. while (i < diffstr.length) {
  20245. var _line = diffstr[i];
  20246. if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
  20247. break;
  20248. } else if (/^@@/.test(_line)) {
  20249. index.hunks.push(parseHunk());
  20250. } else if (_line && options.strict) {
  20251. // Ignore unexpected content unless in strict mode
  20252. throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
  20253. } else {
  20254. i++;
  20255. }
  20256. }
  20257. }
  20258. // Parses the --- and +++ headers, if none are found, no lines
  20259. // are consumed.
  20260. function parseFileHeader(index) {
  20261. var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
  20262. if (fileHeader) {
  20263. var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
  20264. var data = fileHeader[2].split('\t', 2);
  20265. var fileName = data[0].replace(/\\\\/g, '\\');
  20266. if (/^".*"$/.test(fileName)) {
  20267. fileName = fileName.substr(1, fileName.length - 2);
  20268. }
  20269. index[keyPrefix + 'FileName'] = fileName;
  20270. index[keyPrefix + 'Header'] = (data[1] || '').trim();
  20271. i++;
  20272. }
  20273. }
  20274. // Parses a hunk
  20275. // This assumes that we are at the start of a hunk.
  20276. function parseHunk() {
  20277. var chunkHeaderIndex = i,
  20278. chunkHeaderLine = diffstr[i++],
  20279. chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
  20280. var hunk = {
  20281. oldStart: +chunkHeader[1],
  20282. oldLines: +chunkHeader[2] || 1,
  20283. newStart: +chunkHeader[3],
  20284. newLines: +chunkHeader[4] || 1,
  20285. lines: [],
  20286. linedelimiters: []
  20287. };
  20288. var addCount = 0,
  20289. removeCount = 0;
  20290. for (; i < diffstr.length; i++) {
  20291. // Lines starting with '---' could be mistaken for the "remove line" operation
  20292. // But they could be the header for the next file. Therefore prune such cases out.
  20293. if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
  20294. break;
  20295. }
  20296. var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
  20297. if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
  20298. hunk.lines.push(diffstr[i]);
  20299. hunk.linedelimiters.push(delimiters[i] || '\n');
  20300. if (operation === '+') {
  20301. addCount++;
  20302. } else if (operation === '-') {
  20303. removeCount++;
  20304. } else if (operation === ' ') {
  20305. addCount++;
  20306. removeCount++;
  20307. }
  20308. } else {
  20309. break;
  20310. }
  20311. }
  20312. // Handle the empty block count case
  20313. if (!addCount && hunk.newLines === 1) {
  20314. hunk.newLines = 0;
  20315. }
  20316. if (!removeCount && hunk.oldLines === 1) {
  20317. hunk.oldLines = 0;
  20318. }
  20319. // Perform optional sanity checking
  20320. if (options.strict) {
  20321. if (addCount !== hunk.newLines) {
  20322. throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
  20323. }
  20324. if (removeCount !== hunk.oldLines) {
  20325. throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
  20326. }
  20327. }
  20328. return hunk;
  20329. }
  20330. while (i < diffstr.length) {
  20331. parseIndex();
  20332. }
  20333. return list;
  20334. }
  20335. });
  20336. unwrapExports(parse);
  20337. var parse_1 = parse.parsePatch;
  20338. var distanceIterator = createCommonjsModule(function (module, exports) {
  20339. exports.__esModule = true;
  20340. exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) {
  20341. var wantForward = true,
  20342. backwardExhausted = false,
  20343. forwardExhausted = false,
  20344. localOffset = 1;
  20345. return function iterator() {
  20346. if (wantForward && !forwardExhausted) {
  20347. if (backwardExhausted) {
  20348. localOffset++;
  20349. } else {
  20350. wantForward = false;
  20351. }
  20352. // Check if trying to fit beyond text length, and if not, check it fits
  20353. // after offset location (or desired location on first iteration)
  20354. if (start + localOffset <= maxLine) {
  20355. return localOffset;
  20356. }
  20357. forwardExhausted = true;
  20358. }
  20359. if (!backwardExhausted) {
  20360. if (!forwardExhausted) {
  20361. wantForward = true;
  20362. }
  20363. // Check if trying to fit before text beginning, and if not, check it fits
  20364. // before offset location
  20365. if (minLine <= start - localOffset) {
  20366. return -localOffset++;
  20367. }
  20368. backwardExhausted = true;
  20369. return iterator();
  20370. }
  20371. // We tried to fit hunk before text beginning and beyond text length, then
  20372. // hunk can't fit on the text. Return undefined
  20373. };
  20374. };
  20375. });
  20376. unwrapExports(distanceIterator);
  20377. var apply = createCommonjsModule(function (module, exports) {
  20378. exports.__esModule = true;
  20379. exports. /*istanbul ignore end*/applyPatch = applyPatch;
  20380. /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches;
  20381. /*istanbul ignore start*/var _distanceIterator2 = _interopRequireDefault(distanceIterator);
  20382. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  20383. /*istanbul ignore end*/function applyPatch(source, uniDiff) {
  20384. /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  20385. if (typeof uniDiff === 'string') {
  20386. uniDiff = /*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(uniDiff);
  20387. }
  20388. if (Array.isArray(uniDiff)) {
  20389. if (uniDiff.length > 1) {
  20390. throw new Error('applyPatch only works with a single input.');
  20391. }
  20392. uniDiff = uniDiff[0];
  20393. }
  20394. // Apply the diff to the input
  20395. var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
  20396. delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
  20397. hunks = uniDiff.hunks,
  20398. compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{
  20399. return (/*istanbul ignore end*/line === patchContent
  20400. );
  20401. },
  20402. errorCount = 0,
  20403. fuzzFactor = options.fuzzFactor || 0,
  20404. minLine = 0,
  20405. offset = 0,
  20406. removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
  20407. addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
  20408. /**
  20409. * Checks if the hunk exactly fits on the provided location
  20410. */
  20411. function hunkFits(hunk, toPos) {
  20412. for (var j = 0; j < hunk.lines.length; j++) {
  20413. var line = hunk.lines[j],
  20414. operation = line.length > 0 ? line[0] : ' ',
  20415. content = line.length > 0 ? line.substr(1) : line;
  20416. if (operation === ' ' || operation === '-') {
  20417. // Context sanity check
  20418. if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
  20419. errorCount++;
  20420. if (errorCount > fuzzFactor) {
  20421. return false;
  20422. }
  20423. }
  20424. toPos++;
  20425. }
  20426. }
  20427. return true;
  20428. }
  20429. // Search best fit offsets for each hunk based on the previous ones
  20430. for (var i = 0; i < hunks.length; i++) {
  20431. var hunk = hunks[i],
  20432. maxLine = lines.length - hunk.oldLines,
  20433. localOffset = 0,
  20434. toPos = offset + hunk.oldStart - 1;
  20435. var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine);
  20436. for (; localOffset !== undefined; localOffset = iterator()) {
  20437. if (hunkFits(hunk, toPos + localOffset)) {
  20438. hunk.offset = offset += localOffset;
  20439. break;
  20440. }
  20441. }
  20442. if (localOffset === undefined) {
  20443. return false;
  20444. }
  20445. // Set lower text limit to end of the current hunk, so next ones don't try
  20446. // to fit over already patched text
  20447. minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
  20448. }
  20449. // Apply patch hunks
  20450. var diffOffset = 0;
  20451. for (var _i = 0; _i < hunks.length; _i++) {
  20452. var _hunk = hunks[_i],
  20453. _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;
  20454. diffOffset += _hunk.newLines - _hunk.oldLines;
  20455. if (_toPos < 0) {
  20456. // Creating a new file
  20457. _toPos = 0;
  20458. }
  20459. for (var j = 0; j < _hunk.lines.length; j++) {
  20460. var line = _hunk.lines[j],
  20461. operation = line.length > 0 ? line[0] : ' ',
  20462. content = line.length > 0 ? line.substr(1) : line,
  20463. delimiter = _hunk.linedelimiters[j];
  20464. if (operation === ' ') {
  20465. _toPos++;
  20466. } else if (operation === '-') {
  20467. lines.splice(_toPos, 1);
  20468. delimiters.splice(_toPos, 1);
  20469. /* istanbul ignore else */
  20470. } else if (operation === '+') {
  20471. lines.splice(_toPos, 0, content);
  20472. delimiters.splice(_toPos, 0, delimiter);
  20473. _toPos++;
  20474. } else if (operation === '\\') {
  20475. var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
  20476. if (previousOperation === '+') {
  20477. removeEOFNL = true;
  20478. } else if (previousOperation === '-') {
  20479. addEOFNL = true;
  20480. }
  20481. }
  20482. }
  20483. }
  20484. // Handle EOFNL insertion/removal
  20485. if (removeEOFNL) {
  20486. while (!lines[lines.length - 1]) {
  20487. lines.pop();
  20488. delimiters.pop();
  20489. }
  20490. } else if (addEOFNL) {
  20491. lines.push('');
  20492. delimiters.push('\n');
  20493. }
  20494. for (var _k = 0; _k < lines.length - 1; _k++) {
  20495. lines[_k] = lines[_k] + delimiters[_k];
  20496. }
  20497. return lines.join('');
  20498. }
  20499. // Wrapper that supports multiple file patches via callbacks.
  20500. function applyPatches(uniDiff, options) {
  20501. if (typeof uniDiff === 'string') {
  20502. uniDiff = /*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(uniDiff);
  20503. }
  20504. var currentIndex = 0;
  20505. function processIndex() {
  20506. var index = uniDiff[currentIndex++];
  20507. if (!index) {
  20508. return options.complete();
  20509. }
  20510. options.loadFile(index, function (err, data) {
  20511. if (err) {
  20512. return options.complete(err);
  20513. }
  20514. var updatedContent = applyPatch(data, index, options);
  20515. options.patched(index, updatedContent, function (err) {
  20516. if (err) {
  20517. return options.complete(err);
  20518. }
  20519. processIndex();
  20520. });
  20521. });
  20522. }
  20523. processIndex();
  20524. }
  20525. });
  20526. unwrapExports(apply);
  20527. var apply_1 = apply.applyPatch;
  20528. var apply_2 = apply.applyPatches;
  20529. var create = createCommonjsModule(function (module, exports) {
  20530. exports.__esModule = true;
  20531. exports. /*istanbul ignore end*/structuredPatch = structuredPatch;
  20532. /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch;
  20533. /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch;
  20534. /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  20535. /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  20536. if (!options) {
  20537. options = {};
  20538. }
  20539. if (typeof options.context === 'undefined') {
  20540. options.context = 4;
  20541. }
  20542. var diff = /*istanbul ignore start*/(0, line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options);
  20543. diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier
  20544. function contextLines(lines) {
  20545. return lines.map(function (entry) {
  20546. return ' ' + entry;
  20547. });
  20548. }
  20549. var hunks = [];
  20550. var oldRangeStart = 0,
  20551. newRangeStart = 0,
  20552. curRange = [],
  20553. oldLine = 1,
  20554. newLine = 1;
  20555. /*istanbul ignore start*/var _loop = function _loop( /*istanbul ignore end*/i) {
  20556. var current = diff[i],
  20557. lines = current.lines || current.value.replace(/\n$/, '').split('\n');
  20558. current.lines = lines;
  20559. if (current.added || current.removed) {
  20560. /*istanbul ignore start*/var _curRange;
  20561. /*istanbul ignore end*/ // If we have previous context, start with that
  20562. if (!oldRangeStart) {
  20563. var prev = diff[i - 1];
  20564. oldRangeStart = oldLine;
  20565. newRangeStart = newLine;
  20566. if (prev) {
  20567. curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
  20568. oldRangeStart -= curRange.length;
  20569. newRangeStart -= curRange.length;
  20570. }
  20571. }
  20572. // Output our changes
  20573. /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) {
  20574. return (current.added ? '+' : '-') + entry;
  20575. })));
  20576. // Track the updated file position
  20577. if (current.added) {
  20578. newLine += lines.length;
  20579. } else {
  20580. oldLine += lines.length;
  20581. }
  20582. } else {
  20583. // Identical context lines. Track line changes
  20584. if (oldRangeStart) {
  20585. // Close out any changes that have been output (or join overlapping)
  20586. if (lines.length <= options.context * 2 && i < diff.length - 2) {
  20587. /*istanbul ignore start*/var _curRange2;
  20588. /*istanbul ignore end*/ // Overlapping
  20589. /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines)));
  20590. } else {
  20591. /*istanbul ignore start*/var _curRange3;
  20592. /*istanbul ignore end*/ // end the range and output
  20593. var contextSize = Math.min(lines.length, options.context);
  20594. /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize))));
  20595. var hunk = {
  20596. oldStart: oldRangeStart,
  20597. oldLines: oldLine - oldRangeStart + contextSize,
  20598. newStart: newRangeStart,
  20599. newLines: newLine - newRangeStart + contextSize,
  20600. lines: curRange
  20601. };
  20602. if (i >= diff.length - 2 && lines.length <= options.context) {
  20603. // EOF is inside this hunk
  20604. var oldEOFNewline = /\n$/.test(oldStr);
  20605. var newEOFNewline = /\n$/.test(newStr);
  20606. if (lines.length == 0 && !oldEOFNewline) {
  20607. // special case: old has no eol and no trailing context; no-nl can end up before adds
  20608. curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file');
  20609. } else if (!oldEOFNewline || !newEOFNewline) {
  20610. curRange.push('\\ No newline at end of file');
  20611. }
  20612. }
  20613. hunks.push(hunk);
  20614. oldRangeStart = 0;
  20615. newRangeStart = 0;
  20616. curRange = [];
  20617. }
  20618. }
  20619. oldLine += lines.length;
  20620. newLine += lines.length;
  20621. }
  20622. };
  20623. for (var i = 0; i < diff.length; i++) {
  20624. /*istanbul ignore start*/_loop( /*istanbul ignore end*/i);
  20625. }
  20626. return {
  20627. oldFileName: oldFileName, newFileName: newFileName,
  20628. oldHeader: oldHeader, newHeader: newHeader,
  20629. hunks: hunks
  20630. };
  20631. }
  20632. function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  20633. var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
  20634. var ret = [];
  20635. if (oldFileName == newFileName) {
  20636. ret.push('Index: ' + oldFileName);
  20637. }
  20638. ret.push('===================================================================');
  20639. ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
  20640. ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
  20641. for (var i = 0; i < diff.hunks.length; i++) {
  20642. var hunk = diff.hunks[i];
  20643. ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
  20644. ret.push.apply(ret, hunk.lines);
  20645. }
  20646. return ret.join('\n') + '\n';
  20647. }
  20648. function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
  20649. return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
  20650. }
  20651. });
  20652. unwrapExports(create);
  20653. var create_1 = create.structuredPatch;
  20654. var create_2 = create.createTwoFilesPatch;
  20655. var create_3 = create.createPatch;
  20656. var array$4 = createCommonjsModule(function (module, exports) {
  20657. exports.__esModule = true;
  20658. exports. /*istanbul ignore end*/arrayEqual = arrayEqual;
  20659. /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayStartsWith = arrayStartsWith;
  20660. function arrayEqual(a, b) {
  20661. if (a.length !== b.length) {
  20662. return false;
  20663. }
  20664. return arrayStartsWith(a, b);
  20665. }
  20666. function arrayStartsWith(array, start) {
  20667. if (start.length > array.length) {
  20668. return false;
  20669. }
  20670. for (var i = 0; i < start.length; i++) {
  20671. if (start[i] !== array[i]) {
  20672. return false;
  20673. }
  20674. }
  20675. return true;
  20676. }
  20677. });
  20678. unwrapExports(array$4);
  20679. var array_1$1 = array$4.arrayEqual;
  20680. var array_2$1 = array$4.arrayStartsWith;
  20681. var merge_1 = createCommonjsModule(function (module, exports) {
  20682. exports.__esModule = true;
  20683. exports. /*istanbul ignore end*/calcLineCount = calcLineCount;
  20684. /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge;
  20685. /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  20686. /*istanbul ignore end*/function calcLineCount(hunk) {
  20687. /*istanbul ignore start*/var _calcOldNewLineCount = /*istanbul ignore end*/calcOldNewLineCount(hunk.lines),
  20688. oldLines = _calcOldNewLineCount.oldLines,
  20689. newLines = _calcOldNewLineCount.newLines;
  20690. if (oldLines !== undefined) {
  20691. hunk.oldLines = oldLines;
  20692. } else {
  20693. delete hunk.oldLines;
  20694. }
  20695. if (newLines !== undefined) {
  20696. hunk.newLines = newLines;
  20697. } else {
  20698. delete hunk.newLines;
  20699. }
  20700. }
  20701. function merge(mine, theirs, base) {
  20702. mine = loadPatch(mine, base);
  20703. theirs = loadPatch(theirs, base);
  20704. var ret = {};
  20705. // For index we just let it pass through as it doesn't have any necessary meaning.
  20706. // Leaving sanity checks on this to the API consumer that may know more about the
  20707. // meaning in their own context.
  20708. if (mine.index || theirs.index) {
  20709. ret.index = mine.index || theirs.index;
  20710. }
  20711. if (mine.newFileName || theirs.newFileName) {
  20712. if (!fileNameChanged(mine)) {
  20713. // No header or no change in ours, use theirs (and ours if theirs does not exist)
  20714. ret.oldFileName = theirs.oldFileName || mine.oldFileName;
  20715. ret.newFileName = theirs.newFileName || mine.newFileName;
  20716. ret.oldHeader = theirs.oldHeader || mine.oldHeader;
  20717. ret.newHeader = theirs.newHeader || mine.newHeader;
  20718. } else if (!fileNameChanged(theirs)) {
  20719. // No header or no change in theirs, use ours
  20720. ret.oldFileName = mine.oldFileName;
  20721. ret.newFileName = mine.newFileName;
  20722. ret.oldHeader = mine.oldHeader;
  20723. ret.newHeader = mine.newHeader;
  20724. } else {
  20725. // Both changed... figure it out
  20726. ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
  20727. ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
  20728. ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
  20729. ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
  20730. }
  20731. }
  20732. ret.hunks = [];
  20733. var mineIndex = 0,
  20734. theirsIndex = 0,
  20735. mineOffset = 0,
  20736. theirsOffset = 0;
  20737. while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
  20738. var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity },
  20739. theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity };
  20740. if (hunkBefore(mineCurrent, theirsCurrent)) {
  20741. // This patch does not overlap with any of the others, yay.
  20742. ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
  20743. mineIndex++;
  20744. theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
  20745. } else if (hunkBefore(theirsCurrent, mineCurrent)) {
  20746. // This patch does not overlap with any of the others, yay.
  20747. ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
  20748. theirsIndex++;
  20749. mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
  20750. } else {
  20751. // Overlap, merge as best we can
  20752. var mergedHunk = {
  20753. oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
  20754. oldLines: 0,
  20755. newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
  20756. newLines: 0,
  20757. lines: []
  20758. };
  20759. mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
  20760. theirsIndex++;
  20761. mineIndex++;
  20762. ret.hunks.push(mergedHunk);
  20763. }
  20764. }
  20765. return ret;
  20766. }
  20767. function loadPatch(param, base) {
  20768. if (typeof param === 'string') {
  20769. if (/^@@/m.test(param) || /^Index:/m.test(param)) {
  20770. return (/*istanbul ignore start*/(0, parse.parsePatch) /*istanbul ignore end*/(param)[0]
  20771. );
  20772. }
  20773. if (!base) {
  20774. throw new Error('Must provide a base reference or pass in a patch');
  20775. }
  20776. return (/*istanbul ignore start*/(0, create.structuredPatch) /*istanbul ignore end*/(undefined, undefined, base, param)
  20777. );
  20778. }
  20779. return param;
  20780. }
  20781. function fileNameChanged(patch) {
  20782. return patch.newFileName && patch.newFileName !== patch.oldFileName;
  20783. }
  20784. function selectField(index, mine, theirs) {
  20785. if (mine === theirs) {
  20786. return mine;
  20787. } else {
  20788. index.conflict = true;
  20789. return { mine: mine, theirs: theirs };
  20790. }
  20791. }
  20792. function hunkBefore(test, check) {
  20793. return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
  20794. }
  20795. function cloneHunk(hunk, offset) {
  20796. return {
  20797. oldStart: hunk.oldStart, oldLines: hunk.oldLines,
  20798. newStart: hunk.newStart + offset, newLines: hunk.newLines,
  20799. lines: hunk.lines
  20800. };
  20801. }
  20802. function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
  20803. // This will generally result in a conflicted hunk, but there are cases where the context
  20804. // is the only overlap where we can successfully merge the content here.
  20805. var mine = { offset: mineOffset, lines: mineLines, index: 0 },
  20806. their = { offset: theirOffset, lines: theirLines, index: 0 };
  20807. // Handle any leading content
  20808. insertLeading(hunk, mine, their);
  20809. insertLeading(hunk, their, mine);
  20810. // Now in the overlap content. Scan through and select the best changes from each.
  20811. while (mine.index < mine.lines.length && their.index < their.lines.length) {
  20812. var mineCurrent = mine.lines[mine.index],
  20813. theirCurrent = their.lines[their.index];
  20814. if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
  20815. // Both modified ...
  20816. mutualChange(hunk, mine, their);
  20817. } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
  20818. /*istanbul ignore start*/var _hunk$lines;
  20819. /*istanbul ignore end*/ // Mine inserted
  20820. /*istanbul ignore start*/(_hunk$lines = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(mine)));
  20821. } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
  20822. /*istanbul ignore start*/var _hunk$lines2;
  20823. /*istanbul ignore end*/ // Theirs inserted
  20824. /*istanbul ignore start*/(_hunk$lines2 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(their)));
  20825. } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
  20826. // Mine removed or edited
  20827. removal(hunk, mine, their);
  20828. } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
  20829. // Their removed or edited
  20830. removal(hunk, their, mine, true);
  20831. } else if (mineCurrent === theirCurrent) {
  20832. // Context identity
  20833. hunk.lines.push(mineCurrent);
  20834. mine.index++;
  20835. their.index++;
  20836. } else {
  20837. // Context mismatch
  20838. conflict(hunk, collectChange(mine), collectChange(their));
  20839. }
  20840. }
  20841. // Now push anything that may be remaining
  20842. insertTrailing(hunk, mine);
  20843. insertTrailing(hunk, their);
  20844. calcLineCount(hunk);
  20845. }
  20846. function mutualChange(hunk, mine, their) {
  20847. var myChanges = collectChange(mine),
  20848. theirChanges = collectChange(their);
  20849. if (allRemoves(myChanges) && allRemoves(theirChanges)) {
  20850. // Special case for remove changes that are supersets of one another
  20851. if ( /*istanbul ignore start*/(0, array$4.arrayStartsWith) /*istanbul ignore end*/(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
  20852. /*istanbul ignore start*/var _hunk$lines3;
  20853. /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines3 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges));
  20854. return;
  20855. } else if ( /*istanbul ignore start*/(0, array$4.arrayStartsWith) /*istanbul ignore end*/(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
  20856. /*istanbul ignore start*/var _hunk$lines4;
  20857. /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines4 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines4 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges));
  20858. return;
  20859. }
  20860. } else if ( /*istanbul ignore start*/(0, array$4.arrayEqual) /*istanbul ignore end*/(myChanges, theirChanges)) {
  20861. /*istanbul ignore start*/var _hunk$lines5;
  20862. /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines5 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines5 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges));
  20863. return;
  20864. }
  20865. conflict(hunk, myChanges, theirChanges);
  20866. }
  20867. function removal(hunk, mine, their, swap) {
  20868. var myChanges = collectChange(mine),
  20869. theirChanges = collectContext(their, myChanges);
  20870. if (theirChanges.merged) {
  20871. /*istanbul ignore start*/var _hunk$lines6;
  20872. /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines6 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines6 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges.merged));
  20873. } else {
  20874. conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
  20875. }
  20876. }
  20877. function conflict(hunk, mine, their) {
  20878. hunk.conflict = true;
  20879. hunk.lines.push({
  20880. conflict: true,
  20881. mine: mine,
  20882. theirs: their
  20883. });
  20884. }
  20885. function insertLeading(hunk, insert, their) {
  20886. while (insert.offset < their.offset && insert.index < insert.lines.length) {
  20887. var line = insert.lines[insert.index++];
  20888. hunk.lines.push(line);
  20889. insert.offset++;
  20890. }
  20891. }
  20892. function insertTrailing(hunk, insert) {
  20893. while (insert.index < insert.lines.length) {
  20894. var line = insert.lines[insert.index++];
  20895. hunk.lines.push(line);
  20896. }
  20897. }
  20898. function collectChange(state) {
  20899. var ret = [],
  20900. operation = state.lines[state.index][0];
  20901. while (state.index < state.lines.length) {
  20902. var line = state.lines[state.index];
  20903. // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
  20904. if (operation === '-' && line[0] === '+') {
  20905. operation = '+';
  20906. }
  20907. if (operation === line[0]) {
  20908. ret.push(line);
  20909. state.index++;
  20910. } else {
  20911. break;
  20912. }
  20913. }
  20914. return ret;
  20915. }
  20916. function collectContext(state, matchChanges) {
  20917. var changes = [],
  20918. merged = [],
  20919. matchIndex = 0,
  20920. contextChanges = false,
  20921. conflicted = false;
  20922. while (matchIndex < matchChanges.length && state.index < state.lines.length) {
  20923. var change = state.lines[state.index],
  20924. match = matchChanges[matchIndex];
  20925. // Once we've hit our add, then we are done
  20926. if (match[0] === '+') {
  20927. break;
  20928. }
  20929. contextChanges = contextChanges || change[0] !== ' ';
  20930. merged.push(match);
  20931. matchIndex++;
  20932. // Consume any additions in the other block as a conflict to attempt
  20933. // to pull in the remaining context after this
  20934. if (change[0] === '+') {
  20935. conflicted = true;
  20936. while (change[0] === '+') {
  20937. changes.push(change);
  20938. change = state.lines[++state.index];
  20939. }
  20940. }
  20941. if (match.substr(1) === change.substr(1)) {
  20942. changes.push(change);
  20943. state.index++;
  20944. } else {
  20945. conflicted = true;
  20946. }
  20947. }
  20948. if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
  20949. conflicted = true;
  20950. }
  20951. if (conflicted) {
  20952. return changes;
  20953. }
  20954. while (matchIndex < matchChanges.length) {
  20955. merged.push(matchChanges[matchIndex++]);
  20956. }
  20957. return {
  20958. merged: merged,
  20959. changes: changes
  20960. };
  20961. }
  20962. function allRemoves(changes) {
  20963. return changes.reduce(function (prev, change) {
  20964. return prev && change[0] === '-';
  20965. }, true);
  20966. }
  20967. function skipRemoveSuperset(state, removeChanges, delta) {
  20968. for (var i = 0; i < delta; i++) {
  20969. var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
  20970. if (state.lines[state.index + i] !== ' ' + changeContent) {
  20971. return false;
  20972. }
  20973. }
  20974. state.index += delta;
  20975. return true;
  20976. }
  20977. function calcOldNewLineCount(lines) {
  20978. var oldLines = 0;
  20979. var newLines = 0;
  20980. lines.forEach(function (line) {
  20981. if (typeof line !== 'string') {
  20982. var myCount = calcOldNewLineCount(line.mine);
  20983. var theirCount = calcOldNewLineCount(line.theirs);
  20984. if (oldLines !== undefined) {
  20985. if (myCount.oldLines === theirCount.oldLines) {
  20986. oldLines += myCount.oldLines;
  20987. } else {
  20988. oldLines = undefined;
  20989. }
  20990. }
  20991. if (newLines !== undefined) {
  20992. if (myCount.newLines === theirCount.newLines) {
  20993. newLines += myCount.newLines;
  20994. } else {
  20995. newLines = undefined;
  20996. }
  20997. }
  20998. } else {
  20999. if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
  21000. newLines++;
  21001. }
  21002. if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
  21003. oldLines++;
  21004. }
  21005. }
  21006. });
  21007. return { oldLines: oldLines, newLines: newLines };
  21008. }
  21009. });
  21010. unwrapExports(merge_1);
  21011. var merge_2 = merge_1.calcLineCount;
  21012. var merge_3 = merge_1.merge;
  21013. var dmp = createCommonjsModule(function (module, exports) {
  21014. exports.__esModule = true;
  21015. exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP;
  21016. // See: http://code.google.com/p/google-diff-match-patch/wiki/API
  21017. function convertChangesToDMP(changes) {
  21018. var ret = [],
  21019. change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
  21020. operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
  21021. for (var i = 0; i < changes.length; i++) {
  21022. change = changes[i];
  21023. if (change.added) {
  21024. operation = 1;
  21025. } else if (change.removed) {
  21026. operation = -1;
  21027. } else {
  21028. operation = 0;
  21029. }
  21030. ret.push([operation, change.value]);
  21031. }
  21032. return ret;
  21033. }
  21034. });
  21035. unwrapExports(dmp);
  21036. var dmp_1 = dmp.convertChangesToDMP;
  21037. var xml = createCommonjsModule(function (module, exports) {
  21038. exports.__esModule = true;
  21039. exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML;
  21040. function convertChangesToXML(changes) {
  21041. var ret = [];
  21042. for (var i = 0; i < changes.length; i++) {
  21043. var change = changes[i];
  21044. if (change.added) {
  21045. ret.push('<ins>');
  21046. } else if (change.removed) {
  21047. ret.push('<del>');
  21048. }
  21049. ret.push(escapeHTML(change.value));
  21050. if (change.added) {
  21051. ret.push('</ins>');
  21052. } else if (change.removed) {
  21053. ret.push('</del>');
  21054. }
  21055. }
  21056. return ret.join('');
  21057. }
  21058. function escapeHTML(s) {
  21059. var n = s;
  21060. n = n.replace(/&/g, '&amp;');
  21061. n = n.replace(/</g, '&lt;');
  21062. n = n.replace(/>/g, '&gt;');
  21063. n = n.replace(/"/g, '&quot;');
  21064. return n;
  21065. }
  21066. });
  21067. unwrapExports(xml);
  21068. var xml_1 = xml.convertChangesToXML;
  21069. var lib$1 = createCommonjsModule(function (module, exports) {
  21070. exports.__esModule = true;
  21071. exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.merge = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined;
  21072. /*istanbul ignore end*/
  21073. /*istanbul ignore start*/var _base2 = _interopRequireDefault(base);
  21074. /*istanbul ignore end*/
  21075. /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  21076. /* See LICENSE file for terms of use */
  21077. /*
  21078. * Text diff implementation.
  21079. *
  21080. * This library supports the following APIS:
  21081. * JsDiff.diffChars: Character by character diff
  21082. * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
  21083. * JsDiff.diffLines: Line based diff
  21084. *
  21085. * JsDiff.diffCss: Diff targeted at CSS content
  21086. *
  21087. * These methods are based on the implementation proposed in
  21088. * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
  21089. * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
  21090. */
  21091. exports. /*istanbul ignore end*/Diff = _base2['default'];
  21092. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = character.diffChars;
  21093. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = word.diffWords;
  21094. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = word.diffWordsWithSpace;
  21095. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = line.diffLines;
  21096. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = line.diffTrimmedLines;
  21097. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = sentence.diffSentences;
  21098. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = css.diffCss;
  21099. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = json.diffJson;
  21100. /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = array$2.diffArrays;
  21101. /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = create.structuredPatch;
  21102. /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = create.createTwoFilesPatch;
  21103. /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = create.createPatch;
  21104. /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = apply.applyPatch;
  21105. /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = apply.applyPatches;
  21106. /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = parse.parsePatch;
  21107. /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge_1.merge;
  21108. /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = dmp.convertChangesToDMP;
  21109. /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = xml.convertChangesToXML;
  21110. /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = json.canonicalize;
  21111. });
  21112. unwrapExports(lib$1);
  21113. var lib_1$1 = lib$1.canonicalize;
  21114. var lib_2$1 = lib$1.convertChangesToXML;
  21115. var lib_3$1 = lib$1.convertChangesToDMP;
  21116. var lib_4$1 = lib$1.merge;
  21117. var lib_5$1 = lib$1.parsePatch;
  21118. var lib_6$1 = lib$1.applyPatches;
  21119. var lib_7$1 = lib$1.applyPatch;
  21120. var lib_8$1 = lib$1.createPatch;
  21121. var lib_9 = lib$1.createTwoFilesPatch;
  21122. var lib_10 = lib$1.structuredPatch;
  21123. var lib_11 = lib$1.diffArrays;
  21124. var lib_12 = lib$1.diffJson;
  21125. var lib_13 = lib$1.diffCss;
  21126. var lib_14 = lib$1.diffSentences;
  21127. var lib_15 = lib$1.diffTrimmedLines;
  21128. var lib_16 = lib$1.diffLines;
  21129. var lib_17 = lib$1.diffWordsWithSpace;
  21130. var lib_18 = lib$1.diffWords;
  21131. var lib_19 = lib$1.diffChars;
  21132. var lib_20 = lib$1.Diff;
  21133. var arrayProto$6 = lib.prototypes.array;
  21134. var match$3 = samsam.createMatcher;
  21135. var join$5 = arrayProto$6.join;
  21136. var map$2 = arrayProto$6.map;
  21137. var push$2 = arrayProto$6.push;
  21138. function colorSinonMatchText(matcher, calledArg, calledArgMessage) {
  21139. var calledArgumentMessage = calledArgMessage;
  21140. if (!matcher.test(calledArg)) {
  21141. matcher.message = color.red(matcher.message);
  21142. if (calledArgumentMessage) {
  21143. calledArgumentMessage = color.green(calledArgumentMessage);
  21144. }
  21145. }
  21146. return calledArgumentMessage + " " + matcher.message;
  21147. }
  21148. function colorDiffText(diff) {
  21149. var objects = map$2(diff, function(part) {
  21150. var text = part.value;
  21151. if (part.added) {
  21152. text = color.green(text);
  21153. } else if (part.removed) {
  21154. text = color.red(text);
  21155. }
  21156. if (diff.length === 2) {
  21157. text += " "; // format simple diffs
  21158. }
  21159. return text;
  21160. });
  21161. return join$5(objects, "");
  21162. }
  21163. var spyFormatters = {
  21164. c: function(spyInstance) {
  21165. return timesInWords(spyInstance.callCount);
  21166. },
  21167. n: function(spyInstance) {
  21168. // eslint-disable-next-line local-rules/no-prototype-methods
  21169. return spyInstance.toString();
  21170. },
  21171. D: function(spyInstance, args) {
  21172. var message = "";
  21173. for (var i = 0, l = spyInstance.callCount; i < l; ++i) {
  21174. // describe multiple calls
  21175. if (l > 1) {
  21176. message += "\nCall " + (i + 1) + ":";
  21177. }
  21178. var calledArgs = spyInstance.getCall(i).args;
  21179. for (var j = 0; j < calledArgs.length || j < args.length; ++j) {
  21180. message += "\n";
  21181. var calledArgMessage = j < calledArgs.length ? format_1(calledArgs[j]) : "";
  21182. if (match$3.isMatcher(args[j])) {
  21183. message += colorSinonMatchText(args[j], calledArgs[j], calledArgMessage);
  21184. } else {
  21185. var expectedArgMessage = j < args.length ? format_1(args[j]) : "";
  21186. var diff = lib$1.diffJson(calledArgMessage, expectedArgMessage);
  21187. message += colorDiffText(diff);
  21188. }
  21189. }
  21190. }
  21191. return message;
  21192. },
  21193. C: function(spyInstance) {
  21194. var calls = [];
  21195. for (var i = 0, l = spyInstance.callCount; i < l; ++i) {
  21196. // eslint-disable-next-line local-rules/no-prototype-methods
  21197. var stringifiedCall = " " + spyInstance.getCall(i).toString();
  21198. if (/\n/.test(calls[i - 1])) {
  21199. stringifiedCall = "\n" + stringifiedCall;
  21200. }
  21201. push$2(calls, stringifiedCall);
  21202. }
  21203. return calls.length > 0 ? "\n" + join$5(calls, "\n") : "";
  21204. },
  21205. t: function(spyInstance) {
  21206. var objects = [];
  21207. for (var i = 0, l = spyInstance.callCount; i < l; ++i) {
  21208. push$2(objects, format_1(spyInstance.thisValues[i]));
  21209. }
  21210. return join$5(objects, ", ");
  21211. },
  21212. "*": function(spyInstance, args) {
  21213. return join$5(
  21214. map$2(args, function(arg) {
  21215. return format_1(arg);
  21216. }),
  21217. ", "
  21218. );
  21219. }
  21220. };
  21221. var arrayProto$7 = lib.prototypes.array;
  21222. var createBehavior$1 = behavior.create;
  21223. var functionName$5 = lib.functionName;
  21224. var deepEqual$4 = samsam.deepEqual;
  21225. var valueToString$9 = lib.valueToString;
  21226. /* cache references to library methods so that they also can be stubbed without problems */
  21227. var concat$3 = arrayProto$7.concat;
  21228. var forEach$2 = arrayProto$7.forEach;
  21229. var pop = arrayProto$7.pop;
  21230. var push$3 = arrayProto$7.push;
  21231. var slice$5 = arrayProto$7.slice;
  21232. var filter$1 = Array.prototype.filter;
  21233. var ErrorConstructor = Error.prototype.constructor;
  21234. var bind = Function.prototype.bind;
  21235. var callId = 0;
  21236. function spy(object, property, types) {
  21237. var descriptor, methodDesc;
  21238. if (isEsModule(object)) {
  21239. throw new TypeError("ES Modules cannot be spied");
  21240. }
  21241. if (!property && typeof object === "function") {
  21242. return spy.create(object);
  21243. }
  21244. if (!object && !property) {
  21245. return spy.create(function() {
  21246. return;
  21247. });
  21248. }
  21249. if (!types) {
  21250. return wrapMethod(object, property, spy.create(object[property]));
  21251. }
  21252. descriptor = {};
  21253. methodDesc = getPropertyDescriptor(object, property);
  21254. forEach$2(types, function(type) {
  21255. descriptor[type] = spy.create(methodDesc[type]);
  21256. });
  21257. return wrapMethod(object, property, descriptor);
  21258. }
  21259. function incrementCallCount() {
  21260. this.called = true;
  21261. this.callCount += 1;
  21262. this.notCalled = false;
  21263. this.calledOnce = this.callCount === 1;
  21264. this.calledTwice = this.callCount === 2;
  21265. this.calledThrice = this.callCount === 3;
  21266. }
  21267. function createCallProperties() {
  21268. this.firstCall = this.getCall(0);
  21269. this.secondCall = this.getCall(1);
  21270. this.thirdCall = this.getCall(2);
  21271. this.lastCall = this.getCall(this.callCount - 1);
  21272. }
  21273. function createProxy(func, proxyLength) {
  21274. // Retain the function length:
  21275. var p;
  21276. if (proxyLength) {
  21277. // Do not change this to use an eval. Projects that depend on sinon block the use of eval.
  21278. // ref: https://github.com/sinonjs/sinon/issues/710
  21279. switch (proxyLength) {
  21280. /*eslint-disable no-unused-vars, max-len*/
  21281. case 1:
  21282. p = function proxy(a) {
  21283. return p.invoke(func, this, slice$5(arguments));
  21284. };
  21285. break;
  21286. case 2:
  21287. p = function proxy(a, b) {
  21288. return p.invoke(func, this, slice$5(arguments));
  21289. };
  21290. break;
  21291. case 3:
  21292. p = function proxy(a, b, c) {
  21293. return p.invoke(func, this, slice$5(arguments));
  21294. };
  21295. break;
  21296. case 4:
  21297. p = function proxy(a, b, c, d) {
  21298. return p.invoke(func, this, slice$5(arguments));
  21299. };
  21300. break;
  21301. case 5:
  21302. p = function proxy(a, b, c, d, e) {
  21303. return p.invoke(func, this, slice$5(arguments));
  21304. };
  21305. break;
  21306. case 6:
  21307. p = function proxy(a, b, c, d, e, f) {
  21308. return p.invoke(func, this, slice$5(arguments));
  21309. };
  21310. break;
  21311. case 7:
  21312. p = function proxy(a, b, c, d, e, f, g) {
  21313. return p.invoke(func, this, slice$5(arguments));
  21314. };
  21315. break;
  21316. case 8:
  21317. p = function proxy(a, b, c, d, e, f, g, h) {
  21318. return p.invoke(func, this, slice$5(arguments));
  21319. };
  21320. break;
  21321. case 9:
  21322. p = function proxy(a, b, c, d, e, f, g, h, i) {
  21323. return p.invoke(func, this, slice$5(arguments));
  21324. };
  21325. break;
  21326. case 10:
  21327. p = function proxy(a, b, c, d, e, f, g, h, i, j) {
  21328. return p.invoke(func, this, slice$5(arguments));
  21329. };
  21330. break;
  21331. case 11:
  21332. p = function proxy(a, b, c, d, e, f, g, h, i, j, k) {
  21333. return p.invoke(func, this, slice$5(arguments));
  21334. };
  21335. break;
  21336. case 12:
  21337. p = function proxy(a, b, c, d, e, f, g, h, i, j, k, l) {
  21338. return p.invoke(func, this, slice$5(arguments));
  21339. };
  21340. break;
  21341. default:
  21342. p = function proxy() {
  21343. return p.invoke(func, this, slice$5(arguments));
  21344. };
  21345. break;
  21346. /*eslint-enable*/
  21347. }
  21348. } else {
  21349. p = function proxy() {
  21350. return p.invoke(func, this, slice$5(arguments));
  21351. };
  21352. }
  21353. extend.nonEnum(p, { isSinonProxy: true });
  21354. return p;
  21355. }
  21356. var uuid = 0;
  21357. // Public API
  21358. var spyApi = {
  21359. formatters: spyFormatters,
  21360. resetHistory: function() {
  21361. if (this.invoking) {
  21362. var err = new Error(
  21363. "Cannot reset Sinon function while invoking it. " +
  21364. "Move the call to .resetHistory outside of the callback."
  21365. );
  21366. err.name = "InvalidResetException";
  21367. throw err;
  21368. }
  21369. extend.nonEnum(this, {
  21370. called: false,
  21371. notCalled: true,
  21372. calledOnce: false,
  21373. calledTwice: false,
  21374. calledThrice: false,
  21375. callCount: 0,
  21376. firstCall: null,
  21377. secondCall: null,
  21378. thirdCall: null,
  21379. lastCall: null,
  21380. args: [],
  21381. returnValues: [],
  21382. thisValues: [],
  21383. exceptions: [],
  21384. callIds: [],
  21385. errorsWithCallStack: []
  21386. });
  21387. if (this.fakes) {
  21388. forEach$2(this.fakes, function(fake) {
  21389. if (fake.resetHistory) {
  21390. fake.resetHistory();
  21391. } else {
  21392. fake.reset();
  21393. }
  21394. });
  21395. }
  21396. return this;
  21397. },
  21398. create: function create(func, spyLength) {
  21399. var name;
  21400. var funk = func;
  21401. if (typeof funk !== "function") {
  21402. funk = function() {
  21403. return;
  21404. };
  21405. } else {
  21406. name = functionName$5(funk);
  21407. }
  21408. var length = spyLength || funk.length;
  21409. var proxy = createProxy(funk, length);
  21410. extend.nonEnum(proxy, spy);
  21411. delete proxy.create;
  21412. extend.nonEnum(proxy, funk);
  21413. proxy.resetHistory();
  21414. proxy.prototype = funk.prototype;
  21415. extend.nonEnum(proxy, {
  21416. displayName: name || "spy",
  21417. toString: functionToString,
  21418. instantiateFake: spy.create,
  21419. id: "spy#" + uuid++
  21420. });
  21421. return proxy;
  21422. },
  21423. invoke: function invoke(func, thisValue, args) {
  21424. var matchings = this.matchingFakes(args);
  21425. var currentCallId = callId++;
  21426. var exception, returnValue;
  21427. incrementCallCount.call(this);
  21428. push$3(this.thisValues, thisValue);
  21429. push$3(this.args, args);
  21430. push$3(this.callIds, currentCallId);
  21431. forEach$2(matchings, function(matching) {
  21432. incrementCallCount.call(matching);
  21433. push$3(matching.thisValues, thisValue);
  21434. push$3(matching.args, args);
  21435. push$3(matching.callIds, currentCallId);
  21436. });
  21437. // Make call properties available from within the spied function:
  21438. createCallProperties.call(this);
  21439. forEach$2(matchings, function(matching) {
  21440. createCallProperties.call(matching);
  21441. });
  21442. try {
  21443. this.invoking = true;
  21444. var thisCall = this.getCall(this.callCount - 1);
  21445. if (thisCall.calledWithNew()) {
  21446. // Call through with `new`
  21447. returnValue = new (bind.apply(this.func || func, concat$3([thisValue], args)))();
  21448. if (typeof returnValue !== "object") {
  21449. returnValue = thisValue;
  21450. }
  21451. } else {
  21452. returnValue = (this.func || func).apply(thisValue, args);
  21453. }
  21454. } catch (e) {
  21455. exception = e;
  21456. } finally {
  21457. delete this.invoking;
  21458. }
  21459. push$3(this.exceptions, exception);
  21460. push$3(this.returnValues, returnValue);
  21461. forEach$2(matchings, function(matching) {
  21462. push$3(matching.exceptions, exception);
  21463. push$3(matching.returnValues, returnValue);
  21464. });
  21465. var err = new ErrorConstructor();
  21466. // 1. Please do not get stack at this point. It may be so very slow, and not actually used
  21467. // 2. PhantomJS does not serialize the stack trace until the error has been thrown:
  21468. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack
  21469. try {
  21470. throw err;
  21471. } catch (e) {
  21472. /* empty */
  21473. }
  21474. push$3(this.errorsWithCallStack, err);
  21475. forEach$2(matchings, function(matching) {
  21476. push$3(matching.errorsWithCallStack, err);
  21477. });
  21478. // Make return value and exception available in the calls:
  21479. createCallProperties.call(this);
  21480. forEach$2(matchings, function(matching) {
  21481. createCallProperties.call(matching);
  21482. });
  21483. if (exception !== undefined) {
  21484. throw exception;
  21485. }
  21486. return returnValue;
  21487. },
  21488. named: function named(name) {
  21489. this.displayName = name;
  21490. return this;
  21491. },
  21492. getCall: function getCall(i) {
  21493. if (i < 0 || i >= this.callCount) {
  21494. return null;
  21495. }
  21496. return call$1(
  21497. this,
  21498. this.thisValues[i],
  21499. this.args[i],
  21500. this.returnValues[i],
  21501. this.exceptions[i],
  21502. this.callIds[i],
  21503. this.errorsWithCallStack[i]
  21504. );
  21505. },
  21506. getCalls: function() {
  21507. var calls = [];
  21508. var i;
  21509. for (i = 0; i < this.callCount; i++) {
  21510. push$3(calls, this.getCall(i));
  21511. }
  21512. return calls;
  21513. },
  21514. calledBefore: function calledBefore(spyFn) {
  21515. if (!this.called) {
  21516. return false;
  21517. }
  21518. if (!spyFn.called) {
  21519. return true;
  21520. }
  21521. return this.callIds[0] < spyFn.callIds[spyFn.callIds.length - 1];
  21522. },
  21523. calledAfter: function calledAfter(spyFn) {
  21524. if (!this.called || !spyFn.called) {
  21525. return false;
  21526. }
  21527. return this.callIds[this.callCount - 1] > spyFn.callIds[0];
  21528. },
  21529. calledImmediatelyBefore: function calledImmediatelyBefore(spyFn) {
  21530. if (!this.called || !spyFn.called) {
  21531. return false;
  21532. }
  21533. return this.callIds[this.callCount - 1] === spyFn.callIds[spyFn.callCount - 1] - 1;
  21534. },
  21535. calledImmediatelyAfter: function calledImmediatelyAfter(spyFn) {
  21536. if (!this.called || !spyFn.called) {
  21537. return false;
  21538. }
  21539. return this.callIds[this.callCount - 1] === spyFn.callIds[spyFn.callCount - 1] + 1;
  21540. },
  21541. withArgs: function() {
  21542. var args = slice$5(arguments);
  21543. if (this.fakes) {
  21544. var matching = pop(this.matchingFakes(args, true));
  21545. if (matching) {
  21546. return matching;
  21547. }
  21548. } else {
  21549. this.fakes = [];
  21550. }
  21551. var original = this;
  21552. var fake = this.instantiateFake();
  21553. fake.matchingArguments = args;
  21554. fake.parent = this;
  21555. push$3(this.fakes, fake);
  21556. if (original.defaultBehavior && original.defaultBehavior.promiseLibrary) {
  21557. fake.defaultBehavior = fake.defaultBehavior || createBehavior$1(fake);
  21558. fake.defaultBehavior.promiseLibrary = original.defaultBehavior.promiseLibrary;
  21559. }
  21560. fake.withArgs = function() {
  21561. return original.withArgs.apply(original, arguments);
  21562. };
  21563. forEach$2(original.args, function(arg, i) {
  21564. if (!fake.matches(arg)) {
  21565. return;
  21566. }
  21567. incrementCallCount.call(fake);
  21568. push$3(fake.thisValues, original.thisValues[i]);
  21569. push$3(fake.args, arg);
  21570. push$3(fake.returnValues, original.returnValues[i]);
  21571. push$3(fake.exceptions, original.exceptions[i]);
  21572. push$3(fake.callIds, original.callIds[i]);
  21573. });
  21574. createCallProperties.call(fake);
  21575. return fake;
  21576. },
  21577. matchingFakes: function(args, strict) {
  21578. return filter$1.call(this.fakes || [], function(fake) {
  21579. return fake.matches(args, strict);
  21580. });
  21581. },
  21582. matches: function(args, strict) {
  21583. var margs = this.matchingArguments;
  21584. if (margs.length <= args.length && deepEqual$4(slice$5(args, 0, margs.length), margs)) {
  21585. return !strict || margs.length === args.length;
  21586. }
  21587. return undefined;
  21588. },
  21589. printf: function(format) {
  21590. var spyInstance = this;
  21591. var args = slice$5(arguments, 1);
  21592. var formatter;
  21593. return (format || "").replace(/%(.)/g, function(match, specifyer) {
  21594. formatter = spyApi.formatters[specifyer];
  21595. if (typeof formatter === "function") {
  21596. return String(formatter(spyInstance, args));
  21597. } else if (!isNaN(parseInt(specifyer, 10))) {
  21598. return format_1(args[specifyer - 1]);
  21599. }
  21600. return "%" + specifyer;
  21601. });
  21602. }
  21603. };
  21604. function delegateToCalls(method, matchAny, actual, returnsValues, notCalled, totalCallCount) {
  21605. spyApi[method] = function() {
  21606. if (!this.called) {
  21607. if (notCalled) {
  21608. return notCalled.apply(this, arguments);
  21609. }
  21610. return false;
  21611. }
  21612. if (totalCallCount !== undefined && this.callCount !== totalCallCount) {
  21613. return false;
  21614. }
  21615. var currentCall;
  21616. var matches = 0;
  21617. var returnValues = [];
  21618. for (var i = 0, l = this.callCount; i < l; i += 1) {
  21619. currentCall = this.getCall(i);
  21620. var returnValue = currentCall[actual || method].apply(currentCall, arguments);
  21621. push$3(returnValues, returnValue);
  21622. if (returnValue) {
  21623. matches += 1;
  21624. if (matchAny) {
  21625. return true;
  21626. }
  21627. }
  21628. }
  21629. if (returnsValues) {
  21630. return returnValues;
  21631. }
  21632. return matches === this.callCount;
  21633. };
  21634. }
  21635. delegateToCalls("calledOn", true);
  21636. delegateToCalls("alwaysCalledOn", false, "calledOn");
  21637. delegateToCalls("calledWith", true);
  21638. delegateToCalls("calledOnceWith", true, "calledWith", false, undefined, 1);
  21639. delegateToCalls("calledWithMatch", true);
  21640. delegateToCalls("alwaysCalledWith", false, "calledWith");
  21641. delegateToCalls("alwaysCalledWithMatch", false, "calledWithMatch");
  21642. delegateToCalls("calledWithExactly", true);
  21643. delegateToCalls("calledOnceWithExactly", true, "calledWithExactly", false, undefined, 1);
  21644. delegateToCalls("alwaysCalledWithExactly", false, "calledWithExactly");
  21645. delegateToCalls("neverCalledWith", false, "notCalledWith", false, function() {
  21646. return true;
  21647. });
  21648. delegateToCalls("neverCalledWithMatch", false, "notCalledWithMatch", false, function() {
  21649. return true;
  21650. });
  21651. delegateToCalls("threw", true);
  21652. delegateToCalls("alwaysThrew", false, "threw");
  21653. delegateToCalls("returned", true);
  21654. delegateToCalls("alwaysReturned", false, "returned");
  21655. delegateToCalls("calledWithNew", true);
  21656. delegateToCalls("alwaysCalledWithNew", false, "calledWithNew");
  21657. /* eslint-disable local-rules/no-prototype-methods */
  21658. delegateToCalls("callArg", false, "callArgWith", true, function() {
  21659. throw new Error(this.toString() + " cannot call arg since it was not yet invoked.");
  21660. });
  21661. spyApi.callArgWith = spyApi.callArg;
  21662. delegateToCalls("callArgOn", false, "callArgOnWith", true, function() {
  21663. throw new Error(this.toString() + " cannot call arg since it was not yet invoked.");
  21664. });
  21665. spyApi.callArgOnWith = spyApi.callArgOn;
  21666. delegateToCalls("throwArg", false, "throwArg", false, function() {
  21667. throw new Error(this.toString() + " cannot throw arg since it was not yet invoked.");
  21668. });
  21669. delegateToCalls("yield", false, "yield", true, function() {
  21670. throw new Error(this.toString() + " cannot yield since it was not yet invoked.");
  21671. });
  21672. // "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode.
  21673. spyApi.invokeCallback = spyApi.yield;
  21674. delegateToCalls("yieldOn", false, "yieldOn", true, function() {
  21675. throw new Error(this.toString() + " cannot yield since it was not yet invoked.");
  21676. });
  21677. delegateToCalls("yieldTo", false, "yieldTo", true, function(property) {
  21678. throw new Error(
  21679. this.toString() + " cannot yield to '" + valueToString$9(property) + "' since it was not yet invoked."
  21680. );
  21681. });
  21682. delegateToCalls("yieldToOn", false, "yieldToOn", true, function(property) {
  21683. throw new Error(
  21684. this.toString() + " cannot yield to '" + valueToString$9(property) + "' since it was not yet invoked."
  21685. );
  21686. });
  21687. /* eslint-enable local-rules/no-prototype-methods */
  21688. extend(spy, spyApi);
  21689. spy.spyCall = call$1;
  21690. var spy_1 = spy;
  21691. var arrayProto$8 = lib.prototypes.array;
  21692. var slice$6 = arrayProto$8.slice;
  21693. var useLeftMostCallback$1 = -1;
  21694. var useRightMostCallback$1 = -2;
  21695. function throwsException(fake, error, message) {
  21696. if (typeof error === "function") {
  21697. fake.exceptionCreator = error;
  21698. } else if (typeof error === "string") {
  21699. fake.exceptionCreator = function() {
  21700. var newException = new Error(message || "");
  21701. newException.name = error;
  21702. return newException;
  21703. };
  21704. } else if (!error) {
  21705. fake.exceptionCreator = function() {
  21706. return new Error("Error");
  21707. };
  21708. } else {
  21709. fake.exception = error;
  21710. }
  21711. }
  21712. var defaultBehaviors = {
  21713. callsFake: function callsFake(fake, fn) {
  21714. fake.fakeFn = fn;
  21715. },
  21716. callsArg: function callsArg(fake, index) {
  21717. if (typeof index !== "number") {
  21718. throw new TypeError("argument index is not number");
  21719. }
  21720. fake.callArgAt = index;
  21721. fake.callbackArguments = [];
  21722. fake.callbackContext = undefined;
  21723. fake.callArgProp = undefined;
  21724. fake.callbackAsync = false;
  21725. },
  21726. callsArgOn: function callsArgOn(fake, index, context) {
  21727. if (typeof index !== "number") {
  21728. throw new TypeError("argument index is not number");
  21729. }
  21730. fake.callArgAt = index;
  21731. fake.callbackArguments = [];
  21732. fake.callbackContext = context;
  21733. fake.callArgProp = undefined;
  21734. fake.callbackAsync = false;
  21735. },
  21736. callsArgWith: function callsArgWith(fake, index) {
  21737. if (typeof index !== "number") {
  21738. throw new TypeError("argument index is not number");
  21739. }
  21740. fake.callArgAt = index;
  21741. fake.callbackArguments = slice$6(arguments, 2);
  21742. fake.callbackContext = undefined;
  21743. fake.callArgProp = undefined;
  21744. fake.callbackAsync = false;
  21745. },
  21746. callsArgOnWith: function callsArgWith(fake, index, context) {
  21747. if (typeof index !== "number") {
  21748. throw new TypeError("argument index is not number");
  21749. }
  21750. fake.callArgAt = index;
  21751. fake.callbackArguments = slice$6(arguments, 3);
  21752. fake.callbackContext = context;
  21753. fake.callArgProp = undefined;
  21754. fake.callbackAsync = false;
  21755. },
  21756. usingPromise: function usingPromise(fake, promiseLibrary) {
  21757. fake.promiseLibrary = promiseLibrary;
  21758. },
  21759. yields: function(fake) {
  21760. fake.callArgAt = useLeftMostCallback$1;
  21761. fake.callbackArguments = slice$6(arguments, 1);
  21762. fake.callbackContext = undefined;
  21763. fake.callArgProp = undefined;
  21764. fake.callbackAsync = false;
  21765. },
  21766. yieldsRight: function(fake) {
  21767. fake.callArgAt = useRightMostCallback$1;
  21768. fake.callbackArguments = slice$6(arguments, 1);
  21769. fake.callbackContext = undefined;
  21770. fake.callArgProp = undefined;
  21771. fake.callbackAsync = false;
  21772. },
  21773. yieldsOn: function(fake, context) {
  21774. fake.callArgAt = useLeftMostCallback$1;
  21775. fake.callbackArguments = slice$6(arguments, 2);
  21776. fake.callbackContext = context;
  21777. fake.callArgProp = undefined;
  21778. fake.callbackAsync = false;
  21779. },
  21780. yieldsTo: function(fake, prop) {
  21781. fake.callArgAt = useLeftMostCallback$1;
  21782. fake.callbackArguments = slice$6(arguments, 2);
  21783. fake.callbackContext = undefined;
  21784. fake.callArgProp = prop;
  21785. fake.callbackAsync = false;
  21786. },
  21787. yieldsToOn: function(fake, prop, context) {
  21788. fake.callArgAt = useLeftMostCallback$1;
  21789. fake.callbackArguments = slice$6(arguments, 3);
  21790. fake.callbackContext = context;
  21791. fake.callArgProp = prop;
  21792. fake.callbackAsync = false;
  21793. },
  21794. throws: throwsException,
  21795. throwsException: throwsException,
  21796. returns: function returns(fake, value) {
  21797. fake.returnValue = value;
  21798. fake.resolve = false;
  21799. fake.reject = false;
  21800. fake.returnValueDefined = true;
  21801. fake.exception = undefined;
  21802. fake.exceptionCreator = undefined;
  21803. fake.fakeFn = undefined;
  21804. },
  21805. returnsArg: function returnsArg(fake, index) {
  21806. if (typeof index !== "number") {
  21807. throw new TypeError("argument index is not number");
  21808. }
  21809. fake.returnArgAt = index;
  21810. },
  21811. throwsArg: function throwsArg(fake, index) {
  21812. if (typeof index !== "number") {
  21813. throw new TypeError("argument index is not number");
  21814. }
  21815. fake.throwArgAt = index;
  21816. },
  21817. returnsThis: function returnsThis(fake) {
  21818. fake.returnThis = true;
  21819. },
  21820. resolves: function resolves(fake, value) {
  21821. fake.returnValue = value;
  21822. fake.resolve = true;
  21823. fake.resolveThis = false;
  21824. fake.reject = false;
  21825. fake.returnValueDefined = true;
  21826. fake.exception = undefined;
  21827. fake.exceptionCreator = undefined;
  21828. fake.fakeFn = undefined;
  21829. },
  21830. resolvesArg: function resolvesArg(fake, index) {
  21831. if (typeof index !== "number") {
  21832. throw new TypeError("argument index is not number");
  21833. }
  21834. fake.resolveArgAt = index;
  21835. fake.returnValue = undefined;
  21836. fake.resolve = true;
  21837. fake.resolveThis = false;
  21838. fake.reject = false;
  21839. fake.returnValueDefined = false;
  21840. fake.exception = undefined;
  21841. fake.exceptionCreator = undefined;
  21842. fake.fakeFn = undefined;
  21843. },
  21844. rejects: function rejects(fake, error, message) {
  21845. var reason;
  21846. if (typeof error === "string") {
  21847. reason = new Error(message || "");
  21848. reason.name = error;
  21849. } else if (!error) {
  21850. reason = new Error("Error");
  21851. } else {
  21852. reason = error;
  21853. }
  21854. fake.returnValue = reason;
  21855. fake.resolve = false;
  21856. fake.resolveThis = false;
  21857. fake.reject = true;
  21858. fake.returnValueDefined = true;
  21859. fake.exception = undefined;
  21860. fake.exceptionCreator = undefined;
  21861. fake.fakeFn = undefined;
  21862. return fake;
  21863. },
  21864. resolvesThis: function resolvesThis(fake) {
  21865. fake.returnValue = undefined;
  21866. fake.resolve = false;
  21867. fake.resolveThis = true;
  21868. fake.reject = false;
  21869. fake.returnValueDefined = false;
  21870. fake.exception = undefined;
  21871. fake.exceptionCreator = undefined;
  21872. fake.fakeFn = undefined;
  21873. },
  21874. callThrough: function callThrough(fake) {
  21875. fake.callsThrough = true;
  21876. },
  21877. get: function get(fake, getterFunction) {
  21878. var rootStub = fake.stub || fake;
  21879. Object.defineProperty(rootStub.rootObj, rootStub.propName, {
  21880. get: getterFunction,
  21881. configurable: isPropertyConfigurable_1(rootStub.rootObj, rootStub.propName)
  21882. });
  21883. return fake;
  21884. },
  21885. set: function set(fake, setterFunction) {
  21886. var rootStub = fake.stub || fake;
  21887. Object.defineProperty(
  21888. rootStub.rootObj,
  21889. rootStub.propName,
  21890. // eslint-disable-next-line accessor-pairs
  21891. {
  21892. set: setterFunction,
  21893. configurable: isPropertyConfigurable_1(rootStub.rootObj, rootStub.propName)
  21894. }
  21895. );
  21896. return fake;
  21897. },
  21898. value: function value(fake, newVal) {
  21899. var rootStub = fake.stub || fake;
  21900. Object.defineProperty(rootStub.rootObj, rootStub.propName, {
  21901. value: newVal,
  21902. enumerable: true,
  21903. configurable: isPropertyConfigurable_1(rootStub.rootObj, rootStub.propName)
  21904. });
  21905. return fake;
  21906. }
  21907. };
  21908. var asyncBehaviors$1 = exportAsyncBehaviors(defaultBehaviors);
  21909. var defaultBehaviors_1 = extend({}, defaultBehaviors, asyncBehaviors$1);
  21910. function stubEntireObject(stub, object) {
  21911. walk(object || {}, function(prop, propOwner) {
  21912. // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object
  21913. // is not Object.prototype
  21914. if (
  21915. propOwner !== Object.prototype &&
  21916. prop !== "constructor" &&
  21917. typeof getPropertyDescriptor(propOwner, prop).value === "function"
  21918. ) {
  21919. stub(object, prop);
  21920. }
  21921. });
  21922. return object;
  21923. }
  21924. var stubEntireObject_1 = stubEntireObject;
  21925. var valueToString$a = lib.valueToString;
  21926. function throwOnFalsyObject(object, property) {
  21927. if (property && !object) {
  21928. var type = object === null ? "null" : "undefined";
  21929. throw new Error("Trying to stub property '" + valueToString$a(property) + "' of " + type);
  21930. }
  21931. }
  21932. var throwOnFalsyObject_1 = throwOnFalsyObject;
  21933. var arrayProto$9 = lib.prototypes.array;
  21934. var hasOwnProperty$5 = lib.prototypes.object.hasOwnProperty;
  21935. var valueToString$b = lib.valueToString;
  21936. var forEach$3 = arrayProto$9.forEach;
  21937. var pop$1 = arrayProto$9.pop;
  21938. var slice$7 = arrayProto$9.slice;
  21939. var sort$1 = arrayProto$9.sort;
  21940. function stub(object, property) {
  21941. if (arguments.length > 2) {
  21942. throw new TypeError("stub(obj, 'meth', fn) has been removed, see documentation");
  21943. }
  21944. if (isEsModule(object)) {
  21945. throw new TypeError("ES Modules cannot be stubbed");
  21946. }
  21947. throwOnFalsyObject_1.apply(null, arguments);
  21948. if (isNonExistentOwnProperty_1(object, property)) {
  21949. throw new TypeError("Cannot stub non-existent own property " + valueToString$b(property));
  21950. }
  21951. var actualDescriptor = getPropertyDescriptor(object, property);
  21952. var isObject = typeof object === "object" || typeof object === "function";
  21953. var isStubbingEntireObject = typeof property === "undefined" && isObject;
  21954. var isCreatingNewStub = !object && typeof property === "undefined";
  21955. var isStubbingNonFuncProperty =
  21956. isObject &&
  21957. typeof property !== "undefined" &&
  21958. (typeof actualDescriptor === "undefined" || typeof actualDescriptor.value !== "function") &&
  21959. typeof descriptor === "undefined";
  21960. var isStubbingExistingMethod =
  21961. typeof object === "object" &&
  21962. typeof actualDescriptor !== "undefined" &&
  21963. typeof actualDescriptor.value === "function";
  21964. var arity = isStubbingExistingMethod ? object[property].length : 0;
  21965. if (isStubbingEntireObject) {
  21966. return stubEntireObject_1(stub, object);
  21967. }
  21968. if (isCreatingNewStub) {
  21969. return stub.create();
  21970. }
  21971. var s = stub.create(arity);
  21972. extend.nonEnum(s, {
  21973. rootObj: object,
  21974. propName: property,
  21975. restore: function restore() {
  21976. if (actualDescriptor !== undefined) {
  21977. Object.defineProperty(object, property, actualDescriptor);
  21978. return;
  21979. }
  21980. delete object[property];
  21981. }
  21982. });
  21983. return isStubbingNonFuncProperty ? s : wrapMethod(object, property, s);
  21984. }
  21985. stub.createStubInstance = function(constructor, overrides) {
  21986. if (typeof constructor !== "function") {
  21987. throw new TypeError("The constructor should be a function.");
  21988. }
  21989. var stubbedObject = stub(Object.create(constructor.prototype));
  21990. forEach$3(Object.keys(overrides || {}), function(propertyName) {
  21991. if (propertyName in stubbedObject) {
  21992. var value = overrides[propertyName];
  21993. if (value && value.createStubInstance) {
  21994. stubbedObject[propertyName] = value;
  21995. } else {
  21996. stubbedObject[propertyName].returns(value);
  21997. }
  21998. } else {
  21999. throw new Error("Cannot stub " + propertyName + ". Property does not exist!");
  22000. }
  22001. });
  22002. return stubbedObject;
  22003. };
  22004. /*eslint-disable no-use-before-define*/
  22005. function getParentBehaviour(stubInstance) {
  22006. return stubInstance.parent && getCurrentBehavior(stubInstance.parent);
  22007. }
  22008. function getDefaultBehavior(stubInstance) {
  22009. return stubInstance.defaultBehavior || getParentBehaviour(stubInstance) || behavior.create(stubInstance);
  22010. }
  22011. function getCurrentBehavior(stubInstance) {
  22012. var currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1];
  22013. return currentBehavior && currentBehavior.isPresent() ? currentBehavior : getDefaultBehavior(stubInstance);
  22014. }
  22015. /*eslint-enable no-use-before-define*/
  22016. var uuid$1 = 0;
  22017. var proto$1 = {
  22018. create: function create(stubLength) {
  22019. var functionStub = function() {
  22020. var args = slice$7(arguments);
  22021. var matchings = functionStub.matchingFakes(args);
  22022. var fnStub =
  22023. pop$1(
  22024. sort$1(matchings, function(a, b) {
  22025. return a.matchingArguments.length - b.matchingArguments.length;
  22026. })
  22027. ) || functionStub;
  22028. return getCurrentBehavior(fnStub).invoke(this, arguments);
  22029. };
  22030. var orig = functionStub;
  22031. functionStub = spy_1.create(functionStub, stubLength);
  22032. extend.nonEnum(functionStub, {
  22033. id: "stub#" + uuid$1++,
  22034. func: orig
  22035. });
  22036. extend(functionStub, stub);
  22037. extend.nonEnum(functionStub, {
  22038. instantiateFake: stub.create,
  22039. displayName: "stub",
  22040. toString: functionToString,
  22041. defaultBehavior: null,
  22042. behaviors: []
  22043. });
  22044. return functionStub;
  22045. },
  22046. resetBehavior: function() {
  22047. var fakes = this.fakes || [];
  22048. this.defaultBehavior = null;
  22049. this.behaviors = [];
  22050. delete this.returnValue;
  22051. delete this.returnArgAt;
  22052. delete this.throwArgAt;
  22053. delete this.resolveArgAt;
  22054. delete this.fakeFn;
  22055. this.returnThis = false;
  22056. this.resolveThis = false;
  22057. forEach$3(fakes, function(fake) {
  22058. fake.resetBehavior();
  22059. });
  22060. },
  22061. resetHistory: spy_1.resetHistory,
  22062. reset: function() {
  22063. this.resetHistory();
  22064. this.resetBehavior();
  22065. },
  22066. onCall: function onCall(index) {
  22067. if (!this.behaviors[index]) {
  22068. this.behaviors[index] = behavior.create(this);
  22069. }
  22070. return this.behaviors[index];
  22071. },
  22072. onFirstCall: function onFirstCall() {
  22073. return this.onCall(0);
  22074. },
  22075. onSecondCall: function onSecondCall() {
  22076. return this.onCall(1);
  22077. },
  22078. onThirdCall: function onThirdCall() {
  22079. return this.onCall(2);
  22080. }
  22081. };
  22082. forEach$3(Object.keys(behavior), function(method) {
  22083. if (
  22084. hasOwnProperty$5(behavior, method) &&
  22085. !hasOwnProperty$5(proto$1, method) &&
  22086. method !== "create" &&
  22087. method !== "withArgs" &&
  22088. method !== "invoke"
  22089. ) {
  22090. proto$1[method] = behavior.createBehavior(method);
  22091. }
  22092. });
  22093. forEach$3(Object.keys(defaultBehaviors_1), function(method) {
  22094. if (hasOwnProperty$5(defaultBehaviors_1, method) && !hasOwnProperty$5(proto$1, method)) {
  22095. behavior.addBehavior(stub, method, defaultBehaviors_1[method]);
  22096. }
  22097. });
  22098. extend(stub, proto$1);
  22099. var stub_1 = stub;
  22100. var arrayProto$a = lib.prototypes.array;
  22101. var spyInvoke = spy_1.invoke;
  22102. var spyCallToString = call$1.toString;
  22103. var match$4 = samsam.createMatcher;
  22104. var deepEqual$5 = samsam.deepEqual;
  22105. var valueToString$c = lib.valueToString;
  22106. var every$4 = arrayProto$a.every;
  22107. var forEach$4 = arrayProto$a.forEach;
  22108. var push$4 = arrayProto$a.push;
  22109. var slice$8 = arrayProto$a.slice;
  22110. function callCountInWords(callCount) {
  22111. if (callCount === 0) {
  22112. return "never called";
  22113. }
  22114. return "called " + timesInWords(callCount);
  22115. }
  22116. function expectedCallCountInWords(expectation) {
  22117. var min = expectation.minCalls;
  22118. var max = expectation.maxCalls;
  22119. if (typeof min === "number" && typeof max === "number") {
  22120. var str = timesInWords(min);
  22121. if (min !== max) {
  22122. str = "at least " + str + " and at most " + timesInWords(max);
  22123. }
  22124. return str;
  22125. }
  22126. if (typeof min === "number") {
  22127. return "at least " + timesInWords(min);
  22128. }
  22129. return "at most " + timesInWords(max);
  22130. }
  22131. function receivedMinCalls(expectation) {
  22132. var hasMinLimit = typeof expectation.minCalls === "number";
  22133. return !hasMinLimit || expectation.callCount >= expectation.minCalls;
  22134. }
  22135. function receivedMaxCalls(expectation) {
  22136. if (typeof expectation.maxCalls !== "number") {
  22137. return false;
  22138. }
  22139. return expectation.callCount === expectation.maxCalls;
  22140. }
  22141. function verifyMatcher(possibleMatcher, arg) {
  22142. var isMatcher = match$4.isMatcher(possibleMatcher);
  22143. return (isMatcher && possibleMatcher.test(arg)) || true;
  22144. }
  22145. var mockExpectation = {
  22146. minCalls: 1,
  22147. maxCalls: 1,
  22148. create: function create(methodName) {
  22149. var expectation = extend.nonEnum(stub_1.create(), mockExpectation);
  22150. delete expectation.create;
  22151. expectation.method = methodName;
  22152. return expectation;
  22153. },
  22154. invoke: function invoke(func, thisValue, args) {
  22155. this.verifyCallAllowed(thisValue, args);
  22156. return spyInvoke.apply(this, arguments);
  22157. },
  22158. atLeast: function atLeast(num) {
  22159. if (typeof num !== "number") {
  22160. throw new TypeError("'" + valueToString$c(num) + "' is not number");
  22161. }
  22162. if (!this.limitsSet) {
  22163. this.maxCalls = null;
  22164. this.limitsSet = true;
  22165. }
  22166. this.minCalls = num;
  22167. return this;
  22168. },
  22169. atMost: function atMost(num) {
  22170. if (typeof num !== "number") {
  22171. throw new TypeError("'" + valueToString$c(num) + "' is not number");
  22172. }
  22173. if (!this.limitsSet) {
  22174. this.minCalls = null;
  22175. this.limitsSet = true;
  22176. }
  22177. this.maxCalls = num;
  22178. return this;
  22179. },
  22180. never: function never() {
  22181. return this.exactly(0);
  22182. },
  22183. once: function once() {
  22184. return this.exactly(1);
  22185. },
  22186. twice: function twice() {
  22187. return this.exactly(2);
  22188. },
  22189. thrice: function thrice() {
  22190. return this.exactly(3);
  22191. },
  22192. exactly: function exactly(num) {
  22193. if (typeof num !== "number") {
  22194. throw new TypeError("'" + valueToString$c(num) + "' is not a number");
  22195. }
  22196. this.atLeast(num);
  22197. return this.atMost(num);
  22198. },
  22199. met: function met() {
  22200. return !this.failed && receivedMinCalls(this);
  22201. },
  22202. verifyCallAllowed: function verifyCallAllowed(thisValue, args) {
  22203. var expectedArguments = this.expectedArguments;
  22204. if (receivedMaxCalls(this)) {
  22205. this.failed = true;
  22206. mockExpectation.fail(this.method + " already called " + timesInWords(this.maxCalls));
  22207. }
  22208. if ("expectedThis" in this && this.expectedThis !== thisValue) {
  22209. mockExpectation.fail(
  22210. this.method +
  22211. " called with " +
  22212. valueToString$c(thisValue) +
  22213. " as thisValue, expected " +
  22214. valueToString$c(this.expectedThis)
  22215. );
  22216. }
  22217. if (!("expectedArguments" in this)) {
  22218. return;
  22219. }
  22220. if (!args) {
  22221. mockExpectation.fail(this.method + " received no arguments, expected " + format_1(expectedArguments));
  22222. }
  22223. if (args.length < expectedArguments.length) {
  22224. mockExpectation.fail(
  22225. this.method +
  22226. " received too few arguments (" +
  22227. format_1(args) +
  22228. "), expected " +
  22229. format_1(expectedArguments)
  22230. );
  22231. }
  22232. if (this.expectsExactArgCount && args.length !== expectedArguments.length) {
  22233. mockExpectation.fail(
  22234. this.method +
  22235. " received too many arguments (" +
  22236. format_1(args) +
  22237. "), expected " +
  22238. format_1(expectedArguments)
  22239. );
  22240. }
  22241. forEach$4(
  22242. expectedArguments,
  22243. function(expectedArgument, i) {
  22244. if (!verifyMatcher(expectedArgument, args[i])) {
  22245. mockExpectation.fail(
  22246. this.method +
  22247. " received wrong arguments " +
  22248. format_1(args) +
  22249. ", didn't match " +
  22250. String(expectedArguments)
  22251. );
  22252. }
  22253. if (!deepEqual$5(args[i], expectedArgument)) {
  22254. mockExpectation.fail(
  22255. this.method +
  22256. " received wrong arguments " +
  22257. format_1(args) +
  22258. ", expected " +
  22259. format_1(expectedArguments)
  22260. );
  22261. }
  22262. },
  22263. this
  22264. );
  22265. },
  22266. allowsCall: function allowsCall(thisValue, args) {
  22267. var expectedArguments = this.expectedArguments;
  22268. if (this.met() && receivedMaxCalls(this)) {
  22269. return false;
  22270. }
  22271. if ("expectedThis" in this && this.expectedThis !== thisValue) {
  22272. return false;
  22273. }
  22274. if (!("expectedArguments" in this)) {
  22275. return true;
  22276. }
  22277. // eslint-disable-next-line no-underscore-dangle
  22278. var _args = args || [];
  22279. if (_args.length < expectedArguments.length) {
  22280. return false;
  22281. }
  22282. if (this.expectsExactArgCount && _args.length !== expectedArguments.length) {
  22283. return false;
  22284. }
  22285. return every$4(expectedArguments, function(expectedArgument, i) {
  22286. if (!verifyMatcher(expectedArgument, _args[i])) {
  22287. return false;
  22288. }
  22289. if (!deepEqual$5(_args[i], expectedArgument)) {
  22290. return false;
  22291. }
  22292. return true;
  22293. });
  22294. },
  22295. withArgs: function withArgs() {
  22296. this.expectedArguments = slice$8(arguments);
  22297. return this;
  22298. },
  22299. withExactArgs: function withExactArgs() {
  22300. this.withArgs.apply(this, arguments);
  22301. this.expectsExactArgCount = true;
  22302. return this;
  22303. },
  22304. on: function on(thisValue) {
  22305. this.expectedThis = thisValue;
  22306. return this;
  22307. },
  22308. toString: function() {
  22309. var args = slice$8(this.expectedArguments || []);
  22310. if (!this.expectsExactArgCount) {
  22311. push$4(args, "[...]");
  22312. }
  22313. var callStr = spyCallToString.call({
  22314. proxy: this.method || "anonymous mock expectation",
  22315. args: args
  22316. });
  22317. var message = callStr.replace(", [...", "[, ...") + " " + expectedCallCountInWords(this);
  22318. if (this.met()) {
  22319. return "Expectation met: " + message;
  22320. }
  22321. return "Expected " + message + " (" + callCountInWords(this.callCount) + ")";
  22322. },
  22323. verify: function verify() {
  22324. if (!this.met()) {
  22325. mockExpectation.fail(String(this));
  22326. } else {
  22327. mockExpectation.pass(String(this));
  22328. }
  22329. return true;
  22330. },
  22331. pass: function pass(message) {
  22332. assert_1.pass(message);
  22333. },
  22334. fail: function fail(message) {
  22335. var exception = new Error(message);
  22336. exception.name = "ExpectationError";
  22337. throw exception;
  22338. }
  22339. };
  22340. var mockExpectation_1 = mockExpectation;
  22341. var forEach$5 = Array.prototype.forEach;
  22342. function usePromiseLibrary(library, fakes) {
  22343. if (typeof library === "undefined") {
  22344. return;
  22345. }
  22346. if (Array.isArray(fakes)) {
  22347. forEach$5.call(fakes, usePromiseLibrary.bind(null, library));
  22348. return;
  22349. }
  22350. if (typeof fakes.usingPromise === "function") {
  22351. fakes.usingPromise(library);
  22352. }
  22353. }
  22354. var usePromiseLibrary_1 = usePromiseLibrary;
  22355. var arrayProto$b = lib.prototypes.array;
  22356. var spyCallToString$1 = call$1.toString;
  22357. var deepEqual$6 = samsam.deepEqual;
  22358. var concat$4 = arrayProto$b.concat;
  22359. var filter$2 = arrayProto$b.filter;
  22360. var forEach$6 = arrayProto$b.forEach;
  22361. var every$5 = arrayProto$b.every;
  22362. var join$6 = arrayProto$b.join;
  22363. var push$5 = arrayProto$b.push;
  22364. var slice$9 = arrayProto$b.slice;
  22365. var unshift = arrayProto$b.unshift;
  22366. function mock(object) {
  22367. if (!object || typeof object === "string") {
  22368. return mockExpectation_1.create(object ? object : "Anonymous mock");
  22369. }
  22370. return mock.create(object);
  22371. }
  22372. function each(collection, callback) {
  22373. var col = collection || [];
  22374. forEach$6(col, callback);
  22375. }
  22376. function arrayEquals(arr1, arr2, compareLength) {
  22377. if (compareLength && arr1.length !== arr2.length) {
  22378. return false;
  22379. }
  22380. return every$5(arr1, function(element, i) {
  22381. return deepEqual$6(arr2[i], element);
  22382. });
  22383. }
  22384. extend(mock, {
  22385. create: function create(object) {
  22386. if (!object) {
  22387. throw new TypeError("object is null");
  22388. }
  22389. var mockObject = extend.nonEnum({}, mock, { object: object });
  22390. delete mockObject.create;
  22391. return mockObject;
  22392. },
  22393. expects: function expects(method) {
  22394. if (!method) {
  22395. throw new TypeError("method is falsy");
  22396. }
  22397. if (!this.expectations) {
  22398. this.expectations = {};
  22399. this.proxies = [];
  22400. this.failures = [];
  22401. }
  22402. if (!this.expectations[method]) {
  22403. this.expectations[method] = [];
  22404. var mockObject = this;
  22405. wrapMethod(this.object, method, function() {
  22406. return mockObject.invokeMethod(method, this, arguments);
  22407. });
  22408. push$5(this.proxies, method);
  22409. }
  22410. var expectation = mockExpectation_1.create(method);
  22411. extend.nonEnum(expectation, this.object[method]);
  22412. push$5(this.expectations[method], expectation);
  22413. usePromiseLibrary_1(this.promiseLibrary, expectation);
  22414. return expectation;
  22415. },
  22416. restore: function restore() {
  22417. var object = this.object;
  22418. each(this.proxies, function(proxy) {
  22419. if (typeof object[proxy].restore === "function") {
  22420. object[proxy].restore();
  22421. }
  22422. });
  22423. },
  22424. verify: function verify() {
  22425. var expectations = this.expectations || {};
  22426. var messages = this.failures ? slice$9(this.failures) : [];
  22427. var met = [];
  22428. each(this.proxies, function(proxy) {
  22429. each(expectations[proxy], function(expectation) {
  22430. if (!expectation.met()) {
  22431. push$5(messages, String(expectation));
  22432. } else {
  22433. push$5(met, String(expectation));
  22434. }
  22435. });
  22436. });
  22437. this.restore();
  22438. if (messages.length > 0) {
  22439. mockExpectation_1.fail(join$6(concat$4(messages, met), "\n"));
  22440. } else if (met.length > 0) {
  22441. mockExpectation_1.pass(join$6(concat$4(messages, met), "\n"));
  22442. }
  22443. return true;
  22444. },
  22445. usingPromise: function usingPromise(promiseLibrary) {
  22446. this.promiseLibrary = promiseLibrary;
  22447. return this;
  22448. },
  22449. invokeMethod: function invokeMethod(method, thisValue, args) {
  22450. /* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */
  22451. /* eslint consistent-return: "off" */
  22452. var expectations = this.expectations && this.expectations[method] ? this.expectations[method] : [];
  22453. var currentArgs = args || [];
  22454. var available;
  22455. var expectationsWithMatchingArgs = filter$2(expectations, function(expectation) {
  22456. var expectedArgs = expectation.expectedArguments || [];
  22457. return arrayEquals(expectedArgs, currentArgs, expectation.expectsExactArgCount);
  22458. });
  22459. var expectationsToApply = filter$2(expectationsWithMatchingArgs, function(expectation) {
  22460. return !expectation.met() && expectation.allowsCall(thisValue, args);
  22461. });
  22462. if (expectationsToApply.length > 0) {
  22463. return expectationsToApply[0].apply(thisValue, args);
  22464. }
  22465. var messages = [];
  22466. var exhausted = 0;
  22467. forEach$6(expectationsWithMatchingArgs, function(expectation) {
  22468. if (expectation.allowsCall(thisValue, args)) {
  22469. available = available || expectation;
  22470. } else {
  22471. exhausted += 1;
  22472. }
  22473. });
  22474. if (available && exhausted === 0) {
  22475. return available.apply(thisValue, args);
  22476. }
  22477. forEach$6(expectations, function(expectation) {
  22478. push$5(messages, " " + String(expectation));
  22479. });
  22480. unshift(
  22481. messages,
  22482. "Unexpected call: " +
  22483. spyCallToString$1.call({
  22484. proxy: method,
  22485. args: args
  22486. })
  22487. );
  22488. var err = new Error();
  22489. if (!err.stack) {
  22490. // PhantomJS does not serialize the stack trace until the error has been thrown
  22491. try {
  22492. throw err;
  22493. } catch (e) {
  22494. /* empty */
  22495. }
  22496. }
  22497. push$5(
  22498. this.failures,
  22499. "Unexpected call: " +
  22500. spyCallToString$1.call({
  22501. proxy: method,
  22502. args: args,
  22503. stack: err.stack
  22504. })
  22505. );
  22506. mockExpectation_1.fail(join$6(messages, "\n"));
  22507. }
  22508. });
  22509. var mock_1 = mock;
  22510. var arrayProto$c = lib.prototypes.array;
  22511. var forEach$7 = arrayProto$c.forEach;
  22512. var slice$a = arrayProto$c.slice;
  22513. function getError(value) {
  22514. return value instanceof Error ? value : new Error(value);
  22515. }
  22516. function cleanProxy(f) {
  22517. var undesirableProperties = [
  22518. "instantiateFake",
  22519. "callArg",
  22520. "callArgOn",
  22521. "callArgOnWith",
  22522. "callArgWith",
  22523. "invokeCallback",
  22524. "throwArg",
  22525. "withArgs",
  22526. "yield",
  22527. "yieldOn",
  22528. "yieldTo",
  22529. "yieldToOn"
  22530. ];
  22531. forEach$7(undesirableProperties, function(key) {
  22532. delete f[key];
  22533. });
  22534. return f;
  22535. }
  22536. var uuid$2 = 0;
  22537. function wrapFunc(f) {
  22538. var fakeInstance = function() {
  22539. var lastArg = (arguments.length > 0 && arguments[arguments.length - 1]) || undefined;
  22540. var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined;
  22541. /* eslint-disable no-use-before-define */
  22542. p.lastArg = lastArg;
  22543. p.callback = callback;
  22544. /* eslint-enable no-use-before-define */
  22545. return f && f.apply(this, arguments);
  22546. };
  22547. var p = cleanProxy(spy_1(fakeInstance));
  22548. p.displayName = "fake";
  22549. p.id = "fake#" + uuid$2++;
  22550. return p;
  22551. }
  22552. function fake(f) {
  22553. if (arguments.length > 0 && typeof f !== "function") {
  22554. throw new TypeError("Expected f argument to be a Function");
  22555. }
  22556. return wrapFunc(f);
  22557. }
  22558. fake.returns = function returns(value) {
  22559. function f() {
  22560. return value;
  22561. }
  22562. return wrapFunc(f);
  22563. };
  22564. fake.throws = function throws(value) {
  22565. function f() {
  22566. throw getError(value);
  22567. }
  22568. return wrapFunc(f);
  22569. };
  22570. fake.resolves = function resolves(value) {
  22571. function f() {
  22572. return Promise.resolve(value);
  22573. }
  22574. return wrapFunc(f);
  22575. };
  22576. fake.rejects = function rejects(value) {
  22577. function f() {
  22578. return Promise.reject(getError(value));
  22579. }
  22580. return wrapFunc(f);
  22581. };
  22582. function yieldInternal(async, values) {
  22583. function f() {
  22584. var callback = arguments[arguments.length - 1];
  22585. if (typeof callback !== "function") {
  22586. throw new TypeError("Expected last argument to be a function");
  22587. }
  22588. if (async) {
  22589. nextTick$1(function() {
  22590. callback.apply(null, values);
  22591. });
  22592. } else {
  22593. callback.apply(null, values);
  22594. }
  22595. }
  22596. return wrapFunc(f);
  22597. }
  22598. fake.yields = function yields() {
  22599. return yieldInternal(false, slice$a(arguments));
  22600. };
  22601. fake.yieldsAsync = function yieldsAsync() {
  22602. return yieldInternal(true, slice$a(arguments));
  22603. };
  22604. var fake_1 = fake;
  22605. var nise = createCommonjsModule(function (module, exports) {
  22606. (function(f){{module.exports=f();}})(function(){var define;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof commonjsRequire=="function"&&commonjsRequire;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r);}return n[o].exports}var i=typeof commonjsRequire=="function"&&commonjsRequire;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){
  22607. // cache a reference to setTimeout, so that our reference won't be stubbed out
  22608. // when using fake timers and errors will still get logged
  22609. // https://github.com/cjohansen/Sinon.JS/issues/381
  22610. var realSetTimeout = setTimeout;
  22611. function configureLogger(config) {
  22612. config = config || {};
  22613. // Function which prints errors.
  22614. if (!config.hasOwnProperty("logger")) {
  22615. config.logger = function () { };
  22616. }
  22617. // When set to true, any errors logged will be thrown immediately;
  22618. // If set to false, the errors will be thrown in separate execution frame.
  22619. if (!config.hasOwnProperty("useImmediateExceptions")) {
  22620. config.useImmediateExceptions = true;
  22621. }
  22622. // wrap realSetTimeout with something we can stub in tests
  22623. if (!config.hasOwnProperty("setTimeout")) {
  22624. config.setTimeout = realSetTimeout;
  22625. }
  22626. return function logError(label, e) {
  22627. var msg = label + " threw exception: ";
  22628. var err = { name: e.name || label, message: e.message || e.toString(), stack: e.stack };
  22629. function throwLoggedError() {
  22630. err.message = msg + err.message;
  22631. throw err;
  22632. }
  22633. config.logger(msg + "[" + err.name + "] " + err.message);
  22634. if (err.stack) {
  22635. config.logger(err.stack);
  22636. }
  22637. if (config.useImmediateExceptions) {
  22638. throwLoggedError();
  22639. } else {
  22640. config.setTimeout(throwLoggedError, 0);
  22641. }
  22642. };
  22643. }
  22644. module.exports = configureLogger;
  22645. },{}],2:[function(require,module,exports){
  22646. var Event = require("./event");
  22647. function CustomEvent(type, customData, target) {
  22648. this.initEvent(type, false, false, target);
  22649. this.detail = customData.detail || null;
  22650. }
  22651. CustomEvent.prototype = new Event();
  22652. CustomEvent.prototype.constructor = CustomEvent;
  22653. module.exports = CustomEvent;
  22654. },{"./event":4}],3:[function(require,module,exports){
  22655. function flattenOptions(options) {
  22656. if (options !== Object(options)) {
  22657. return {
  22658. capture: Boolean(options),
  22659. once: false,
  22660. passive: false
  22661. };
  22662. }
  22663. return {
  22664. capture: Boolean(options.capture),
  22665. once: Boolean(options.once),
  22666. passive: Boolean(options.passive)
  22667. };
  22668. }
  22669. function not(fn) {
  22670. return function () {
  22671. return !fn.apply(this, arguments);
  22672. };
  22673. }
  22674. function hasListenerFilter(listener, capture) {
  22675. return function (listenerSpec) {
  22676. return listenerSpec.capture === capture
  22677. && listenerSpec.listener === listener;
  22678. };
  22679. }
  22680. var EventTarget = {
  22681. // https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener
  22682. addEventListener: function addEventListener(event, listener, providedOptions) {
  22683. // 3. Let capture, passive, and once be the result of flattening more options.
  22684. // Flatten property before executing step 2,
  22685. // feture detection is usually based on registering handler with options object,
  22686. // that has getter defined
  22687. // addEventListener("load", () => {}, {
  22688. // get once() { supportsOnce = true; }
  22689. // });
  22690. var options = flattenOptions(providedOptions);
  22691. // 2. If callback is null, then return.
  22692. if (listener == null) {
  22693. return;
  22694. }
  22695. this.eventListeners = this.eventListeners || {};
  22696. this.eventListeners[event] = this.eventListeners[event] || [];
  22697. // 4. If context object’s associated list of event listener
  22698. // does not contain an event listener whose type is type,
  22699. // callback is callback, and capture is capture, then append
  22700. // a new event listener to it, whose type is type, callback is
  22701. // callback, capture is capture, passive is passive, and once is once.
  22702. if (!this.eventListeners[event].some(hasListenerFilter(listener, options.capture))) {
  22703. this.eventListeners[event].push({
  22704. listener: listener,
  22705. capture: options.capture,
  22706. once: options.once
  22707. });
  22708. }
  22709. },
  22710. // https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener
  22711. removeEventListener: function removeEventListener(event, listener, providedOptions) {
  22712. if (!this.eventListeners || !this.eventListeners[event]) {
  22713. return;
  22714. }
  22715. // 2. Let capture be the result of flattening options.
  22716. var options = flattenOptions(providedOptions);
  22717. // 3. If there is an event listener in the associated list of
  22718. // event listeners whose type is type, callback is callback,
  22719. // and capture is capture, then set that event listener’s
  22720. // removed to true and remove it from the associated list of event listeners.
  22721. this.eventListeners[event] = this.eventListeners[event]
  22722. .filter(not(hasListenerFilter(listener, options.capture)));
  22723. },
  22724. dispatchEvent: function dispatchEvent(event) {
  22725. if (!this.eventListeners || !this.eventListeners[event.type]) {
  22726. return Boolean(event.defaultPrevented);
  22727. }
  22728. var self = this;
  22729. var type = event.type;
  22730. var listeners = self.eventListeners[type];
  22731. // Remove listeners, that should be dispatched once
  22732. // before running dispatch loop to avoid nested dispatch issues
  22733. self.eventListeners[type] = listeners.filter(function (listenerSpec) {
  22734. return !listenerSpec.once;
  22735. });
  22736. listeners.forEach(function (listenerSpec) {
  22737. var listener = listenerSpec.listener;
  22738. if (typeof listener === "function") {
  22739. listener.call(self, event);
  22740. } else {
  22741. listener.handleEvent(event);
  22742. }
  22743. });
  22744. return Boolean(event.defaultPrevented);
  22745. }
  22746. };
  22747. module.exports = EventTarget;
  22748. },{}],4:[function(require,module,exports){
  22749. function Event(type, bubbles, cancelable, target) {
  22750. this.initEvent(type, bubbles, cancelable, target);
  22751. }
  22752. Event.prototype = {
  22753. initEvent: function (type, bubbles, cancelable, target) {
  22754. this.type = type;
  22755. this.bubbles = bubbles;
  22756. this.cancelable = cancelable;
  22757. this.target = target;
  22758. this.currentTarget = target;
  22759. },
  22760. stopPropagation: function () {},
  22761. preventDefault: function () {
  22762. this.defaultPrevented = true;
  22763. }
  22764. };
  22765. module.exports = Event;
  22766. },{}],5:[function(require,module,exports){
  22767. module.exports = {
  22768. Event: require("./event"),
  22769. ProgressEvent: require("./progress-event"),
  22770. CustomEvent: require("./custom-event"),
  22771. EventTarget: require("./event-target")
  22772. };
  22773. },{"./custom-event":2,"./event":4,"./event-target":3,"./progress-event":6}],6:[function(require,module,exports){
  22774. var Event = require("./event");
  22775. function ProgressEvent(type, progressEventRaw, target) {
  22776. this.initEvent(type, false, false, target);
  22777. this.loaded = typeof progressEventRaw.loaded === "number" ? progressEventRaw.loaded : null;
  22778. this.total = typeof progressEventRaw.total === "number" ? progressEventRaw.total : null;
  22779. this.lengthComputable = !!progressEventRaw.total;
  22780. }
  22781. ProgressEvent.prototype = new Event();
  22782. ProgressEvent.prototype.constructor = ProgressEvent;
  22783. module.exports = ProgressEvent;
  22784. },{"./event":4}],7:[function(require,module,exports){
  22785. var lolex = require("lolex");
  22786. var fakeServer = require("./index");
  22787. function Server() {}
  22788. Server.prototype = fakeServer;
  22789. var fakeServerWithClock = new Server();
  22790. fakeServerWithClock.addRequest = function addRequest(xhr) {
  22791. if (xhr.async) {
  22792. if (typeof setTimeout.clock === "object") {
  22793. this.clock = setTimeout.clock;
  22794. } else {
  22795. this.clock = lolex.install();
  22796. this.resetClock = true;
  22797. }
  22798. if (!this.longestTimeout) {
  22799. var clockSetTimeout = this.clock.setTimeout;
  22800. var clockSetInterval = this.clock.setInterval;
  22801. var server = this;
  22802. this.clock.setTimeout = function (fn, timeout) {
  22803. server.longestTimeout = Math.max(timeout, server.longestTimeout || 0);
  22804. return clockSetTimeout.apply(this, arguments);
  22805. };
  22806. this.clock.setInterval = function (fn, timeout) {
  22807. server.longestTimeout = Math.max(timeout, server.longestTimeout || 0);
  22808. return clockSetInterval.apply(this, arguments);
  22809. };
  22810. }
  22811. }
  22812. return fakeServer.addRequest.call(this, xhr);
  22813. };
  22814. fakeServerWithClock.respond = function respond() {
  22815. var returnVal = fakeServer.respond.apply(this, arguments);
  22816. if (this.clock) {
  22817. this.clock.tick(this.longestTimeout || 0);
  22818. this.longestTimeout = 0;
  22819. if (this.resetClock) {
  22820. this.clock.uninstall();
  22821. this.resetClock = false;
  22822. }
  22823. }
  22824. return returnVal;
  22825. };
  22826. fakeServerWithClock.restore = function restore() {
  22827. if (this.clock) {
  22828. this.clock.uninstall();
  22829. }
  22830. return fakeServer.restore.apply(this, arguments);
  22831. };
  22832. module.exports = fakeServerWithClock;
  22833. },{"./index":9,"lolex":47}],8:[function(require,module,exports){
  22834. var formatio = require("@sinonjs/formatio");
  22835. var formatter = formatio.configure({
  22836. quoteStrings: false,
  22837. limitChildrenCount: 250
  22838. });
  22839. module.exports = function format() {
  22840. return formatter.ascii.apply(formatter, arguments);
  22841. };
  22842. },{"@sinonjs/formatio":24}],9:[function(require,module,exports){
  22843. var fakeXhr = require("../fake-xhr");
  22844. var push = [].push;
  22845. var format = require("./format");
  22846. var configureLogError = require("../configure-logger");
  22847. var pathToRegexp = require("path-to-regexp");
  22848. var supportsArrayBuffer = typeof ArrayBuffer !== "undefined";
  22849. function responseArray(handler) {
  22850. var response = handler;
  22851. if (Object.prototype.toString.call(handler) !== "[object Array]") {
  22852. response = [200, {}, handler];
  22853. }
  22854. if (typeof response[2] !== "string") {
  22855. if (!supportsArrayBuffer) {
  22856. throw new TypeError("Fake server response body should be a string, but was " +
  22857. typeof response[2]);
  22858. }
  22859. else if (!(response[2] instanceof ArrayBuffer)) {
  22860. throw new TypeError("Fake server response body should be a string or ArrayBuffer, but was " +
  22861. typeof response[2]);
  22862. }
  22863. }
  22864. return response;
  22865. }
  22866. function getDefaultWindowLocation() {
  22867. return { "host": "localhost", "protocol": "http" };
  22868. }
  22869. function getWindowLocation() {
  22870. if (typeof window === "undefined") {
  22871. // Fallback
  22872. return getDefaultWindowLocation();
  22873. }
  22874. if (typeof window.location !== "undefined") {
  22875. // Browsers place location on window
  22876. return window.location;
  22877. }
  22878. if ((typeof window.window !== "undefined") && (typeof window.window.location !== "undefined")) {
  22879. // React Native on Android places location on window.window
  22880. return window.window.location;
  22881. }
  22882. return getDefaultWindowLocation();
  22883. }
  22884. function matchOne(response, reqMethod, reqUrl) {
  22885. var rmeth = response.method;
  22886. var matchMethod = !rmeth || rmeth.toLowerCase() === reqMethod.toLowerCase();
  22887. var url = response.url;
  22888. var matchUrl = !url || url === reqUrl || (typeof url.test === "function" && url.test(reqUrl));
  22889. return matchMethod && matchUrl;
  22890. }
  22891. function match(response, request) {
  22892. var wloc = getWindowLocation();
  22893. var rCurrLoc = new RegExp("^" + wloc.protocol + "//" + wloc.host);
  22894. var requestUrl = request.url;
  22895. if (!/^https?:\/\//.test(requestUrl) || rCurrLoc.test(requestUrl)) {
  22896. requestUrl = requestUrl.replace(rCurrLoc, "");
  22897. }
  22898. if (matchOne(response, this.getHTTPMethod(request), requestUrl)) {
  22899. if (typeof response.response === "function") {
  22900. var ru = response.url;
  22901. var args = [request].concat(ru && typeof ru.exec === "function" ? ru.exec(requestUrl).slice(1) : []);
  22902. return response.response.apply(response, args);
  22903. }
  22904. return true;
  22905. }
  22906. return false;
  22907. }
  22908. function incrementRequestCount() {
  22909. var count = ++this.requestCount;
  22910. this.requested = true;
  22911. this.requestedOnce = count === 1;
  22912. this.requestedTwice = count === 2;
  22913. this.requestedThrice = count === 3;
  22914. this.firstRequest = this.getRequest(0);
  22915. this.secondRequest = this.getRequest(1);
  22916. this.thirdRequest = this.getRequest(2);
  22917. this.lastRequest = this.getRequest(count - 1);
  22918. }
  22919. var fakeServer = {
  22920. create: function (config) {
  22921. var server = Object.create(this);
  22922. server.configure(config);
  22923. this.xhr = fakeXhr.useFakeXMLHttpRequest();
  22924. server.requests = [];
  22925. server.requestCount = 0;
  22926. server.queue = [];
  22927. server.responses = [];
  22928. this.xhr.onCreate = function (xhrObj) {
  22929. xhrObj.unsafeHeadersEnabled = function () {
  22930. return !(server.unsafeHeadersEnabled === false);
  22931. };
  22932. server.addRequest(xhrObj);
  22933. };
  22934. return server;
  22935. },
  22936. configure: function (config) {
  22937. var self = this;
  22938. var whitelist = {
  22939. "autoRespond": true,
  22940. "autoRespondAfter": true,
  22941. "respondImmediately": true,
  22942. "fakeHTTPMethods": true,
  22943. "logger": true,
  22944. "unsafeHeadersEnabled": true
  22945. };
  22946. config = config || {};
  22947. Object.keys(config).forEach(function (setting) {
  22948. if (setting in whitelist) {
  22949. self[setting] = config[setting];
  22950. }
  22951. });
  22952. self.logError = configureLogError(config);
  22953. },
  22954. addRequest: function addRequest(xhrObj) {
  22955. var server = this;
  22956. push.call(this.requests, xhrObj);
  22957. incrementRequestCount.call(this);
  22958. xhrObj.onSend = function () {
  22959. server.handleRequest(this);
  22960. if (server.respondImmediately) {
  22961. server.respond();
  22962. } else if (server.autoRespond && !server.responding) {
  22963. setTimeout(function () {
  22964. server.responding = false;
  22965. server.respond();
  22966. }, server.autoRespondAfter || 10);
  22967. server.responding = true;
  22968. }
  22969. };
  22970. },
  22971. getHTTPMethod: function getHTTPMethod(request) {
  22972. if (this.fakeHTTPMethods && /post/i.test(request.method)) {
  22973. var matches = (request.requestBody || "").match(/_method=([^\b;]+)/);
  22974. return matches ? matches[1] : request.method;
  22975. }
  22976. return request.method;
  22977. },
  22978. handleRequest: function handleRequest(xhr) {
  22979. if (xhr.async) {
  22980. push.call(this.queue, xhr);
  22981. } else {
  22982. this.processRequest(xhr);
  22983. }
  22984. },
  22985. logger: function () {
  22986. // no-op; override via configure()
  22987. },
  22988. logError: configureLogError({}),
  22989. log: function log(response, request) {
  22990. var str;
  22991. str = "Request:\n" + format(request) + "\n\n";
  22992. str += "Response:\n" + format(response) + "\n\n";
  22993. if (typeof this.logger === "function") {
  22994. this.logger(str);
  22995. }
  22996. },
  22997. respondWith: function respondWith(method, url, body) {
  22998. if (arguments.length === 1 && typeof method !== "function") {
  22999. this.response = responseArray(method);
  23000. return;
  23001. }
  23002. if (arguments.length === 1) {
  23003. body = method;
  23004. url = method = null;
  23005. }
  23006. if (arguments.length === 2) {
  23007. body = url;
  23008. url = method;
  23009. method = null;
  23010. }
  23011. push.call(this.responses, {
  23012. method: method,
  23013. url: typeof url === "string" && url !== "" ? pathToRegexp(url) : url,
  23014. response: typeof body === "function" ? body : responseArray(body)
  23015. });
  23016. },
  23017. respond: function respond() {
  23018. if (arguments.length > 0) {
  23019. this.respondWith.apply(this, arguments);
  23020. }
  23021. var queue = this.queue || [];
  23022. var requests = queue.splice(0, queue.length);
  23023. var self = this;
  23024. requests.forEach(function (request) {
  23025. self.processRequest(request);
  23026. });
  23027. },
  23028. processRequest: function processRequest(request) {
  23029. try {
  23030. if (request.aborted) {
  23031. return;
  23032. }
  23033. var response = this.response || [404, {}, ""];
  23034. if (this.responses) {
  23035. for (var l = this.responses.length, i = l - 1; i >= 0; i--) {
  23036. if (match.call(this, this.responses[i], request)) {
  23037. response = this.responses[i].response;
  23038. break;
  23039. }
  23040. }
  23041. }
  23042. if (request.readyState !== 4) {
  23043. this.log(response, request);
  23044. request.respond(response[0], response[1], response[2]);
  23045. }
  23046. } catch (e) {
  23047. this.logError("Fake server request processing", e);
  23048. }
  23049. },
  23050. restore: function restore() {
  23051. return this.xhr.restore && this.xhr.restore.apply(this.xhr, arguments);
  23052. },
  23053. getRequest: function getRequest(index) {
  23054. return this.requests[index] || null;
  23055. },
  23056. reset: function reset() {
  23057. this.resetBehavior();
  23058. this.resetHistory();
  23059. },
  23060. resetBehavior: function resetBehavior() {
  23061. this.responses.length = this.queue.length = 0;
  23062. },
  23063. resetHistory: function resetHistory() {
  23064. this.requests.length = this.requestCount = 0;
  23065. this.requestedOnce = this.requestedTwice = this.requestedThrice = this.requested = false;
  23066. this.firstRequest = this.secondRequest = this.thirdRequest = this.lastRequest = null;
  23067. }
  23068. };
  23069. module.exports = fakeServer;
  23070. },{"../configure-logger":1,"../fake-xhr":11,"./format":8,"path-to-regexp":48}],10:[function(require,module,exports){
  23071. exports.isSupported = (function () {
  23072. try {
  23073. return !!new Blob();
  23074. } catch (e) {
  23075. return false;
  23076. }
  23077. }());
  23078. },{}],11:[function(require,module,exports){
  23079. (function (global){
  23080. var TextEncoder = require("@sinonjs/text-encoding").TextEncoder;
  23081. var configureLogError = require("../configure-logger");
  23082. var sinonEvent = require("../event");
  23083. var extend = require("just-extend");
  23084. function getWorkingXHR(globalScope) {
  23085. var supportsXHR = typeof globalScope.XMLHttpRequest !== "undefined";
  23086. if (supportsXHR) {
  23087. return globalScope.XMLHttpRequest;
  23088. }
  23089. var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined";
  23090. if (supportsActiveX) {
  23091. return function () {
  23092. return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0");
  23093. };
  23094. }
  23095. return false;
  23096. }
  23097. var supportsProgress = typeof ProgressEvent !== "undefined";
  23098. var supportsCustomEvent = typeof CustomEvent !== "undefined";
  23099. var supportsFormData = typeof FormData !== "undefined";
  23100. var supportsArrayBuffer = typeof ArrayBuffer !== "undefined";
  23101. var supportsBlob = require("./blob").isSupported;
  23102. var isReactNative = global.navigator && global.navigator.product === "ReactNative";
  23103. var sinonXhr = { XMLHttpRequest: global.XMLHttpRequest };
  23104. sinonXhr.GlobalXMLHttpRequest = global.XMLHttpRequest;
  23105. sinonXhr.GlobalActiveXObject = global.ActiveXObject;
  23106. sinonXhr.supportsActiveX = typeof sinonXhr.GlobalActiveXObject !== "undefined";
  23107. sinonXhr.supportsXHR = typeof sinonXhr.GlobalXMLHttpRequest !== "undefined";
  23108. sinonXhr.workingXHR = getWorkingXHR(global);
  23109. sinonXhr.supportsTimeout =
  23110. (sinonXhr.supportsXHR && "timeout" in (new sinonXhr.GlobalXMLHttpRequest()));
  23111. sinonXhr.supportsCORS = isReactNative ||
  23112. (sinonXhr.supportsXHR && "withCredentials" in (new sinonXhr.GlobalXMLHttpRequest()));
  23113. // Ref: https://fetch.spec.whatwg.org/#forbidden-header-name
  23114. var unsafeHeaders = {
  23115. "Accept-Charset": true,
  23116. "Access-Control-Request-Headers": true,
  23117. "Access-Control-Request-Method": true,
  23118. "Accept-Encoding": true,
  23119. "Connection": true,
  23120. "Content-Length": true,
  23121. "Cookie": true,
  23122. "Cookie2": true,
  23123. "Content-Transfer-Encoding": true,
  23124. "Date": true,
  23125. "DNT": true,
  23126. "Expect": true,
  23127. "Host": true,
  23128. "Keep-Alive": true,
  23129. "Origin": true,
  23130. "Referer": true,
  23131. "TE": true,
  23132. "Trailer": true,
  23133. "Transfer-Encoding": true,
  23134. "Upgrade": true,
  23135. "User-Agent": true,
  23136. "Via": true
  23137. };
  23138. function EventTargetHandler() {
  23139. var self = this;
  23140. var events = ["loadstart", "progress", "abort", "error", "load", "timeout", "loadend"];
  23141. function addEventListener(eventName) {
  23142. self.addEventListener(eventName, function (event) {
  23143. var listener = self["on" + eventName];
  23144. if (listener && typeof listener === "function") {
  23145. listener.call(this, event);
  23146. }
  23147. });
  23148. }
  23149. events.forEach(addEventListener);
  23150. }
  23151. EventTargetHandler.prototype = sinonEvent.EventTarget;
  23152. // Note that for FakeXMLHttpRequest to work pre ES5
  23153. // we lose some of the alignment with the spec.
  23154. // To ensure as close a match as possible,
  23155. // set responseType before calling open, send or respond;
  23156. function FakeXMLHttpRequest(config) {
  23157. EventTargetHandler.call(this);
  23158. this.readyState = FakeXMLHttpRequest.UNSENT;
  23159. this.requestHeaders = {};
  23160. this.requestBody = null;
  23161. this.status = 0;
  23162. this.statusText = "";
  23163. this.upload = new EventTargetHandler();
  23164. this.responseType = "";
  23165. this.response = "";
  23166. this.logError = configureLogError(config);
  23167. if (sinonXhr.supportsTimeout) {
  23168. this.timeout = 0;
  23169. }
  23170. if (sinonXhr.supportsCORS) {
  23171. this.withCredentials = false;
  23172. }
  23173. if (typeof FakeXMLHttpRequest.onCreate === "function") {
  23174. FakeXMLHttpRequest.onCreate(this);
  23175. }
  23176. }
  23177. function verifyState(xhr) {
  23178. if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
  23179. throw new Error("INVALID_STATE_ERR");
  23180. }
  23181. if (xhr.sendFlag) {
  23182. throw new Error("INVALID_STATE_ERR");
  23183. }
  23184. }
  23185. function normalizeHeaderValue(value) {
  23186. // Ref: https://fetch.spec.whatwg.org/#http-whitespace-bytes
  23187. /*eslint no-control-regex: "off"*/
  23188. return value.replace(/^[\x09\x0A\x0D\x20]+|[\x09\x0A\x0D\x20]+$/g, "");
  23189. }
  23190. function getHeader(headers, header) {
  23191. var foundHeader = Object.keys(headers).filter(function (h) {
  23192. return h.toLowerCase() === header.toLowerCase();
  23193. });
  23194. return foundHeader[0] || null;
  23195. }
  23196. function excludeSetCookie2Header(header) {
  23197. return !/^Set-Cookie2?$/i.test(header);
  23198. }
  23199. // largest arity in XHR is 5 - XHR#open
  23200. var apply = function (obj, method, args) {
  23201. switch (args.length) {
  23202. case 0: return obj[method]();
  23203. case 1: return obj[method](args[0]);
  23204. case 2: return obj[method](args[0], args[1]);
  23205. case 3: return obj[method](args[0], args[1], args[2]);
  23206. case 4: return obj[method](args[0], args[1], args[2], args[3]);
  23207. case 5: return obj[method](args[0], args[1], args[2], args[3], args[4]);
  23208. default: throw new Error("Unhandled case");
  23209. }
  23210. };
  23211. FakeXMLHttpRequest.filters = [];
  23212. FakeXMLHttpRequest.addFilter = function addFilter(fn) {
  23213. this.filters.push(fn);
  23214. };
  23215. FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) {
  23216. var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap
  23217. [
  23218. "open",
  23219. "setRequestHeader",
  23220. "abort",
  23221. "getResponseHeader",
  23222. "getAllResponseHeaders",
  23223. "addEventListener",
  23224. "overrideMimeType",
  23225. "removeEventListener"
  23226. ].forEach(function (method) {
  23227. fakeXhr[method] = function () {
  23228. return apply(xhr, method, arguments);
  23229. };
  23230. });
  23231. fakeXhr.send = function () {
  23232. // Ref: https://xhr.spec.whatwg.org/#the-responsetype-attribute
  23233. if (xhr.responseType !== fakeXhr.responseType) {
  23234. xhr.responseType = fakeXhr.responseType;
  23235. }
  23236. return apply(xhr, "send", arguments);
  23237. };
  23238. var copyAttrs = function (args) {
  23239. args.forEach(function (attr) {
  23240. fakeXhr[attr] = xhr[attr];
  23241. });
  23242. };
  23243. var stateChangeStart = function () {
  23244. fakeXhr.readyState = xhr.readyState;
  23245. if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) {
  23246. copyAttrs(["status", "statusText"]);
  23247. }
  23248. if (xhr.readyState >= FakeXMLHttpRequest.LOADING) {
  23249. copyAttrs(["response"]);
  23250. if (xhr.responseType === "" || xhr.responseType === "text") {
  23251. copyAttrs(["responseText"]);
  23252. }
  23253. }
  23254. if (
  23255. xhr.readyState === FakeXMLHttpRequest.DONE &&
  23256. (xhr.responseType === "" || xhr.responseType === "document")
  23257. ) {
  23258. copyAttrs(["responseXML"]);
  23259. }
  23260. };
  23261. var stateChangeEnd = function () {
  23262. if (fakeXhr.onreadystatechange) {
  23263. fakeXhr.onreadystatechange.call(fakeXhr, { target: fakeXhr, currentTarget: fakeXhr });
  23264. }
  23265. };
  23266. var stateChange = function stateChange() {
  23267. stateChangeStart();
  23268. stateChangeEnd();
  23269. };
  23270. if (xhr.addEventListener) {
  23271. xhr.addEventListener("readystatechange", stateChangeStart);
  23272. Object.keys(fakeXhr.eventListeners).forEach(function (event) {
  23273. /*eslint-disable no-loop-func*/
  23274. fakeXhr.eventListeners[event].forEach(function (handler) {
  23275. xhr.addEventListener(event, handler.listener, {
  23276. capture: handler.capture,
  23277. once: handler.once
  23278. });
  23279. });
  23280. /*eslint-enable no-loop-func*/
  23281. });
  23282. xhr.addEventListener("readystatechange", stateChangeEnd);
  23283. } else {
  23284. xhr.onreadystatechange = stateChange;
  23285. }
  23286. apply(xhr, "open", xhrArgs);
  23287. };
  23288. FakeXMLHttpRequest.useFilters = false;
  23289. function verifyRequestOpened(xhr) {
  23290. if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
  23291. throw new Error("INVALID_STATE_ERR - " + xhr.readyState);
  23292. }
  23293. }
  23294. function verifyRequestSent(xhr) {
  23295. if (xhr.readyState === FakeXMLHttpRequest.DONE) {
  23296. throw new Error("Request done");
  23297. }
  23298. }
  23299. function verifyHeadersReceived(xhr) {
  23300. if (xhr.async && xhr.readyState !== FakeXMLHttpRequest.HEADERS_RECEIVED) {
  23301. throw new Error("No headers received");
  23302. }
  23303. }
  23304. function verifyResponseBodyType(body, responseType) {
  23305. var error = null;
  23306. var isString = typeof body === "string";
  23307. if (responseType === "arraybuffer") {
  23308. if (!isString && !(body instanceof ArrayBuffer)) {
  23309. error = new Error("Attempted to respond to fake XMLHttpRequest with " +
  23310. body + ", which is not a string or ArrayBuffer.");
  23311. error.name = "InvalidBodyException";
  23312. }
  23313. }
  23314. else if (!isString) {
  23315. error = new Error("Attempted to respond to fake XMLHttpRequest with " +
  23316. body + ", which is not a string.");
  23317. error.name = "InvalidBodyException";
  23318. }
  23319. if (error) {
  23320. throw error;
  23321. }
  23322. }
  23323. function convertToArrayBuffer(body, encoding) {
  23324. if (body instanceof ArrayBuffer) {
  23325. return body;
  23326. }
  23327. return new TextEncoder(encoding || "utf-8").encode(body).buffer;
  23328. }
  23329. function isXmlContentType(contentType) {
  23330. return !contentType || /(text\/xml)|(application\/xml)|(\+xml)/.test(contentType);
  23331. }
  23332. function convertResponseBody(responseType, contentType, body) {
  23333. if (responseType === "" || responseType === "text") {
  23334. return body;
  23335. } else if (supportsArrayBuffer && responseType === "arraybuffer") {
  23336. return convertToArrayBuffer(body);
  23337. } else if (responseType === "json") {
  23338. try {
  23339. return JSON.parse(body);
  23340. } catch (e) {
  23341. // Return parsing failure as null
  23342. return null;
  23343. }
  23344. } else if (supportsBlob && responseType === "blob") {
  23345. var blobOptions = {};
  23346. if (contentType) {
  23347. blobOptions.type = contentType;
  23348. }
  23349. return new Blob([convertToArrayBuffer(body)], blobOptions);
  23350. } else if (responseType === "document") {
  23351. if (isXmlContentType(contentType)) {
  23352. return FakeXMLHttpRequest.parseXML(body);
  23353. }
  23354. return null;
  23355. }
  23356. throw new Error("Invalid responseType " + responseType);
  23357. }
  23358. function clearResponse(xhr) {
  23359. if (xhr.responseType === "" || xhr.responseType === "text") {
  23360. xhr.response = xhr.responseText = "";
  23361. } else {
  23362. xhr.response = xhr.responseText = null;
  23363. }
  23364. xhr.responseXML = null;
  23365. }
  23366. /**
  23367. * Steps to follow when there is an error, according to:
  23368. * https://xhr.spec.whatwg.org/#request-error-steps
  23369. */
  23370. function requestErrorSteps(xhr) {
  23371. clearResponse(xhr);
  23372. xhr.errorFlag = true;
  23373. xhr.requestHeaders = {};
  23374. xhr.responseHeaders = {};
  23375. if (xhr.readyState !== FakeXMLHttpRequest.UNSENT && xhr.sendFlag
  23376. && xhr.readyState !== FakeXMLHttpRequest.DONE) {
  23377. xhr.readyStateChange(FakeXMLHttpRequest.DONE);
  23378. xhr.sendFlag = false;
  23379. }
  23380. }
  23381. FakeXMLHttpRequest.parseXML = function parseXML(text) {
  23382. // Treat empty string as parsing failure
  23383. if (text !== "") {
  23384. try {
  23385. if (typeof DOMParser !== "undefined") {
  23386. var parser = new DOMParser();
  23387. var parsererrorNS = "";
  23388. try {
  23389. var parsererrors = parser
  23390. .parseFromString("INVALID", "text/xml")
  23391. .getElementsByTagName("parsererror");
  23392. if (parsererrors.length) {
  23393. parsererrorNS = parsererrors[0].namespaceURI;
  23394. }
  23395. } catch (e) {
  23396. // passing invalid XML makes IE11 throw
  23397. // so no namespace needs to be determined
  23398. }
  23399. var result;
  23400. try {
  23401. result = parser.parseFromString(text, "text/xml");
  23402. } catch (err) {
  23403. return null;
  23404. }
  23405. return result.getElementsByTagNameNS(parsererrorNS, "parsererror").length
  23406. ? null : result;
  23407. }
  23408. var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
  23409. xmlDoc.async = "false";
  23410. xmlDoc.loadXML(text);
  23411. return xmlDoc.parseError.errorCode !== 0
  23412. ? null : xmlDoc;
  23413. } catch (e) {
  23414. // Unable to parse XML - no biggie
  23415. }
  23416. }
  23417. return null;
  23418. };
  23419. FakeXMLHttpRequest.statusCodes = {
  23420. 100: "Continue",
  23421. 101: "Switching Protocols",
  23422. 200: "OK",
  23423. 201: "Created",
  23424. 202: "Accepted",
  23425. 203: "Non-Authoritative Information",
  23426. 204: "No Content",
  23427. 205: "Reset Content",
  23428. 206: "Partial Content",
  23429. 207: "Multi-Status",
  23430. 300: "Multiple Choice",
  23431. 301: "Moved Permanently",
  23432. 302: "Found",
  23433. 303: "See Other",
  23434. 304: "Not Modified",
  23435. 305: "Use Proxy",
  23436. 307: "Temporary Redirect",
  23437. 400: "Bad Request",
  23438. 401: "Unauthorized",
  23439. 402: "Payment Required",
  23440. 403: "Forbidden",
  23441. 404: "Not Found",
  23442. 405: "Method Not Allowed",
  23443. 406: "Not Acceptable",
  23444. 407: "Proxy Authentication Required",
  23445. 408: "Request Timeout",
  23446. 409: "Conflict",
  23447. 410: "Gone",
  23448. 411: "Length Required",
  23449. 412: "Precondition Failed",
  23450. 413: "Request Entity Too Large",
  23451. 414: "Request-URI Too Long",
  23452. 415: "Unsupported Media Type",
  23453. 416: "Requested Range Not Satisfiable",
  23454. 417: "Expectation Failed",
  23455. 422: "Unprocessable Entity",
  23456. 500: "Internal Server Error",
  23457. 501: "Not Implemented",
  23458. 502: "Bad Gateway",
  23459. 503: "Service Unavailable",
  23460. 504: "Gateway Timeout",
  23461. 505: "HTTP Version Not Supported"
  23462. };
  23463. extend(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, {
  23464. async: true,
  23465. open: function open(method, url, async, username, password) {
  23466. this.method = method;
  23467. this.url = url;
  23468. this.async = typeof async === "boolean" ? async : true;
  23469. this.username = username;
  23470. this.password = password;
  23471. clearResponse(this);
  23472. this.requestHeaders = {};
  23473. this.sendFlag = false;
  23474. if (FakeXMLHttpRequest.useFilters === true) {
  23475. var xhrArgs = arguments;
  23476. var defake = FakeXMLHttpRequest.filters.some(function (filter) {
  23477. return filter.apply(this, xhrArgs);
  23478. });
  23479. if (defake) {
  23480. FakeXMLHttpRequest.defake(this, arguments);
  23481. return;
  23482. }
  23483. }
  23484. this.readyStateChange(FakeXMLHttpRequest.OPENED);
  23485. },
  23486. readyStateChange: function readyStateChange(state) {
  23487. this.readyState = state;
  23488. var readyStateChangeEvent = new sinonEvent.Event("readystatechange", false, false, this);
  23489. var event, progress;
  23490. if (typeof this.onreadystatechange === "function") {
  23491. try {
  23492. this.onreadystatechange(readyStateChangeEvent);
  23493. } catch (e) {
  23494. this.logError("Fake XHR onreadystatechange handler", e);
  23495. }
  23496. }
  23497. if (this.readyState === FakeXMLHttpRequest.DONE) {
  23498. if (this.timedOut || this.aborted || this.status === 0) {
  23499. progress = {loaded: 0, total: 0};
  23500. event = (this.timedOut && "timeout") || (this.aborted && "abort") || "error";
  23501. } else {
  23502. progress = {loaded: 100, total: 100};
  23503. event = "load";
  23504. }
  23505. if (supportsProgress) {
  23506. this.upload.dispatchEvent(new sinonEvent.ProgressEvent("progress", progress, this));
  23507. this.upload.dispatchEvent(new sinonEvent.ProgressEvent(event, progress, this));
  23508. this.upload.dispatchEvent(new sinonEvent.ProgressEvent("loadend", progress, this));
  23509. }
  23510. this.dispatchEvent(new sinonEvent.ProgressEvent("progress", progress, this));
  23511. this.dispatchEvent(new sinonEvent.ProgressEvent(event, progress, this));
  23512. this.dispatchEvent(new sinonEvent.ProgressEvent("loadend", progress, this));
  23513. }
  23514. this.dispatchEvent(readyStateChangeEvent);
  23515. },
  23516. // Ref https://xhr.spec.whatwg.org/#the-setrequestheader()-method
  23517. setRequestHeader: function setRequestHeader(header, value) {
  23518. if (typeof value !== "string") {
  23519. throw new TypeError("By RFC7230, section 3.2.4, header values should be strings. Got " + typeof value);
  23520. }
  23521. verifyState(this);
  23522. var checkUnsafeHeaders = true;
  23523. if (typeof this.unsafeHeadersEnabled === "function") {
  23524. checkUnsafeHeaders = this.unsafeHeadersEnabled();
  23525. }
  23526. if (checkUnsafeHeaders && (getHeader(unsafeHeaders, header) !== null || /^(Sec-|Proxy-)/i.test(header))) {
  23527. throw new Error("Refused to set unsafe header \"" + header + "\"");
  23528. }
  23529. value = normalizeHeaderValue(value);
  23530. var existingHeader = getHeader(this.requestHeaders, header);
  23531. if (existingHeader) {
  23532. this.requestHeaders[existingHeader] += ", " + value;
  23533. } else {
  23534. this.requestHeaders[header] = value;
  23535. }
  23536. },
  23537. setStatus: function setStatus(status) {
  23538. var sanitizedStatus = typeof status === "number" ? status : 200;
  23539. verifyRequestOpened(this);
  23540. this.status = sanitizedStatus;
  23541. this.statusText = FakeXMLHttpRequest.statusCodes[sanitizedStatus];
  23542. },
  23543. // Helps testing
  23544. setResponseHeaders: function setResponseHeaders(headers) {
  23545. verifyRequestOpened(this);
  23546. var responseHeaders = this.responseHeaders = {};
  23547. Object.keys(headers).forEach(function (header) {
  23548. responseHeaders[header] = headers[header];
  23549. });
  23550. if (this.async) {
  23551. this.readyStateChange(FakeXMLHttpRequest.HEADERS_RECEIVED);
  23552. } else {
  23553. this.readyState = FakeXMLHttpRequest.HEADERS_RECEIVED;
  23554. }
  23555. },
  23556. // Currently treats ALL data as a DOMString (i.e. no Document)
  23557. send: function send(data) {
  23558. verifyState(this);
  23559. if (!/^(head)$/i.test(this.method)) {
  23560. var contentType = getHeader(this.requestHeaders, "Content-Type");
  23561. if (this.requestHeaders[contentType]) {
  23562. var value = this.requestHeaders[contentType].split(";");
  23563. this.requestHeaders[contentType] = value[0] + ";charset=utf-8";
  23564. } else if (supportsFormData && !(data instanceof FormData)) {
  23565. this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8";
  23566. }
  23567. this.requestBody = data;
  23568. }
  23569. this.errorFlag = false;
  23570. this.sendFlag = this.async;
  23571. clearResponse(this);
  23572. this.readyStateChange(FakeXMLHttpRequest.OPENED);
  23573. if (typeof this.onSend === "function") {
  23574. this.onSend(this);
  23575. }
  23576. // Only listen if setInterval and Date are a stubbed.
  23577. if (sinonXhr.supportsTimeout && typeof setInterval.clock === "object" && typeof Date.clock === "object") {
  23578. var initiatedTime = Date.now();
  23579. var self = this;
  23580. // Listen to any possible tick by fake timers and check to see if timeout has
  23581. // been exceeded. It's important to note that timeout can be changed while a request
  23582. // is in flight, so we must check anytime the end user forces a clock tick to make
  23583. // sure timeout hasn't changed.
  23584. // https://xhr.spec.whatwg.org/#dfnReturnLink-2
  23585. var clearIntervalId = setInterval(function () {
  23586. // Check if the readyState has been reset or is done. If this is the case, there
  23587. // should be no timeout. This will also prevent aborted requests and
  23588. // fakeServerWithClock from triggering unnecessary responses.
  23589. if (self.readyState === FakeXMLHttpRequest.UNSENT
  23590. || self.readyState === FakeXMLHttpRequest.DONE) {
  23591. clearInterval(clearIntervalId);
  23592. } else if (typeof self.timeout === "number" && self.timeout > 0) {
  23593. if (Date.now() >= (initiatedTime + self.timeout)) {
  23594. self.triggerTimeout();
  23595. clearInterval(clearIntervalId);
  23596. }
  23597. }
  23598. }, 1);
  23599. }
  23600. this.dispatchEvent(new sinonEvent.Event("loadstart", false, false, this));
  23601. },
  23602. abort: function abort() {
  23603. this.aborted = true;
  23604. requestErrorSteps(this);
  23605. this.readyState = FakeXMLHttpRequest.UNSENT;
  23606. },
  23607. error: function () {
  23608. clearResponse(this);
  23609. this.errorFlag = true;
  23610. this.requestHeaders = {};
  23611. this.responseHeaders = {};
  23612. this.readyStateChange(FakeXMLHttpRequest.DONE);
  23613. },
  23614. triggerTimeout: function triggerTimeout() {
  23615. if (sinonXhr.supportsTimeout) {
  23616. this.timedOut = true;
  23617. requestErrorSteps(this);
  23618. }
  23619. },
  23620. getResponseHeader: function getResponseHeader(header) {
  23621. if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) {
  23622. return null;
  23623. }
  23624. if (/^Set-Cookie2?$/i.test(header)) {
  23625. return null;
  23626. }
  23627. header = getHeader(this.responseHeaders, header);
  23628. return this.responseHeaders[header] || null;
  23629. },
  23630. getAllResponseHeaders: function getAllResponseHeaders() {
  23631. if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) {
  23632. return "";
  23633. }
  23634. var responseHeaders = this.responseHeaders;
  23635. var headers = Object.keys(responseHeaders)
  23636. .filter(excludeSetCookie2Header)
  23637. .reduce(function (prev, header) {
  23638. var value = responseHeaders[header];
  23639. return prev + (header + ": " + value + "\r\n");
  23640. }, "");
  23641. return headers;
  23642. },
  23643. setResponseBody: function setResponseBody(body) {
  23644. verifyRequestSent(this);
  23645. verifyHeadersReceived(this);
  23646. verifyResponseBodyType(body, this.responseType);
  23647. var contentType = this.overriddenMimeType || this.getResponseHeader("Content-Type");
  23648. var isTextResponse = this.responseType === "" || this.responseType === "text";
  23649. clearResponse(this);
  23650. if (this.async) {
  23651. var chunkSize = this.chunkSize || 10;
  23652. var index = 0;
  23653. do {
  23654. this.readyStateChange(FakeXMLHttpRequest.LOADING);
  23655. if (isTextResponse) {
  23656. this.responseText = this.response += body.substring(index, index + chunkSize);
  23657. }
  23658. index += chunkSize;
  23659. } while (index < body.length);
  23660. }
  23661. this.response = convertResponseBody(this.responseType, contentType, body);
  23662. if (isTextResponse) {
  23663. this.responseText = this.response;
  23664. }
  23665. if (this.responseType === "document") {
  23666. this.responseXML = this.response;
  23667. } else if (this.responseType === "" && isXmlContentType(contentType)) {
  23668. this.responseXML = FakeXMLHttpRequest.parseXML(this.responseText);
  23669. }
  23670. this.readyStateChange(FakeXMLHttpRequest.DONE);
  23671. },
  23672. respond: function respond(status, headers, body) {
  23673. this.setStatus(status);
  23674. this.setResponseHeaders(headers || {});
  23675. this.setResponseBody(body || "");
  23676. },
  23677. uploadProgress: function uploadProgress(progressEventRaw) {
  23678. if (supportsProgress) {
  23679. this.upload.dispatchEvent(new sinonEvent.ProgressEvent("progress", progressEventRaw, this.upload));
  23680. }
  23681. },
  23682. downloadProgress: function downloadProgress(progressEventRaw) {
  23683. if (supportsProgress) {
  23684. this.dispatchEvent(new sinonEvent.ProgressEvent("progress", progressEventRaw, this));
  23685. }
  23686. },
  23687. uploadError: function uploadError(error) {
  23688. if (supportsCustomEvent) {
  23689. this.upload.dispatchEvent(new sinonEvent.CustomEvent("error", {detail: error}));
  23690. }
  23691. },
  23692. overrideMimeType: function overrideMimeType(type) {
  23693. if (this.readyState >= FakeXMLHttpRequest.LOADING) {
  23694. throw new Error("INVALID_STATE_ERR");
  23695. }
  23696. this.overriddenMimeType = type;
  23697. }
  23698. });
  23699. var states = {
  23700. UNSENT: 0,
  23701. OPENED: 1,
  23702. HEADERS_RECEIVED: 2,
  23703. LOADING: 3,
  23704. DONE: 4
  23705. };
  23706. extend(FakeXMLHttpRequest, states);
  23707. extend(FakeXMLHttpRequest.prototype, states);
  23708. function useFakeXMLHttpRequest() {
  23709. FakeXMLHttpRequest.restore = function restore(keepOnCreate) {
  23710. if (sinonXhr.supportsXHR) {
  23711. global.XMLHttpRequest = sinonXhr.GlobalXMLHttpRequest;
  23712. }
  23713. if (sinonXhr.supportsActiveX) {
  23714. global.ActiveXObject = sinonXhr.GlobalActiveXObject;
  23715. }
  23716. delete FakeXMLHttpRequest.restore;
  23717. if (keepOnCreate !== true) {
  23718. delete FakeXMLHttpRequest.onCreate;
  23719. }
  23720. };
  23721. if (sinonXhr.supportsXHR) {
  23722. global.XMLHttpRequest = FakeXMLHttpRequest;
  23723. }
  23724. if (sinonXhr.supportsActiveX) {
  23725. global.ActiveXObject = function ActiveXObject(objId) {
  23726. if (objId === "Microsoft.XMLHTTP" || /^Msxml2\.XMLHTTP/i.test(objId)) {
  23727. return new FakeXMLHttpRequest();
  23728. }
  23729. return new sinonXhr.GlobalActiveXObject(objId);
  23730. };
  23731. }
  23732. return FakeXMLHttpRequest;
  23733. }
  23734. module.exports = {
  23735. xhr: sinonXhr,
  23736. FakeXMLHttpRequest: FakeXMLHttpRequest,
  23737. useFakeXMLHttpRequest: useFakeXMLHttpRequest
  23738. };
  23739. }).call(this,typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  23740. },{"../configure-logger":1,"../event":5,"./blob":10,"@sinonjs/text-encoding":41,"just-extend":45}],12:[function(require,module,exports){
  23741. module.exports = {
  23742. fakeServer: require("./fake-server"),
  23743. fakeServerWithClock: require("./fake-server/fake-server-with-clock"),
  23744. fakeXhr: require("./fake-xhr")
  23745. };
  23746. },{"./fake-server":9,"./fake-server/fake-server-with-clock":7,"./fake-xhr":11}],13:[function(require,module,exports){
  23747. // This is an `every` implementation that works for all iterables
  23748. module.exports = function every(obj, fn) {
  23749. var pass = true;
  23750. try {
  23751. /* eslint-disable-next-line local-rules/no-prototype-methods */
  23752. obj.forEach(function() {
  23753. if (!fn.apply(this, arguments)) {
  23754. // Throwing an error is the only way to break `forEach`
  23755. throw new Error();
  23756. }
  23757. });
  23758. } catch (e) {
  23759. pass = false;
  23760. }
  23761. return pass;
  23762. };
  23763. },{}],14:[function(require,module,exports){
  23764. module.exports = function functionName(func) {
  23765. return (
  23766. func.displayName ||
  23767. func.name ||
  23768. // Use function decomposition as a last resort to get function
  23769. // name. Does not rely on function decomposition to work - if it
  23770. // doesn't debugging will be slightly less informative
  23771. // (i.e. toString will say 'spy' rather than 'myFunc').
  23772. (String(func).match(/function ([^\s\(]+)/) || [])[1]
  23773. );
  23774. };
  23775. },{}],15:[function(require,module,exports){
  23776. module.exports = {
  23777. every: require("./every"),
  23778. functionName: require("./function-name"),
  23779. prototypes: require("./prototypes"),
  23780. typeOf: require("./type-of"),
  23781. valueToString: require("./value-to-string")
  23782. };
  23783. },{"./every":13,"./function-name":14,"./prototypes":19,"./type-of":22,"./value-to-string":23}],16:[function(require,module,exports){
  23784. var copyPrototype = require("./copy-prototype");
  23785. module.exports = copyPrototype(Array.prototype);
  23786. },{"./copy-prototype":17}],17:[function(require,module,exports){
  23787. var call = Function.call;
  23788. module.exports = function copyPrototypeMethods(prototype) {
  23789. /* eslint-disable local-rules/no-prototype-methods */
  23790. return Object.getOwnPropertyNames(prototype).reduce(function(result, name) {
  23791. // ignore size because it throws from Map
  23792. if (
  23793. name !== "size" &&
  23794. name !== "caller" &&
  23795. name !== "callee" &&
  23796. name !== "arguments" &&
  23797. typeof prototype[name] === "function"
  23798. ) {
  23799. result[name] = call.bind(prototype[name]);
  23800. }
  23801. return result;
  23802. }, Object.create(null));
  23803. };
  23804. },{}],18:[function(require,module,exports){
  23805. var copyPrototype = require("./copy-prototype");
  23806. module.exports = copyPrototype(Function.prototype);
  23807. },{"./copy-prototype":17}],19:[function(require,module,exports){
  23808. module.exports = {
  23809. array: require("./array"),
  23810. function: require("./function"),
  23811. object: require("./object"),
  23812. string: require("./string")
  23813. };
  23814. },{"./array":16,"./function":18,"./object":20,"./string":21}],20:[function(require,module,exports){
  23815. var copyPrototype = require("./copy-prototype");
  23816. module.exports = copyPrototype(Object.prototype);
  23817. },{"./copy-prototype":17}],21:[function(require,module,exports){
  23818. var copyPrototype = require("./copy-prototype");
  23819. module.exports = copyPrototype(String.prototype);
  23820. },{"./copy-prototype":17}],22:[function(require,module,exports){
  23821. var type = require("type-detect");
  23822. module.exports = function typeOf(value) {
  23823. return type(value).toLowerCase();
  23824. };
  23825. },{"type-detect":49}],23:[function(require,module,exports){
  23826. function valueToString(value) {
  23827. if (value && value.toString) {
  23828. /* eslint-disable-next-line local-rules/no-prototype-methods */
  23829. return value.toString();
  23830. }
  23831. return String(value);
  23832. }
  23833. module.exports = valueToString;
  23834. },{}],24:[function(require,module,exports){
  23835. (function (global){
  23836. var samsam = require("@sinonjs/samsam");
  23837. var formatio = {
  23838. excludeConstructors: ["Object", /^.$/],
  23839. quoteStrings: true,
  23840. limitChildrenCount: 0
  23841. };
  23842. var specialObjects = [];
  23843. if (typeof global !== "undefined") {
  23844. specialObjects.push({ object: global, value: "[object global]" });
  23845. }
  23846. if (typeof document !== "undefined") {
  23847. specialObjects.push({
  23848. object: document,
  23849. value: "[object HTMLDocument]"
  23850. });
  23851. }
  23852. if (typeof window !== "undefined") {
  23853. specialObjects.push({ object: window, value: "[object Window]" });
  23854. }
  23855. function functionName(func) {
  23856. if (!func) { return ""; }
  23857. if (func.displayName) { return func.displayName; }
  23858. if (func.name) { return func.name; }
  23859. var matches = func.toString().match(/function\s+([^\(]+)/m);
  23860. return (matches && matches[1]) || "";
  23861. }
  23862. function constructorName(f, object) {
  23863. var name = functionName(object && object.constructor);
  23864. var excludes = f.excludeConstructors ||
  23865. formatio.excludeConstructors || [];
  23866. var i, l;
  23867. for (i = 0, l = excludes.length; i < l; ++i) {
  23868. if (typeof excludes[i] === "string" && excludes[i] === name) {
  23869. return "";
  23870. } else if (excludes[i].test && excludes[i].test(name)) {
  23871. return "";
  23872. }
  23873. }
  23874. return name;
  23875. }
  23876. function isCircular(object, objects) {
  23877. if (typeof object !== "object") { return false; }
  23878. var i, l;
  23879. for (i = 0, l = objects.length; i < l; ++i) {
  23880. if (objects[i] === object) { return true; }
  23881. }
  23882. return false;
  23883. }
  23884. function ascii(f, object, processed, indent) {
  23885. if (typeof object === "string") {
  23886. if (object.length === 0) { return "(empty string)"; }
  23887. var qs = f.quoteStrings;
  23888. var quote = typeof qs !== "boolean" || qs;
  23889. return processed || quote ? "\"" + object + "\"" : object;
  23890. }
  23891. if (typeof object === "function" && !(object instanceof RegExp)) {
  23892. return ascii.func(object);
  23893. }
  23894. processed = processed || [];
  23895. if (isCircular(object, processed)) { return "[Circular]"; }
  23896. if (Object.prototype.toString.call(object) === "[object Array]") {
  23897. return ascii.array.call(f, object, processed);
  23898. }
  23899. if (!object) { return String((1 / object) === -Infinity ? "-0" : object); }
  23900. if (samsam.isElement(object)) { return ascii.element(object); }
  23901. if (typeof object.toString === "function" &&
  23902. object.toString !== Object.prototype.toString) {
  23903. return object.toString();
  23904. }
  23905. var i, l;
  23906. for (i = 0, l = specialObjects.length; i < l; i++) {
  23907. if (object === specialObjects[i].object) {
  23908. return specialObjects[i].value;
  23909. }
  23910. }
  23911. if (typeof Set !== "undefined" && object instanceof Set) {
  23912. return ascii.set.call(f, object, processed);
  23913. }
  23914. return ascii.object.call(f, object, processed, indent);
  23915. }
  23916. ascii.func = function (func) {
  23917. return "function " + functionName(func) + "() {}";
  23918. };
  23919. function delimit(str, delimiters) {
  23920. delimiters = delimiters || ["[", "]"];
  23921. return delimiters[0] + str + delimiters[1];
  23922. }
  23923. ascii.array = function (array, processed, delimiters) {
  23924. processed = processed || [];
  23925. processed.push(array);
  23926. var pieces = [];
  23927. var i, l;
  23928. l = (this.limitChildrenCount > 0) ?
  23929. Math.min(this.limitChildrenCount, array.length) : array.length;
  23930. for (i = 0; i < l; ++i) {
  23931. pieces.push(ascii(this, array[i], processed));
  23932. }
  23933. if (l < array.length) {
  23934. pieces.push("[... " + (array.length - l) + " more elements]");
  23935. }
  23936. return delimit(pieces.join(", "), delimiters);
  23937. };
  23938. ascii.set = function (set, processed) {
  23939. return ascii.array.call(this, Array.from(set), processed, ["Set {", "}"]);
  23940. };
  23941. ascii.object = function (object, processed, indent) {
  23942. processed = processed || [];
  23943. processed.push(object);
  23944. indent = indent || 0;
  23945. var pieces = [];
  23946. var properties = Object.keys(object).sort();
  23947. var length = 3;
  23948. var prop, str, obj, i, k, l;
  23949. l = (this.limitChildrenCount > 0) ?
  23950. Math.min(this.limitChildrenCount, properties.length) : properties.length;
  23951. for (i = 0; i < l; ++i) {
  23952. prop = properties[i];
  23953. obj = object[prop];
  23954. if (isCircular(obj, processed)) {
  23955. str = "[Circular]";
  23956. } else {
  23957. str = ascii(this, obj, processed, indent + 2);
  23958. }
  23959. str = (/\s/.test(prop) ? "\"" + prop + "\"" : prop) + ": " + str;
  23960. length += str.length;
  23961. pieces.push(str);
  23962. }
  23963. var cons = constructorName(this, object);
  23964. var prefix = cons ? "[" + cons + "] " : "";
  23965. var is = "";
  23966. for (i = 0, k = indent; i < k; ++i) { is += " "; }
  23967. if (l < properties.length)
  23968. {pieces.push("[... " + (properties.length - l) + " more elements]");}
  23969. if (length + indent > 80) {
  23970. return prefix + "{\n " + is + pieces.join(",\n " + is) + "\n" +
  23971. is + "}";
  23972. }
  23973. return prefix + "{ " + pieces.join(", ") + " }";
  23974. };
  23975. ascii.element = function (element) {
  23976. var tagName = element.tagName.toLowerCase();
  23977. var attrs = element.attributes;
  23978. var pairs = [];
  23979. var attr, attrName, i, l, val;
  23980. for (i = 0, l = attrs.length; i < l; ++i) {
  23981. attr = attrs.item(i);
  23982. attrName = attr.nodeName.toLowerCase().replace("html:", "");
  23983. val = attr.nodeValue;
  23984. if (attrName !== "contenteditable" || val !== "inherit") {
  23985. if (val) { pairs.push(attrName + "=\"" + val + "\""); }
  23986. }
  23987. }
  23988. var formatted = "<" + tagName + (pairs.length > 0 ? " " : "");
  23989. // SVG elements have undefined innerHTML
  23990. var content = element.innerHTML || "";
  23991. if (content.length > 20) {
  23992. content = content.substr(0, 20) + "[...]";
  23993. }
  23994. var res = formatted + pairs.join(" ") + ">" + content +
  23995. "</" + tagName + ">";
  23996. return res.replace(/ contentEditable="inherit"/, "");
  23997. };
  23998. function Formatio(options) {
  23999. // eslint-disable-next-line guard-for-in
  24000. for (var opt in options) {
  24001. this[opt] = options[opt];
  24002. }
  24003. }
  24004. Formatio.prototype = {
  24005. functionName: functionName,
  24006. configure: function (options) {
  24007. return new Formatio(options);
  24008. },
  24009. constructorName: function (object) {
  24010. return constructorName(this, object);
  24011. },
  24012. ascii: function (object, processed, indent) {
  24013. return ascii(this, object, processed, indent);
  24014. }
  24015. };
  24016. module.exports = Formatio.prototype;
  24017. }).call(this,typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  24018. },{"@sinonjs/samsam":40}],25:[function(require,module,exports){
  24019. var getClass = require("./get-class");
  24020. var identical = require("./identical");
  24021. var isArguments = require("./is-arguments");
  24022. var isDate = require("./is-date");
  24023. var isElement = require("./is-element");
  24024. var isNaN = require("./is-nan");
  24025. var isObject = require("./is-object");
  24026. var isSet = require("./is-set");
  24027. var isSubset = require("./is-subset");
  24028. var getClassName = require("./get-class-name");
  24029. var every = Array.prototype.every;
  24030. var getTime = Date.prototype.getTime;
  24031. var hasOwnProperty = Object.prototype.hasOwnProperty;
  24032. var indexOf = Array.prototype.indexOf;
  24033. var keys = Object.keys;
  24034. /**
  24035. * @name samsam.deepEqual
  24036. * @param Object first
  24037. * @param Object second
  24038. *
  24039. * Deep equal comparison. Two values are "deep equal" if:
  24040. *
  24041. * - They are equal, according to samsam.identical
  24042. * - They are both date objects representing the same time
  24043. * - They are both arrays containing elements that are all deepEqual
  24044. * - They are objects with the same set of properties, and each property
  24045. * in ``first`` is deepEqual to the corresponding property in ``second``
  24046. *
  24047. * Supports cyclic objects.
  24048. */
  24049. function deepEqualCyclic(first, second, match) {
  24050. // used for cyclic comparison
  24051. // contain already visited objects
  24052. var objects1 = [];
  24053. var objects2 = [];
  24054. // contain pathes (position in the object structure)
  24055. // of the already visited objects
  24056. // indexes same as in objects arrays
  24057. var paths1 = [];
  24058. var paths2 = [];
  24059. // contains combinations of already compared objects
  24060. // in the manner: { "$1['ref']$2['ref']": true }
  24061. var compared = {};
  24062. // does the recursion for the deep equal check
  24063. return (function deepEqual(obj1, obj2, path1, path2) {
  24064. // If both are matchers they must be the same instance in order to be
  24065. // considered equal If we didn't do that we would end up running one
  24066. // matcher against the other
  24067. if (match && match.isMatcher(obj2)) {
  24068. if (match.isMatcher(obj1)) {
  24069. return obj1 === obj2;
  24070. }
  24071. return obj2.test(obj1);
  24072. }
  24073. var type1 = typeof obj1;
  24074. var type2 = typeof obj2;
  24075. // == null also matches undefined
  24076. if (
  24077. obj1 === obj2 ||
  24078. isNaN(obj1) ||
  24079. isNaN(obj2) ||
  24080. obj1 == null ||
  24081. obj2 == null ||
  24082. type1 !== "object" ||
  24083. type2 !== "object"
  24084. ) {
  24085. return identical(obj1, obj2);
  24086. }
  24087. // Elements are only equal if identical(expected, actual)
  24088. if (isElement(obj1) || isElement(obj2)) {
  24089. return false;
  24090. }
  24091. var isDate1 = isDate(obj1);
  24092. var isDate2 = isDate(obj2);
  24093. if (isDate1 || isDate2) {
  24094. if (
  24095. !isDate1 ||
  24096. !isDate2 ||
  24097. getTime.call(obj1) !== getTime.call(obj2)
  24098. ) {
  24099. return false;
  24100. }
  24101. }
  24102. if (obj1 instanceof RegExp && obj2 instanceof RegExp) {
  24103. if (obj1.toString() !== obj2.toString()) {
  24104. return false;
  24105. }
  24106. }
  24107. if (obj1 instanceof Error && obj2 instanceof Error) {
  24108. if (
  24109. obj1.constructor !== obj2.constructor ||
  24110. obj1.message !== obj2.message ||
  24111. obj1.stack !== obj2.stack
  24112. ) {
  24113. return false;
  24114. }
  24115. }
  24116. var class1 = getClass(obj1);
  24117. var class2 = getClass(obj2);
  24118. var keys1 = keys(obj1);
  24119. var keys2 = keys(obj2);
  24120. var name1 = getClassName(obj1);
  24121. var name2 = getClassName(obj2);
  24122. if (isArguments(obj1) || isArguments(obj2)) {
  24123. if (obj1.length !== obj2.length) {
  24124. return false;
  24125. }
  24126. } else {
  24127. if (
  24128. type1 !== type2 ||
  24129. class1 !== class2 ||
  24130. keys1.length !== keys2.length ||
  24131. (name1 && name2 && name1 !== name2)
  24132. ) {
  24133. return false;
  24134. }
  24135. }
  24136. if (isSet(obj1) || isSet(obj2)) {
  24137. if (!isSet(obj1) || !isSet(obj2) || obj1.size !== obj2.size) {
  24138. return false;
  24139. }
  24140. return isSubset(obj1, obj2, deepEqual);
  24141. }
  24142. return every.call(keys1, function(key) {
  24143. if (!hasOwnProperty.call(obj2, key)) {
  24144. return false;
  24145. }
  24146. var value1 = obj1[key];
  24147. var value2 = obj2[key];
  24148. var isObject1 = isObject(value1);
  24149. var isObject2 = isObject(value2);
  24150. // determines, if the objects were already visited
  24151. // (it's faster to check for isObject first, than to
  24152. // get -1 from getIndex for non objects)
  24153. var index1 = isObject1 ? indexOf.call(objects1, value1) : -1;
  24154. var index2 = isObject2 ? indexOf.call(objects2, value2) : -1;
  24155. // determines the new paths of the objects
  24156. // - for non cyclic objects the current path will be extended
  24157. // by current property name
  24158. // - for cyclic objects the stored path is taken
  24159. var newPath1 =
  24160. index1 !== -1
  24161. ? paths1[index1]
  24162. : path1 + "[" + JSON.stringify(key) + "]";
  24163. var newPath2 =
  24164. index2 !== -1
  24165. ? paths2[index2]
  24166. : path2 + "[" + JSON.stringify(key) + "]";
  24167. var combinedPath = newPath1 + newPath2;
  24168. // stop recursion if current objects are already compared
  24169. if (compared[combinedPath]) {
  24170. return true;
  24171. }
  24172. // remember the current objects and their paths
  24173. if (index1 === -1 && isObject1) {
  24174. objects1.push(value1);
  24175. paths1.push(newPath1);
  24176. }
  24177. if (index2 === -1 && isObject2) {
  24178. objects2.push(value2);
  24179. paths2.push(newPath2);
  24180. }
  24181. // remember that the current objects are already compared
  24182. if (isObject1 && isObject2) {
  24183. compared[combinedPath] = true;
  24184. }
  24185. // End of cyclic logic
  24186. // neither value1 nor value2 is a cycle
  24187. // continue with next level
  24188. return deepEqual(value1, value2, newPath1, newPath2);
  24189. });
  24190. })(first, second, "$1", "$2");
  24191. }
  24192. deepEqualCyclic.use = function(match) {
  24193. return function(a, b) {
  24194. return deepEqualCyclic(a, b, match);
  24195. };
  24196. };
  24197. module.exports = deepEqualCyclic;
  24198. },{"./get-class":27,"./get-class-name":26,"./identical":28,"./is-arguments":29,"./is-date":30,"./is-element":31,"./is-nan":32,"./is-object":34,"./is-set":35,"./is-subset":36}],26:[function(require,module,exports){
  24199. var re = /function (\w+)\s*\(/;
  24200. function getClassName(value) {
  24201. if (value.constructor && "name" in value.constructor) {
  24202. return value.constructor.name;
  24203. }
  24204. if (typeof value.constructor === "function") {
  24205. var match = value.constructor.toString().match(re);
  24206. if (match.length > 1) {
  24207. return match[1];
  24208. }
  24209. }
  24210. return null;
  24211. }
  24212. module.exports = getClassName;
  24213. },{}],27:[function(require,module,exports){
  24214. var o = Object.prototype;
  24215. function getClass(value) {
  24216. // Returns the internal [[Class]] by calling Object.prototype.toString
  24217. // with the provided value as this. Return value is a string, naming the
  24218. // internal class, e.g. "Array"
  24219. return o.toString.call(value).split(/[ \]]/)[1];
  24220. }
  24221. module.exports = getClass;
  24222. },{}],28:[function(require,module,exports){
  24223. var isNaN = require("./is-nan");
  24224. var isNegZero = require("./is-neg-zero");
  24225. /**
  24226. * @name samsam.equal
  24227. * @param Object obj1
  24228. * @param Object obj2
  24229. *
  24230. * Returns ``true`` if two objects are strictly equal. Compared to
  24231. * ``===`` there are two exceptions:
  24232. *
  24233. * - NaN is considered equal to NaN
  24234. * - -0 and +0 are not considered equal
  24235. */
  24236. function identical(obj1, obj2) {
  24237. if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) {
  24238. return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2);
  24239. }
  24240. return false;
  24241. }
  24242. module.exports = identical;
  24243. },{"./is-nan":32,"./is-neg-zero":33}],29:[function(require,module,exports){
  24244. var getClass = require("./get-class");
  24245. /**
  24246. * @name samsam.isArguments
  24247. * @param Object object
  24248. *
  24249. * Returns ``true`` if ``object`` is an ``arguments`` object,
  24250. * ``false`` otherwise.
  24251. */
  24252. function isArguments(object) {
  24253. if (getClass(object) === "Arguments") {
  24254. return true;
  24255. }
  24256. if (
  24257. typeof object !== "object" ||
  24258. typeof object.length !== "number" ||
  24259. getClass(object) === "Array"
  24260. ) {
  24261. return false;
  24262. }
  24263. if (typeof object.callee === "function") {
  24264. return true;
  24265. }
  24266. try {
  24267. object[object.length] = 6;
  24268. delete object[object.length];
  24269. } catch (e) {
  24270. return true;
  24271. }
  24272. return false;
  24273. }
  24274. module.exports = isArguments;
  24275. },{"./get-class":27}],30:[function(require,module,exports){
  24276. function isDate(value) {
  24277. return value instanceof Date;
  24278. }
  24279. module.exports = isDate;
  24280. },{}],31:[function(require,module,exports){
  24281. var div = typeof document !== "undefined" && document.createElement("div");
  24282. /**
  24283. * @name samsam.isElement
  24284. * @param Object object
  24285. *
  24286. * Returns ``true`` if ``object`` is a DOM element node. Unlike
  24287. * Underscore.js/lodash, this function will return ``false`` if ``object``
  24288. * is an *element-like* object, i.e. a regular object with a ``nodeType``
  24289. * property that holds the value ``1``.
  24290. */
  24291. function isElement(object) {
  24292. if (!object || object.nodeType !== 1 || !div) {
  24293. return false;
  24294. }
  24295. try {
  24296. object.appendChild(div);
  24297. object.removeChild(div);
  24298. } catch (e) {
  24299. return false;
  24300. }
  24301. return true;
  24302. }
  24303. module.exports = isElement;
  24304. },{}],32:[function(require,module,exports){
  24305. function isNaN(value) {
  24306. // Unlike global isNaN, this avoids type coercion
  24307. // typeof check avoids IE host object issues, hat tip to
  24308. // lodash
  24309. var val = value; // JsLint thinks value !== value is "weird"
  24310. return typeof value === "number" && value !== val;
  24311. }
  24312. module.exports = isNaN;
  24313. },{}],33:[function(require,module,exports){
  24314. /**
  24315. * @name samsam.isNegZero
  24316. * @param Object value
  24317. *
  24318. * Returns ``true`` if ``value`` is ``-0``.
  24319. */
  24320. function isNegZero(value) {
  24321. return value === 0 && 1 / value === -Infinity;
  24322. }
  24323. module.exports = isNegZero;
  24324. },{}],34:[function(require,module,exports){
  24325. // Returns true when the value is a regular Object and not a specialized Object
  24326. //
  24327. // This helps speeding up deepEqual cyclic checks
  24328. // The premise is that only Objects are stored in the visited array.
  24329. // So if this function returns false, we don't have to do the
  24330. // expensive operation of searching for the value in the the array of already
  24331. // visited objects
  24332. function isObject(value) {
  24333. return (
  24334. typeof value === "object" &&
  24335. value !== null &&
  24336. // none of these are collection objects, so we can return false
  24337. !(value instanceof Boolean) &&
  24338. !(value instanceof Date) &&
  24339. !(value instanceof Error) &&
  24340. !(value instanceof Number) &&
  24341. !(value instanceof RegExp) &&
  24342. !(value instanceof String)
  24343. );
  24344. }
  24345. module.exports = isObject;
  24346. },{}],35:[function(require,module,exports){
  24347. function isSet(val) {
  24348. return (typeof Set !== "undefined" && val instanceof Set) || false;
  24349. }
  24350. module.exports = isSet;
  24351. },{}],36:[function(require,module,exports){
  24352. function isSubset(s1, s2, compare) {
  24353. var allContained = true;
  24354. s1.forEach(function(v1) {
  24355. var includes = false;
  24356. s2.forEach(function(v2) {
  24357. if (compare(v2, v1)) {
  24358. includes = true;
  24359. }
  24360. });
  24361. allContained = allContained && includes;
  24362. });
  24363. return allContained;
  24364. }
  24365. module.exports = isSubset;
  24366. },{}],37:[function(require,module,exports){
  24367. var slice = require("@sinonjs/commons").prototypes.string.slice;
  24368. var typeOf = require("@sinonjs/commons").typeOf;
  24369. module.exports = function iterableToString(obj) {
  24370. var representation = "";
  24371. function stringify(item) {
  24372. return typeof item === "string" ? "'" + item + "'" : String(item);
  24373. }
  24374. function mapToString(map) {
  24375. /* eslint-disable-next-line local-rules/no-prototype-methods */
  24376. map.forEach(function(value, key) {
  24377. representation +=
  24378. "[" + stringify(key) + "," + stringify(value) + "],";
  24379. });
  24380. representation = slice(representation, 0, -1);
  24381. return representation;
  24382. }
  24383. function genericIterableToString(iterable) {
  24384. /* eslint-disable-next-line local-rules/no-prototype-methods */
  24385. iterable.forEach(function(value) {
  24386. representation += stringify(value) + ",";
  24387. });
  24388. representation = slice(representation, 0, -1);
  24389. return representation;
  24390. }
  24391. if (typeOf(obj) === "map") {
  24392. return mapToString(obj);
  24393. }
  24394. return genericIterableToString(obj);
  24395. };
  24396. },{"@sinonjs/commons":15}],38:[function(require,module,exports){
  24397. var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define
  24398. var getClass = require("./get-class");
  24399. var isDate = require("./is-date");
  24400. var isSet = require("./is-set");
  24401. var isSubset = require("./is-subset");
  24402. var createMatcher = require("./matcher");
  24403. function arrayContains(array, subset, compare) {
  24404. if (subset.length === 0) {
  24405. return true;
  24406. }
  24407. var i, l, j, k;
  24408. for (i = 0, l = array.length; i < l; ++i) {
  24409. if (compare(array[i], subset[0])) {
  24410. for (j = 0, k = subset.length; j < k; ++j) {
  24411. if (i + j >= l) {
  24412. return false;
  24413. }
  24414. if (!compare(array[i + j], subset[j])) {
  24415. return false;
  24416. }
  24417. }
  24418. return true;
  24419. }
  24420. }
  24421. return false;
  24422. }
  24423. /**
  24424. * @name samsam.match
  24425. * @param Object object
  24426. * @param Object matcher
  24427. *
  24428. * Compare arbitrary value ``object`` with matcher.
  24429. */
  24430. function match(object, matcher) {
  24431. if (matcher && typeof matcher.test === "function") {
  24432. return matcher.test(object);
  24433. }
  24434. if (typeof matcher === "function") {
  24435. return matcher(object) === true;
  24436. }
  24437. if (typeof matcher === "string") {
  24438. matcher = matcher.toLowerCase();
  24439. var notNull = typeof object === "string" || !!object;
  24440. return (
  24441. notNull &&
  24442. String(object)
  24443. .toLowerCase()
  24444. .indexOf(matcher) >= 0
  24445. );
  24446. }
  24447. if (typeof matcher === "number") {
  24448. return matcher === object;
  24449. }
  24450. if (typeof matcher === "boolean") {
  24451. return matcher === object;
  24452. }
  24453. if (typeof matcher === "undefined") {
  24454. return typeof object === "undefined";
  24455. }
  24456. if (matcher === null) {
  24457. return object === null;
  24458. }
  24459. if (object === null) {
  24460. return false;
  24461. }
  24462. if (isSet(object)) {
  24463. return isSubset(matcher, object, match);
  24464. }
  24465. if (getClass(object) === "Array" && getClass(matcher) === "Array") {
  24466. return arrayContains(object, matcher, match);
  24467. }
  24468. if (isDate(matcher)) {
  24469. return isDate(object) && object.getTime() === matcher.getTime();
  24470. }
  24471. if (matcher && typeof matcher === "object") {
  24472. if (matcher === object) {
  24473. return true;
  24474. }
  24475. if (typeof object !== "object") {
  24476. return false;
  24477. }
  24478. var prop;
  24479. // eslint-disable-next-line guard-for-in
  24480. for (prop in matcher) {
  24481. var value = object[prop];
  24482. if (
  24483. typeof value === "undefined" &&
  24484. typeof object.getAttribute === "function"
  24485. ) {
  24486. value = object.getAttribute(prop);
  24487. }
  24488. if (
  24489. matcher[prop] === null ||
  24490. typeof matcher[prop] === "undefined"
  24491. ) {
  24492. if (value !== matcher[prop]) {
  24493. return false;
  24494. }
  24495. } else if (
  24496. typeof value === "undefined" ||
  24497. !deepEqual(value, matcher[prop])
  24498. ) {
  24499. return false;
  24500. }
  24501. }
  24502. return true;
  24503. }
  24504. throw new Error(
  24505. "Matcher was not a string, a number, a " +
  24506. "function, a boolean or an object"
  24507. );
  24508. }
  24509. Object.keys(createMatcher).forEach(function(key) {
  24510. match[key] = createMatcher[key];
  24511. });
  24512. module.exports = match;
  24513. },{"./deep-equal":25,"./get-class":27,"./is-date":30,"./is-set":35,"./is-subset":36,"./matcher":39}],39:[function(require,module,exports){
  24514. var arrayProto = require("@sinonjs/commons").prototypes.array;
  24515. var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define
  24516. var every = require("@sinonjs/commons").every;
  24517. var functionName = require("@sinonjs/commons").functionName;
  24518. var get = require("lodash.get");
  24519. var iterableToString = require("./iterable-to-string");
  24520. var objectProto = require("@sinonjs/commons").prototypes.object;
  24521. var stringProto = require("@sinonjs/commons").prototypes.string;
  24522. var typeOf = require("@sinonjs/commons").typeOf;
  24523. var valueToString = require("@sinonjs/commons").valueToString;
  24524. var arrayIndexOf = arrayProto.indexOf;
  24525. var arrayEvery = arrayProto.every;
  24526. var join = arrayProto.join;
  24527. var map = arrayProto.map;
  24528. var some = arrayProto.some;
  24529. var hasOwnProperty = objectProto.hasOwnProperty;
  24530. var isPrototypeOf = objectProto.isPrototypeOf;
  24531. var stringIndexOf = stringProto.indexOf;
  24532. function assertType(value, type, name) {
  24533. var actual = typeOf(value);
  24534. if (actual !== type) {
  24535. throw new TypeError(
  24536. "Expected type of " +
  24537. name +
  24538. " to be " +
  24539. type +
  24540. ", but was " +
  24541. actual
  24542. );
  24543. }
  24544. }
  24545. function assertMethodExists(value, method, name, methodPath) {
  24546. if (value[method] == null) {
  24547. throw new TypeError(
  24548. "Expected " + name + " to have method " + methodPath
  24549. );
  24550. }
  24551. }
  24552. var matcher = {
  24553. toString: function() {
  24554. return this.message;
  24555. }
  24556. };
  24557. function isMatcher(object) {
  24558. return isPrototypeOf(matcher, object);
  24559. }
  24560. function matchObject(actual, expectation) {
  24561. if (actual === null || actual === undefined) {
  24562. return false;
  24563. }
  24564. return arrayEvery(Object.keys(expectation), function(key) {
  24565. var exp = expectation[key];
  24566. var act = actual[key];
  24567. if (isMatcher(exp)) {
  24568. if (!exp.test(act)) {
  24569. return false;
  24570. }
  24571. } else if (typeOf(exp) === "object") {
  24572. if (!matchObject(act, exp)) {
  24573. return false;
  24574. }
  24575. } else if (!deepEqual(act, exp)) {
  24576. return false;
  24577. }
  24578. return true;
  24579. });
  24580. }
  24581. var TYPE_MAP = {
  24582. function: function(m, expectation, message) {
  24583. m.test = expectation;
  24584. m.message = message || "match(" + functionName(expectation) + ")";
  24585. },
  24586. number: function(m, expectation) {
  24587. m.test = function(actual) {
  24588. // we need type coercion here
  24589. return expectation == actual; // eslint-disable-line eqeqeq
  24590. };
  24591. },
  24592. object: function(m, expectation) {
  24593. var array = [];
  24594. if (typeof expectation.test === "function") {
  24595. m.test = function(actual) {
  24596. return expectation.test(actual) === true;
  24597. };
  24598. m.message = "match(" + functionName(expectation.test) + ")";
  24599. return m;
  24600. }
  24601. array = map(Object.keys(expectation), function(key) {
  24602. return key + ": " + valueToString(expectation[key]);
  24603. });
  24604. m.test = function(actual) {
  24605. return matchObject(actual, expectation);
  24606. };
  24607. m.message = "match(" + join(array, ", ") + ")";
  24608. return m;
  24609. },
  24610. regexp: function(m, expectation) {
  24611. m.test = function(actual) {
  24612. return typeof actual === "string" && expectation.test(actual);
  24613. };
  24614. },
  24615. string: function(m, expectation) {
  24616. m.test = function(actual) {
  24617. return (
  24618. typeof actual === "string" &&
  24619. stringIndexOf(actual, expectation) !== -1
  24620. );
  24621. };
  24622. m.message = 'match("' + expectation + '")';
  24623. }
  24624. };
  24625. function match(expectation, message) {
  24626. var m = Object.create(matcher);
  24627. var type = typeOf(expectation);
  24628. if (type in TYPE_MAP) {
  24629. TYPE_MAP[type](m, expectation, message);
  24630. } else {
  24631. m.test = function(actual) {
  24632. return deepEqual(actual, expectation);
  24633. };
  24634. }
  24635. if (!m.message) {
  24636. m.message = "match(" + valueToString(expectation) + ")";
  24637. }
  24638. return m;
  24639. }
  24640. matcher.or = function(m2) {
  24641. if (!arguments.length) {
  24642. throw new TypeError("Matcher expected");
  24643. } else if (!isMatcher(m2)) {
  24644. m2 = match(m2);
  24645. }
  24646. var m1 = this;
  24647. var or = Object.create(matcher);
  24648. or.test = function(actual) {
  24649. return m1.test(actual) || m2.test(actual);
  24650. };
  24651. or.message = m1.message + ".or(" + m2.message + ")";
  24652. return or;
  24653. };
  24654. matcher.and = function(m2) {
  24655. if (!arguments.length) {
  24656. throw new TypeError("Matcher expected");
  24657. } else if (!isMatcher(m2)) {
  24658. m2 = match(m2);
  24659. }
  24660. var m1 = this;
  24661. var and = Object.create(matcher);
  24662. and.test = function(actual) {
  24663. return m1.test(actual) && m2.test(actual);
  24664. };
  24665. and.message = m1.message + ".and(" + m2.message + ")";
  24666. return and;
  24667. };
  24668. match.isMatcher = isMatcher;
  24669. match.any = match(function() {
  24670. return true;
  24671. }, "any");
  24672. match.defined = match(function(actual) {
  24673. return actual !== null && actual !== undefined;
  24674. }, "defined");
  24675. match.truthy = match(function(actual) {
  24676. return !!actual;
  24677. }, "truthy");
  24678. match.falsy = match(function(actual) {
  24679. return !actual;
  24680. }, "falsy");
  24681. match.same = function(expectation) {
  24682. return match(function(actual) {
  24683. return expectation === actual;
  24684. }, "same(" + valueToString(expectation) + ")");
  24685. };
  24686. match.in = function(arrayOfExpectations) {
  24687. if (!Array.isArray(arrayOfExpectations)) {
  24688. throw new TypeError("array expected");
  24689. }
  24690. return match(function(actual) {
  24691. return some(arrayOfExpectations, function(expectation) {
  24692. return expectation === actual;
  24693. });
  24694. }, "in(" + valueToString(arrayOfExpectations) + ")");
  24695. };
  24696. match.typeOf = function(type) {
  24697. assertType(type, "string", "type");
  24698. return match(function(actual) {
  24699. return typeOf(actual) === type;
  24700. }, 'typeOf("' + type + '")');
  24701. };
  24702. match.instanceOf = function(type) {
  24703. if (
  24704. typeof Symbol === "undefined" ||
  24705. typeof Symbol.hasInstance === "undefined"
  24706. ) {
  24707. assertType(type, "function", "type");
  24708. } else {
  24709. assertMethodExists(
  24710. type,
  24711. Symbol.hasInstance,
  24712. "type",
  24713. "[Symbol.hasInstance]"
  24714. );
  24715. }
  24716. return match(function(actual) {
  24717. return actual instanceof type;
  24718. }, "instanceOf(" +
  24719. (functionName(type) || Object.prototype.toString.call(type)) +
  24720. ")");
  24721. };
  24722. function createPropertyMatcher(propertyTest, messagePrefix) {
  24723. return function(property, value) {
  24724. assertType(property, "string", "property");
  24725. var onlyProperty = arguments.length === 1;
  24726. var message = messagePrefix + '("' + property + '"';
  24727. if (!onlyProperty) {
  24728. message += ", " + valueToString(value);
  24729. }
  24730. message += ")";
  24731. return match(function(actual) {
  24732. if (
  24733. actual === undefined ||
  24734. actual === null ||
  24735. !propertyTest(actual, property)
  24736. ) {
  24737. return false;
  24738. }
  24739. return onlyProperty || deepEqual(actual[property], value);
  24740. }, message);
  24741. };
  24742. }
  24743. match.has = createPropertyMatcher(function(actual, property) {
  24744. if (typeof actual === "object") {
  24745. return property in actual;
  24746. }
  24747. return actual[property] !== undefined;
  24748. }, "has");
  24749. match.hasOwn = createPropertyMatcher(function(actual, property) {
  24750. return hasOwnProperty(actual, property);
  24751. }, "hasOwn");
  24752. match.hasNested = function(property, value) {
  24753. assertType(property, "string", "property");
  24754. var onlyProperty = arguments.length === 1;
  24755. var message = 'hasNested("' + property + '"';
  24756. if (!onlyProperty) {
  24757. message += ", " + valueToString(value);
  24758. }
  24759. message += ")";
  24760. return match(function(actual) {
  24761. if (
  24762. actual === undefined ||
  24763. actual === null ||
  24764. get(actual, property) === undefined
  24765. ) {
  24766. return false;
  24767. }
  24768. return onlyProperty || deepEqual(get(actual, property), value);
  24769. }, message);
  24770. };
  24771. match.every = function(predicate) {
  24772. if (!isMatcher(predicate)) {
  24773. throw new TypeError("Matcher expected");
  24774. }
  24775. return match(function(actual) {
  24776. if (typeOf(actual) === "object") {
  24777. return every(Object.keys(actual), function(key) {
  24778. return predicate.test(actual[key]);
  24779. });
  24780. }
  24781. return (
  24782. !!actual &&
  24783. typeOf(actual.forEach) === "function" &&
  24784. every(actual, function(element) {
  24785. return predicate.test(element);
  24786. })
  24787. );
  24788. }, "every(" + predicate.message + ")");
  24789. };
  24790. match.some = function(predicate) {
  24791. if (!isMatcher(predicate)) {
  24792. throw new TypeError("Matcher expected");
  24793. }
  24794. return match(function(actual) {
  24795. if (typeOf(actual) === "object") {
  24796. return !every(Object.keys(actual), function(key) {
  24797. return !predicate.test(actual[key]);
  24798. });
  24799. }
  24800. return (
  24801. !!actual &&
  24802. typeOf(actual.forEach) === "function" &&
  24803. !every(actual, function(element) {
  24804. return !predicate.test(element);
  24805. })
  24806. );
  24807. }, "some(" + predicate.message + ")");
  24808. };
  24809. match.array = match.typeOf("array");
  24810. match.array.deepEquals = function(expectation) {
  24811. return match(function(actual) {
  24812. // Comparing lengths is the fastest way to spot a difference before iterating through every item
  24813. var sameLength = actual.length === expectation.length;
  24814. return (
  24815. typeOf(actual) === "array" &&
  24816. sameLength &&
  24817. every(actual, function(element, index) {
  24818. return expectation[index] === element;
  24819. })
  24820. );
  24821. }, "deepEquals([" + iterableToString(expectation) + "])");
  24822. };
  24823. match.array.startsWith = function(expectation) {
  24824. return match(function(actual) {
  24825. return (
  24826. typeOf(actual) === "array" &&
  24827. every(expectation, function(expectedElement, index) {
  24828. return actual[index] === expectedElement;
  24829. })
  24830. );
  24831. }, "startsWith([" + iterableToString(expectation) + "])");
  24832. };
  24833. match.array.endsWith = function(expectation) {
  24834. return match(function(actual) {
  24835. // This indicates the index in which we should start matching
  24836. var offset = actual.length - expectation.length;
  24837. return (
  24838. typeOf(actual) === "array" &&
  24839. every(expectation, function(expectedElement, index) {
  24840. return actual[offset + index] === expectedElement;
  24841. })
  24842. );
  24843. }, "endsWith([" + iterableToString(expectation) + "])");
  24844. };
  24845. match.array.contains = function(expectation) {
  24846. return match(function(actual) {
  24847. return (
  24848. typeOf(actual) === "array" &&
  24849. every(expectation, function(expectedElement) {
  24850. return arrayIndexOf(actual, expectedElement) !== -1;
  24851. })
  24852. );
  24853. }, "contains([" + iterableToString(expectation) + "])");
  24854. };
  24855. match.map = match.typeOf("map");
  24856. match.map.deepEquals = function mapDeepEquals(expectation) {
  24857. return match(function(actual) {
  24858. // Comparing lengths is the fastest way to spot a difference before iterating through every item
  24859. var sameLength = actual.size === expectation.size;
  24860. return (
  24861. typeOf(actual) === "map" &&
  24862. sameLength &&
  24863. every(actual, function(element, key) {
  24864. return expectation.has(key) && expectation.get(key) === element;
  24865. })
  24866. );
  24867. }, "deepEquals(Map[" + iterableToString(expectation) + "])");
  24868. };
  24869. match.map.contains = function mapContains(expectation) {
  24870. return match(function(actual) {
  24871. return (
  24872. typeOf(actual) === "map" &&
  24873. every(expectation, function(element, key) {
  24874. return actual.has(key) && actual.get(key) === element;
  24875. })
  24876. );
  24877. }, "contains(Map[" + iterableToString(expectation) + "])");
  24878. };
  24879. match.set = match.typeOf("set");
  24880. match.set.deepEquals = function setDeepEquals(expectation) {
  24881. return match(function(actual) {
  24882. // Comparing lengths is the fastest way to spot a difference before iterating through every item
  24883. var sameLength = actual.size === expectation.size;
  24884. return (
  24885. typeOf(actual) === "set" &&
  24886. sameLength &&
  24887. every(actual, function(element) {
  24888. return expectation.has(element);
  24889. })
  24890. );
  24891. }, "deepEquals(Set[" + iterableToString(expectation) + "])");
  24892. };
  24893. match.set.contains = function setContains(expectation) {
  24894. return match(function(actual) {
  24895. return (
  24896. typeOf(actual) === "set" &&
  24897. every(expectation, function(element) {
  24898. return actual.has(element);
  24899. })
  24900. );
  24901. }, "contains(Set[" + iterableToString(expectation) + "])");
  24902. };
  24903. match.bool = match.typeOf("boolean");
  24904. match.number = match.typeOf("number");
  24905. match.string = match.typeOf("string");
  24906. match.object = match.typeOf("object");
  24907. match.func = match.typeOf("function");
  24908. match.regexp = match.typeOf("regexp");
  24909. match.date = match.typeOf("date");
  24910. match.symbol = match.typeOf("symbol");
  24911. module.exports = match;
  24912. },{"./deep-equal":25,"./iterable-to-string":37,"@sinonjs/commons":15,"lodash.get":46}],40:[function(require,module,exports){
  24913. var identical = require("./identical");
  24914. var isArguments = require("./is-arguments");
  24915. var isElement = require("./is-element");
  24916. var isNegZero = require("./is-neg-zero");
  24917. var match = require("./match");
  24918. var deepEqualCyclic = require("./deep-equal").use(match);
  24919. var createMatcher = require("./matcher");
  24920. module.exports = {
  24921. createMatcher: createMatcher,
  24922. deepEqual: deepEqualCyclic,
  24923. isArguments: isArguments,
  24924. isElement: isElement,
  24925. isNegZero: isNegZero,
  24926. identical: identical,
  24927. match: match
  24928. };
  24929. },{"./deep-equal":25,"./identical":28,"./is-arguments":29,"./is-element":31,"./is-neg-zero":33,"./match":38,"./matcher":39}],41:[function(require,module,exports){
  24930. // This is free and unencumbered software released into the public domain.
  24931. // See LICENSE.md for more information.
  24932. var encoding = require("./lib/encoding.js");
  24933. module.exports = {
  24934. TextEncoder: encoding.TextEncoder,
  24935. TextDecoder: encoding.TextDecoder,
  24936. };
  24937. },{"./lib/encoding.js":43}],42:[function(require,module,exports){
  24938. (function(global) {
  24939. if (typeof module !== "undefined" && module.exports) {
  24940. module.exports = global;
  24941. }
  24942. global["encoding-indexes"] =
  24943. {
  24944. "big5":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,17392,19506,17923,17830,17784,160359,19831,17843,162993,19682,163013,15253,18230,18244,19527,19520,148159,144919,160594,159371,159954,19543,172881,18255,17882,19589,162924,19719,19108,18081,158499,29221,154196,137827,146950,147297,26189,22267,null,32149,22813,166841,15860,38708,162799,23515,138590,23204,13861,171696,23249,23479,23804,26478,34195,170309,29793,29853,14453,138579,145054,155681,16108,153822,15093,31484,40855,147809,166157,143850,133770,143966,17162,33924,40854,37935,18736,34323,22678,38730,37400,31184,31282,26208,27177,34973,29772,31685,26498,31276,21071,36934,13542,29636,155065,29894,40903,22451,18735,21580,16689,145038,22552,31346,162661,35727,18094,159368,16769,155033,31662,140476,40904,140481,140489,140492,40905,34052,144827,16564,40906,17633,175615,25281,28782,40907,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,12736,12737,12738,12739,12740,131340,12741,131281,131277,12742,12743,131275,139240,12744,131274,12745,12746,12747,12748,131342,12749,12750,256,193,461,192,274,201,282,200,332,211,465,210,null,7870,null,7872,202,257,225,462,224,593,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,null,7871,null,7873,234,609,9178,9179,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,172969,135493,null,25866,null,null,20029,28381,40270,37343,null,null,161589,25745,20250,20264,20392,20822,20852,20892,20964,21153,21160,21307,21326,21457,21464,22242,22768,22788,22791,22834,22836,23398,23454,23455,23706,24198,24635,25993,26622,26628,26725,27982,28860,30005,32420,32428,32442,32455,32463,32479,32518,32567,33402,33487,33647,35270,35774,35810,36710,36711,36718,29713,31996,32205,26950,31433,21031,null,null,null,null,37260,30904,37214,32956,null,36107,33014,133607,null,null,32927,40647,19661,40393,40460,19518,171510,159758,40458,172339,13761,null,28314,33342,29977,null,18705,39532,39567,40857,31111,164972,138698,132560,142054,20004,20097,20096,20103,20159,20203,20279,13388,20413,15944,20483,20616,13437,13459,13477,20870,22789,20955,20988,20997,20105,21113,21136,21287,13767,21417,13649,21424,13651,21442,21539,13677,13682,13953,21651,21667,21684,21689,21712,21743,21784,21795,21800,13720,21823,13733,13759,21975,13765,163204,21797,null,134210,134421,151851,21904,142534,14828,131905,36422,150968,169189,16467,164030,30586,142392,14900,18389,164189,158194,151018,25821,134524,135092,134357,135412,25741,36478,134806,134155,135012,142505,164438,148691,null,134470,170573,164073,18420,151207,142530,39602,14951,169460,16365,13574,152263,169940,161992,142660,40302,38933,null,17369,155813,25780,21731,142668,142282,135287,14843,135279,157402,157462,162208,25834,151634,134211,36456,139681,166732,132913,null,18443,131497,16378,22643,142733,null,148936,132348,155799,134988,134550,21881,16571,17338,null,19124,141926,135325,33194,39157,134556,25465,14846,141173,36288,22177,25724,15939,null,173569,134665,142031,142537,null,135368,145858,14738,14854,164507,13688,155209,139463,22098,134961,142514,169760,13500,27709,151099,null,null,161140,142987,139784,173659,167117,134778,134196,157724,32659,135375,141315,141625,13819,152035,134796,135053,134826,16275,134960,134471,135503,134732,null,134827,134057,134472,135360,135485,16377,140950,25650,135085,144372,161337,142286,134526,134527,142417,142421,14872,134808,135367,134958,173618,158544,167122,167321,167114,38314,21708,33476,21945,null,171715,39974,39606,161630,142830,28992,33133,33004,23580,157042,33076,14231,21343,164029,37302,134906,134671,134775,134907,13789,151019,13833,134358,22191,141237,135369,134672,134776,135288,135496,164359,136277,134777,151120,142756,23124,135197,135198,135413,135414,22428,134673,161428,164557,135093,134779,151934,14083,135094,135552,152280,172733,149978,137274,147831,164476,22681,21096,13850,153405,31666,23400,18432,19244,40743,18919,39967,39821,154484,143677,22011,13810,22153,20008,22786,138177,194680,38737,131206,20059,20155,13630,23587,24401,24516,14586,25164,25909,27514,27701,27706,28780,29227,20012,29357,149737,32594,31035,31993,32595,156266,13505,null,156491,32770,32896,157202,158033,21341,34916,35265,161970,35744,36125,38021,38264,38271,38376,167439,38886,39029,39118,39134,39267,170000,40060,40479,40644,27503,63751,20023,131207,38429,25143,38050,null,20539,28158,171123,40870,15817,34959,147790,28791,23797,19232,152013,13657,154928,24866,166450,36775,37366,29073,26393,29626,144001,172295,15499,137600,19216,30948,29698,20910,165647,16393,27235,172730,16931,34319,133743,31274,170311,166634,38741,28749,21284,139390,37876,30425,166371,40871,30685,20131,20464,20668,20015,20247,40872,21556,32139,22674,22736,138678,24210,24217,24514,141074,25995,144377,26905,27203,146531,27903,null,29184,148741,29580,16091,150035,23317,29881,35715,154788,153237,31379,31724,31939,32364,33528,34199,40873,34960,40874,36537,40875,36815,34143,39392,37409,40876,167353,136255,16497,17058,23066,null,null,null,39016,26475,17014,22333,null,34262,149883,33471,160013,19585,159092,23931,158485,159678,40877,40878,23446,40879,26343,32347,28247,31178,15752,17603,143958,141206,17306,17718,null,23765,146202,35577,23672,15634,144721,23928,40882,29015,17752,147692,138787,19575,14712,13386,131492,158785,35532,20404,131641,22975,33132,38998,170234,24379,134047,null,139713,166253,16642,18107,168057,16135,40883,172469,16632,14294,18167,158790,16764,165554,160767,17773,14548,152730,17761,17691,19849,19579,19830,17898,16328,150287,13921,17630,17597,16877,23870,23880,23894,15868,14351,23972,23993,14368,14392,24130,24253,24357,24451,14600,14612,14655,14669,24791,24893,23781,14729,25015,25017,25039,14776,25132,25232,25317,25368,14840,22193,14851,25570,25595,25607,25690,14923,25792,23829,22049,40863,14999,25990,15037,26111,26195,15090,26258,15138,26390,15170,26532,26624,15192,26698,26756,15218,15217,15227,26889,26947,29276,26980,27039,27013,15292,27094,15325,27237,27252,27249,27266,15340,27289,15346,27307,27317,27348,27382,27521,27585,27626,27765,27818,15563,27906,27910,27942,28033,15599,28068,28081,28181,28184,28201,28294,166336,28347,28386,28378,40831,28392,28393,28452,28468,15686,147265,28545,28606,15722,15733,29111,23705,15754,28716,15761,28752,28756,28783,28799,28809,131877,17345,13809,134872,147159,22462,159443,28990,153568,13902,27042,166889,23412,31305,153825,169177,31333,31357,154028,31419,31408,31426,31427,29137,156813,16842,31450,31453,31466,16879,21682,154625,31499,31573,31529,152334,154878,31650,31599,33692,154548,158847,31696,33825,31634,31672,154912,15789,154725,33938,31738,31750,31797,154817,31812,31875,149634,31910,26237,148856,31945,31943,31974,31860,31987,31989,31950,32359,17693,159300,32093,159446,29837,32137,32171,28981,32179,32210,147543,155689,32228,15635,32245,137209,32229,164717,32285,155937,155994,32366,32402,17195,37996,32295,32576,32577,32583,31030,156368,39393,32663,156497,32675,136801,131176,17756,145254,17667,164666,32762,156809,32773,32776,32797,32808,32815,172167,158915,32827,32828,32865,141076,18825,157222,146915,157416,26405,32935,166472,33031,33050,22704,141046,27775,156824,151480,25831,136330,33304,137310,27219,150117,150165,17530,33321,133901,158290,146814,20473,136445,34018,33634,158474,149927,144688,137075,146936,33450,26907,194964,16859,34123,33488,33562,134678,137140,14017,143741,144730,33403,33506,33560,147083,159139,158469,158615,144846,15807,33565,21996,33669,17675,159141,33708,33729,33747,13438,159444,27223,34138,13462,159298,143087,33880,154596,33905,15827,17636,27303,33866,146613,31064,33960,158614,159351,159299,34014,33807,33681,17568,33939,34020,154769,16960,154816,17731,34100,23282,159385,17703,34163,17686,26559,34326,165413,165435,34241,159880,34306,136578,159949,194994,17770,34344,13896,137378,21495,160666,34430,34673,172280,34798,142375,34737,34778,34831,22113,34412,26710,17935,34885,34886,161248,146873,161252,34910,34972,18011,34996,34997,25537,35013,30583,161551,35207,35210,35238,35241,35239,35260,166437,35303,162084,162493,35484,30611,37374,35472,162393,31465,162618,147343,18195,162616,29052,35596,35615,152624,152933,35647,35660,35661,35497,150138,35728,35739,35503,136927,17941,34895,35995,163156,163215,195028,14117,163155,36054,163224,163261,36114,36099,137488,36059,28764,36113,150729,16080,36215,36265,163842,135188,149898,15228,164284,160012,31463,36525,36534,36547,37588,36633,36653,164709,164882,36773,37635,172703,133712,36787,18730,166366,165181,146875,24312,143970,36857,172052,165564,165121,140069,14720,159447,36919,165180,162494,36961,165228,165387,37032,165651,37060,165606,37038,37117,37223,15088,37289,37316,31916,166195,138889,37390,27807,37441,37474,153017,37561,166598,146587,166668,153051,134449,37676,37739,166625,166891,28815,23235,166626,166629,18789,37444,166892,166969,166911,37747,37979,36540,38277,38310,37926,38304,28662,17081,140922,165592,135804,146990,18911,27676,38523,38550,16748,38563,159445,25050,38582,30965,166624,38589,21452,18849,158904,131700,156688,168111,168165,150225,137493,144138,38705,34370,38710,18959,17725,17797,150249,28789,23361,38683,38748,168405,38743,23370,168427,38751,37925,20688,143543,143548,38793,38815,38833,38846,38848,38866,38880,152684,38894,29724,169011,38911,38901,168989,162170,19153,38964,38963,38987,39014,15118,160117,15697,132656,147804,153350,39114,39095,39112,39111,19199,159015,136915,21936,39137,39142,39148,37752,39225,150057,19314,170071,170245,39413,39436,39483,39440,39512,153381,14020,168113,170965,39648,39650,170757,39668,19470,39700,39725,165376,20532,39732,158120,14531,143485,39760,39744,171326,23109,137315,39822,148043,39938,39935,39948,171624,40404,171959,172434,172459,172257,172323,172511,40318,40323,172340,40462,26760,40388,139611,172435,172576,137531,172595,40249,172217,172724,40592,40597,40606,40610,19764,40618,40623,148324,40641,15200,14821,15645,20274,14270,166955,40706,40712,19350,37924,159138,40727,40726,40761,22175,22154,40773,39352,168075,38898,33919,40802,40809,31452,40846,29206,19390,149877,149947,29047,150008,148296,150097,29598,166874,137466,31135,166270,167478,37737,37875,166468,37612,37761,37835,166252,148665,29207,16107,30578,31299,28880,148595,148472,29054,137199,28835,137406,144793,16071,137349,152623,137208,14114,136955,137273,14049,137076,137425,155467,14115,136896,22363,150053,136190,135848,136134,136374,34051,145062,34051,33877,149908,160101,146993,152924,147195,159826,17652,145134,170397,159526,26617,14131,15381,15847,22636,137506,26640,16471,145215,147681,147595,147727,158753,21707,22174,157361,22162,135135,134056,134669,37830,166675,37788,20216,20779,14361,148534,20156,132197,131967,20299,20362,153169,23144,131499,132043,14745,131850,132116,13365,20265,131776,167603,131701,35546,131596,20120,20685,20749,20386,20227,150030,147082,20290,20526,20588,20609,20428,20453,20568,20732,20825,20827,20829,20830,28278,144789,147001,147135,28018,137348,147081,20904,20931,132576,17629,132259,132242,132241,36218,166556,132878,21081,21156,133235,21217,37742,18042,29068,148364,134176,149932,135396,27089,134685,29817,16094,29849,29716,29782,29592,19342,150204,147597,21456,13700,29199,147657,21940,131909,21709,134086,22301,37469,38644,37734,22493,22413,22399,13886,22731,23193,166470,136954,137071,136976,23084,22968,37519,23166,23247,23058,153926,137715,137313,148117,14069,27909,29763,23073,155267,23169,166871,132115,37856,29836,135939,28933,18802,37896,166395,37821,14240,23582,23710,24158,24136,137622,137596,146158,24269,23375,137475,137476,14081,137376,14045,136958,14035,33066,166471,138682,144498,166312,24332,24334,137511,137131,23147,137019,23364,34324,161277,34912,24702,141408,140843,24539,16056,140719,140734,168072,159603,25024,131134,131142,140827,24985,24984,24693,142491,142599,149204,168269,25713,149093,142186,14889,142114,144464,170218,142968,25399,173147,25782,25393,25553,149987,142695,25252,142497,25659,25963,26994,15348,143502,144045,149897,144043,21773,144096,137433,169023,26318,144009,143795,15072,16784,152964,166690,152975,136956,152923,152613,30958,143619,137258,143924,13412,143887,143746,148169,26254,159012,26219,19347,26160,161904,138731,26211,144082,144097,26142,153714,14545,145466,145340,15257,145314,144382,29904,15254,26511,149034,26806,26654,15300,27326,14435,145365,148615,27187,27218,27337,27397,137490,25873,26776,27212,15319,27258,27479,147392,146586,37792,37618,166890,166603,37513,163870,166364,37991,28069,28427,149996,28007,147327,15759,28164,147516,23101,28170,22599,27940,30786,28987,148250,148086,28913,29264,29319,29332,149391,149285,20857,150180,132587,29818,147192,144991,150090,149783,155617,16134,16049,150239,166947,147253,24743,16115,29900,29756,37767,29751,17567,159210,17745,30083,16227,150745,150790,16216,30037,30323,173510,15129,29800,166604,149931,149902,15099,15821,150094,16127,149957,149747,37370,22322,37698,166627,137316,20703,152097,152039,30584,143922,30478,30479,30587,149143,145281,14942,149744,29752,29851,16063,150202,150215,16584,150166,156078,37639,152961,30750,30861,30856,30930,29648,31065,161601,153315,16654,31131,33942,31141,27181,147194,31290,31220,16750,136934,16690,37429,31217,134476,149900,131737,146874,137070,13719,21867,13680,13994,131540,134157,31458,23129,141045,154287,154268,23053,131675,30960,23082,154566,31486,16889,31837,31853,16913,154547,155324,155302,31949,150009,137136,31886,31868,31918,27314,32220,32263,32211,32590,156257,155996,162632,32151,155266,17002,158581,133398,26582,131150,144847,22468,156690,156664,149858,32733,31527,133164,154345,154947,31500,155150,39398,34373,39523,27164,144447,14818,150007,157101,39455,157088,33920,160039,158929,17642,33079,17410,32966,33033,33090,157620,39107,158274,33378,33381,158289,33875,159143,34320,160283,23174,16767,137280,23339,137377,23268,137432,34464,195004,146831,34861,160802,23042,34926,20293,34951,35007,35046,35173,35149,153219,35156,161669,161668,166901,166873,166812,166393,16045,33955,18165,18127,14322,35389,35356,169032,24397,37419,148100,26068,28969,28868,137285,40301,35999,36073,163292,22938,30659,23024,17262,14036,36394,36519,150537,36656,36682,17140,27736,28603,140065,18587,28537,28299,137178,39913,14005,149807,37051,37015,21873,18694,37307,37892,166475,16482,166652,37927,166941,166971,34021,35371,38297,38311,38295,38294,167220,29765,16066,149759,150082,148458,16103,143909,38543,167655,167526,167525,16076,149997,150136,147438,29714,29803,16124,38721,168112,26695,18973,168083,153567,38749,37736,166281,166950,166703,156606,37562,23313,35689,18748,29689,147995,38811,38769,39224,134950,24001,166853,150194,38943,169178,37622,169431,37349,17600,166736,150119,166756,39132,166469,16128,37418,18725,33812,39227,39245,162566,15869,39323,19311,39338,39516,166757,153800,27279,39457,23294,39471,170225,19344,170312,39356,19389,19351,37757,22642,135938,22562,149944,136424,30788,141087,146872,26821,15741,37976,14631,24912,141185,141675,24839,40015,40019,40059,39989,39952,39807,39887,171565,39839,172533,172286,40225,19630,147716,40472,19632,40204,172468,172269,172275,170287,40357,33981,159250,159711,158594,34300,17715,159140,159364,159216,33824,34286,159232,145367,155748,31202,144796,144960,18733,149982,15714,37851,37566,37704,131775,30905,37495,37965,20452,13376,36964,152925,30781,30804,30902,30795,137047,143817,149825,13978,20338,28634,28633,28702,28702,21524,147893,22459,22771,22410,40214,22487,28980,13487,147884,29163,158784,151447,23336,137141,166473,24844,23246,23051,17084,148616,14124,19323,166396,37819,37816,137430,134941,33906,158912,136211,148218,142374,148417,22932,146871,157505,32168,155995,155812,149945,149899,166394,37605,29666,16105,29876,166755,137375,16097,150195,27352,29683,29691,16086,150078,150164,137177,150118,132007,136228,149989,29768,149782,28837,149878,37508,29670,37727,132350,37681,166606,166422,37766,166887,153045,18741,166530,29035,149827,134399,22180,132634,134123,134328,21762,31172,137210,32254,136898,150096,137298,17710,37889,14090,166592,149933,22960,137407,137347,160900,23201,14050,146779,14000,37471,23161,166529,137314,37748,15565,133812,19094,14730,20724,15721,15692,136092,29045,17147,164376,28175,168164,17643,27991,163407,28775,27823,15574,147437,146989,28162,28428,15727,132085,30033,14012,13512,18048,16090,18545,22980,37486,18750,36673,166940,158656,22546,22472,14038,136274,28926,148322,150129,143331,135856,140221,26809,26983,136088,144613,162804,145119,166531,145366,144378,150687,27162,145069,158903,33854,17631,17614,159014,159057,158850,159710,28439,160009,33597,137018,33773,158848,159827,137179,22921,23170,137139,23137,23153,137477,147964,14125,23023,137020,14023,29070,37776,26266,148133,23150,23083,148115,27179,147193,161590,148571,148170,28957,148057,166369,20400,159016,23746,148686,163405,148413,27148,148054,135940,28838,28979,148457,15781,27871,194597,150095,32357,23019,23855,15859,24412,150109,137183,32164,33830,21637,146170,144128,131604,22398,133333,132633,16357,139166,172726,28675,168283,23920,29583,31955,166489,168992,20424,32743,29389,29456,162548,29496,29497,153334,29505,29512,16041,162584,36972,29173,149746,29665,33270,16074,30476,16081,27810,22269,29721,29726,29727,16098,16112,16116,16122,29907,16142,16211,30018,30061,30066,30093,16252,30152,30172,16320,30285,16343,30324,16348,30330,151388,29064,22051,35200,22633,16413,30531,16441,26465,16453,13787,30616,16490,16495,23646,30654,30667,22770,30744,28857,30748,16552,30777,30791,30801,30822,33864,152885,31027,26627,31026,16643,16649,31121,31129,36795,31238,36796,16743,31377,16818,31420,33401,16836,31439,31451,16847,20001,31586,31596,31611,31762,31771,16992,17018,31867,31900,17036,31928,17044,31981,36755,28864,134351,32207,32212,32208,32253,32686,32692,29343,17303,32800,32805,31545,32814,32817,32852,15820,22452,28832,32951,33001,17389,33036,29482,33038,33042,30048,33044,17409,15161,33110,33113,33114,17427,22586,33148,33156,17445,33171,17453,33189,22511,33217,33252,33364,17551,33446,33398,33482,33496,33535,17584,33623,38505,27018,33797,28917,33892,24803,33928,17668,33982,34017,34040,34064,34104,34130,17723,34159,34160,34272,17783,34418,34450,34482,34543,38469,34699,17926,17943,34990,35071,35108,35143,35217,162151,35369,35384,35476,35508,35921,36052,36082,36124,18328,22623,36291,18413,20206,36410,21976,22356,36465,22005,36528,18487,36558,36578,36580,36589,36594,36791,36801,36810,36812,36915,39364,18605,39136,37395,18718,37416,37464,37483,37553,37550,37567,37603,37611,37619,37620,37629,37699,37764,37805,18757,18769,40639,37911,21249,37917,37933,37950,18794,37972,38009,38189,38306,18855,38388,38451,18917,26528,18980,38720,18997,38834,38850,22100,19172,24808,39097,19225,39153,22596,39182,39193,20916,39196,39223,39234,39261,39266,19312,39365,19357,39484,39695,31363,39785,39809,39901,39921,39924,19565,39968,14191,138178,40265,39994,40702,22096,40339,40381,40384,40444,38134,36790,40571,40620,40625,40637,40646,38108,40674,40689,40696,31432,40772,131220,131767,132000,26906,38083,22956,132311,22592,38081,14265,132565,132629,132726,136890,22359,29043,133826,133837,134079,21610,194619,134091,21662,134139,134203,134227,134245,134268,24807,134285,22138,134325,134365,134381,134511,134578,134600,26965,39983,34725,134660,134670,134871,135056,134957,134771,23584,135100,24075,135260,135247,135286,26398,135291,135304,135318,13895,135359,135379,135471,135483,21348,33965,135907,136053,135990,35713,136567,136729,137155,137159,20088,28859,137261,137578,137773,137797,138282,138352,138412,138952,25283,138965,139029,29080,26709,139333,27113,14024,139900,140247,140282,141098,141425,141647,33533,141671,141715,142037,35237,142056,36768,142094,38840,142143,38983,39613,142412,null,142472,142519,154600,142600,142610,142775,142741,142914,143220,143308,143411,143462,144159,144350,24497,26184,26303,162425,144743,144883,29185,149946,30679,144922,145174,32391,131910,22709,26382,26904,146087,161367,155618,146961,147129,161278,139418,18640,19128,147737,166554,148206,148237,147515,148276,148374,150085,132554,20946,132625,22943,138920,15294,146687,148484,148694,22408,149108,14747,149295,165352,170441,14178,139715,35678,166734,39382,149522,149755,150037,29193,150208,134264,22885,151205,151430,132985,36570,151596,21135,22335,29041,152217,152601,147274,150183,21948,152646,152686,158546,37332,13427,152895,161330,152926,18200,152930,152934,153543,149823,153693,20582,13563,144332,24798,153859,18300,166216,154286,154505,154630,138640,22433,29009,28598,155906,162834,36950,156082,151450,35682,156674,156746,23899,158711,36662,156804,137500,35562,150006,156808,147439,156946,19392,157119,157365,141083,37989,153569,24981,23079,194765,20411,22201,148769,157436,20074,149812,38486,28047,158909,13848,35191,157593,157806,156689,157790,29151,157895,31554,168128,133649,157990,37124,158009,31301,40432,158202,39462,158253,13919,156777,131105,31107,158260,158555,23852,144665,33743,158621,18128,158884,30011,34917,159150,22710,14108,140685,159819,160205,15444,160384,160389,37505,139642,160395,37680,160486,149968,27705,38047,160848,134904,34855,35061,141606,164979,137137,28344,150058,137248,14756,14009,23568,31203,17727,26294,171181,170148,35139,161740,161880,22230,16607,136714,14753,145199,164072,136133,29101,33638,162269,168360,23143,19639,159919,166315,162301,162314,162571,163174,147834,31555,31102,163849,28597,172767,27139,164632,21410,159239,37823,26678,38749,164207,163875,158133,136173,143919,163912,23941,166960,163971,22293,38947,166217,23979,149896,26046,27093,21458,150181,147329,15377,26422,163984,164084,164142,139169,164175,164233,164271,164378,164614,164655,164746,13770,164968,165546,18682,25574,166230,30728,37461,166328,17394,166375,17375,166376,166726,166868,23032,166921,36619,167877,168172,31569,168208,168252,15863,168286,150218,36816,29327,22155,169191,169449,169392,169400,169778,170193,170313,170346,170435,170536,170766,171354,171419,32415,171768,171811,19620,38215,172691,29090,172799,19857,36882,173515,19868,134300,36798,21953,36794,140464,36793,150163,17673,32383,28502,27313,20202,13540,166700,161949,14138,36480,137205,163876,166764,166809,162366,157359,15851,161365,146615,153141,153942,20122,155265,156248,22207,134765,36366,23405,147080,150686,25566,25296,137206,137339,25904,22061,154698,21530,152337,15814,171416,19581,22050,22046,32585,155352,22901,146752,34672,19996,135146,134473,145082,33047,40286,36120,30267,40005,30286,30649,37701,21554,33096,33527,22053,33074,33816,32957,21994,31074,22083,21526,134813,13774,22021,22001,26353,164578,13869,30004,22000,21946,21655,21874,134209,134294,24272,151880,134774,142434,134818,40619,32090,21982,135285,25245,38765,21652,36045,29174,37238,25596,25529,25598,21865,142147,40050,143027,20890,13535,134567,20903,21581,21790,21779,30310,36397,157834,30129,32950,34820,34694,35015,33206,33820,135361,17644,29444,149254,23440,33547,157843,22139,141044,163119,147875,163187,159440,160438,37232,135641,37384,146684,173737,134828,134905,29286,138402,18254,151490,163833,135147,16634,40029,25887,142752,18675,149472,171388,135148,134666,24674,161187,135149,null,155720,135559,29091,32398,40272,19994,19972,13687,23309,27826,21351,13996,14812,21373,13989,149016,22682,150382,33325,21579,22442,154261,133497,null,14930,140389,29556,171692,19721,39917,146686,171824,19547,151465,169374,171998,33884,146870,160434,157619,145184,25390,32037,147191,146988,14890,36872,21196,15988,13946,17897,132238,30272,23280,134838,30842,163630,22695,16575,22140,39819,23924,30292,173108,40581,19681,30201,14331,24857,143578,148466,null,22109,135849,22439,149859,171526,21044,159918,13741,27722,40316,31830,39737,22494,137068,23635,25811,169168,156469,160100,34477,134440,159010,150242,134513,null,20990,139023,23950,38659,138705,40577,36940,31519,39682,23761,31651,25192,25397,39679,31695,39722,31870,39726,31810,31878,39957,31740,39689,40727,39963,149822,40794,21875,23491,20477,40600,20466,21088,15878,21201,22375,20566,22967,24082,38856,40363,36700,21609,38836,39232,38842,21292,24880,26924,21466,39946,40194,19515,38465,27008,20646,30022,137069,39386,21107,null,37209,38529,37212,null,37201,167575,25471,159011,27338,22033,37262,30074,25221,132092,29519,31856,154657,146685,null,149785,30422,39837,20010,134356,33726,34882,null,23626,27072,20717,22394,21023,24053,20174,27697,131570,20281,21660,21722,21146,36226,13822,24332,13811,null,27474,37244,40869,39831,38958,39092,39610,40616,40580,29050,31508,null,27642,34840,32632,null,22048,173642,36471,40787,null,36308,36431,40476,36353,25218,164733,36392,36469,31443,150135,31294,30936,27882,35431,30215,166490,40742,27854,34774,30147,172722,30803,194624,36108,29410,29553,35629,29442,29937,36075,150203,34351,24506,34976,17591,null,137275,159237,null,35454,140571,null,24829,30311,39639,40260,37742,39823,34805,null,34831,36087,29484,38689,39856,13782,29362,19463,31825,39242,155993,24921,19460,40598,24957,null,22367,24943,25254,25145,25294,14940,25058,21418,144373,25444,26626,13778,23895,166850,36826,167481,null,20697,138566,30982,21298,38456,134971,16485,null,30718,null,31938,155418,31962,31277,32870,32867,32077,29957,29938,35220,33306,26380,32866,160902,32859,29936,33027,30500,35209,157644,30035,159441,34729,34766,33224,34700,35401,36013,35651,30507,29944,34010,13877,27058,36262,null,35241,29800,28089,34753,147473,29927,15835,29046,24740,24988,15569,29026,24695,null,32625,166701,29264,24809,19326,21024,15384,146631,155351,161366,152881,137540,135934,170243,159196,159917,23745,156077,166415,145015,131310,157766,151310,17762,23327,156492,40784,40614,156267,12288,65292,12289,12290,65294,8231,65307,65306,65311,65281,65072,8230,8229,65104,65105,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,65088,12300,12301,65089,65090,12302,12303,65091,65092,65113,65114,65115,65116,65117,65118,8216,8217,8220,8221,12317,12318,8245,8242,65283,65286,65290,8251,167,12291,9675,9679,9651,9650,9678,9734,9733,9671,9670,9633,9632,9661,9660,12963,8453,175,65507,65343,717,65097,65098,65101,65102,65099,65100,65119,65120,65121,65291,65293,215,247,177,8730,65308,65310,65309,8806,8807,8800,8734,8786,8801,65122,65123,65124,65125,65126,65374,8745,8746,8869,8736,8735,8895,13266,13265,8747,8750,8757,8756,9792,9794,8853,8857,8593,8595,8592,8594,8598,8599,8601,8600,8741,8739,65295,65340,8725,65128,65284,65509,12306,65504,65505,65285,65312,8451,8457,65129,65130,65131,13269,13212,13213,13214,13262,13217,13198,13199,13252,176,20825,20827,20830,20829,20833,20835,21991,29929,31950,9601,9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,9582,9584,9583,9552,9566,9578,9569,9698,9699,9701,9700,9585,9586,9587,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,12321,12322,12323,12324,12325,12326,12327,12328,12329,21313,21316,21317,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,729,713,714,711,715,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9249,8364,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19968,20057,19969,19971,20035,20061,20102,20108,20154,20799,20837,20843,20960,20992,20993,21147,21269,21313,21340,21448,19977,19979,19976,19978,20011,20024,20961,20037,20040,20063,20062,20110,20129,20800,20995,21242,21315,21449,21475,22303,22763,22805,22823,22899,23376,23377,23379,23544,23567,23586,23608,23665,24029,24037,24049,24050,24051,24062,24178,24318,24331,24339,25165,19985,19984,19981,20013,20016,20025,20043,23609,20104,20113,20117,20114,20116,20130,20161,20160,20163,20166,20167,20173,20170,20171,20164,20803,20801,20839,20845,20846,20844,20887,20982,20998,20999,21000,21243,21246,21247,21270,21305,21320,21319,21317,21342,21380,21451,21450,21453,22764,22825,22827,22826,22829,23380,23569,23588,23610,23663,24052,24187,24319,24340,24341,24515,25096,25142,25163,25166,25903,25991,26007,26020,26041,26085,26352,26376,26408,27424,27490,27513,27595,27604,27611,27663,27700,28779,29226,29238,29243,29255,29273,29275,29356,29579,19993,19990,19989,19988,19992,20027,20045,20047,20046,20197,20184,20180,20181,20182,20183,20195,20196,20185,20190,20805,20804,20873,20874,20908,20985,20986,20984,21002,21152,21151,21253,21254,21271,21277,20191,21322,21321,21345,21344,21359,21358,21435,21487,21476,21491,21484,21486,21481,21480,21500,21496,21493,21483,21478,21482,21490,21489,21488,21477,21485,21499,22235,22234,22806,22830,22833,22900,22902,23381,23427,23612,24040,24039,24038,24066,24067,24179,24188,24321,24344,24343,24517,25098,25171,25172,25170,25169,26021,26086,26414,26412,26410,26411,26413,27491,27597,27665,27664,27704,27713,27712,27710,29359,29572,29577,29916,29926,29976,29983,29992,29993,30000,30001,30002,30003,30091,30333,30382,30399,30446,30683,30690,30707,31034,31166,31348,31435,19998,19999,20050,20051,20073,20121,20132,20134,20133,20223,20233,20249,20234,20245,20237,20240,20241,20239,20210,20214,20219,20208,20211,20221,20225,20235,20809,20807,20806,20808,20840,20849,20877,20912,21015,21009,21010,21006,21014,21155,21256,21281,21280,21360,21361,21513,21519,21516,21514,21520,21505,21515,21508,21521,21517,21512,21507,21518,21510,21522,22240,22238,22237,22323,22320,22312,22317,22316,22319,22313,22809,22810,22839,22840,22916,22904,22915,22909,22905,22914,22913,23383,23384,23431,23432,23429,23433,23546,23574,23673,24030,24070,24182,24180,24335,24347,24537,24534,25102,25100,25101,25104,25187,25179,25176,25910,26089,26088,26092,26093,26354,26355,26377,26429,26420,26417,26421,27425,27492,27515,27670,27741,27735,27737,27743,27744,27728,27733,27745,27739,27725,27726,28784,29279,29277,30334,31481,31859,31992,32566,32650,32701,32769,32771,32780,32786,32819,32895,32905,32907,32908,33251,33258,33267,33276,33292,33307,33311,33390,33394,33406,34411,34880,34892,34915,35199,38433,20018,20136,20301,20303,20295,20311,20318,20276,20315,20309,20272,20304,20305,20285,20282,20280,20291,20308,20284,20294,20323,20316,20320,20271,20302,20278,20313,20317,20296,20314,20812,20811,20813,20853,20918,20919,21029,21028,21033,21034,21032,21163,21161,21162,21164,21283,21363,21365,21533,21549,21534,21566,21542,21582,21543,21574,21571,21555,21576,21570,21531,21545,21578,21561,21563,21560,21550,21557,21558,21536,21564,21568,21553,21547,21535,21548,22250,22256,22244,22251,22346,22353,22336,22349,22343,22350,22334,22352,22351,22331,22767,22846,22941,22930,22952,22942,22947,22937,22934,22925,22948,22931,22922,22949,23389,23388,23386,23387,23436,23435,23439,23596,23616,23617,23615,23614,23696,23697,23700,23692,24043,24076,24207,24199,24202,24311,24324,24351,24420,24418,24439,24441,24536,24524,24535,24525,24561,24555,24568,24554,25106,25105,25220,25239,25238,25216,25206,25225,25197,25226,25212,25214,25209,25203,25234,25199,25240,25198,25237,25235,25233,25222,25913,25915,25912,26097,26356,26463,26446,26447,26448,26449,26460,26454,26462,26441,26438,26464,26451,26455,27493,27599,27714,27742,27801,27777,27784,27785,27781,27803,27754,27770,27792,27760,27788,27752,27798,27794,27773,27779,27762,27774,27764,27782,27766,27789,27796,27800,27778,28790,28796,28797,28792,29282,29281,29280,29380,29378,29590,29996,29995,30007,30008,30338,30447,30691,31169,31168,31167,31350,31995,32597,32918,32915,32925,32920,32923,32922,32946,33391,33426,33419,33421,35211,35282,35328,35895,35910,35925,35997,36196,36208,36275,36523,36554,36763,36784,36802,36806,36805,36804,24033,37009,37026,37034,37030,37027,37193,37318,37324,38450,38446,38449,38442,38444,20006,20054,20083,20107,20123,20126,20139,20140,20335,20381,20365,20339,20351,20332,20379,20363,20358,20355,20336,20341,20360,20329,20347,20374,20350,20367,20369,20346,20820,20818,20821,20841,20855,20854,20856,20925,20989,21051,21048,21047,21050,21040,21038,21046,21057,21182,21179,21330,21332,21331,21329,21350,21367,21368,21369,21462,21460,21463,21619,21621,21654,21624,21653,21632,21627,21623,21636,21650,21638,21628,21648,21617,21622,21644,21658,21602,21608,21643,21629,21646,22266,22403,22391,22378,22377,22369,22374,22372,22396,22812,22857,22855,22856,22852,22868,22974,22971,22996,22969,22958,22993,22982,22992,22989,22987,22995,22986,22959,22963,22994,22981,23391,23396,23395,23447,23450,23448,23452,23449,23451,23578,23624,23621,23622,23735,23713,23736,23721,23723,23729,23731,24088,24090,24086,24085,24091,24081,24184,24218,24215,24220,24213,24214,24310,24358,24359,24361,24448,24449,24447,24444,24541,24544,24573,24565,24575,24591,24596,24623,24629,24598,24618,24597,24609,24615,24617,24619,24603,25110,25109,25151,25150,25152,25215,25289,25292,25284,25279,25282,25273,25298,25307,25259,25299,25300,25291,25288,25256,25277,25276,25296,25305,25287,25293,25269,25306,25265,25304,25302,25303,25286,25260,25294,25918,26023,26044,26106,26132,26131,26124,26118,26114,26126,26112,26127,26133,26122,26119,26381,26379,26477,26507,26517,26481,26524,26483,26487,26503,26525,26519,26479,26480,26495,26505,26494,26512,26485,26522,26515,26492,26474,26482,27427,27494,27495,27519,27667,27675,27875,27880,27891,27825,27852,27877,27827,27837,27838,27836,27874,27819,27861,27859,27832,27844,27833,27841,27822,27863,27845,27889,27839,27835,27873,27867,27850,27820,27887,27868,27862,27872,28821,28814,28818,28810,28825,29228,29229,29240,29256,29287,29289,29376,29390,29401,29399,29392,29609,29608,29599,29611,29605,30013,30109,30105,30106,30340,30402,30450,30452,30693,30717,31038,31040,31041,31177,31176,31354,31353,31482,31998,32596,32652,32651,32773,32954,32933,32930,32945,32929,32939,32937,32948,32938,32943,33253,33278,33293,33459,33437,33433,33453,33469,33439,33465,33457,33452,33445,33455,33464,33443,33456,33470,33463,34382,34417,21021,34920,36555,36814,36820,36817,37045,37048,37041,37046,37319,37329,38263,38272,38428,38464,38463,38459,38468,38466,38585,38632,38738,38750,20127,20141,20142,20449,20405,20399,20415,20448,20433,20431,20445,20419,20406,20440,20447,20426,20439,20398,20432,20420,20418,20442,20430,20446,20407,20823,20882,20881,20896,21070,21059,21066,21069,21068,21067,21063,21191,21193,21187,21185,21261,21335,21371,21402,21467,21676,21696,21672,21710,21705,21688,21670,21683,21703,21698,21693,21674,21697,21700,21704,21679,21675,21681,21691,21673,21671,21695,22271,22402,22411,22432,22435,22434,22478,22446,22419,22869,22865,22863,22862,22864,23004,23000,23039,23011,23016,23043,23013,23018,23002,23014,23041,23035,23401,23459,23462,23460,23458,23461,23553,23630,23631,23629,23627,23769,23762,24055,24093,24101,24095,24189,24224,24230,24314,24328,24365,24421,24456,24453,24458,24459,24455,24460,24457,24594,24605,24608,24613,24590,24616,24653,24688,24680,24674,24646,24643,24684,24683,24682,24676,25153,25308,25366,25353,25340,25325,25345,25326,25341,25351,25329,25335,25327,25324,25342,25332,25361,25346,25919,25925,26027,26045,26082,26149,26157,26144,26151,26159,26143,26152,26161,26148,26359,26623,26579,26609,26580,26576,26604,26550,26543,26613,26601,26607,26564,26577,26548,26586,26597,26552,26575,26590,26611,26544,26585,26594,26589,26578,27498,27523,27526,27573,27602,27607,27679,27849,27915,27954,27946,27969,27941,27916,27953,27934,27927,27963,27965,27966,27958,27931,27893,27961,27943,27960,27945,27950,27957,27918,27947,28843,28858,28851,28844,28847,28845,28856,28846,28836,29232,29298,29295,29300,29417,29408,29409,29623,29642,29627,29618,29645,29632,29619,29978,29997,30031,30028,30030,30027,30123,30116,30117,30114,30115,30328,30342,30343,30344,30408,30406,30403,30405,30465,30457,30456,30473,30475,30462,30460,30471,30684,30722,30740,30732,30733,31046,31049,31048,31047,31161,31162,31185,31186,31179,31359,31361,31487,31485,31869,32002,32005,32000,32009,32007,32004,32006,32568,32654,32703,32772,32784,32781,32785,32822,32982,32997,32986,32963,32964,32972,32993,32987,32974,32990,32996,32989,33268,33314,33511,33539,33541,33507,33499,33510,33540,33509,33538,33545,33490,33495,33521,33537,33500,33492,33489,33502,33491,33503,33519,33542,34384,34425,34427,34426,34893,34923,35201,35284,35336,35330,35331,35998,36000,36212,36211,36276,36557,36556,36848,36838,36834,36842,36837,36845,36843,36836,36840,37066,37070,37057,37059,37195,37194,37325,38274,38480,38475,38476,38477,38754,38761,38859,38893,38899,38913,39080,39131,39135,39318,39321,20056,20147,20492,20493,20515,20463,20518,20517,20472,20521,20502,20486,20540,20511,20506,20498,20497,20474,20480,20500,20520,20465,20513,20491,20505,20504,20467,20462,20525,20522,20478,20523,20489,20860,20900,20901,20898,20941,20940,20934,20939,21078,21084,21076,21083,21085,21290,21375,21407,21405,21471,21736,21776,21761,21815,21756,21733,21746,21766,21754,21780,21737,21741,21729,21769,21742,21738,21734,21799,21767,21757,21775,22275,22276,22466,22484,22475,22467,22537,22799,22871,22872,22874,23057,23064,23068,23071,23067,23059,23020,23072,23075,23081,23077,23052,23049,23403,23640,23472,23475,23478,23476,23470,23477,23481,23480,23556,23633,23637,23632,23789,23805,23803,23786,23784,23792,23798,23809,23796,24046,24109,24107,24235,24237,24231,24369,24466,24465,24464,24665,24675,24677,24656,24661,24685,24681,24687,24708,24735,24730,24717,24724,24716,24709,24726,25159,25331,25352,25343,25422,25406,25391,25429,25410,25414,25423,25417,25402,25424,25405,25386,25387,25384,25421,25420,25928,25929,26009,26049,26053,26178,26185,26191,26179,26194,26188,26181,26177,26360,26388,26389,26391,26657,26680,26696,26694,26707,26681,26690,26708,26665,26803,26647,26700,26705,26685,26612,26704,26688,26684,26691,26666,26693,26643,26648,26689,27530,27529,27575,27683,27687,27688,27686,27684,27888,28010,28053,28040,28039,28006,28024,28023,27993,28051,28012,28041,28014,27994,28020,28009,28044,28042,28025,28037,28005,28052,28874,28888,28900,28889,28872,28879,29241,29305,29436,29433,29437,29432,29431,29574,29677,29705,29678,29664,29674,29662,30036,30045,30044,30042,30041,30142,30149,30151,30130,30131,30141,30140,30137,30146,30136,30347,30384,30410,30413,30414,30505,30495,30496,30504,30697,30768,30759,30776,30749,30772,30775,30757,30765,30752,30751,30770,31061,31056,31072,31071,31062,31070,31069,31063,31066,31204,31203,31207,31199,31206,31209,31192,31364,31368,31449,31494,31505,31881,32033,32023,32011,32010,32032,32034,32020,32016,32021,32026,32028,32013,32025,32027,32570,32607,32660,32709,32705,32774,32792,32789,32793,32791,32829,32831,33009,33026,33008,33029,33005,33012,33030,33016,33011,33032,33021,33034,33020,33007,33261,33260,33280,33296,33322,33323,33320,33324,33467,33579,33618,33620,33610,33592,33616,33609,33589,33588,33615,33586,33593,33590,33559,33600,33585,33576,33603,34388,34442,34474,34451,34468,34473,34444,34467,34460,34928,34935,34945,34946,34941,34937,35352,35344,35342,35340,35349,35338,35351,35347,35350,35343,35345,35912,35962,35961,36001,36002,36215,36524,36562,36564,36559,36785,36865,36870,36855,36864,36858,36852,36867,36861,36869,36856,37013,37089,37085,37090,37202,37197,37196,37336,37341,37335,37340,37337,38275,38498,38499,38497,38491,38493,38500,38488,38494,38587,39138,39340,39592,39640,39717,39730,39740,20094,20602,20605,20572,20551,20547,20556,20570,20553,20581,20598,20558,20565,20597,20596,20599,20559,20495,20591,20589,20828,20885,20976,21098,21103,21202,21209,21208,21205,21264,21263,21273,21311,21312,21310,21443,26364,21830,21866,21862,21828,21854,21857,21827,21834,21809,21846,21839,21845,21807,21860,21816,21806,21852,21804,21859,21811,21825,21847,22280,22283,22281,22495,22533,22538,22534,22496,22500,22522,22530,22581,22519,22521,22816,22882,23094,23105,23113,23142,23146,23104,23100,23138,23130,23110,23114,23408,23495,23493,23492,23490,23487,23494,23561,23560,23559,23648,23644,23645,23815,23814,23822,23835,23830,23842,23825,23849,23828,23833,23844,23847,23831,24034,24120,24118,24115,24119,24247,24248,24246,24245,24254,24373,24375,24407,24428,24425,24427,24471,24473,24478,24472,24481,24480,24476,24703,24739,24713,24736,24744,24779,24756,24806,24765,24773,24763,24757,24796,24764,24792,24789,24774,24799,24760,24794,24775,25114,25115,25160,25504,25511,25458,25494,25506,25509,25463,25447,25496,25514,25457,25513,25481,25475,25499,25451,25512,25476,25480,25497,25505,25516,25490,25487,25472,25467,25449,25448,25466,25949,25942,25937,25945,25943,21855,25935,25944,25941,25940,26012,26011,26028,26063,26059,26060,26062,26205,26202,26212,26216,26214,26206,26361,21207,26395,26753,26799,26786,26771,26805,26751,26742,26801,26791,26775,26800,26755,26820,26797,26758,26757,26772,26781,26792,26783,26785,26754,27442,27578,27627,27628,27691,28046,28092,28147,28121,28082,28129,28108,28132,28155,28154,28165,28103,28107,28079,28113,28078,28126,28153,28088,28151,28149,28101,28114,28186,28085,28122,28139,28120,28138,28145,28142,28136,28102,28100,28074,28140,28095,28134,28921,28937,28938,28925,28911,29245,29309,29313,29468,29467,29462,29459,29465,29575,29701,29706,29699,29702,29694,29709,29920,29942,29943,29980,29986,30053,30054,30050,30064,30095,30164,30165,30133,30154,30157,30350,30420,30418,30427,30519,30526,30524,30518,30520,30522,30827,30787,30798,31077,31080,31085,31227,31378,31381,31520,31528,31515,31532,31526,31513,31518,31534,31890,31895,31893,32070,32067,32113,32046,32057,32060,32064,32048,32051,32068,32047,32066,32050,32049,32573,32670,32666,32716,32718,32722,32796,32842,32838,33071,33046,33059,33067,33065,33072,33060,33282,33333,33335,33334,33337,33678,33694,33688,33656,33698,33686,33725,33707,33682,33674,33683,33673,33696,33655,33659,33660,33670,33703,34389,24426,34503,34496,34486,34500,34485,34502,34507,34481,34479,34505,34899,34974,34952,34987,34962,34966,34957,34955,35219,35215,35370,35357,35363,35365,35377,35373,35359,35355,35362,35913,35930,36009,36012,36011,36008,36010,36007,36199,36198,36286,36282,36571,36575,36889,36877,36890,36887,36899,36895,36893,36880,36885,36894,36896,36879,36898,36886,36891,36884,37096,37101,37117,37207,37326,37365,37350,37347,37351,37357,37353,38281,38506,38517,38515,38520,38512,38516,38518,38519,38508,38592,38634,38633,31456,31455,38914,38915,39770,40165,40565,40575,40613,40635,20642,20621,20613,20633,20625,20608,20630,20632,20634,26368,20977,21106,21108,21109,21097,21214,21213,21211,21338,21413,21883,21888,21927,21884,21898,21917,21912,21890,21916,21930,21908,21895,21899,21891,21939,21934,21919,21822,21938,21914,21947,21932,21937,21886,21897,21931,21913,22285,22575,22570,22580,22564,22576,22577,22561,22557,22560,22777,22778,22880,23159,23194,23167,23186,23195,23207,23411,23409,23506,23500,23507,23504,23562,23563,23601,23884,23888,23860,23879,24061,24133,24125,24128,24131,24190,24266,24257,24258,24260,24380,24429,24489,24490,24488,24785,24801,24754,24758,24800,24860,24867,24826,24853,24816,24827,24820,24936,24817,24846,24822,24841,24832,24850,25119,25161,25507,25484,25551,25536,25577,25545,25542,25549,25554,25571,25552,25569,25558,25581,25582,25462,25588,25578,25563,25682,25562,25593,25950,25958,25954,25955,26001,26000,26031,26222,26224,26228,26230,26223,26257,26234,26238,26231,26366,26367,26399,26397,26874,26837,26848,26840,26839,26885,26847,26869,26862,26855,26873,26834,26866,26851,26827,26829,26893,26898,26894,26825,26842,26990,26875,27454,27450,27453,27544,27542,27580,27631,27694,27695,27692,28207,28216,28244,28193,28210,28263,28234,28192,28197,28195,28187,28251,28248,28196,28246,28270,28205,28198,28271,28212,28237,28218,28204,28227,28189,28222,28363,28297,28185,28238,28259,28228,28274,28265,28255,28953,28954,28966,28976,28961,28982,29038,28956,29260,29316,29312,29494,29477,29492,29481,29754,29738,29747,29730,29733,29749,29750,29748,29743,29723,29734,29736,29989,29990,30059,30058,30178,30171,30179,30169,30168,30174,30176,30331,30332,30358,30355,30388,30428,30543,30701,30813,30828,30831,31245,31240,31243,31237,31232,31384,31383,31382,31461,31459,31561,31574,31558,31568,31570,31572,31565,31563,31567,31569,31903,31909,32094,32080,32104,32085,32043,32110,32114,32097,32102,32098,32112,32115,21892,32724,32725,32779,32850,32901,33109,33108,33099,33105,33102,33081,33094,33086,33100,33107,33140,33298,33308,33769,33795,33784,33805,33760,33733,33803,33729,33775,33777,33780,33879,33802,33776,33804,33740,33789,33778,33738,33848,33806,33796,33756,33799,33748,33759,34395,34527,34521,34541,34516,34523,34532,34512,34526,34903,35009,35010,34993,35203,35222,35387,35424,35413,35422,35388,35393,35412,35419,35408,35398,35380,35386,35382,35414,35937,35970,36015,36028,36019,36029,36033,36027,36032,36020,36023,36022,36031,36024,36234,36229,36225,36302,36317,36299,36314,36305,36300,36315,36294,36603,36600,36604,36764,36910,36917,36913,36920,36914,36918,37122,37109,37129,37118,37219,37221,37327,37396,37397,37411,37385,37406,37389,37392,37383,37393,38292,38287,38283,38289,38291,38290,38286,38538,38542,38539,38525,38533,38534,38541,38514,38532,38593,38597,38596,38598,38599,38639,38642,38860,38917,38918,38920,39143,39146,39151,39145,39154,39149,39342,39341,40643,40653,40657,20098,20653,20661,20658,20659,20677,20670,20652,20663,20667,20655,20679,21119,21111,21117,21215,21222,21220,21218,21219,21295,21983,21992,21971,21990,21966,21980,21959,21969,21987,21988,21999,21978,21985,21957,21958,21989,21961,22290,22291,22622,22609,22616,22615,22618,22612,22635,22604,22637,22602,22626,22610,22603,22887,23233,23241,23244,23230,23229,23228,23219,23234,23218,23913,23919,24140,24185,24265,24264,24338,24409,24492,24494,24858,24847,24904,24863,24819,24859,24825,24833,24840,24910,24908,24900,24909,24894,24884,24871,24845,24838,24887,25121,25122,25619,25662,25630,25642,25645,25661,25644,25615,25628,25620,25613,25654,25622,25623,25606,25964,26015,26032,26263,26249,26247,26248,26262,26244,26264,26253,26371,27028,26989,26970,26999,26976,26964,26997,26928,27010,26954,26984,26987,26974,26963,27001,27014,26973,26979,26971,27463,27506,27584,27583,27603,27645,28322,28335,28371,28342,28354,28304,28317,28359,28357,28325,28312,28348,28346,28331,28369,28310,28316,28356,28372,28330,28327,28340,29006,29017,29033,29028,29001,29031,29020,29036,29030,29004,29029,29022,28998,29032,29014,29242,29266,29495,29509,29503,29502,29807,29786,29781,29791,29790,29761,29759,29785,29787,29788,30070,30072,30208,30192,30209,30194,30193,30202,30207,30196,30195,30430,30431,30555,30571,30566,30558,30563,30585,30570,30572,30556,30565,30568,30562,30702,30862,30896,30871,30872,30860,30857,30844,30865,30867,30847,31098,31103,31105,33836,31165,31260,31258,31264,31252,31263,31262,31391,31392,31607,31680,31584,31598,31591,31921,31923,31925,32147,32121,32145,32129,32143,32091,32622,32617,32618,32626,32681,32680,32676,32854,32856,32902,32900,33137,33136,33144,33125,33134,33139,33131,33145,33146,33126,33285,33351,33922,33911,33853,33841,33909,33894,33899,33865,33900,33883,33852,33845,33889,33891,33897,33901,33862,34398,34396,34399,34553,34579,34568,34567,34560,34558,34555,34562,34563,34566,34570,34905,35039,35028,35033,35036,35032,35037,35041,35018,35029,35026,35228,35299,35435,35442,35443,35430,35433,35440,35463,35452,35427,35488,35441,35461,35437,35426,35438,35436,35449,35451,35390,35432,35938,35978,35977,36042,36039,36040,36036,36018,36035,36034,36037,36321,36319,36328,36335,36339,36346,36330,36324,36326,36530,36611,36617,36606,36618,36767,36786,36939,36938,36947,36930,36948,36924,36949,36944,36935,36943,36942,36941,36945,36926,36929,37138,37143,37228,37226,37225,37321,37431,37463,37432,37437,37440,37438,37467,37451,37476,37457,37428,37449,37453,37445,37433,37439,37466,38296,38552,38548,38549,38605,38603,38601,38602,38647,38651,38649,38646,38742,38772,38774,38928,38929,38931,38922,38930,38924,39164,39156,39165,39166,39347,39345,39348,39649,40169,40578,40718,40723,40736,20711,20718,20709,20694,20717,20698,20693,20687,20689,20721,20686,20713,20834,20979,21123,21122,21297,21421,22014,22016,22043,22039,22013,22036,22022,22025,22029,22030,22007,22038,22047,22024,22032,22006,22296,22294,22645,22654,22659,22675,22666,22649,22661,22653,22781,22821,22818,22820,22890,22889,23265,23270,23273,23255,23254,23256,23267,23413,23518,23527,23521,23525,23526,23528,23522,23524,23519,23565,23650,23940,23943,24155,24163,24149,24151,24148,24275,24278,24330,24390,24432,24505,24903,24895,24907,24951,24930,24931,24927,24922,24920,24949,25130,25735,25688,25684,25764,25720,25695,25722,25681,25703,25652,25709,25723,25970,26017,26071,26070,26274,26280,26269,27036,27048,27029,27073,27054,27091,27083,27035,27063,27067,27051,27060,27088,27085,27053,27084,27046,27075,27043,27465,27468,27699,28467,28436,28414,28435,28404,28457,28478,28448,28460,28431,28418,28450,28415,28399,28422,28465,28472,28466,28451,28437,28459,28463,28552,28458,28396,28417,28402,28364,28407,29076,29081,29053,29066,29060,29074,29246,29330,29334,29508,29520,29796,29795,29802,29808,29805,29956,30097,30247,30221,30219,30217,30227,30433,30435,30596,30589,30591,30561,30913,30879,30887,30899,30889,30883,31118,31119,31117,31278,31281,31402,31401,31469,31471,31649,31637,31627,31605,31639,31645,31636,31631,31672,31623,31620,31929,31933,31934,32187,32176,32156,32189,32190,32160,32202,32180,32178,32177,32186,32162,32191,32181,32184,32173,32210,32199,32172,32624,32736,32737,32735,32862,32858,32903,33104,33152,33167,33160,33162,33151,33154,33255,33274,33287,33300,33310,33355,33993,33983,33990,33988,33945,33950,33970,33948,33995,33976,33984,34003,33936,33980,34001,33994,34623,34588,34619,34594,34597,34612,34584,34645,34615,34601,35059,35074,35060,35065,35064,35069,35048,35098,35055,35494,35468,35486,35491,35469,35489,35475,35492,35498,35493,35496,35480,35473,35482,35495,35946,35981,35980,36051,36049,36050,36203,36249,36245,36348,36628,36626,36629,36627,36771,36960,36952,36956,36963,36953,36958,36962,36957,36955,37145,37144,37150,37237,37240,37239,37236,37496,37504,37509,37528,37526,37499,37523,37532,37544,37500,37521,38305,38312,38313,38307,38309,38308,38553,38556,38555,38604,38610,38656,38780,38789,38902,38935,38936,39087,39089,39171,39173,39180,39177,39361,39599,39600,39654,39745,39746,40180,40182,40179,40636,40763,40778,20740,20736,20731,20725,20729,20738,20744,20745,20741,20956,21127,21128,21129,21133,21130,21232,21426,22062,22075,22073,22066,22079,22068,22057,22099,22094,22103,22132,22070,22063,22064,22656,22687,22686,22707,22684,22702,22697,22694,22893,23305,23291,23307,23285,23308,23304,23534,23532,23529,23531,23652,23653,23965,23956,24162,24159,24161,24290,24282,24287,24285,24291,24288,24392,24433,24503,24501,24950,24935,24942,24925,24917,24962,24956,24944,24939,24958,24999,24976,25003,24974,25004,24986,24996,24980,25006,25134,25705,25711,25721,25758,25778,25736,25744,25776,25765,25747,25749,25769,25746,25774,25773,25771,25754,25772,25753,25762,25779,25973,25975,25976,26286,26283,26292,26289,27171,27167,27112,27137,27166,27161,27133,27169,27155,27146,27123,27138,27141,27117,27153,27472,27470,27556,27589,27590,28479,28540,28548,28497,28518,28500,28550,28525,28507,28536,28526,28558,28538,28528,28516,28567,28504,28373,28527,28512,28511,29087,29100,29105,29096,29270,29339,29518,29527,29801,29835,29827,29822,29824,30079,30240,30249,30239,30244,30246,30241,30242,30362,30394,30436,30606,30599,30604,30609,30603,30923,30917,30906,30922,30910,30933,30908,30928,31295,31292,31296,31293,31287,31291,31407,31406,31661,31665,31684,31668,31686,31687,31681,31648,31692,31946,32224,32244,32239,32251,32216,32236,32221,32232,32227,32218,32222,32233,32158,32217,32242,32249,32629,32631,32687,32745,32806,33179,33180,33181,33184,33178,33176,34071,34109,34074,34030,34092,34093,34067,34065,34083,34081,34068,34028,34085,34047,34054,34690,34676,34678,34656,34662,34680,34664,34649,34647,34636,34643,34907,34909,35088,35079,35090,35091,35093,35082,35516,35538,35527,35524,35477,35531,35576,35506,35529,35522,35519,35504,35542,35533,35510,35513,35547,35916,35918,35948,36064,36062,36070,36068,36076,36077,36066,36067,36060,36074,36065,36205,36255,36259,36395,36368,36381,36386,36367,36393,36383,36385,36382,36538,36637,36635,36639,36649,36646,36650,36636,36638,36645,36969,36974,36968,36973,36983,37168,37165,37159,37169,37255,37257,37259,37251,37573,37563,37559,37610,37548,37604,37569,37555,37564,37586,37575,37616,37554,38317,38321,38660,38662,38663,38665,38752,38797,38795,38799,38945,38955,38940,39091,39178,39187,39186,39192,39389,39376,39391,39387,39377,39381,39378,39385,39607,39662,39663,39719,39749,39748,39799,39791,40198,40201,40195,40617,40638,40654,22696,40786,20754,20760,20756,20752,20757,20864,20906,20957,21137,21139,21235,22105,22123,22137,22121,22116,22136,22122,22120,22117,22129,22127,22124,22114,22134,22721,22718,22727,22725,22894,23325,23348,23416,23536,23566,24394,25010,24977,25001,24970,25037,25014,25022,25034,25032,25136,25797,25793,25803,25787,25788,25818,25796,25799,25794,25805,25791,25810,25812,25790,25972,26310,26313,26297,26308,26311,26296,27197,27192,27194,27225,27243,27224,27193,27204,27234,27233,27211,27207,27189,27231,27208,27481,27511,27653,28610,28593,28577,28611,28580,28609,28583,28595,28608,28601,28598,28582,28576,28596,29118,29129,29136,29138,29128,29141,29113,29134,29145,29148,29123,29124,29544,29852,29859,29848,29855,29854,29922,29964,29965,30260,30264,30266,30439,30437,30624,30622,30623,30629,30952,30938,30956,30951,31142,31309,31310,31302,31308,31307,31418,31705,31761,31689,31716,31707,31713,31721,31718,31957,31958,32266,32273,32264,32283,32291,32286,32285,32265,32272,32633,32690,32752,32753,32750,32808,33203,33193,33192,33275,33288,33368,33369,34122,34137,34120,34152,34153,34115,34121,34157,34154,34142,34691,34719,34718,34722,34701,34913,35114,35122,35109,35115,35105,35242,35238,35558,35578,35563,35569,35584,35548,35559,35566,35582,35585,35586,35575,35565,35571,35574,35580,35947,35949,35987,36084,36420,36401,36404,36418,36409,36405,36667,36655,36664,36659,36776,36774,36981,36980,36984,36978,36988,36986,37172,37266,37664,37686,37624,37683,37679,37666,37628,37675,37636,37658,37648,37670,37665,37653,37678,37657,38331,38567,38568,38570,38613,38670,38673,38678,38669,38675,38671,38747,38748,38758,38808,38960,38968,38971,38967,38957,38969,38948,39184,39208,39198,39195,39201,39194,39405,39394,39409,39608,39612,39675,39661,39720,39825,40213,40227,40230,40232,40210,40219,40664,40660,40845,40860,20778,20767,20769,20786,21237,22158,22144,22160,22149,22151,22159,22741,22739,22737,22734,23344,23338,23332,23418,23607,23656,23996,23994,23997,23992,24171,24396,24509,25033,25026,25031,25062,25035,25138,25140,25806,25802,25816,25824,25840,25830,25836,25841,25826,25837,25986,25987,26329,26326,27264,27284,27268,27298,27292,27355,27299,27262,27287,27280,27296,27484,27566,27610,27656,28632,28657,28639,28640,28635,28644,28651,28655,28544,28652,28641,28649,28629,28654,28656,29159,29151,29166,29158,29157,29165,29164,29172,29152,29237,29254,29552,29554,29865,29872,29862,29864,30278,30274,30284,30442,30643,30634,30640,30636,30631,30637,30703,30967,30970,30964,30959,30977,31143,31146,31319,31423,31751,31757,31742,31735,31756,31712,31968,31964,31966,31970,31967,31961,31965,32302,32318,32326,32311,32306,32323,32299,32317,32305,32325,32321,32308,32313,32328,32309,32319,32303,32580,32755,32764,32881,32882,32880,32879,32883,33222,33219,33210,33218,33216,33215,33213,33225,33214,33256,33289,33393,34218,34180,34174,34204,34193,34196,34223,34203,34183,34216,34186,34407,34752,34769,34739,34770,34758,34731,34747,34746,34760,34763,35131,35126,35140,35128,35133,35244,35598,35607,35609,35611,35594,35616,35613,35588,35600,35905,35903,35955,36090,36093,36092,36088,36091,36264,36425,36427,36424,36426,36676,36670,36674,36677,36671,36991,36989,36996,36993,36994,36992,37177,37283,37278,37276,37709,37762,37672,37749,37706,37733,37707,37656,37758,37740,37723,37744,37722,37716,38346,38347,38348,38344,38342,38577,38584,38614,38684,38686,38816,38867,38982,39094,39221,39425,39423,39854,39851,39850,39853,40251,40255,40587,40655,40670,40668,40669,40667,40766,40779,21474,22165,22190,22745,22744,23352,24413,25059,25139,25844,25842,25854,25862,25850,25851,25847,26039,26332,26406,27315,27308,27331,27323,27320,27330,27310,27311,27487,27512,27567,28681,28683,28670,28678,28666,28689,28687,29179,29180,29182,29176,29559,29557,29863,29887,29973,30294,30296,30290,30653,30655,30651,30652,30990,31150,31329,31330,31328,31428,31429,31787,31783,31786,31774,31779,31777,31975,32340,32341,32350,32346,32353,32338,32345,32584,32761,32763,32887,32886,33229,33231,33290,34255,34217,34253,34256,34249,34224,34234,34233,34214,34799,34796,34802,34784,35206,35250,35316,35624,35641,35628,35627,35920,36101,36441,36451,36454,36452,36447,36437,36544,36681,36685,36999,36995,37000,37291,37292,37328,37780,37770,37782,37794,37811,37806,37804,37808,37784,37786,37783,38356,38358,38352,38357,38626,38620,38617,38619,38622,38692,38819,38822,38829,38905,38989,38991,38988,38990,38995,39098,39230,39231,39229,39214,39333,39438,39617,39683,39686,39759,39758,39757,39882,39881,39933,39880,39872,40273,40285,40288,40672,40725,40748,20787,22181,22750,22751,22754,23541,40848,24300,25074,25079,25078,25077,25856,25871,26336,26333,27365,27357,27354,27347,28699,28703,28712,28698,28701,28693,28696,29190,29197,29272,29346,29560,29562,29885,29898,29923,30087,30086,30303,30305,30663,31001,31153,31339,31337,31806,31807,31800,31805,31799,31808,32363,32365,32377,32361,32362,32645,32371,32694,32697,32696,33240,34281,34269,34282,34261,34276,34277,34295,34811,34821,34829,34809,34814,35168,35167,35158,35166,35649,35676,35672,35657,35674,35662,35663,35654,35673,36104,36106,36476,36466,36487,36470,36460,36474,36468,36692,36686,36781,37002,37003,37297,37294,37857,37841,37855,37827,37832,37852,37853,37846,37858,37837,37848,37860,37847,37864,38364,38580,38627,38698,38695,38753,38876,38907,39006,39000,39003,39100,39237,39241,39446,39449,39693,39912,39911,39894,39899,40329,40289,40306,40298,40300,40594,40599,40595,40628,21240,22184,22199,22198,22196,22204,22756,23360,23363,23421,23542,24009,25080,25082,25880,25876,25881,26342,26407,27372,28734,28720,28722,29200,29563,29903,30306,30309,31014,31018,31020,31019,31431,31478,31820,31811,31821,31983,31984,36782,32381,32380,32386,32588,32768,33242,33382,34299,34297,34321,34298,34310,34315,34311,34314,34836,34837,35172,35258,35320,35696,35692,35686,35695,35679,35691,36111,36109,36489,36481,36485,36482,37300,37323,37912,37891,37885,38369,38704,39108,39250,39249,39336,39467,39472,39479,39477,39955,39949,40569,40629,40680,40751,40799,40803,40801,20791,20792,22209,22208,22210,22804,23660,24013,25084,25086,25885,25884,26005,26345,27387,27396,27386,27570,28748,29211,29351,29910,29908,30313,30675,31824,32399,32396,32700,34327,34349,34330,34851,34850,34849,34847,35178,35180,35261,35700,35703,35709,36115,36490,36493,36491,36703,36783,37306,37934,37939,37941,37946,37944,37938,37931,38370,38712,38713,38706,38911,39015,39013,39255,39493,39491,39488,39486,39631,39764,39761,39981,39973,40367,40372,40386,40376,40605,40687,40729,40796,40806,40807,20796,20795,22216,22218,22217,23423,24020,24018,24398,25087,25892,27402,27489,28753,28760,29568,29924,30090,30318,30316,31155,31840,31839,32894,32893,33247,35186,35183,35324,35712,36118,36119,36497,36499,36705,37192,37956,37969,37970,38717,38718,38851,38849,39019,39253,39509,39501,39634,39706,40009,39985,39998,39995,40403,40407,40756,40812,40810,40852,22220,24022,25088,25891,25899,25898,26348,27408,29914,31434,31844,31843,31845,32403,32406,32404,33250,34360,34367,34865,35722,37008,37007,37987,37984,37988,38760,39023,39260,39514,39515,39511,39635,39636,39633,40020,40023,40022,40421,40607,40692,22225,22761,25900,28766,30321,30322,30679,32592,32648,34870,34873,34914,35731,35730,35734,33399,36123,37312,37994,38722,38728,38724,38854,39024,39519,39714,39768,40031,40441,40442,40572,40573,40711,40823,40818,24307,27414,28771,31852,31854,34875,35264,36513,37313,38002,38000,39025,39262,39638,39715,40652,28772,30682,35738,38007,38857,39522,39525,32412,35740,36522,37317,38013,38014,38012,40055,40056,40695,35924,38015,40474,29224,39530,39729,40475,40478,31858,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,20022,20031,20101,20128,20866,20886,20907,21241,21304,21353,21430,22794,23424,24027,12083,24191,24308,24400,24417,25908,26080,30098,30326,36789,38582,168,710,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,65339,65341,10045,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8679,8632,8633,12751,131276,20058,131210,20994,17553,40880,20872,40881,161287,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65506,65508,65287,65282,12849,8470,8481,12443,12444,11904,11908,11910,11911,11912,11914,11916,11917,11925,11932,11933,11941,11943,11946,11948,11950,11958,11964,11966,11974,11978,11980,11981,11983,11990,11991,11998,12003,null,null,null,643,592,603,596,629,339,248,331,650,618,20034,20060,20981,21274,21378,19975,19980,20039,20109,22231,64012,23662,24435,19983,20871,19982,20014,20115,20162,20169,20168,20888,21244,21356,21433,22304,22787,22828,23568,24063,26081,27571,27596,27668,29247,20017,20028,20200,20188,20201,20193,20189,20186,21004,21276,21324,22306,22307,22807,22831,23425,23428,23570,23611,23668,23667,24068,24192,24194,24521,25097,25168,27669,27702,27715,27711,27707,29358,29360,29578,31160,32906,38430,20238,20248,20268,20213,20244,20209,20224,20215,20232,20253,20226,20229,20258,20243,20228,20212,20242,20913,21011,21001,21008,21158,21282,21279,21325,21386,21511,22241,22239,22318,22314,22324,22844,22912,22908,22917,22907,22910,22903,22911,23382,23573,23589,23676,23674,23675,23678,24031,24181,24196,24322,24346,24436,24533,24532,24527,25180,25182,25188,25185,25190,25186,25177,25184,25178,25189,26095,26094,26430,26425,26424,26427,26426,26431,26428,26419,27672,27718,27730,27740,27727,27722,27732,27723,27724,28785,29278,29364,29365,29582,29994,30335,31349,32593,33400,33404,33408,33405,33407,34381,35198,37017,37015,37016,37019,37012,38434,38436,38432,38435,20310,20283,20322,20297,20307,20324,20286,20327,20306,20319,20289,20312,20269,20275,20287,20321,20879,20921,21020,21022,21025,21165,21166,21257,21347,21362,21390,21391,21552,21559,21546,21588,21573,21529,21532,21541,21528,21565,21583,21569,21544,21540,21575,22254,22247,22245,22337,22341,22348,22345,22347,22354,22790,22848,22950,22936,22944,22935,22926,22946,22928,22927,22951,22945,23438,23442,23592,23594,23693,23695,23688,23691,23689,23698,23690,23686,23699,23701,24032,24074,24078,24203,24201,24204,24200,24205,24325,24349,24440,24438,24530,24529,24528,24557,24552,24558,24563,24545,24548,24547,24570,24559,24567,24571,24576,24564,25146,25219,25228,25230,25231,25236,25223,25201,25211,25210,25200,25217,25224,25207,25213,25202,25204,25911,26096,26100,26099,26098,26101,26437,26439,26457,26453,26444,26440,26461,26445,26458,26443,27600,27673,27674,27768,27751,27755,27780,27787,27791,27761,27759,27753,27802,27757,27783,27797,27804,27750,27763,27749,27771,27790,28788,28794,29283,29375,29373,29379,29382,29377,29370,29381,29589,29591,29587,29588,29586,30010,30009,30100,30101,30337,31037,32820,32917,32921,32912,32914,32924,33424,33423,33413,33422,33425,33427,33418,33411,33412,35960,36809,36799,37023,37025,37029,37022,37031,37024,38448,38440,38447,38445,20019,20376,20348,20357,20349,20352,20359,20342,20340,20361,20356,20343,20300,20375,20330,20378,20345,20353,20344,20368,20380,20372,20382,20370,20354,20373,20331,20334,20894,20924,20926,21045,21042,21043,21062,21041,21180,21258,21259,21308,21394,21396,21639,21631,21633,21649,21634,21640,21611,21626,21630,21605,21612,21620,21606,21645,21615,21601,21600,21656,21603,21607,21604,22263,22265,22383,22386,22381,22379,22385,22384,22390,22400,22389,22395,22387,22388,22370,22376,22397,22796,22853,22965,22970,22991,22990,22962,22988,22977,22966,22972,22979,22998,22961,22973,22976,22984,22964,22983,23394,23397,23443,23445,23620,23623,23726,23716,23712,23733,23727,23720,23724,23711,23715,23725,23714,23722,23719,23709,23717,23734,23728,23718,24087,24084,24089,24360,24354,24355,24356,24404,24450,24446,24445,24542,24549,24621,24614,24601,24626,24587,24628,24586,24599,24627,24602,24606,24620,24610,24589,24592,24622,24595,24593,24588,24585,24604,25108,25149,25261,25268,25297,25278,25258,25270,25290,25262,25267,25263,25275,25257,25264,25272,25917,26024,26043,26121,26108,26116,26130,26120,26107,26115,26123,26125,26117,26109,26129,26128,26358,26378,26501,26476,26510,26514,26486,26491,26520,26502,26500,26484,26509,26508,26490,26527,26513,26521,26499,26493,26497,26488,26489,26516,27429,27520,27518,27614,27677,27795,27884,27883,27886,27865,27830,27860,27821,27879,27831,27856,27842,27834,27843,27846,27885,27890,27858,27869,27828,27786,27805,27776,27870,27840,27952,27853,27847,27824,27897,27855,27881,27857,28820,28824,28805,28819,28806,28804,28817,28822,28802,28826,28803,29290,29398,29387,29400,29385,29404,29394,29396,29402,29388,29393,29604,29601,29613,29606,29602,29600,29612,29597,29917,29928,30015,30016,30014,30092,30104,30383,30451,30449,30448,30453,30712,30716,30713,30715,30714,30711,31042,31039,31173,31352,31355,31483,31861,31997,32821,32911,32942,32931,32952,32949,32941,33312,33440,33472,33451,33434,33432,33435,33461,33447,33454,33468,33438,33466,33460,33448,33441,33449,33474,33444,33475,33462,33442,34416,34415,34413,34414,35926,36818,36811,36819,36813,36822,36821,36823,37042,37044,37039,37043,37040,38457,38461,38460,38458,38467,20429,20421,20435,20402,20425,20427,20417,20436,20444,20441,20411,20403,20443,20423,20438,20410,20416,20409,20460,21060,21065,21184,21186,21309,21372,21399,21398,21401,21400,21690,21665,21677,21669,21711,21699,33549,21687,21678,21718,21686,21701,21702,21664,21616,21692,21666,21694,21618,21726,21680,22453,22430,22431,22436,22412,22423,22429,22427,22420,22424,22415,22425,22437,22426,22421,22772,22797,22867,23009,23006,23022,23040,23025,23005,23034,23037,23036,23030,23012,23026,23031,23003,23017,23027,23029,23008,23038,23028,23021,23464,23628,23760,23768,23756,23767,23755,23771,23774,23770,23753,23751,23754,23766,23763,23764,23759,23752,23750,23758,23775,23800,24057,24097,24098,24099,24096,24100,24240,24228,24226,24219,24227,24229,24327,24366,24406,24454,24631,24633,24660,24690,24670,24645,24659,24647,24649,24667,24652,24640,24642,24671,24612,24644,24664,24678,24686,25154,25155,25295,25357,25355,25333,25358,25347,25323,25337,25359,25356,25336,25334,25344,25363,25364,25338,25365,25339,25328,25921,25923,26026,26047,26166,26145,26162,26165,26140,26150,26146,26163,26155,26170,26141,26164,26169,26158,26383,26384,26561,26610,26568,26554,26588,26555,26616,26584,26560,26551,26565,26603,26596,26591,26549,26573,26547,26615,26614,26606,26595,26562,26553,26574,26599,26608,26546,26620,26566,26605,26572,26542,26598,26587,26618,26569,26570,26563,26602,26571,27432,27522,27524,27574,27606,27608,27616,27680,27681,27944,27956,27949,27935,27964,27967,27922,27914,27866,27955,27908,27929,27962,27930,27921,27904,27933,27970,27905,27928,27959,27907,27919,27968,27911,27936,27948,27912,27938,27913,27920,28855,28831,28862,28849,28848,28833,28852,28853,28841,29249,29257,29258,29292,29296,29299,29294,29386,29412,29416,29419,29407,29418,29414,29411,29573,29644,29634,29640,29637,29625,29622,29621,29620,29675,29631,29639,29630,29635,29638,29624,29643,29932,29934,29998,30023,30024,30119,30122,30329,30404,30472,30467,30468,30469,30474,30455,30459,30458,30695,30696,30726,30737,30738,30725,30736,30735,30734,30729,30723,30739,31050,31052,31051,31045,31044,31189,31181,31183,31190,31182,31360,31358,31441,31488,31489,31866,31864,31865,31871,31872,31873,32003,32008,32001,32600,32657,32653,32702,32775,32782,32783,32788,32823,32984,32967,32992,32977,32968,32962,32976,32965,32995,32985,32988,32970,32981,32969,32975,32983,32998,32973,33279,33313,33428,33497,33534,33529,33543,33512,33536,33493,33594,33515,33494,33524,33516,33505,33522,33525,33548,33531,33526,33520,33514,33508,33504,33530,33523,33517,34423,34420,34428,34419,34881,34894,34919,34922,34921,35283,35332,35335,36210,36835,36833,36846,36832,37105,37053,37055,37077,37061,37054,37063,37067,37064,37332,37331,38484,38479,38481,38483,38474,38478,20510,20485,20487,20499,20514,20528,20507,20469,20468,20531,20535,20524,20470,20471,20503,20508,20512,20519,20533,20527,20529,20494,20826,20884,20883,20938,20932,20933,20936,20942,21089,21082,21074,21086,21087,21077,21090,21197,21262,21406,21798,21730,21783,21778,21735,21747,21732,21786,21759,21764,21768,21739,21777,21765,21745,21770,21755,21751,21752,21728,21774,21763,21771,22273,22274,22476,22578,22485,22482,22458,22470,22461,22460,22456,22454,22463,22471,22480,22457,22465,22798,22858,23065,23062,23085,23086,23061,23055,23063,23050,23070,23091,23404,23463,23469,23468,23555,23638,23636,23788,23807,23790,23793,23799,23808,23801,24105,24104,24232,24238,24234,24236,24371,24368,24423,24669,24666,24679,24641,24738,24712,24704,24722,24705,24733,24707,24725,24731,24727,24711,24732,24718,25113,25158,25330,25360,25430,25388,25412,25413,25398,25411,25572,25401,25419,25418,25404,25385,25409,25396,25432,25428,25433,25389,25415,25395,25434,25425,25400,25431,25408,25416,25930,25926,26054,26051,26052,26050,26186,26207,26183,26193,26386,26387,26655,26650,26697,26674,26675,26683,26699,26703,26646,26673,26652,26677,26667,26669,26671,26702,26692,26676,26653,26642,26644,26662,26664,26670,26701,26682,26661,26656,27436,27439,27437,27441,27444,27501,32898,27528,27622,27620,27624,27619,27618,27623,27685,28026,28003,28004,28022,27917,28001,28050,27992,28002,28013,28015,28049,28045,28143,28031,28038,27998,28007,28000,28055,28016,28028,27999,28034,28056,27951,28008,28043,28030,28032,28036,27926,28035,28027,28029,28021,28048,28892,28883,28881,28893,28875,32569,28898,28887,28882,28894,28896,28884,28877,28869,28870,28871,28890,28878,28897,29250,29304,29303,29302,29440,29434,29428,29438,29430,29427,29435,29441,29651,29657,29669,29654,29628,29671,29667,29673,29660,29650,29659,29652,29661,29658,29655,29656,29672,29918,29919,29940,29941,29985,30043,30047,30128,30145,30139,30148,30144,30143,30134,30138,30346,30409,30493,30491,30480,30483,30482,30499,30481,30485,30489,30490,30498,30503,30755,30764,30754,30773,30767,30760,30766,30763,30753,30761,30771,30762,30769,31060,31067,31055,31068,31059,31058,31057,31211,31212,31200,31214,31213,31210,31196,31198,31197,31366,31369,31365,31371,31372,31370,31367,31448,31504,31492,31507,31493,31503,31496,31498,31502,31497,31506,31876,31889,31882,31884,31880,31885,31877,32030,32029,32017,32014,32024,32022,32019,32031,32018,32015,32012,32604,32609,32606,32608,32605,32603,32662,32658,32707,32706,32704,32790,32830,32825,33018,33010,33017,33013,33025,33019,33024,33281,33327,33317,33587,33581,33604,33561,33617,33573,33622,33599,33601,33574,33564,33570,33602,33614,33563,33578,33544,33596,33613,33558,33572,33568,33591,33583,33577,33607,33605,33612,33619,33566,33580,33611,33575,33608,34387,34386,34466,34472,34454,34445,34449,34462,34439,34455,34438,34443,34458,34437,34469,34457,34465,34471,34453,34456,34446,34461,34448,34452,34883,34884,34925,34933,34934,34930,34944,34929,34943,34927,34947,34942,34932,34940,35346,35911,35927,35963,36004,36003,36214,36216,36277,36279,36278,36561,36563,36862,36853,36866,36863,36859,36868,36860,36854,37078,37088,37081,37082,37091,37087,37093,37080,37083,37079,37084,37092,37200,37198,37199,37333,37346,37338,38492,38495,38588,39139,39647,39727,20095,20592,20586,20577,20574,20576,20563,20555,20573,20594,20552,20557,20545,20571,20554,20578,20501,20549,20575,20585,20587,20579,20580,20550,20544,20590,20595,20567,20561,20944,21099,21101,21100,21102,21206,21203,21293,21404,21877,21878,21820,21837,21840,21812,21802,21841,21858,21814,21813,21808,21842,21829,21772,21810,21861,21838,21817,21832,21805,21819,21824,21835,22282,22279,22523,22548,22498,22518,22492,22516,22528,22509,22525,22536,22520,22539,22515,22479,22535,22510,22499,22514,22501,22508,22497,22542,22524,22544,22503,22529,22540,22513,22505,22512,22541,22532,22876,23136,23128,23125,23143,23134,23096,23093,23149,23120,23135,23141,23148,23123,23140,23127,23107,23133,23122,23108,23131,23112,23182,23102,23117,23097,23116,23152,23145,23111,23121,23126,23106,23132,23410,23406,23489,23488,23641,23838,23819,23837,23834,23840,23820,23848,23821,23846,23845,23823,23856,23826,23843,23839,23854,24126,24116,24241,24244,24249,24242,24243,24374,24376,24475,24470,24479,24714,24720,24710,24766,24752,24762,24787,24788,24783,24804,24793,24797,24776,24753,24795,24759,24778,24767,24771,24781,24768,25394,25445,25482,25474,25469,25533,25502,25517,25501,25495,25515,25486,25455,25479,25488,25454,25519,25461,25500,25453,25518,25468,25508,25403,25503,25464,25477,25473,25489,25485,25456,25939,26061,26213,26209,26203,26201,26204,26210,26392,26745,26759,26768,26780,26733,26734,26798,26795,26966,26735,26787,26796,26793,26741,26740,26802,26767,26743,26770,26748,26731,26738,26794,26752,26737,26750,26779,26774,26763,26784,26761,26788,26744,26747,26769,26764,26762,26749,27446,27443,27447,27448,27537,27535,27533,27534,27532,27690,28096,28075,28084,28083,28276,28076,28137,28130,28087,28150,28116,28160,28104,28128,28127,28118,28094,28133,28124,28125,28123,28148,28106,28093,28141,28144,28090,28117,28098,28111,28105,28112,28146,28115,28157,28119,28109,28131,28091,28922,28941,28919,28951,28916,28940,28912,28932,28915,28944,28924,28927,28934,28947,28928,28920,28918,28939,28930,28942,29310,29307,29308,29311,29469,29463,29447,29457,29464,29450,29448,29439,29455,29470,29576,29686,29688,29685,29700,29697,29693,29703,29696,29690,29692,29695,29708,29707,29684,29704,30052,30051,30158,30162,30159,30155,30156,30161,30160,30351,30345,30419,30521,30511,30509,30513,30514,30516,30515,30525,30501,30523,30517,30792,30802,30793,30797,30794,30796,30758,30789,30800,31076,31079,31081,31082,31075,31083,31073,31163,31226,31224,31222,31223,31375,31380,31376,31541,31559,31540,31525,31536,31522,31524,31539,31512,31530,31517,31537,31531,31533,31535,31538,31544,31514,31523,31892,31896,31894,31907,32053,32061,32056,32054,32058,32069,32044,32041,32065,32071,32062,32063,32074,32059,32040,32611,32661,32668,32669,32667,32714,32715,32717,32720,32721,32711,32719,32713,32799,32798,32795,32839,32835,32840,33048,33061,33049,33051,33069,33055,33068,33054,33057,33045,33063,33053,33058,33297,33336,33331,33338,33332,33330,33396,33680,33699,33704,33677,33658,33651,33700,33652,33679,33665,33685,33689,33653,33684,33705,33661,33667,33676,33693,33691,33706,33675,33662,33701,33711,33672,33687,33712,33663,33702,33671,33710,33654,33690,34393,34390,34495,34487,34498,34497,34501,34490,34480,34504,34489,34483,34488,34508,34484,34491,34492,34499,34493,34494,34898,34953,34965,34984,34978,34986,34970,34961,34977,34975,34968,34983,34969,34971,34967,34980,34988,34956,34963,34958,35202,35286,35289,35285,35376,35367,35372,35358,35897,35899,35932,35933,35965,36005,36221,36219,36217,36284,36290,36281,36287,36289,36568,36574,36573,36572,36567,36576,36577,36900,36875,36881,36892,36876,36897,37103,37098,37104,37108,37106,37107,37076,37099,37100,37097,37206,37208,37210,37203,37205,37356,37364,37361,37363,37368,37348,37369,37354,37355,37367,37352,37358,38266,38278,38280,38524,38509,38507,38513,38511,38591,38762,38916,39141,39319,20635,20629,20628,20638,20619,20643,20611,20620,20622,20637,20584,20636,20626,20610,20615,20831,20948,21266,21265,21412,21415,21905,21928,21925,21933,21879,22085,21922,21907,21896,21903,21941,21889,21923,21906,21924,21885,21900,21926,21887,21909,21921,21902,22284,22569,22583,22553,22558,22567,22563,22568,22517,22600,22565,22556,22555,22579,22591,22582,22574,22585,22584,22573,22572,22587,22881,23215,23188,23199,23162,23202,23198,23160,23206,23164,23205,23212,23189,23214,23095,23172,23178,23191,23171,23179,23209,23163,23165,23180,23196,23183,23187,23197,23530,23501,23499,23508,23505,23498,23502,23564,23600,23863,23875,23915,23873,23883,23871,23861,23889,23886,23893,23859,23866,23890,23869,23857,23897,23874,23865,23881,23864,23868,23858,23862,23872,23877,24132,24129,24408,24486,24485,24491,24777,24761,24780,24802,24782,24772,24852,24818,24842,24854,24837,24821,24851,24824,24828,24830,24769,24835,24856,24861,24848,24831,24836,24843,25162,25492,25521,25520,25550,25573,25576,25583,25539,25757,25587,25546,25568,25590,25557,25586,25589,25697,25567,25534,25565,25564,25540,25560,25555,25538,25543,25548,25547,25544,25584,25559,25561,25906,25959,25962,25956,25948,25960,25957,25996,26013,26014,26030,26064,26066,26236,26220,26235,26240,26225,26233,26218,26226,26369,26892,26835,26884,26844,26922,26860,26858,26865,26895,26838,26871,26859,26852,26870,26899,26896,26867,26849,26887,26828,26888,26992,26804,26897,26863,26822,26900,26872,26832,26877,26876,26856,26891,26890,26903,26830,26824,26845,26846,26854,26868,26833,26886,26836,26857,26901,26917,26823,27449,27451,27455,27452,27540,27543,27545,27541,27581,27632,27634,27635,27696,28156,28230,28231,28191,28233,28296,28220,28221,28229,28258,28203,28223,28225,28253,28275,28188,28211,28235,28224,28241,28219,28163,28206,28254,28264,28252,28257,28209,28200,28256,28273,28267,28217,28194,28208,28243,28261,28199,28280,28260,28279,28245,28281,28242,28262,28213,28214,28250,28960,28958,28975,28923,28974,28977,28963,28965,28962,28978,28959,28968,28986,28955,29259,29274,29320,29321,29318,29317,29323,29458,29451,29488,29474,29489,29491,29479,29490,29485,29478,29475,29493,29452,29742,29740,29744,29739,29718,29722,29729,29741,29745,29732,29731,29725,29737,29728,29746,29947,29999,30063,30060,30183,30170,30177,30182,30173,30175,30180,30167,30357,30354,30426,30534,30535,30532,30541,30533,30538,30542,30539,30540,30686,30700,30816,30820,30821,30812,30829,30833,30826,30830,30832,30825,30824,30814,30818,31092,31091,31090,31088,31234,31242,31235,31244,31236,31385,31462,31460,31562,31547,31556,31560,31564,31566,31552,31576,31557,31906,31902,31912,31905,32088,32111,32099,32083,32086,32103,32106,32079,32109,32092,32107,32082,32084,32105,32081,32095,32078,32574,32575,32613,32614,32674,32672,32673,32727,32849,32847,32848,33022,32980,33091,33098,33106,33103,33095,33085,33101,33082,33254,33262,33271,33272,33273,33284,33340,33341,33343,33397,33595,33743,33785,33827,33728,33768,33810,33767,33764,33788,33782,33808,33734,33736,33771,33763,33727,33793,33757,33765,33752,33791,33761,33739,33742,33750,33781,33737,33801,33807,33758,33809,33798,33730,33779,33749,33786,33735,33745,33770,33811,33731,33772,33774,33732,33787,33751,33762,33819,33755,33790,34520,34530,34534,34515,34531,34522,34538,34525,34539,34524,34540,34537,34519,34536,34513,34888,34902,34901,35002,35031,35001,35000,35008,35006,34998,35004,34999,35005,34994,35073,35017,35221,35224,35223,35293,35290,35291,35406,35405,35385,35417,35392,35415,35416,35396,35397,35410,35400,35409,35402,35404,35407,35935,35969,35968,36026,36030,36016,36025,36021,36228,36224,36233,36312,36307,36301,36295,36310,36316,36303,36309,36313,36296,36311,36293,36591,36599,36602,36601,36582,36590,36581,36597,36583,36584,36598,36587,36593,36588,36596,36585,36909,36916,36911,37126,37164,37124,37119,37116,37128,37113,37115,37121,37120,37127,37125,37123,37217,37220,37215,37218,37216,37377,37386,37413,37379,37402,37414,37391,37388,37376,37394,37375,37373,37382,37380,37415,37378,37404,37412,37401,37399,37381,37398,38267,38285,38284,38288,38535,38526,38536,38537,38531,38528,38594,38600,38595,38641,38640,38764,38768,38766,38919,39081,39147,40166,40697,20099,20100,20150,20669,20671,20678,20654,20676,20682,20660,20680,20674,20656,20673,20666,20657,20683,20681,20662,20664,20951,21114,21112,21115,21116,21955,21979,21964,21968,21963,21962,21981,21952,21972,21956,21993,21951,21970,21901,21967,21973,21986,21974,21960,22002,21965,21977,21954,22292,22611,22632,22628,22607,22605,22601,22639,22613,22606,22621,22617,22629,22619,22589,22627,22641,22780,23239,23236,23243,23226,23224,23217,23221,23216,23231,23240,23227,23238,23223,23232,23242,23220,23222,23245,23225,23184,23510,23512,23513,23583,23603,23921,23907,23882,23909,23922,23916,23902,23912,23911,23906,24048,24143,24142,24138,24141,24139,24261,24268,24262,24267,24263,24384,24495,24493,24823,24905,24906,24875,24901,24886,24882,24878,24902,24879,24911,24873,24896,25120,37224,25123,25125,25124,25541,25585,25579,25616,25618,25609,25632,25636,25651,25667,25631,25621,25624,25657,25655,25634,25635,25612,25638,25648,25640,25665,25653,25647,25610,25626,25664,25637,25639,25611,25575,25627,25646,25633,25614,25967,26002,26067,26246,26252,26261,26256,26251,26250,26265,26260,26232,26400,26982,26975,26936,26958,26978,26993,26943,26949,26986,26937,26946,26967,26969,27002,26952,26953,26933,26988,26931,26941,26981,26864,27000,26932,26985,26944,26991,26948,26998,26968,26945,26996,26956,26939,26955,26935,26972,26959,26961,26930,26962,26927,27003,26940,27462,27461,27459,27458,27464,27457,27547,64013,27643,27644,27641,27639,27640,28315,28374,28360,28303,28352,28319,28307,28308,28320,28337,28345,28358,28370,28349,28353,28318,28361,28343,28336,28365,28326,28367,28338,28350,28355,28380,28376,28313,28306,28302,28301,28324,28321,28351,28339,28368,28362,28311,28334,28323,28999,29012,29010,29027,29024,28993,29021,29026,29042,29048,29034,29025,28994,29016,28995,29003,29040,29023,29008,29011,28996,29005,29018,29263,29325,29324,29329,29328,29326,29500,29506,29499,29498,29504,29514,29513,29764,29770,29771,29778,29777,29783,29760,29775,29776,29774,29762,29766,29773,29780,29921,29951,29950,29949,29981,30073,30071,27011,30191,30223,30211,30199,30206,30204,30201,30200,30224,30203,30198,30189,30197,30205,30361,30389,30429,30549,30559,30560,30546,30550,30554,30569,30567,30548,30553,30573,30688,30855,30874,30868,30863,30852,30869,30853,30854,30881,30851,30841,30873,30848,30870,30843,31100,31106,31101,31097,31249,31256,31257,31250,31255,31253,31266,31251,31259,31248,31395,31394,31390,31467,31590,31588,31597,31604,31593,31602,31589,31603,31601,31600,31585,31608,31606,31587,31922,31924,31919,32136,32134,32128,32141,32127,32133,32122,32142,32123,32131,32124,32140,32148,32132,32125,32146,32621,32619,32615,32616,32620,32678,32677,32679,32731,32732,32801,33124,33120,33143,33116,33129,33115,33122,33138,26401,33118,33142,33127,33135,33092,33121,33309,33353,33348,33344,33346,33349,34033,33855,33878,33910,33913,33935,33933,33893,33873,33856,33926,33895,33840,33869,33917,33882,33881,33908,33907,33885,34055,33886,33847,33850,33844,33914,33859,33912,33842,33861,33833,33753,33867,33839,33858,33837,33887,33904,33849,33870,33868,33874,33903,33989,33934,33851,33863,33846,33843,33896,33918,33860,33835,33888,33876,33902,33872,34571,34564,34551,34572,34554,34518,34549,34637,34552,34574,34569,34561,34550,34573,34565,35030,35019,35021,35022,35038,35035,35034,35020,35024,35205,35227,35295,35301,35300,35297,35296,35298,35292,35302,35446,35462,35455,35425,35391,35447,35458,35460,35445,35459,35457,35444,35450,35900,35915,35914,35941,35940,35942,35974,35972,35973,36044,36200,36201,36241,36236,36238,36239,36237,36243,36244,36240,36242,36336,36320,36332,36337,36334,36304,36329,36323,36322,36327,36338,36331,36340,36614,36607,36609,36608,36613,36615,36616,36610,36619,36946,36927,36932,36937,36925,37136,37133,37135,37137,37142,37140,37131,37134,37230,37231,37448,37458,37424,37434,37478,37427,37477,37470,37507,37422,37450,37446,37485,37484,37455,37472,37479,37487,37430,37473,37488,37425,37460,37475,37456,37490,37454,37459,37452,37462,37426,38303,38300,38302,38299,38546,38547,38545,38551,38606,38650,38653,38648,38645,38771,38775,38776,38770,38927,38925,38926,39084,39158,39161,39343,39346,39344,39349,39597,39595,39771,40170,40173,40167,40576,40701,20710,20692,20695,20712,20723,20699,20714,20701,20708,20691,20716,20720,20719,20707,20704,20952,21120,21121,21225,21227,21296,21420,22055,22037,22028,22034,22012,22031,22044,22017,22035,22018,22010,22045,22020,22015,22009,22665,22652,22672,22680,22662,22657,22655,22644,22667,22650,22663,22673,22670,22646,22658,22664,22651,22676,22671,22782,22891,23260,23278,23269,23253,23274,23258,23277,23275,23283,23266,23264,23259,23276,23262,23261,23257,23272,23263,23415,23520,23523,23651,23938,23936,23933,23942,23930,23937,23927,23946,23945,23944,23934,23932,23949,23929,23935,24152,24153,24147,24280,24273,24279,24270,24284,24277,24281,24274,24276,24388,24387,24431,24502,24876,24872,24897,24926,24945,24947,24914,24915,24946,24940,24960,24948,24916,24954,24923,24933,24891,24938,24929,24918,25129,25127,25131,25643,25677,25691,25693,25716,25718,25714,25715,25725,25717,25702,25766,25678,25730,25694,25692,25675,25683,25696,25680,25727,25663,25708,25707,25689,25701,25719,25971,26016,26273,26272,26271,26373,26372,26402,27057,27062,27081,27040,27086,27030,27056,27052,27068,27025,27033,27022,27047,27021,27049,27070,27055,27071,27076,27069,27044,27092,27065,27082,27034,27087,27059,27027,27050,27041,27038,27097,27031,27024,27074,27061,27045,27078,27466,27469,27467,27550,27551,27552,27587,27588,27646,28366,28405,28401,28419,28453,28408,28471,28411,28462,28425,28494,28441,28442,28455,28440,28475,28434,28397,28426,28470,28531,28409,28398,28461,28480,28464,28476,28469,28395,28423,28430,28483,28421,28413,28406,28473,28444,28412,28474,28447,28429,28446,28424,28449,29063,29072,29065,29056,29061,29058,29071,29051,29062,29057,29079,29252,29267,29335,29333,29331,29507,29517,29521,29516,29794,29811,29809,29813,29810,29799,29806,29952,29954,29955,30077,30096,30230,30216,30220,30229,30225,30218,30228,30392,30593,30588,30597,30594,30574,30592,30575,30590,30595,30898,30890,30900,30893,30888,30846,30891,30878,30885,30880,30892,30882,30884,31128,31114,31115,31126,31125,31124,31123,31127,31112,31122,31120,31275,31306,31280,31279,31272,31270,31400,31403,31404,31470,31624,31644,31626,31633,31632,31638,31629,31628,31643,31630,31621,31640,21124,31641,31652,31618,31931,31935,31932,31930,32167,32183,32194,32163,32170,32193,32192,32197,32157,32206,32196,32198,32203,32204,32175,32185,32150,32188,32159,32166,32174,32169,32161,32201,32627,32738,32739,32741,32734,32804,32861,32860,33161,33158,33155,33159,33165,33164,33163,33301,33943,33956,33953,33951,33978,33998,33986,33964,33966,33963,33977,33972,33985,33997,33962,33946,33969,34000,33949,33959,33979,33954,33940,33991,33996,33947,33961,33967,33960,34006,33944,33974,33999,33952,34007,34004,34002,34011,33968,33937,34401,34611,34595,34600,34667,34624,34606,34590,34593,34585,34587,34627,34604,34625,34622,34630,34592,34610,34602,34605,34620,34578,34618,34609,34613,34626,34598,34599,34616,34596,34586,34608,34577,35063,35047,35057,35058,35066,35070,35054,35068,35062,35067,35056,35052,35051,35229,35233,35231,35230,35305,35307,35304,35499,35481,35467,35474,35471,35478,35901,35944,35945,36053,36047,36055,36246,36361,36354,36351,36365,36349,36362,36355,36359,36358,36357,36350,36352,36356,36624,36625,36622,36621,37155,37148,37152,37154,37151,37149,37146,37156,37153,37147,37242,37234,37241,37235,37541,37540,37494,37531,37498,37536,37524,37546,37517,37542,37530,37547,37497,37527,37503,37539,37614,37518,37506,37525,37538,37501,37512,37537,37514,37510,37516,37529,37543,37502,37511,37545,37533,37515,37421,38558,38561,38655,38744,38781,38778,38782,38787,38784,38786,38779,38788,38785,38783,38862,38861,38934,39085,39086,39170,39168,39175,39325,39324,39363,39353,39355,39354,39362,39357,39367,39601,39651,39655,39742,39743,39776,39777,39775,40177,40178,40181,40615,20735,20739,20784,20728,20742,20743,20726,20734,20747,20748,20733,20746,21131,21132,21233,21231,22088,22082,22092,22069,22081,22090,22089,22086,22104,22106,22080,22067,22077,22060,22078,22072,22058,22074,22298,22699,22685,22705,22688,22691,22703,22700,22693,22689,22783,23295,23284,23293,23287,23286,23299,23288,23298,23289,23297,23303,23301,23311,23655,23961,23959,23967,23954,23970,23955,23957,23968,23964,23969,23962,23966,24169,24157,24160,24156,32243,24283,24286,24289,24393,24498,24971,24963,24953,25009,25008,24994,24969,24987,24979,25007,25005,24991,24978,25002,24993,24973,24934,25011,25133,25710,25712,25750,25760,25733,25751,25756,25743,25739,25738,25740,25763,25759,25704,25777,25752,25974,25978,25977,25979,26034,26035,26293,26288,26281,26290,26295,26282,26287,27136,27142,27159,27109,27128,27157,27121,27108,27168,27135,27116,27106,27163,27165,27134,27175,27122,27118,27156,27127,27111,27200,27144,27110,27131,27149,27132,27115,27145,27140,27160,27173,27151,27126,27174,27143,27124,27158,27473,27557,27555,27554,27558,27649,27648,27647,27650,28481,28454,28542,28551,28614,28562,28557,28553,28556,28514,28495,28549,28506,28566,28534,28524,28546,28501,28530,28498,28496,28503,28564,28563,28509,28416,28513,28523,28541,28519,28560,28499,28555,28521,28543,28565,28515,28535,28522,28539,29106,29103,29083,29104,29088,29082,29097,29109,29085,29093,29086,29092,29089,29098,29084,29095,29107,29336,29338,29528,29522,29534,29535,29536,29533,29531,29537,29530,29529,29538,29831,29833,29834,29830,29825,29821,29829,29832,29820,29817,29960,29959,30078,30245,30238,30233,30237,30236,30243,30234,30248,30235,30364,30365,30366,30363,30605,30607,30601,30600,30925,30907,30927,30924,30929,30926,30932,30920,30915,30916,30921,31130,31137,31136,31132,31138,31131,27510,31289,31410,31412,31411,31671,31691,31678,31660,31694,31663,31673,31690,31669,31941,31944,31948,31947,32247,32219,32234,32231,32215,32225,32259,32250,32230,32246,32241,32240,32238,32223,32630,32684,32688,32685,32749,32747,32746,32748,32742,32744,32868,32871,33187,33183,33182,33173,33186,33177,33175,33302,33359,33363,33362,33360,33358,33361,34084,34107,34063,34048,34089,34062,34057,34061,34079,34058,34087,34076,34043,34091,34042,34056,34060,34036,34090,34034,34069,34039,34027,34035,34044,34066,34026,34025,34070,34046,34088,34077,34094,34050,34045,34078,34038,34097,34086,34023,34024,34032,34031,34041,34072,34080,34096,34059,34073,34095,34402,34646,34659,34660,34679,34785,34675,34648,34644,34651,34642,34657,34650,34641,34654,34669,34666,34640,34638,34655,34653,34671,34668,34682,34670,34652,34661,34639,34683,34677,34658,34663,34665,34906,35077,35084,35092,35083,35095,35096,35097,35078,35094,35089,35086,35081,35234,35236,35235,35309,35312,35308,35535,35526,35512,35539,35537,35540,35541,35515,35543,35518,35520,35525,35544,35523,35514,35517,35545,35902,35917,35983,36069,36063,36057,36072,36058,36061,36071,36256,36252,36257,36251,36384,36387,36389,36388,36398,36373,36379,36374,36369,36377,36390,36391,36372,36370,36376,36371,36380,36375,36378,36652,36644,36632,36634,36640,36643,36630,36631,36979,36976,36975,36967,36971,37167,37163,37161,37162,37170,37158,37166,37253,37254,37258,37249,37250,37252,37248,37584,37571,37572,37568,37593,37558,37583,37617,37599,37592,37609,37591,37597,37580,37615,37570,37608,37578,37576,37582,37606,37581,37589,37577,37600,37598,37607,37585,37587,37557,37601,37574,37556,38268,38316,38315,38318,38320,38564,38562,38611,38661,38664,38658,38746,38794,38798,38792,38864,38863,38942,38941,38950,38953,38952,38944,38939,38951,39090,39176,39162,39185,39188,39190,39191,39189,39388,39373,39375,39379,39380,39374,39369,39382,39384,39371,39383,39372,39603,39660,39659,39667,39666,39665,39750,39747,39783,39796,39793,39782,39798,39797,39792,39784,39780,39788,40188,40186,40189,40191,40183,40199,40192,40185,40187,40200,40197,40196,40579,40659,40719,40720,20764,20755,20759,20762,20753,20958,21300,21473,22128,22112,22126,22131,22118,22115,22125,22130,22110,22135,22300,22299,22728,22717,22729,22719,22714,22722,22716,22726,23319,23321,23323,23329,23316,23315,23312,23318,23336,23322,23328,23326,23535,23980,23985,23977,23975,23989,23984,23982,23978,23976,23986,23981,23983,23988,24167,24168,24166,24175,24297,24295,24294,24296,24293,24395,24508,24989,25000,24982,25029,25012,25030,25025,25036,25018,25023,25016,24972,25815,25814,25808,25807,25801,25789,25737,25795,25819,25843,25817,25907,25983,25980,26018,26312,26302,26304,26314,26315,26319,26301,26299,26298,26316,26403,27188,27238,27209,27239,27186,27240,27198,27229,27245,27254,27227,27217,27176,27226,27195,27199,27201,27242,27236,27216,27215,27220,27247,27241,27232,27196,27230,27222,27221,27213,27214,27206,27477,27476,27478,27559,27562,27563,27592,27591,27652,27651,27654,28589,28619,28579,28615,28604,28622,28616,28510,28612,28605,28574,28618,28584,28676,28581,28590,28602,28588,28586,28623,28607,28600,28578,28617,28587,28621,28591,28594,28592,29125,29122,29119,29112,29142,29120,29121,29131,29140,29130,29127,29135,29117,29144,29116,29126,29146,29147,29341,29342,29545,29542,29543,29548,29541,29547,29546,29823,29850,29856,29844,29842,29845,29857,29963,30080,30255,30253,30257,30269,30259,30268,30261,30258,30256,30395,30438,30618,30621,30625,30620,30619,30626,30627,30613,30617,30615,30941,30953,30949,30954,30942,30947,30939,30945,30946,30957,30943,30944,31140,31300,31304,31303,31414,31416,31413,31409,31415,31710,31715,31719,31709,31701,31717,31706,31720,31737,31700,31722,31714,31708,31723,31704,31711,31954,31956,31959,31952,31953,32274,32289,32279,32268,32287,32288,32275,32270,32284,32277,32282,32290,32267,32271,32278,32269,32276,32293,32292,32579,32635,32636,32634,32689,32751,32810,32809,32876,33201,33190,33198,33209,33205,33195,33200,33196,33204,33202,33207,33191,33266,33365,33366,33367,34134,34117,34155,34125,34131,34145,34136,34112,34118,34148,34113,34146,34116,34129,34119,34147,34110,34139,34161,34126,34158,34165,34133,34151,34144,34188,34150,34141,34132,34149,34156,34403,34405,34404,34715,34703,34711,34707,34706,34696,34689,34710,34712,34681,34695,34723,34693,34704,34705,34717,34692,34708,34716,34714,34697,35102,35110,35120,35117,35118,35111,35121,35106,35113,35107,35119,35116,35103,35313,35552,35554,35570,35572,35573,35549,35604,35556,35551,35568,35528,35550,35553,35560,35583,35567,35579,35985,35986,35984,36085,36078,36081,36080,36083,36204,36206,36261,36263,36403,36414,36408,36416,36421,36406,36412,36413,36417,36400,36415,36541,36662,36654,36661,36658,36665,36663,36660,36982,36985,36987,36998,37114,37171,37173,37174,37267,37264,37265,37261,37263,37671,37662,37640,37663,37638,37647,37754,37688,37692,37659,37667,37650,37633,37702,37677,37646,37645,37579,37661,37626,37669,37651,37625,37623,37684,37634,37668,37631,37673,37689,37685,37674,37652,37644,37643,37630,37641,37632,37627,37654,38332,38349,38334,38329,38330,38326,38335,38325,38333,38569,38612,38667,38674,38672,38809,38807,38804,38896,38904,38965,38959,38962,39204,39199,39207,39209,39326,39406,39404,39397,39396,39408,39395,39402,39401,39399,39609,39615,39604,39611,39670,39674,39673,39671,39731,39808,39813,39815,39804,39806,39803,39810,39827,39826,39824,39802,39829,39805,39816,40229,40215,40224,40222,40212,40233,40221,40216,40226,40208,40217,40223,40584,40582,40583,40622,40621,40661,40662,40698,40722,40765,20774,20773,20770,20772,20768,20777,21236,22163,22156,22157,22150,22148,22147,22142,22146,22143,22145,22742,22740,22735,22738,23341,23333,23346,23331,23340,23335,23334,23343,23342,23419,23537,23538,23991,24172,24170,24510,24507,25027,25013,25020,25063,25056,25061,25060,25064,25054,25839,25833,25827,25835,25828,25832,25985,25984,26038,26074,26322,27277,27286,27265,27301,27273,27295,27291,27297,27294,27271,27283,27278,27285,27267,27304,27300,27281,27263,27302,27290,27269,27276,27282,27483,27565,27657,28620,28585,28660,28628,28643,28636,28653,28647,28646,28638,28658,28637,28642,28648,29153,29169,29160,29170,29156,29168,29154,29555,29550,29551,29847,29874,29867,29840,29866,29869,29873,29861,29871,29968,29969,29970,29967,30084,30275,30280,30281,30279,30372,30441,30645,30635,30642,30647,30646,30644,30641,30632,30704,30963,30973,30978,30971,30972,30962,30981,30969,30974,30980,31147,31144,31324,31323,31318,31320,31316,31322,31422,31424,31425,31749,31759,31730,31744,31743,31739,31758,31732,31755,31731,31746,31753,31747,31745,31736,31741,31750,31728,31729,31760,31754,31976,32301,32316,32322,32307,38984,32312,32298,32329,32320,32327,32297,32332,32304,32315,32310,32324,32314,32581,32639,32638,32637,32756,32754,32812,33211,33220,33228,33226,33221,33223,33212,33257,33371,33370,33372,34179,34176,34191,34215,34197,34208,34187,34211,34171,34212,34202,34206,34167,34172,34185,34209,34170,34168,34135,34190,34198,34182,34189,34201,34205,34177,34210,34178,34184,34181,34169,34166,34200,34192,34207,34408,34750,34730,34733,34757,34736,34732,34745,34741,34748,34734,34761,34755,34754,34764,34743,34735,34756,34762,34740,34742,34751,34744,34749,34782,34738,35125,35123,35132,35134,35137,35154,35127,35138,35245,35247,35246,35314,35315,35614,35608,35606,35601,35589,35595,35618,35599,35602,35605,35591,35597,35592,35590,35612,35603,35610,35919,35952,35954,35953,35951,35989,35988,36089,36207,36430,36429,36435,36432,36428,36423,36675,36672,36997,36990,37176,37274,37282,37275,37273,37279,37281,37277,37280,37793,37763,37807,37732,37718,37703,37756,37720,37724,37750,37705,37712,37713,37728,37741,37775,37708,37738,37753,37719,37717,37714,37711,37745,37751,37755,37729,37726,37731,37735,37760,37710,37721,38343,38336,38345,38339,38341,38327,38574,38576,38572,38688,38687,38680,38685,38681,38810,38817,38812,38814,38813,38869,38868,38897,38977,38980,38986,38985,38981,38979,39205,39211,39212,39210,39219,39218,39215,39213,39217,39216,39320,39331,39329,39426,39418,39412,39415,39417,39416,39414,39419,39421,39422,39420,39427,39614,39678,39677,39681,39676,39752,39834,39848,39838,39835,39846,39841,39845,39844,39814,39842,39840,39855,40243,40257,40295,40246,40238,40239,40241,40248,40240,40261,40258,40259,40254,40247,40256,40253,32757,40237,40586,40585,40589,40624,40648,40666,40699,40703,40740,40739,40738,40788,40864,20785,20781,20782,22168,22172,22167,22170,22173,22169,22896,23356,23657,23658,24000,24173,24174,25048,25055,25069,25070,25073,25066,25072,25067,25046,25065,25855,25860,25853,25848,25857,25859,25852,26004,26075,26330,26331,26328,27333,27321,27325,27361,27334,27322,27318,27319,27335,27316,27309,27486,27593,27659,28679,28684,28685,28673,28677,28692,28686,28671,28672,28667,28710,28668,28663,28682,29185,29183,29177,29187,29181,29558,29880,29888,29877,29889,29886,29878,29883,29890,29972,29971,30300,30308,30297,30288,30291,30295,30298,30374,30397,30444,30658,30650,30975,30988,30995,30996,30985,30992,30994,30993,31149,31148,31327,31772,31785,31769,31776,31775,31789,31773,31782,31784,31778,31781,31792,32348,32336,32342,32355,32344,32354,32351,32337,32352,32343,32339,32693,32691,32759,32760,32885,33233,33234,33232,33375,33374,34228,34246,34240,34243,34242,34227,34229,34237,34247,34244,34239,34251,34254,34248,34245,34225,34230,34258,34340,34232,34231,34238,34409,34791,34790,34786,34779,34795,34794,34789,34783,34803,34788,34772,34780,34771,34797,34776,34787,34724,34775,34777,34817,34804,34792,34781,35155,35147,35151,35148,35142,35152,35153,35145,35626,35623,35619,35635,35632,35637,35655,35631,35644,35646,35633,35621,35639,35622,35638,35630,35620,35643,35645,35642,35906,35957,35993,35992,35991,36094,36100,36098,36096,36444,36450,36448,36439,36438,36446,36453,36455,36443,36442,36449,36445,36457,36436,36678,36679,36680,36683,37160,37178,37179,37182,37288,37285,37287,37295,37290,37813,37772,37778,37815,37787,37789,37769,37799,37774,37802,37790,37798,37781,37768,37785,37791,37773,37809,37777,37810,37796,37800,37812,37795,37797,38354,38355,38353,38579,38615,38618,24002,38623,38616,38621,38691,38690,38693,38828,38830,38824,38827,38820,38826,38818,38821,38871,38873,38870,38872,38906,38992,38993,38994,39096,39233,39228,39226,39439,39435,39433,39437,39428,39441,39434,39429,39431,39430,39616,39644,39688,39684,39685,39721,39733,39754,39756,39755,39879,39878,39875,39871,39873,39861,39864,39891,39862,39876,39865,39869,40284,40275,40271,40266,40283,40267,40281,40278,40268,40279,40274,40276,40287,40280,40282,40590,40588,40671,40705,40704,40726,40741,40747,40746,40745,40744,40780,40789,20788,20789,21142,21239,21428,22187,22189,22182,22183,22186,22188,22746,22749,22747,22802,23357,23358,23359,24003,24176,24511,25083,25863,25872,25869,25865,25868,25870,25988,26078,26077,26334,27367,27360,27340,27345,27353,27339,27359,27356,27344,27371,27343,27341,27358,27488,27568,27660,28697,28711,28704,28694,28715,28705,28706,28707,28713,28695,28708,28700,28714,29196,29194,29191,29186,29189,29349,29350,29348,29347,29345,29899,29893,29879,29891,29974,30304,30665,30666,30660,30705,31005,31003,31009,31004,30999,31006,31152,31335,31336,31795,31804,31801,31788,31803,31980,31978,32374,32373,32376,32368,32375,32367,32378,32370,32372,32360,32587,32586,32643,32646,32695,32765,32766,32888,33239,33237,33380,33377,33379,34283,34289,34285,34265,34273,34280,34266,34263,34284,34290,34296,34264,34271,34275,34268,34257,34288,34278,34287,34270,34274,34816,34810,34819,34806,34807,34825,34828,34827,34822,34812,34824,34815,34826,34818,35170,35162,35163,35159,35169,35164,35160,35165,35161,35208,35255,35254,35318,35664,35656,35658,35648,35667,35670,35668,35659,35669,35665,35650,35666,35671,35907,35959,35958,35994,36102,36103,36105,36268,36266,36269,36267,36461,36472,36467,36458,36463,36475,36546,36690,36689,36687,36688,36691,36788,37184,37183,37296,37293,37854,37831,37839,37826,37850,37840,37881,37868,37836,37849,37801,37862,37834,37844,37870,37859,37845,37828,37838,37824,37842,37863,38269,38362,38363,38625,38697,38699,38700,38696,38694,38835,38839,38838,38877,38878,38879,39004,39001,39005,38999,39103,39101,39099,39102,39240,39239,39235,39334,39335,39450,39445,39461,39453,39460,39451,39458,39456,39463,39459,39454,39452,39444,39618,39691,39690,39694,39692,39735,39914,39915,39904,39902,39908,39910,39906,39920,39892,39895,39916,39900,39897,39909,39893,39905,39898,40311,40321,40330,40324,40328,40305,40320,40312,40326,40331,40332,40317,40299,40308,40309,40304,40297,40325,40307,40315,40322,40303,40313,40319,40327,40296,40596,40593,40640,40700,40749,40768,40769,40781,40790,40791,40792,21303,22194,22197,22195,22755,23365,24006,24007,24302,24303,24512,24513,25081,25879,25878,25877,25875,26079,26344,26339,26340,27379,27376,27370,27368,27385,27377,27374,27375,28732,28725,28719,28727,28724,28721,28738,28728,28735,28730,28729,28736,28731,28723,28737,29203,29204,29352,29565,29564,29882,30379,30378,30398,30445,30668,30670,30671,30669,30706,31013,31011,31015,31016,31012,31017,31154,31342,31340,31341,31479,31817,31816,31818,31815,31813,31982,32379,32382,32385,32384,32698,32767,32889,33243,33241,33291,33384,33385,34338,34303,34305,34302,34331,34304,34294,34308,34313,34309,34316,34301,34841,34832,34833,34839,34835,34838,35171,35174,35257,35319,35680,35690,35677,35688,35683,35685,35687,35693,36270,36486,36488,36484,36697,36694,36695,36693,36696,36698,37005,37187,37185,37303,37301,37298,37299,37899,37907,37883,37920,37903,37908,37886,37909,37904,37928,37913,37901,37877,37888,37879,37895,37902,37910,37906,37882,37897,37880,37898,37887,37884,37900,37878,37905,37894,38366,38368,38367,38702,38703,38841,38843,38909,38910,39008,39010,39011,39007,39105,39106,39248,39246,39257,39244,39243,39251,39474,39476,39473,39468,39466,39478,39465,39470,39480,39469,39623,39626,39622,39696,39698,39697,39947,39944,39927,39941,39954,39928,40000,39943,39950,39942,39959,39956,39945,40351,40345,40356,40349,40338,40344,40336,40347,40352,40340,40348,40362,40343,40353,40346,40354,40360,40350,40355,40383,40361,40342,40358,40359,40601,40603,40602,40677,40676,40679,40678,40752,40750,40795,40800,40798,40797,40793,40849,20794,20793,21144,21143,22211,22205,22206,23368,23367,24011,24015,24305,25085,25883,27394,27388,27395,27384,27392,28739,28740,28746,28744,28745,28741,28742,29213,29210,29209,29566,29975,30314,30672,31021,31025,31023,31828,31827,31986,32394,32391,32392,32395,32390,32397,32589,32699,32816,33245,34328,34346,34342,34335,34339,34332,34329,34343,34350,34337,34336,34345,34334,34341,34857,34845,34843,34848,34852,34844,34859,34890,35181,35177,35182,35179,35322,35705,35704,35653,35706,35707,36112,36116,36271,36494,36492,36702,36699,36701,37190,37188,37189,37305,37951,37947,37942,37929,37949,37948,37936,37945,37930,37943,37932,37952,37937,38373,38372,38371,38709,38714,38847,38881,39012,39113,39110,39104,39256,39254,39481,39485,39494,39492,39490,39489,39482,39487,39629,39701,39703,39704,39702,39738,39762,39979,39965,39964,39980,39971,39976,39977,39972,39969,40375,40374,40380,40385,40391,40394,40399,40382,40389,40387,40379,40373,40398,40377,40378,40364,40392,40369,40365,40396,40371,40397,40370,40570,40604,40683,40686,40685,40731,40728,40730,40753,40782,40805,40804,40850,20153,22214,22213,22219,22897,23371,23372,24021,24017,24306,25889,25888,25894,25890,27403,27400,27401,27661,28757,28758,28759,28754,29214,29215,29353,29567,29912,29909,29913,29911,30317,30381,31029,31156,31344,31345,31831,31836,31833,31835,31834,31988,31985,32401,32591,32647,33246,33387,34356,34357,34355,34348,34354,34358,34860,34856,34854,34858,34853,35185,35263,35262,35323,35710,35716,35714,35718,35717,35711,36117,36501,36500,36506,36498,36496,36502,36503,36704,36706,37191,37964,37968,37962,37963,37967,37959,37957,37960,37961,37958,38719,38883,39018,39017,39115,39252,39259,39502,39507,39508,39500,39503,39496,39498,39497,39506,39504,39632,39705,39723,39739,39766,39765,40006,40008,39999,40004,39993,39987,40001,39996,39991,39988,39986,39997,39990,40411,40402,40414,40410,40395,40400,40412,40401,40415,40425,40409,40408,40406,40437,40405,40413,40630,40688,40757,40755,40754,40770,40811,40853,40866,20797,21145,22760,22759,22898,23373,24024,34863,24399,25089,25091,25092,25897,25893,26006,26347,27409,27410,27407,27594,28763,28762,29218,29570,29569,29571,30320,30676,31847,31846,32405,33388,34362,34368,34361,34364,34353,34363,34366,34864,34866,34862,34867,35190,35188,35187,35326,35724,35726,35723,35720,35909,36121,36504,36708,36707,37308,37986,37973,37981,37975,37982,38852,38853,38912,39510,39513,39710,39711,39712,40018,40024,40016,40010,40013,40011,40021,40025,40012,40014,40443,40439,40431,40419,40427,40440,40420,40438,40417,40430,40422,40434,40432,40418,40428,40436,40435,40424,40429,40642,40656,40690,40691,40710,40732,40760,40759,40758,40771,40783,40817,40816,40814,40815,22227,22221,23374,23661,25901,26349,26350,27411,28767,28769,28765,28768,29219,29915,29925,30677,31032,31159,31158,31850,32407,32649,33389,34371,34872,34871,34869,34891,35732,35733,36510,36511,36512,36509,37310,37309,37314,37995,37992,37993,38629,38726,38723,38727,38855,38885,39518,39637,39769,40035,40039,40038,40034,40030,40032,40450,40446,40455,40451,40454,40453,40448,40449,40457,40447,40445,40452,40608,40734,40774,40820,40821,40822,22228,25902,26040,27416,27417,27415,27418,28770,29222,29354,30680,30681,31033,31849,31851,31990,32410,32408,32411,32409,33248,33249,34374,34375,34376,35193,35194,35196,35195,35327,35736,35737,36517,36516,36515,37998,37997,37999,38001,38003,38729,39026,39263,40040,40046,40045,40459,40461,40464,40463,40466,40465,40609,40693,40713,40775,40824,40827,40826,40825,22302,28774,31855,34876,36274,36518,37315,38004,38008,38006,38005,39520,40052,40051,40049,40053,40468,40467,40694,40714,40868,28776,28773,31991,34410,34878,34877,34879,35742,35996,36521,36553,38731,39027,39028,39116,39265,39339,39524,39526,39527,39716,40469,40471,40776,25095,27422,29223,34380,36520,38018,38016,38017,39529,39528,39726,40473,29225,34379,35743,38019,40057,40631,30325,39531,40058,40477,28777,28778,40612,40830,40777,40856,30849,37561,35023,22715,24658,31911,23290,9556,9574,9559,9568,9580,9571,9562,9577,9565,9554,9572,9557,9566,9578,9569,9560,9575,9563,9555,9573,9558,9567,9579,9570,9561,9576,9564,9553,9552,9581,9582,9584,9583,65517,132423,37595,132575,147397,34124,17077,29679,20917,13897,149826,166372,37700,137691,33518,146632,30780,26436,25311,149811,166314,131744,158643,135941,20395,140525,20488,159017,162436,144896,150193,140563,20521,131966,24484,131968,131911,28379,132127,20605,20737,13434,20750,39020,14147,33814,149924,132231,20832,144308,20842,134143,139516,131813,140592,132494,143923,137603,23426,34685,132531,146585,20914,20920,40244,20937,20943,20945,15580,20947,150182,20915,20962,21314,20973,33741,26942,145197,24443,21003,21030,21052,21173,21079,21140,21177,21189,31765,34114,21216,34317,158483,21253,166622,21833,28377,147328,133460,147436,21299,21316,134114,27851,136998,26651,29653,24650,16042,14540,136936,29149,17570,21357,21364,165547,21374,21375,136598,136723,30694,21395,166555,21408,21419,21422,29607,153458,16217,29596,21441,21445,27721,20041,22526,21465,15019,134031,21472,147435,142755,21494,134263,21523,28793,21803,26199,27995,21613,158547,134516,21853,21647,21668,18342,136973,134877,15796,134477,166332,140952,21831,19693,21551,29719,21894,21929,22021,137431,147514,17746,148533,26291,135348,22071,26317,144010,26276,26285,22093,22095,30961,22257,38791,21502,22272,22255,22253,166758,13859,135759,22342,147877,27758,28811,22338,14001,158846,22502,136214,22531,136276,148323,22566,150517,22620,22698,13665,22752,22748,135740,22779,23551,22339,172368,148088,37843,13729,22815,26790,14019,28249,136766,23076,21843,136850,34053,22985,134478,158849,159018,137180,23001,137211,137138,159142,28017,137256,136917,23033,159301,23211,23139,14054,149929,23159,14088,23190,29797,23251,159649,140628,15749,137489,14130,136888,24195,21200,23414,25992,23420,162318,16388,18525,131588,23509,24928,137780,154060,132517,23539,23453,19728,23557,138052,23571,29646,23572,138405,158504,23625,18653,23685,23785,23791,23947,138745,138807,23824,23832,23878,138916,23738,24023,33532,14381,149761,139337,139635,33415,14390,15298,24110,27274,24181,24186,148668,134355,21414,20151,24272,21416,137073,24073,24308,164994,24313,24315,14496,24316,26686,37915,24333,131521,194708,15070,18606,135994,24378,157832,140240,24408,140401,24419,38845,159342,24434,37696,166454,24487,23990,15711,152144,139114,159992,140904,37334,131742,166441,24625,26245,137335,14691,15815,13881,22416,141236,31089,15936,24734,24740,24755,149890,149903,162387,29860,20705,23200,24932,33828,24898,194726,159442,24961,20980,132694,24967,23466,147383,141407,25043,166813,170333,25040,14642,141696,141505,24611,24924,25886,25483,131352,25285,137072,25301,142861,25452,149983,14871,25656,25592,136078,137212,25744,28554,142902,38932,147596,153373,25825,25829,38011,14950,25658,14935,25933,28438,150056,150051,25989,25965,25951,143486,26037,149824,19255,26065,16600,137257,26080,26083,24543,144384,26136,143863,143864,26180,143780,143781,26187,134773,26215,152038,26227,26228,138813,143921,165364,143816,152339,30661,141559,39332,26370,148380,150049,15147,27130,145346,26462,26471,26466,147917,168173,26583,17641,26658,28240,37436,26625,144358,159136,26717,144495,27105,27147,166623,26995,26819,144845,26881,26880,15666,14849,144956,15232,26540,26977,166474,17148,26934,27032,15265,132041,33635,20624,27129,144985,139562,27205,145155,27293,15347,26545,27336,168348,15373,27421,133411,24798,27445,27508,141261,28341,146139,132021,137560,14144,21537,146266,27617,147196,27612,27703,140427,149745,158545,27738,33318,27769,146876,17605,146877,147876,149772,149760,146633,14053,15595,134450,39811,143865,140433,32655,26679,159013,159137,159211,28054,27996,28284,28420,149887,147589,159346,34099,159604,20935,27804,28189,33838,166689,28207,146991,29779,147330,31180,28239,23185,143435,28664,14093,28573,146992,28410,136343,147517,17749,37872,28484,28508,15694,28532,168304,15675,28575,147780,28627,147601,147797,147513,147440,147380,147775,20959,147798,147799,147776,156125,28747,28798,28839,28801,28876,28885,28886,28895,16644,15848,29108,29078,148087,28971,28997,23176,29002,29038,23708,148325,29007,37730,148161,28972,148570,150055,150050,29114,166888,28861,29198,37954,29205,22801,37955,29220,37697,153093,29230,29248,149876,26813,29269,29271,15957,143428,26637,28477,29314,29482,29483,149539,165931,18669,165892,29480,29486,29647,29610,134202,158254,29641,29769,147938,136935,150052,26147,14021,149943,149901,150011,29687,29717,26883,150054,29753,132547,16087,29788,141485,29792,167602,29767,29668,29814,33721,29804,14128,29812,37873,27180,29826,18771,150156,147807,150137,166799,23366,166915,137374,29896,137608,29966,29929,29982,167641,137803,23511,167596,37765,30029,30026,30055,30062,151426,16132,150803,30094,29789,30110,30132,30210,30252,30289,30287,30319,30326,156661,30352,33263,14328,157969,157966,30369,30373,30391,30412,159647,33890,151709,151933,138780,30494,30502,30528,25775,152096,30552,144044,30639,166244,166248,136897,30708,30729,136054,150034,26826,30895,30919,30931,38565,31022,153056,30935,31028,30897,161292,36792,34948,166699,155779,140828,31110,35072,26882,31104,153687,31133,162617,31036,31145,28202,160038,16040,31174,168205,31188],
  24945. "euc-kr":[44034,44035,44037,44038,44043,44044,44045,44046,44047,44056,44062,44063,44065,44066,44067,44069,44070,44071,44072,44073,44074,44075,44078,44082,44083,44084,null,null,null,null,null,null,44085,44086,44087,44090,44091,44093,44094,44095,44097,44098,44099,44100,44101,44102,44103,44104,44105,44106,44108,44110,44111,44112,44113,44114,44115,44117,null,null,null,null,null,null,44118,44119,44121,44122,44123,44125,44126,44127,44128,44129,44130,44131,44132,44133,44134,44135,44136,44137,44138,44139,44140,44141,44142,44143,44146,44147,44149,44150,44153,44155,44156,44157,44158,44159,44162,44167,44168,44173,44174,44175,44177,44178,44179,44181,44182,44183,44184,44185,44186,44187,44190,44194,44195,44196,44197,44198,44199,44203,44205,44206,44209,44210,44211,44212,44213,44214,44215,44218,44222,44223,44224,44226,44227,44229,44230,44231,44233,44234,44235,44237,44238,44239,44240,44241,44242,44243,44244,44246,44248,44249,44250,44251,44252,44253,44254,44255,44258,44259,44261,44262,44265,44267,44269,44270,44274,44276,44279,44280,44281,44282,44283,44286,44287,44289,44290,44291,44293,44295,44296,44297,44298,44299,44302,44304,44306,44307,44308,44309,44310,44311,44313,44314,44315,44317,44318,44319,44321,44322,44323,44324,44325,44326,44327,44328,44330,44331,44334,44335,44336,44337,44338,44339,null,null,null,null,null,null,44342,44343,44345,44346,44347,44349,44350,44351,44352,44353,44354,44355,44358,44360,44362,44363,44364,44365,44366,44367,44369,44370,44371,44373,44374,44375,null,null,null,null,null,null,44377,44378,44379,44380,44381,44382,44383,44384,44386,44388,44389,44390,44391,44392,44393,44394,44395,44398,44399,44401,44402,44407,44408,44409,44410,44414,44416,44419,44420,44421,44422,44423,44426,44427,44429,44430,44431,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,44443,44446,44447,44448,44449,44450,44451,44453,44454,44455,44456,44457,44458,44459,44460,44461,44462,44463,44464,44465,44466,44467,44468,44469,44470,44472,44473,44474,44475,44476,44477,44478,44479,44482,44483,44485,44486,44487,44489,44490,44491,44492,44493,44494,44495,44498,44500,44501,44502,44503,44504,44505,44506,44507,44509,44510,44511,44513,44514,44515,44517,44518,44519,44520,44521,44522,44523,44524,44525,44526,44527,44528,44529,44530,44531,44532,44533,44534,44535,44538,44539,44541,44542,44546,44547,44548,44549,44550,44551,44554,44556,44558,44559,44560,44561,44562,44563,44565,44566,44567,44568,44569,44570,44571,44572,null,null,null,null,null,null,44573,44574,44575,44576,44577,44578,44579,44580,44581,44582,44583,44584,44585,44586,44587,44588,44589,44590,44591,44594,44595,44597,44598,44601,44603,44604,null,null,null,null,null,null,44605,44606,44607,44610,44612,44615,44616,44617,44619,44623,44625,44626,44627,44629,44631,44632,44633,44634,44635,44638,44642,44643,44644,44646,44647,44650,44651,44653,44654,44655,44657,44658,44659,44660,44661,44662,44663,44666,44670,44671,44672,44673,44674,44675,44678,44679,44680,44681,44682,44683,44685,44686,44687,44688,44689,44690,44691,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44702,44703,44704,44705,44706,44707,44708,44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,44719,44720,44721,44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,44735,44737,44738,44739,44741,44742,44743,44744,44745,44746,44747,44750,44754,44755,44756,44757,44758,44759,44762,44763,44765,44766,44767,44768,44769,44770,44771,44772,44773,44774,44775,44777,44778,44780,44782,44783,44784,44785,44786,44787,44789,44790,44791,44793,44794,44795,44797,44798,44799,44800,44801,44802,44803,44804,44805,null,null,null,null,null,null,44806,44809,44810,44811,44812,44814,44815,44817,44818,44819,44820,44821,44822,44823,44824,44825,44826,44827,44828,44829,44830,44831,44832,44833,44834,44835,null,null,null,null,null,null,44836,44837,44838,44839,44840,44841,44842,44843,44846,44847,44849,44851,44853,44854,44855,44856,44857,44858,44859,44862,44864,44868,44869,44870,44871,44874,44875,44876,44877,44878,44879,44881,44882,44883,44884,44885,44886,44887,44888,44889,44890,44891,44894,44895,44896,44897,44898,44899,44902,44903,44904,44905,44906,44907,44908,44909,44910,44911,44912,44913,44914,44915,44916,44917,44918,44919,44920,44922,44923,44924,44925,44926,44927,44929,44930,44931,44933,44934,44935,44937,44938,44939,44940,44941,44942,44943,44946,44947,44948,44950,44951,44952,44953,44954,44955,44957,44958,44959,44960,44961,44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,44972,44973,44974,44975,44976,44977,44978,44979,44980,44981,44982,44983,44986,44987,44989,44990,44991,44993,44994,44995,44996,44997,44998,45002,45004,45007,45008,45009,45010,45011,45013,45014,45015,45016,45017,45018,45019,45021,45022,45023,45024,45025,null,null,null,null,null,null,45026,45027,45028,45029,45030,45031,45034,45035,45036,45037,45038,45039,45042,45043,45045,45046,45047,45049,45050,45051,45052,45053,45054,45055,45058,45059,null,null,null,null,null,null,45061,45062,45063,45064,45065,45066,45067,45069,45070,45071,45073,45074,45075,45077,45078,45079,45080,45081,45082,45083,45086,45087,45088,45089,45090,45091,45092,45093,45094,45095,45097,45098,45099,45100,45101,45102,45103,45104,45105,45106,45107,45108,45109,45110,45111,45112,45113,45114,45115,45116,45117,45118,45119,45120,45121,45122,45123,45126,45127,45129,45131,45133,45135,45136,45137,45138,45142,45144,45146,45147,45148,45150,45151,45152,45153,45154,45155,45156,45157,45158,45159,45160,45161,45162,45163,45164,45165,45166,45167,45168,45169,45170,45171,45172,45173,45174,45175,45176,45177,45178,45179,45182,45183,45185,45186,45187,45189,45190,45191,45192,45193,45194,45195,45198,45200,45202,45203,45204,45205,45206,45207,45211,45213,45214,45219,45220,45221,45222,45223,45226,45232,45234,45238,45239,45241,45242,45243,45245,45246,45247,45248,45249,45250,45251,45254,45258,45259,45260,45261,45262,45263,45266,null,null,null,null,null,null,45267,45269,45270,45271,45273,45274,45275,45276,45277,45278,45279,45281,45282,45283,45284,45286,45287,45288,45289,45290,45291,45292,45293,45294,45295,45296,null,null,null,null,null,null,45297,45298,45299,45300,45301,45302,45303,45304,45305,45306,45307,45308,45309,45310,45311,45312,45313,45314,45315,45316,45317,45318,45319,45322,45325,45326,45327,45329,45332,45333,45334,45335,45338,45342,45343,45344,45345,45346,45350,45351,45353,45354,45355,45357,45358,45359,45360,45361,45362,45363,45366,45370,45371,45372,45373,45374,45375,45378,45379,45381,45382,45383,45385,45386,45387,45388,45389,45390,45391,45394,45395,45398,45399,45401,45402,45403,45405,45406,45407,45409,45410,45411,45412,45413,45414,45415,45416,45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,45427,45428,45429,45430,45431,45434,45435,45437,45438,45439,45441,45443,45444,45445,45446,45447,45450,45452,45454,45455,45456,45457,45461,45462,45463,45465,45466,45467,45469,45470,45471,45472,45473,45474,45475,45476,45477,45478,45479,45481,45482,45483,45484,45485,45486,45487,45488,45489,45490,45491,45492,45493,45494,45495,45496,null,null,null,null,null,null,45497,45498,45499,45500,45501,45502,45503,45504,45505,45506,45507,45508,45509,45510,45511,45512,45513,45514,45515,45517,45518,45519,45521,45522,45523,45525,null,null,null,null,null,null,45526,45527,45528,45529,45530,45531,45534,45536,45537,45538,45539,45540,45541,45542,45543,45546,45547,45549,45550,45551,45553,45554,45555,45556,45557,45558,45559,45560,45562,45564,45566,45567,45568,45569,45570,45571,45574,45575,45577,45578,45581,45582,45583,45584,45585,45586,45587,45590,45592,45594,45595,45596,45597,45598,45599,45601,45602,45603,45604,45605,45606,45607,45608,45609,45610,45611,45612,45613,45614,45615,45616,45617,45618,45619,45621,45622,45623,45624,45625,45626,45627,45629,45630,45631,45632,45633,45634,45635,45636,45637,45638,45639,45640,45641,45642,45643,45644,45645,45646,45647,45648,45649,45650,45651,45652,45653,45654,45655,45657,45658,45659,45661,45662,45663,45665,45666,45667,45668,45669,45670,45671,45674,45675,45676,45677,45678,45679,45680,45681,45682,45683,45686,45687,45688,45689,45690,45691,45693,45694,45695,45696,45697,45698,45699,45702,45703,45704,45706,45707,45708,45709,45710,null,null,null,null,null,null,45711,45714,45715,45717,45718,45719,45723,45724,45725,45726,45727,45730,45732,45735,45736,45737,45739,45741,45742,45743,45745,45746,45747,45749,45750,45751,null,null,null,null,null,null,45752,45753,45754,45755,45756,45757,45758,45759,45760,45761,45762,45763,45764,45765,45766,45767,45770,45771,45773,45774,45775,45777,45779,45780,45781,45782,45783,45786,45788,45790,45791,45792,45793,45795,45799,45801,45802,45808,45809,45810,45814,45820,45821,45822,45826,45827,45829,45830,45831,45833,45834,45835,45836,45837,45838,45839,45842,45846,45847,45848,45849,45850,45851,45853,45854,45855,45856,45857,45858,45859,45860,45861,45862,45863,45864,45865,45866,45867,45868,45869,45870,45871,45872,45873,45874,45875,45876,45877,45878,45879,45880,45881,45882,45883,45884,45885,45886,45887,45888,45889,45890,45891,45892,45893,45894,45895,45896,45897,45898,45899,45900,45901,45902,45903,45904,45905,45906,45907,45911,45913,45914,45917,45920,45921,45922,45923,45926,45928,45930,45932,45933,45935,45938,45939,45941,45942,45943,45945,45946,45947,45948,45949,45950,45951,45954,45958,45959,45960,45961,45962,45963,45965,null,null,null,null,null,null,45966,45967,45969,45970,45971,45973,45974,45975,45976,45977,45978,45979,45980,45981,45982,45983,45986,45987,45988,45989,45990,45991,45993,45994,45995,45997,null,null,null,null,null,null,45998,45999,46000,46001,46002,46003,46004,46005,46006,46007,46008,46009,46010,46011,46012,46013,46014,46015,46016,46017,46018,46019,46022,46023,46025,46026,46029,46031,46033,46034,46035,46038,46040,46042,46044,46046,46047,46049,46050,46051,46053,46054,46055,46057,46058,46059,46060,46061,46062,46063,46064,46065,46066,46067,46068,46069,46070,46071,46072,46073,46074,46075,46077,46078,46079,46080,46081,46082,46083,46084,46085,46086,46087,46088,46089,46090,46091,46092,46093,46094,46095,46097,46098,46099,46100,46101,46102,46103,46105,46106,46107,46109,46110,46111,46113,46114,46115,46116,46117,46118,46119,46122,46124,46125,46126,46127,46128,46129,46130,46131,46133,46134,46135,46136,46137,46138,46139,46140,46141,46142,46143,46144,46145,46146,46147,46148,46149,46150,46151,46152,46153,46154,46155,46156,46157,46158,46159,46162,46163,46165,46166,46167,46169,46170,46171,46172,46173,46174,46175,46178,46180,46182,null,null,null,null,null,null,46183,46184,46185,46186,46187,46189,46190,46191,46192,46193,46194,46195,46196,46197,46198,46199,46200,46201,46202,46203,46204,46205,46206,46207,46209,46210,null,null,null,null,null,null,46211,46212,46213,46214,46215,46217,46218,46219,46220,46221,46222,46223,46224,46225,46226,46227,46228,46229,46230,46231,46232,46233,46234,46235,46236,46238,46239,46240,46241,46242,46243,46245,46246,46247,46249,46250,46251,46253,46254,46255,46256,46257,46258,46259,46260,46262,46264,46266,46267,46268,46269,46270,46271,46273,46274,46275,46277,46278,46279,46281,46282,46283,46284,46285,46286,46287,46289,46290,46291,46292,46294,46295,46296,46297,46298,46299,46302,46303,46305,46306,46309,46311,46312,46313,46314,46315,46318,46320,46322,46323,46324,46325,46326,46327,46329,46330,46331,46332,46333,46334,46335,46336,46337,46338,46339,46340,46341,46342,46343,46344,46345,46346,46347,46348,46349,46350,46351,46352,46353,46354,46355,46358,46359,46361,46362,46365,46366,46367,46368,46369,46370,46371,46374,46379,46380,46381,46382,46383,46386,46387,46389,46390,46391,46393,46394,46395,46396,46397,46398,46399,46402,46406,null,null,null,null,null,null,46407,46408,46409,46410,46414,46415,46417,46418,46419,46421,46422,46423,46424,46425,46426,46427,46430,46434,46435,46436,46437,46438,46439,46440,46441,46442,null,null,null,null,null,null,46443,46444,46445,46446,46447,46448,46449,46450,46451,46452,46453,46454,46455,46456,46457,46458,46459,46460,46461,46462,46463,46464,46465,46466,46467,46468,46469,46470,46471,46472,46473,46474,46475,46476,46477,46478,46479,46480,46481,46482,46483,46484,46485,46486,46487,46488,46489,46490,46491,46492,46493,46494,46495,46498,46499,46501,46502,46503,46505,46508,46509,46510,46511,46514,46518,46519,46520,46521,46522,46526,46527,46529,46530,46531,46533,46534,46535,46536,46537,46538,46539,46542,46546,46547,46548,46549,46550,46551,46553,46554,46555,46556,46557,46558,46559,46560,46561,46562,46563,46564,46565,46566,46567,46568,46569,46570,46571,46573,46574,46575,46576,46577,46578,46579,46580,46581,46582,46583,46584,46585,46586,46587,46588,46589,46590,46591,46592,46593,46594,46595,46596,46597,46598,46599,46600,46601,46602,46603,46604,46605,46606,46607,46610,46611,46613,46614,46615,46617,46618,46619,46620,46621,null,null,null,null,null,null,46622,46623,46624,46625,46626,46627,46628,46630,46631,46632,46633,46634,46635,46637,46638,46639,46640,46641,46642,46643,46645,46646,46647,46648,46649,46650,null,null,null,null,null,null,46651,46652,46653,46654,46655,46656,46657,46658,46659,46660,46661,46662,46663,46665,46666,46667,46668,46669,46670,46671,46672,46673,46674,46675,46676,46677,46678,46679,46680,46681,46682,46683,46684,46685,46686,46687,46688,46689,46690,46691,46693,46694,46695,46697,46698,46699,46700,46701,46702,46703,46704,46705,46706,46707,46708,46709,46710,46711,46712,46713,46714,46715,46716,46717,46718,46719,46720,46721,46722,46723,46724,46725,46726,46727,46728,46729,46730,46731,46732,46733,46734,46735,46736,46737,46738,46739,46740,46741,46742,46743,46744,46745,46746,46747,46750,46751,46753,46754,46755,46757,46758,46759,46760,46761,46762,46765,46766,46767,46768,46770,46771,46772,46773,46774,46775,46776,46777,46778,46779,46780,46781,46782,46783,46784,46785,46786,46787,46788,46789,46790,46791,46792,46793,46794,46795,46796,46797,46798,46799,46800,46801,46802,46803,46805,46806,46807,46808,46809,46810,46811,46812,46813,null,null,null,null,null,null,46814,46815,46816,46817,46818,46819,46820,46821,46822,46823,46824,46825,46826,46827,46828,46829,46830,46831,46833,46834,46835,46837,46838,46839,46841,46842,null,null,null,null,null,null,46843,46844,46845,46846,46847,46850,46851,46852,46854,46855,46856,46857,46858,46859,46860,46861,46862,46863,46864,46865,46866,46867,46868,46869,46870,46871,46872,46873,46874,46875,46876,46877,46878,46879,46880,46881,46882,46883,46884,46885,46886,46887,46890,46891,46893,46894,46897,46898,46899,46900,46901,46902,46903,46906,46908,46909,46910,46911,46912,46913,46914,46915,46917,46918,46919,46921,46922,46923,46925,46926,46927,46928,46929,46930,46931,46934,46935,46936,46937,46938,46939,46940,46941,46942,46943,46945,46946,46947,46949,46950,46951,46953,46954,46955,46956,46957,46958,46959,46962,46964,46966,46967,46968,46969,46970,46971,46974,46975,46977,46978,46979,46981,46982,46983,46984,46985,46986,46987,46990,46995,46996,46997,47002,47003,47005,47006,47007,47009,47010,47011,47012,47013,47014,47015,47018,47022,47023,47024,47025,47026,47027,47030,47031,47033,47034,47035,47036,47037,47038,47039,47040,47041,null,null,null,null,null,null,47042,47043,47044,47045,47046,47048,47050,47051,47052,47053,47054,47055,47056,47057,47058,47059,47060,47061,47062,47063,47064,47065,47066,47067,47068,47069,null,null,null,null,null,null,47070,47071,47072,47073,47074,47075,47076,47077,47078,47079,47080,47081,47082,47083,47086,47087,47089,47090,47091,47093,47094,47095,47096,47097,47098,47099,47102,47106,47107,47108,47109,47110,47114,47115,47117,47118,47119,47121,47122,47123,47124,47125,47126,47127,47130,47132,47134,47135,47136,47137,47138,47139,47142,47143,47145,47146,47147,47149,47150,47151,47152,47153,47154,47155,47158,47162,47163,47164,47165,47166,47167,47169,47170,47171,47173,47174,47175,47176,47177,47178,47179,47180,47181,47182,47183,47184,47186,47188,47189,47190,47191,47192,47193,47194,47195,47198,47199,47201,47202,47203,47205,47206,47207,47208,47209,47210,47211,47214,47216,47218,47219,47220,47221,47222,47223,47225,47226,47227,47229,47230,47231,47232,47233,47234,47235,47236,47237,47238,47239,47240,47241,47242,47243,47244,47246,47247,47248,47249,47250,47251,47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,null,null,null,null,null,null,47264,47265,47266,47267,47268,47269,47270,47271,47273,47274,47275,47276,47277,47278,47279,47281,47282,47283,47285,47286,47287,47289,47290,47291,47292,47293,null,null,null,null,null,null,47294,47295,47298,47300,47302,47303,47304,47305,47306,47307,47309,47310,47311,47313,47314,47315,47317,47318,47319,47320,47321,47322,47323,47324,47326,47328,47330,47331,47332,47333,47334,47335,47338,47339,47341,47342,47343,47345,47346,47347,47348,47349,47350,47351,47354,47356,47358,47359,47360,47361,47362,47363,47365,47366,47367,47368,47369,47370,47371,47372,47373,47374,47375,47376,47377,47378,47379,47380,47381,47382,47383,47385,47386,47387,47388,47389,47390,47391,47393,47394,47395,47396,47397,47398,47399,47400,47401,47402,47403,47404,47405,47406,47407,47408,47409,47410,47411,47412,47413,47414,47415,47416,47417,47418,47419,47422,47423,47425,47426,47427,47429,47430,47431,47432,47433,47434,47435,47437,47438,47440,47442,47443,47444,47445,47446,47447,47450,47451,47453,47454,47455,47457,47458,47459,47460,47461,47462,47463,47466,47468,47470,47471,47472,47473,47474,47475,47478,47479,47481,47482,47483,47485,null,null,null,null,null,null,47486,47487,47488,47489,47490,47491,47494,47496,47499,47500,47503,47504,47505,47506,47507,47508,47509,47510,47511,47512,47513,47514,47515,47516,47517,47518,null,null,null,null,null,null,47519,47520,47521,47522,47523,47524,47525,47526,47527,47528,47529,47530,47531,47534,47535,47537,47538,47539,47541,47542,47543,47544,47545,47546,47547,47550,47552,47554,47555,47556,47557,47558,47559,47562,47563,47565,47571,47572,47573,47574,47575,47578,47580,47583,47584,47586,47590,47591,47593,47594,47595,47597,47598,47599,47600,47601,47602,47603,47606,47611,47612,47613,47614,47615,47618,47619,47620,47621,47622,47623,47625,47626,47627,47628,47629,47630,47631,47632,47633,47634,47635,47636,47638,47639,47640,47641,47642,47643,47644,47645,47646,47647,47648,47649,47650,47651,47652,47653,47654,47655,47656,47657,47658,47659,47660,47661,47662,47663,47664,47665,47666,47667,47668,47669,47670,47671,47674,47675,47677,47678,47679,47681,47683,47684,47685,47686,47687,47690,47692,47695,47696,47697,47698,47702,47703,47705,47706,47707,47709,47710,47711,47712,47713,47714,47715,47718,47722,47723,47724,47725,47726,47727,null,null,null,null,null,null,47730,47731,47733,47734,47735,47737,47738,47739,47740,47741,47742,47743,47744,47745,47746,47750,47752,47753,47754,47755,47757,47758,47759,47760,47761,47762,null,null,null,null,null,null,47763,47764,47765,47766,47767,47768,47769,47770,47771,47772,47773,47774,47775,47776,47777,47778,47779,47780,47781,47782,47783,47786,47789,47790,47791,47793,47795,47796,47797,47798,47799,47802,47804,47806,47807,47808,47809,47810,47811,47813,47814,47815,47817,47818,47819,47820,47821,47822,47823,47824,47825,47826,47827,47828,47829,47830,47831,47834,47835,47836,47837,47838,47839,47840,47841,47842,47843,47844,47845,47846,47847,47848,47849,47850,47851,47852,47853,47854,47855,47856,47857,47858,47859,47860,47861,47862,47863,47864,47865,47866,47867,47869,47870,47871,47873,47874,47875,47877,47878,47879,47880,47881,47882,47883,47884,47886,47888,47890,47891,47892,47893,47894,47895,47897,47898,47899,47901,47902,47903,47905,47906,47907,47908,47909,47910,47911,47912,47914,47916,47917,47918,47919,47920,47921,47922,47923,47927,47929,47930,47935,47936,47937,47938,47939,47942,47944,47946,47947,47948,47950,47953,47954,null,null,null,null,null,null,47955,47957,47958,47959,47961,47962,47963,47964,47965,47966,47967,47968,47970,47972,47973,47974,47975,47976,47977,47978,47979,47981,47982,47983,47984,47985,null,null,null,null,null,null,47986,47987,47988,47989,47990,47991,47992,47993,47994,47995,47996,47997,47998,47999,48000,48001,48002,48003,48004,48005,48006,48007,48009,48010,48011,48013,48014,48015,48017,48018,48019,48020,48021,48022,48023,48024,48025,48026,48027,48028,48029,48030,48031,48032,48033,48034,48035,48037,48038,48039,48041,48042,48043,48045,48046,48047,48048,48049,48050,48051,48053,48054,48056,48057,48058,48059,48060,48061,48062,48063,48065,48066,48067,48069,48070,48071,48073,48074,48075,48076,48077,48078,48079,48081,48082,48084,48085,48086,48087,48088,48089,48090,48091,48092,48093,48094,48095,48096,48097,48098,48099,48100,48101,48102,48103,48104,48105,48106,48107,48108,48109,48110,48111,48112,48113,48114,48115,48116,48117,48118,48119,48122,48123,48125,48126,48129,48131,48132,48133,48134,48135,48138,48142,48144,48146,48147,48153,48154,48160,48161,48162,48163,48166,48168,48170,48171,48172,48174,48175,48178,48179,48181,null,null,null,null,null,null,48182,48183,48185,48186,48187,48188,48189,48190,48191,48194,48198,48199,48200,48202,48203,48206,48207,48209,48210,48211,48212,48213,48214,48215,48216,48217,null,null,null,null,null,null,48218,48219,48220,48222,48223,48224,48225,48226,48227,48228,48229,48230,48231,48232,48233,48234,48235,48236,48237,48238,48239,48240,48241,48242,48243,48244,48245,48246,48247,48248,48249,48250,48251,48252,48253,48254,48255,48256,48257,48258,48259,48262,48263,48265,48266,48269,48271,48272,48273,48274,48275,48278,48280,48283,48284,48285,48286,48287,48290,48291,48293,48294,48297,48298,48299,48300,48301,48302,48303,48306,48310,48311,48312,48313,48314,48315,48318,48319,48321,48322,48323,48325,48326,48327,48328,48329,48330,48331,48332,48334,48338,48339,48340,48342,48343,48345,48346,48347,48349,48350,48351,48352,48353,48354,48355,48356,48357,48358,48359,48360,48361,48362,48363,48364,48365,48366,48367,48368,48369,48370,48371,48375,48377,48378,48379,48381,48382,48383,48384,48385,48386,48387,48390,48392,48394,48395,48396,48397,48398,48399,48401,48402,48403,48405,48406,48407,48408,48409,48410,48411,48412,48413,null,null,null,null,null,null,48414,48415,48416,48417,48418,48419,48421,48422,48423,48424,48425,48426,48427,48429,48430,48431,48432,48433,48434,48435,48436,48437,48438,48439,48440,48441,null,null,null,null,null,null,48442,48443,48444,48445,48446,48447,48449,48450,48451,48452,48453,48454,48455,48458,48459,48461,48462,48463,48465,48466,48467,48468,48469,48470,48471,48474,48475,48476,48477,48478,48479,48480,48481,48482,48483,48485,48486,48487,48489,48490,48491,48492,48493,48494,48495,48496,48497,48498,48499,48500,48501,48502,48503,48504,48505,48506,48507,48508,48509,48510,48511,48514,48515,48517,48518,48523,48524,48525,48526,48527,48530,48532,48534,48535,48536,48539,48541,48542,48543,48544,48545,48546,48547,48549,48550,48551,48552,48553,48554,48555,48556,48557,48558,48559,48561,48562,48563,48564,48565,48566,48567,48569,48570,48571,48572,48573,48574,48575,48576,48577,48578,48579,48580,48581,48582,48583,48584,48585,48586,48587,48588,48589,48590,48591,48592,48593,48594,48595,48598,48599,48601,48602,48603,48605,48606,48607,48608,48609,48610,48611,48612,48613,48614,48615,48616,48618,48619,48620,48621,48622,48623,48625,null,null,null,null,null,null,48626,48627,48629,48630,48631,48633,48634,48635,48636,48637,48638,48639,48641,48642,48644,48646,48647,48648,48649,48650,48651,48654,48655,48657,48658,48659,null,null,null,null,null,null,48661,48662,48663,48664,48665,48666,48667,48670,48672,48673,48674,48675,48676,48677,48678,48679,48680,48681,48682,48683,48684,48685,48686,48687,48688,48689,48690,48691,48692,48693,48694,48695,48696,48697,48698,48699,48700,48701,48702,48703,48704,48705,48706,48707,48710,48711,48713,48714,48715,48717,48719,48720,48721,48722,48723,48726,48728,48732,48733,48734,48735,48738,48739,48741,48742,48743,48745,48747,48748,48749,48750,48751,48754,48758,48759,48760,48761,48762,48766,48767,48769,48770,48771,48773,48774,48775,48776,48777,48778,48779,48782,48786,48787,48788,48789,48790,48791,48794,48795,48796,48797,48798,48799,48800,48801,48802,48803,48804,48805,48806,48807,48809,48810,48811,48812,48813,48814,48815,48816,48817,48818,48819,48820,48821,48822,48823,48824,48825,48826,48827,48828,48829,48830,48831,48832,48833,48834,48835,48836,48837,48838,48839,48840,48841,48842,48843,48844,48845,48846,48847,48850,48851,null,null,null,null,null,null,48853,48854,48857,48858,48859,48860,48861,48862,48863,48865,48866,48870,48871,48872,48873,48874,48875,48877,48878,48879,48880,48881,48882,48883,48884,48885,null,null,null,null,null,null,48886,48887,48888,48889,48890,48891,48892,48893,48894,48895,48896,48898,48899,48900,48901,48902,48903,48906,48907,48908,48909,48910,48911,48912,48913,48914,48915,48916,48917,48918,48919,48922,48926,48927,48928,48929,48930,48931,48932,48933,48934,48935,48936,48937,48938,48939,48940,48941,48942,48943,48944,48945,48946,48947,48948,48949,48950,48951,48952,48953,48954,48955,48956,48957,48958,48959,48962,48963,48965,48966,48967,48969,48970,48971,48972,48973,48974,48975,48978,48979,48980,48982,48983,48984,48985,48986,48987,48988,48989,48990,48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,49014,49015,49016,49017,49018,49019,49020,49021,49022,49023,49024,49025,49026,49027,49028,49029,49030,49031,49032,49033,49034,49035,49036,49037,49038,49039,49040,49041,49042,49043,49045,49046,49047,49048,49049,49050,49051,49052,49053,null,null,null,null,null,null,49054,49055,49056,49057,49058,49059,49060,49061,49062,49063,49064,49065,49066,49067,49068,49069,49070,49071,49073,49074,49075,49076,49077,49078,49079,49080,null,null,null,null,null,null,49081,49082,49083,49084,49085,49086,49087,49088,49089,49090,49091,49092,49094,49095,49096,49097,49098,49099,49102,49103,49105,49106,49107,49109,49110,49111,49112,49113,49114,49115,49117,49118,49120,49122,49123,49124,49125,49126,49127,49128,49129,49130,49131,49132,49133,49134,49135,49136,49137,49138,49139,49140,49141,49142,49143,49144,49145,49146,49147,49148,49149,49150,49151,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49162,49163,49164,49165,49166,49167,49168,49169,49170,49171,49172,49173,49174,49175,49176,49177,49178,49179,49180,49181,49182,49183,49184,49185,49186,49187,49188,49189,49190,49191,49192,49193,49194,49195,49196,49197,49198,49199,49200,49201,49202,49203,49204,49205,49206,49207,49208,49209,49210,49211,49213,49214,49215,49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,49226,49227,49228,49229,49230,49231,49232,49234,49235,49236,49237,49238,49239,49241,49242,49243,null,null,null,null,null,null,49245,49246,49247,49249,49250,49251,49252,49253,49254,49255,49258,49259,49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,49272,49273,null,null,null,null,null,null,49274,49275,49276,49277,49278,49279,49280,49281,49282,49283,49284,49285,49286,49287,49288,49289,49290,49291,49292,49293,49294,49295,49298,49299,49301,49302,49303,49305,49306,49307,49308,49309,49310,49311,49314,49316,49318,49319,49320,49321,49322,49323,49326,49329,49330,49335,49336,49337,49338,49339,49342,49346,49347,49348,49350,49351,49354,49355,49357,49358,49359,49361,49362,49363,49364,49365,49366,49367,49370,49374,49375,49376,49377,49378,49379,49382,49383,49385,49386,49387,49389,49390,49391,49392,49393,49394,49395,49398,49400,49402,49403,49404,49405,49406,49407,49409,49410,49411,49413,49414,49415,49417,49418,49419,49420,49421,49422,49423,49425,49426,49427,49428,49430,49431,49432,49433,49434,49435,49441,49442,49445,49448,49449,49450,49451,49454,49458,49459,49460,49461,49463,49466,49467,49469,49470,49471,49473,49474,49475,49476,49477,49478,49479,49482,49486,49487,49488,49489,49490,49491,49494,49495,null,null,null,null,null,null,49497,49498,49499,49501,49502,49503,49504,49505,49506,49507,49510,49514,49515,49516,49517,49518,49519,49521,49522,49523,49525,49526,49527,49529,49530,49531,null,null,null,null,null,null,49532,49533,49534,49535,49536,49537,49538,49539,49540,49542,49543,49544,49545,49546,49547,49551,49553,49554,49555,49557,49559,49560,49561,49562,49563,49566,49568,49570,49571,49572,49574,49575,49578,49579,49581,49582,49583,49585,49586,49587,49588,49589,49590,49591,49592,49593,49594,49595,49596,49598,49599,49600,49601,49602,49603,49605,49606,49607,49609,49610,49611,49613,49614,49615,49616,49617,49618,49619,49621,49622,49625,49626,49627,49628,49629,49630,49631,49633,49634,49635,49637,49638,49639,49641,49642,49643,49644,49645,49646,49647,49650,49652,49653,49654,49655,49656,49657,49658,49659,49662,49663,49665,49666,49667,49669,49670,49671,49672,49673,49674,49675,49678,49680,49682,49683,49684,49685,49686,49687,49690,49691,49693,49694,49697,49698,49699,49700,49701,49702,49703,49706,49708,49710,49712,49715,49717,49718,49719,49720,49721,49722,49723,49724,49725,49726,49727,49728,49729,49730,49731,49732,49733,null,null,null,null,null,null,49734,49735,49737,49738,49739,49740,49741,49742,49743,49746,49747,49749,49750,49751,49753,49754,49755,49756,49757,49758,49759,49761,49762,49763,49764,49766,null,null,null,null,null,null,49767,49768,49769,49770,49771,49774,49775,49777,49778,49779,49781,49782,49783,49784,49785,49786,49787,49790,49792,49794,49795,49796,49797,49798,49799,49802,49803,49804,49805,49806,49807,49809,49810,49811,49812,49813,49814,49815,49817,49818,49820,49822,49823,49824,49825,49826,49827,49830,49831,49833,49834,49835,49838,49839,49840,49841,49842,49843,49846,49848,49850,49851,49852,49853,49854,49855,49856,49857,49858,49859,49860,49861,49862,49863,49864,49865,49866,49867,49868,49869,49870,49871,49872,49873,49874,49875,49876,49877,49878,49879,49880,49881,49882,49883,49886,49887,49889,49890,49893,49894,49895,49896,49897,49898,49902,49904,49906,49907,49908,49909,49911,49914,49917,49918,49919,49921,49922,49923,49924,49925,49926,49927,49930,49931,49934,49935,49936,49937,49938,49942,49943,49945,49946,49947,49949,49950,49951,49952,49953,49954,49955,49958,49959,49962,49963,49964,49965,49966,49967,49968,49969,49970,null,null,null,null,null,null,49971,49972,49973,49974,49975,49976,49977,49978,49979,49980,49981,49982,49983,49984,49985,49986,49987,49988,49990,49991,49992,49993,49994,49995,49996,49997,null,null,null,null,null,null,49998,49999,50000,50001,50002,50003,50004,50005,50006,50007,50008,50009,50010,50011,50012,50013,50014,50015,50016,50017,50018,50019,50020,50021,50022,50023,50026,50027,50029,50030,50031,50033,50035,50036,50037,50038,50039,50042,50043,50046,50047,50048,50049,50050,50051,50053,50054,50055,50057,50058,50059,50061,50062,50063,50064,50065,50066,50067,50068,50069,50070,50071,50072,50073,50074,50075,50076,50077,50078,50079,50080,50081,50082,50083,50084,50085,50086,50087,50088,50089,50090,50091,50092,50093,50094,50095,50096,50097,50098,50099,50100,50101,50102,50103,50104,50105,50106,50107,50108,50109,50110,50111,50113,50114,50115,50116,50117,50118,50119,50120,50121,50122,50123,50124,50125,50126,50127,50128,50129,50130,50131,50132,50133,50134,50135,50138,50139,50141,50142,50145,50147,50148,50149,50150,50151,50154,50155,50156,50158,50159,50160,50161,50162,50163,50166,50167,50169,50170,50171,50172,50173,50174,null,null,null,null,null,null,50175,50176,50177,50178,50179,50180,50181,50182,50183,50185,50186,50187,50188,50189,50190,50191,50193,50194,50195,50196,50197,50198,50199,50200,50201,50202,null,null,null,null,null,null,50203,50204,50205,50206,50207,50208,50209,50210,50211,50213,50214,50215,50216,50217,50218,50219,50221,50222,50223,50225,50226,50227,50229,50230,50231,50232,50233,50234,50235,50238,50239,50240,50241,50242,50243,50244,50245,50246,50247,50249,50250,50251,50252,50253,50254,50255,50256,50257,50258,50259,50260,50261,50262,50263,50264,50265,50266,50267,50268,50269,50270,50271,50272,50273,50274,50275,50278,50279,50281,50282,50283,50285,50286,50287,50288,50289,50290,50291,50294,50295,50296,50298,50299,50300,50301,50302,50303,50305,50306,50307,50308,50309,50310,50311,50312,50313,50314,50315,50316,50317,50318,50319,50320,50321,50322,50323,50325,50326,50327,50328,50329,50330,50331,50333,50334,50335,50336,50337,50338,50339,50340,50341,50342,50343,50344,50345,50346,50347,50348,50349,50350,50351,50352,50353,50354,50355,50356,50357,50358,50359,50361,50362,50363,50365,50366,50367,50368,50369,50370,50371,50372,50373,null,null,null,null,null,null,50374,50375,50376,50377,50378,50379,50380,50381,50382,50383,50384,50385,50386,50387,50388,50389,50390,50391,50392,50393,50394,50395,50396,50397,50398,50399,null,null,null,null,null,null,50400,50401,50402,50403,50404,50405,50406,50407,50408,50410,50411,50412,50413,50414,50415,50418,50419,50421,50422,50423,50425,50427,50428,50429,50430,50434,50435,50436,50437,50438,50439,50440,50441,50442,50443,50445,50446,50447,50449,50450,50451,50453,50454,50455,50456,50457,50458,50459,50461,50462,50463,50464,50465,50466,50467,50468,50469,50470,50471,50474,50475,50477,50478,50479,50481,50482,50483,50484,50485,50486,50487,50490,50492,50494,50495,50496,50497,50498,50499,50502,50503,50507,50511,50512,50513,50514,50518,50522,50523,50524,50527,50530,50531,50533,50534,50535,50537,50538,50539,50540,50541,50542,50543,50546,50550,50551,50552,50553,50554,50555,50558,50559,50561,50562,50563,50565,50566,50568,50569,50570,50571,50574,50576,50578,50579,50580,50582,50585,50586,50587,50589,50590,50591,50593,50594,50595,50596,50597,50598,50599,50600,50602,50603,50604,50605,50606,50607,50608,50609,50610,50611,50614,null,null,null,null,null,null,50615,50618,50623,50624,50625,50626,50627,50635,50637,50639,50642,50643,50645,50646,50647,50649,50650,50651,50652,50653,50654,50655,50658,50660,50662,50663,null,null,null,null,null,null,50664,50665,50666,50667,50671,50673,50674,50675,50677,50680,50681,50682,50683,50690,50691,50692,50697,50698,50699,50701,50702,50703,50705,50706,50707,50708,50709,50710,50711,50714,50717,50718,50719,50720,50721,50722,50723,50726,50727,50729,50730,50731,50735,50737,50738,50742,50744,50746,50748,50749,50750,50751,50754,50755,50757,50758,50759,50761,50762,50763,50764,50765,50766,50767,50770,50774,50775,50776,50777,50778,50779,50782,50783,50785,50786,50787,50788,50789,50790,50791,50792,50793,50794,50795,50797,50798,50800,50802,50803,50804,50805,50806,50807,50810,50811,50813,50814,50815,50817,50818,50819,50820,50821,50822,50823,50826,50828,50830,50831,50832,50833,50834,50835,50838,50839,50841,50842,50843,50845,50846,50847,50848,50849,50850,50851,50854,50856,50858,50859,50860,50861,50862,50863,50866,50867,50869,50870,50871,50875,50876,50877,50878,50879,50882,50884,50886,50887,50888,50889,50890,50891,50894,null,null,null,null,null,null,50895,50897,50898,50899,50901,50902,50903,50904,50905,50906,50907,50910,50911,50914,50915,50916,50917,50918,50919,50922,50923,50925,50926,50927,50929,50930,null,null,null,null,null,null,50931,50932,50933,50934,50935,50938,50939,50940,50942,50943,50944,50945,50946,50947,50950,50951,50953,50954,50955,50957,50958,50959,50960,50961,50962,50963,50966,50968,50970,50971,50972,50973,50974,50975,50978,50979,50981,50982,50983,50985,50986,50987,50988,50989,50990,50991,50994,50996,50998,51000,51001,51002,51003,51006,51007,51009,51010,51011,51013,51014,51015,51016,51017,51019,51022,51024,51033,51034,51035,51037,51038,51039,51041,51042,51043,51044,51045,51046,51047,51049,51050,51052,51053,51054,51055,51056,51057,51058,51059,51062,51063,51065,51066,51067,51071,51072,51073,51074,51078,51083,51084,51085,51087,51090,51091,51093,51097,51099,51100,51101,51102,51103,51106,51111,51112,51113,51114,51115,51118,51119,51121,51122,51123,51125,51126,51127,51128,51129,51130,51131,51134,51138,51139,51140,51141,51142,51143,51146,51147,51149,51151,51153,51154,51155,51156,51157,51158,51159,51161,51162,51163,51164,null,null,null,null,null,null,51166,51167,51168,51169,51170,51171,51173,51174,51175,51177,51178,51179,51181,51182,51183,51184,51185,51186,51187,51188,51189,51190,51191,51192,51193,51194,null,null,null,null,null,null,51195,51196,51197,51198,51199,51202,51203,51205,51206,51207,51209,51211,51212,51213,51214,51215,51218,51220,51223,51224,51225,51226,51227,51230,51231,51233,51234,51235,51237,51238,51239,51240,51241,51242,51243,51246,51248,51250,51251,51252,51253,51254,51255,51257,51258,51259,51261,51262,51263,51265,51266,51267,51268,51269,51270,51271,51274,51275,51278,51279,51280,51281,51282,51283,51285,51286,51287,51288,51289,51290,51291,51292,51293,51294,51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,51306,51307,51308,51309,51310,51311,51314,51315,51317,51318,51319,51321,51323,51324,51325,51326,51327,51330,51332,51336,51337,51338,51342,51343,51344,51345,51346,51347,51349,51350,51351,51352,51353,51354,51355,51356,51358,51360,51362,51363,51364,51365,51366,51367,51369,51370,51371,51372,51373,51374,51375,51376,51377,51378,51379,51380,51381,51382,51383,51384,51385,51386,51387,51390,51391,51392,51393,null,null,null,null,null,null,51394,51395,51397,51398,51399,51401,51402,51403,51405,51406,51407,51408,51409,51410,51411,51414,51416,51418,51419,51420,51421,51422,51423,51426,51427,51429,null,null,null,null,null,null,51430,51431,51432,51433,51434,51435,51436,51437,51438,51439,51440,51441,51442,51443,51444,51446,51447,51448,51449,51450,51451,51454,51455,51457,51458,51459,51463,51464,51465,51466,51467,51470,12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8594,8592,8593,8595,8596,12307,8810,8811,8730,8765,8733,8757,8747,8748,8712,8715,8838,8839,8834,8835,8746,8745,8743,8744,65506,51472,51474,51475,51476,51477,51478,51479,51481,51482,51483,51484,51485,51486,51487,51488,51489,51490,51491,51492,51493,51494,51495,51496,51497,51498,51499,null,null,null,null,null,null,51501,51502,51503,51504,51505,51506,51507,51509,51510,51511,51512,51513,51514,51515,51516,51517,51518,51519,51520,51521,51522,51523,51524,51525,51526,51527,null,null,null,null,null,null,51528,51529,51530,51531,51532,51533,51534,51535,51538,51539,51541,51542,51543,51545,51546,51547,51548,51549,51550,51551,51554,51556,51557,51558,51559,51560,51561,51562,51563,51565,51566,51567,8658,8660,8704,8707,180,65374,711,728,733,730,729,184,731,161,191,720,8750,8721,8719,164,8457,8240,9665,9664,9655,9654,9828,9824,9825,9829,9831,9827,8857,9672,9635,9680,9681,9618,9636,9637,9640,9639,9638,9641,9832,9743,9742,9756,9758,182,8224,8225,8597,8599,8601,8598,8600,9837,9833,9834,9836,12927,12828,8470,13255,8482,13250,13272,8481,8364,174,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51569,51570,51571,51573,51574,51575,51576,51577,51578,51579,51581,51582,51583,51584,51585,51586,51587,51588,51589,51590,51591,51594,51595,51597,51598,51599,null,null,null,null,null,null,51601,51602,51603,51604,51605,51606,51607,51610,51612,51614,51615,51616,51617,51618,51619,51620,51621,51622,51623,51624,51625,51626,51627,51628,51629,51630,null,null,null,null,null,null,51631,51632,51633,51634,51635,51636,51637,51638,51639,51640,51641,51642,51643,51644,51645,51646,51647,51650,51651,51653,51654,51657,51659,51660,51661,51662,51663,51666,51668,51671,51672,51675,65281,65282,65283,65284,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65510,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,51678,51679,51681,51683,51685,51686,51688,51689,51690,51691,51694,51698,51699,51700,51701,51702,51703,51706,51707,51709,51710,51711,51713,51714,51715,51716,null,null,null,null,null,null,51717,51718,51719,51722,51726,51727,51728,51729,51730,51731,51733,51734,51735,51737,51738,51739,51740,51741,51742,51743,51744,51745,51746,51747,51748,51749,null,null,null,null,null,null,51750,51751,51752,51754,51755,51756,51757,51758,51759,51760,51761,51762,51763,51764,51765,51766,51767,51768,51769,51770,51771,51772,51773,51774,51775,51776,51777,51778,51779,51780,51781,51782,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,51783,51784,51785,51786,51787,51790,51791,51793,51794,51795,51797,51798,51799,51800,51801,51802,51803,51806,51810,51811,51812,51813,51814,51815,51817,51818,null,null,null,null,null,null,51819,51820,51821,51822,51823,51824,51825,51826,51827,51828,51829,51830,51831,51832,51833,51834,51835,51836,51838,51839,51840,51841,51842,51843,51845,51846,null,null,null,null,null,null,51847,51848,51849,51850,51851,51852,51853,51854,51855,51856,51857,51858,51859,51860,51861,51862,51863,51865,51866,51867,51868,51869,51870,51871,51872,51873,51874,51875,51876,51877,51878,51879,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,null,null,null,null,null,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,51880,51881,51882,51883,51884,51885,51886,51887,51888,51889,51890,51891,51892,51893,51894,51895,51896,51897,51898,51899,51902,51903,51905,51906,51907,51909,null,null,null,null,null,null,51910,51911,51912,51913,51914,51915,51918,51920,51922,51924,51925,51926,51927,51930,51931,51932,51933,51934,51935,51937,51938,51939,51940,51941,51942,51943,null,null,null,null,null,null,51944,51945,51946,51947,51949,51950,51951,51952,51953,51954,51955,51957,51958,51959,51960,51961,51962,51963,51964,51965,51966,51967,51968,51969,51970,51971,51972,51973,51974,51975,51977,51978,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,9489,9498,9497,9494,9493,9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525,9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51979,51980,51981,51982,51983,51985,51986,51987,51989,51990,51991,51993,51994,51995,51996,51997,51998,51999,52002,52003,52004,52005,52006,52007,52008,52009,null,null,null,null,null,null,52010,52011,52012,52013,52014,52015,52016,52017,52018,52019,52020,52021,52022,52023,52024,52025,52026,52027,52028,52029,52030,52031,52032,52034,52035,52036,null,null,null,null,null,null,52037,52038,52039,52042,52043,52045,52046,52047,52049,52050,52051,52052,52053,52054,52055,52058,52059,52060,52062,52063,52064,52065,52066,52067,52069,52070,52071,52072,52073,52074,52075,52076,13205,13206,13207,8467,13208,13252,13219,13220,13221,13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13258,13197,13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242,13243,13244,13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249,13194,13195,13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228,13277,13264,13267,13251,13257,13276,13254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52077,52078,52079,52080,52081,52082,52083,52084,52085,52086,52087,52090,52091,52092,52093,52094,52095,52096,52097,52098,52099,52100,52101,52102,52103,52104,null,null,null,null,null,null,52105,52106,52107,52108,52109,52110,52111,52112,52113,52114,52115,52116,52117,52118,52119,52120,52121,52122,52123,52125,52126,52127,52128,52129,52130,52131,null,null,null,null,null,null,52132,52133,52134,52135,52136,52137,52138,52139,52140,52141,52142,52143,52144,52145,52146,52147,52148,52149,52150,52151,52153,52154,52155,52156,52157,52158,52159,52160,52161,52162,52163,52164,198,208,170,294,null,306,null,319,321,216,338,186,222,358,330,null,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188,190,8539,8540,8541,8542,52165,52166,52167,52168,52169,52170,52171,52172,52173,52174,52175,52176,52177,52178,52179,52181,52182,52183,52184,52185,52186,52187,52188,52189,52190,52191,null,null,null,null,null,null,52192,52193,52194,52195,52197,52198,52200,52202,52203,52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,52217,52218,52219,52220,null,null,null,null,null,null,52221,52222,52223,52224,52225,52226,52227,52228,52229,52230,52231,52232,52233,52234,52235,52238,52239,52241,52242,52243,52245,52246,52247,52248,52249,52250,52251,52254,52255,52256,52259,52260,230,273,240,295,305,307,312,320,322,248,339,223,254,359,331,329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,185,178,179,8308,8319,8321,8322,8323,8324,52261,52262,52266,52267,52269,52271,52273,52274,52275,52276,52277,52278,52279,52282,52287,52288,52289,52290,52291,52294,52295,52297,52298,52299,52301,52302,null,null,null,null,null,null,52303,52304,52305,52306,52307,52310,52314,52315,52316,52317,52318,52319,52321,52322,52323,52325,52327,52329,52330,52331,52332,52333,52334,52335,52337,52338,null,null,null,null,null,null,52339,52340,52342,52343,52344,52345,52346,52347,52348,52349,52350,52351,52352,52353,52354,52355,52356,52357,52358,52359,52360,52361,52362,52363,52364,52365,52366,52367,52368,52369,52370,52371,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,52372,52373,52374,52375,52378,52379,52381,52382,52383,52385,52386,52387,52388,52389,52390,52391,52394,52398,52399,52400,52401,52402,52403,52406,52407,52409,null,null,null,null,null,null,52410,52411,52413,52414,52415,52416,52417,52418,52419,52422,52424,52426,52427,52428,52429,52430,52431,52433,52434,52435,52437,52438,52439,52440,52441,52442,null,null,null,null,null,null,52443,52444,52445,52446,52447,52448,52449,52450,52451,52453,52454,52455,52456,52457,52458,52459,52461,52462,52463,52465,52466,52467,52468,52469,52470,52471,52472,52473,52474,52475,52476,52477,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,52478,52479,52480,52482,52483,52484,52485,52486,52487,52490,52491,52493,52494,52495,52497,52498,52499,52500,52501,52502,52503,52506,52508,52510,52511,52512,null,null,null,null,null,null,52513,52514,52515,52517,52518,52519,52521,52522,52523,52525,52526,52527,52528,52529,52530,52531,52532,52533,52534,52535,52536,52538,52539,52540,52541,52542,null,null,null,null,null,null,52543,52544,52545,52546,52547,52548,52549,52550,52551,52552,52553,52554,52555,52556,52557,52558,52559,52560,52561,52562,52563,52564,52565,52566,52567,52568,52569,52570,52571,52573,52574,52575,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,52577,52578,52579,52581,52582,52583,52584,52585,52586,52587,52590,52592,52594,52595,52596,52597,52598,52599,52601,52602,52603,52604,52605,52606,52607,52608,null,null,null,null,null,null,52609,52610,52611,52612,52613,52614,52615,52617,52618,52619,52620,52621,52622,52623,52624,52625,52626,52627,52630,52631,52633,52634,52635,52637,52638,52639,null,null,null,null,null,null,52640,52641,52642,52643,52646,52648,52650,52651,52652,52653,52654,52655,52657,52658,52659,52660,52661,52662,52663,52664,52665,52666,52667,52668,52669,52670,52671,52672,52673,52674,52675,52677,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52678,52679,52680,52681,52682,52683,52685,52686,52687,52689,52690,52691,52692,52693,52694,52695,52696,52697,52698,52699,52700,52701,52702,52703,52704,52705,null,null,null,null,null,null,52706,52707,52708,52709,52710,52711,52713,52714,52715,52717,52718,52719,52721,52722,52723,52724,52725,52726,52727,52730,52732,52734,52735,52736,52737,52738,null,null,null,null,null,null,52739,52741,52742,52743,52745,52746,52747,52749,52750,52751,52752,52753,52754,52755,52757,52758,52759,52760,52762,52763,52764,52765,52766,52767,52770,52771,52773,52774,52775,52777,52778,52779,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52780,52781,52782,52783,52786,52788,52790,52791,52792,52793,52794,52795,52796,52797,52798,52799,52800,52801,52802,52803,52804,52805,52806,52807,52808,52809,null,null,null,null,null,null,52810,52811,52812,52813,52814,52815,52816,52817,52818,52819,52820,52821,52822,52823,52826,52827,52829,52830,52834,52835,52836,52837,52838,52839,52842,52844,null,null,null,null,null,null,52846,52847,52848,52849,52850,52851,52854,52855,52857,52858,52859,52861,52862,52863,52864,52865,52866,52867,52870,52872,52874,52875,52876,52877,52878,52879,52882,52883,52885,52886,52887,52889,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52890,52891,52892,52893,52894,52895,52898,52902,52903,52904,52905,52906,52907,52910,52911,52912,52913,52914,52915,52916,52917,52918,52919,52920,52921,52922,null,null,null,null,null,null,52923,52924,52925,52926,52927,52928,52930,52931,52932,52933,52934,52935,52936,52937,52938,52939,52940,52941,52942,52943,52944,52945,52946,52947,52948,52949,null,null,null,null,null,null,52950,52951,52952,52953,52954,52955,52956,52957,52958,52959,52960,52961,52962,52963,52966,52967,52969,52970,52973,52974,52975,52976,52977,52978,52979,52982,52986,52987,52988,52989,52990,52991,44032,44033,44036,44039,44040,44041,44042,44048,44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061,44064,44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109,44116,44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164,44165,44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193,44200,44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228,44232,44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272,44273,44275,44277,44278,44284,44285,44288,44292,44294,52994,52995,52997,52998,52999,53001,53002,53003,53004,53005,53006,53007,53010,53012,53014,53015,53016,53017,53018,53019,53021,53022,53023,53025,53026,53027,null,null,null,null,null,null,53029,53030,53031,53032,53033,53034,53035,53038,53042,53043,53044,53045,53046,53047,53049,53050,53051,53052,53053,53054,53055,53056,53057,53058,53059,53060,null,null,null,null,null,null,53061,53062,53063,53064,53065,53066,53067,53068,53069,53070,53071,53072,53073,53074,53075,53078,53079,53081,53082,53083,53085,53086,53087,53088,53089,53090,53091,53094,53096,53098,53099,53100,44300,44301,44303,44305,44312,44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359,44361,44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406,44411,44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452,44471,44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537,44540,44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599,44600,44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628,44630,44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,53101,53102,53103,53106,53107,53109,53110,53111,53113,53114,53115,53116,53117,53118,53119,53121,53122,53123,53124,53126,53127,53128,53129,53130,53131,53133,null,null,null,null,null,null,53134,53135,53136,53137,53138,53139,53140,53141,53142,53143,53144,53145,53146,53147,53148,53149,53150,53151,53152,53154,53155,53156,53157,53158,53159,53161,null,null,null,null,null,null,53162,53163,53164,53165,53166,53167,53169,53170,53171,53172,53173,53174,53175,53176,53177,53178,53179,53180,53181,53182,53183,53184,53185,53186,53187,53189,53190,53191,53192,53193,53194,53195,44665,44667,44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749,44751,44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807,44808,44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866,44867,44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944,44945,44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006,45012,45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072,45076,45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141,45143,45145,53196,53197,53198,53199,53200,53201,53202,53203,53204,53205,53206,53207,53208,53209,53210,53211,53212,53213,53214,53215,53218,53219,53221,53222,53223,53225,null,null,null,null,null,null,53226,53227,53228,53229,53230,53231,53234,53236,53238,53239,53240,53241,53242,53243,53245,53246,53247,53249,53250,53251,53253,53254,53255,53256,53257,53258,null,null,null,null,null,null,53259,53260,53261,53262,53263,53264,53266,53267,53268,53269,53270,53271,53273,53274,53275,53276,53277,53278,53279,53280,53281,53282,53283,53284,53285,53286,53287,53288,53289,53290,53291,53292,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209,45210,45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231,45233,45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265,45268,45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337,45339,45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369,45376,45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433,45436,45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480,45516,45520,45524,45532,45533,53294,53295,53296,53297,53298,53299,53302,53303,53305,53306,53307,53309,53310,53311,53312,53313,53314,53315,53318,53320,53322,53323,53324,53325,53326,53327,null,null,null,null,null,null,53329,53330,53331,53333,53334,53335,53337,53338,53339,53340,53341,53342,53343,53345,53346,53347,53348,53349,53350,53351,53352,53353,53354,53355,53358,53359,null,null,null,null,null,null,53361,53362,53363,53365,53366,53367,53368,53369,53370,53371,53374,53375,53376,53378,53379,53380,53381,53382,53383,53384,53385,53386,53387,53388,53389,53390,53391,53392,53393,53394,53395,53396,45535,45544,45545,45548,45552,45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,45600,45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,45705,45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,45740,45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,45796,45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,45816,45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,45845,45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,53397,53398,53399,53400,53401,53402,53403,53404,53405,53406,53407,53408,53409,53410,53411,53414,53415,53417,53418,53419,53421,53422,53423,53424,53425,53426,null,null,null,null,null,null,53427,53430,53432,53434,53435,53436,53437,53438,53439,53442,53443,53445,53446,53447,53450,53451,53452,53453,53454,53455,53458,53462,53463,53464,53465,53466,null,null,null,null,null,null,53467,53470,53471,53473,53474,53475,53477,53478,53479,53480,53481,53482,53483,53486,53490,53491,53492,53493,53494,53495,53497,53498,53499,53500,53501,53502,53503,53504,53505,53506,53507,53508,45927,45929,45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,45968,45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,46036,46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,46112,46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,46188,46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,46288,46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,46356,46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,46388,46392,53509,53510,53511,53512,53513,53514,53515,53516,53518,53519,53520,53521,53522,53523,53524,53525,53526,53527,53528,53529,53530,53531,53532,53533,53534,53535,null,null,null,null,null,null,53536,53537,53538,53539,53540,53541,53542,53543,53544,53545,53546,53547,53548,53549,53550,53551,53554,53555,53557,53558,53559,53561,53563,53564,53565,53566,null,null,null,null,null,null,53567,53570,53574,53575,53576,53577,53578,53579,53582,53583,53585,53586,53587,53589,53590,53591,53592,53593,53594,53595,53598,53600,53602,53603,53604,53605,53606,53607,53609,53610,53611,53613,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,46429,46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,46516,46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,46572,46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,46752,46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,46889,46892,46895,46896,46904,46905,46907,46916,46920,46924,46932,46933,46944,46948,46952,46960,46961,46963,46965,46972,46973,46976,46980,46988,46989,46991,46992,46993,46994,46998,46999,53614,53615,53616,53617,53618,53619,53620,53621,53622,53623,53624,53625,53626,53627,53629,53630,53631,53632,53633,53634,53635,53637,53638,53639,53641,53642,null,null,null,null,null,null,53643,53644,53645,53646,53647,53648,53649,53650,53651,53652,53653,53654,53655,53656,53657,53658,53659,53660,53661,53662,53663,53666,53667,53669,53670,53671,null,null,null,null,null,null,53673,53674,53675,53676,53677,53678,53679,53682,53684,53686,53687,53688,53689,53691,53693,53694,53695,53697,53698,53699,53700,53701,53702,53703,53704,53705,53706,53707,53708,53709,53710,53711,47000,47001,47004,47008,47016,47017,47019,47020,47021,47028,47029,47032,47047,47049,47084,47085,47088,47092,47100,47101,47103,47104,47105,47111,47112,47113,47116,47120,47128,47129,47131,47133,47140,47141,47144,47148,47156,47157,47159,47160,47161,47168,47172,47185,47187,47196,47197,47200,47204,47212,47213,47215,47217,47224,47228,47245,47272,47280,47284,47288,47296,47297,47299,47301,47308,47312,47316,47325,47327,47329,47336,47337,47340,47344,47352,47353,47355,47357,47364,47384,47392,47420,47421,47424,47428,47436,47439,47441,47448,47449,47452,47456,47464,47465,53712,53713,53714,53715,53716,53717,53718,53719,53721,53722,53723,53724,53725,53726,53727,53728,53729,53730,53731,53732,53733,53734,53735,53736,53737,53738,null,null,null,null,null,null,53739,53740,53741,53742,53743,53744,53745,53746,53747,53749,53750,53751,53753,53754,53755,53756,53757,53758,53759,53760,53761,53762,53763,53764,53765,53766,null,null,null,null,null,null,53768,53770,53771,53772,53773,53774,53775,53777,53778,53779,53780,53781,53782,53783,53784,53785,53786,53787,53788,53789,53790,53791,53792,53793,53794,53795,53796,53797,53798,53799,53800,53801,47467,47469,47476,47477,47480,47484,47492,47493,47495,47497,47498,47501,47502,47532,47533,47536,47540,47548,47549,47551,47553,47560,47561,47564,47566,47567,47568,47569,47570,47576,47577,47579,47581,47582,47585,47587,47588,47589,47592,47596,47604,47605,47607,47608,47609,47610,47616,47617,47624,47637,47672,47673,47676,47680,47682,47688,47689,47691,47693,47694,47699,47700,47701,47704,47708,47716,47717,47719,47720,47721,47728,47729,47732,47736,47747,47748,47749,47751,47756,47784,47785,47787,47788,47792,47794,47800,47801,47803,47805,47812,47816,47832,47833,47868,53802,53803,53806,53807,53809,53810,53811,53813,53814,53815,53816,53817,53818,53819,53822,53824,53826,53827,53828,53829,53830,53831,53833,53834,53835,53836,null,null,null,null,null,null,53837,53838,53839,53840,53841,53842,53843,53844,53845,53846,53847,53848,53849,53850,53851,53853,53854,53855,53856,53857,53858,53859,53861,53862,53863,53864,null,null,null,null,null,null,53865,53866,53867,53868,53869,53870,53871,53872,53873,53874,53875,53876,53877,53878,53879,53880,53881,53882,53883,53884,53885,53886,53887,53890,53891,53893,53894,53895,53897,53898,53899,53900,47872,47876,47885,47887,47889,47896,47900,47904,47913,47915,47924,47925,47926,47928,47931,47932,47933,47934,47940,47941,47943,47945,47949,47951,47952,47956,47960,47969,47971,47980,48008,48012,48016,48036,48040,48044,48052,48055,48064,48068,48072,48080,48083,48120,48121,48124,48127,48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149,48150,48151,48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173,48176,48177,48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208,48221,48260,48261,48264,48267,48268,48270,48276,48277,48279,53901,53902,53903,53906,53907,53908,53910,53911,53912,53913,53914,53915,53917,53918,53919,53921,53922,53923,53925,53926,53927,53928,53929,53930,53931,53933,null,null,null,null,null,null,53934,53935,53936,53938,53939,53940,53941,53942,53943,53946,53947,53949,53950,53953,53955,53956,53957,53958,53959,53962,53964,53965,53966,53967,53968,53969,null,null,null,null,null,null,53970,53971,53973,53974,53975,53977,53978,53979,53981,53982,53983,53984,53985,53986,53987,53990,53991,53992,53993,53994,53995,53996,53997,53998,53999,54002,54003,54005,54006,54007,54009,54010,48281,48282,48288,48289,48292,48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324,48333,48335,48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388,48389,48391,48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472,48473,48484,48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531,48533,48537,48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624,48628,48632,48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708,48709,48712,48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740,54011,54012,54013,54014,54015,54018,54020,54022,54023,54024,54025,54026,54027,54031,54033,54034,54035,54037,54039,54040,54041,54042,54043,54046,54050,54051,null,null,null,null,null,null,54052,54054,54055,54058,54059,54061,54062,54063,54065,54066,54067,54068,54069,54070,54071,54074,54078,54079,54080,54081,54082,54083,54086,54087,54088,54089,null,null,null,null,null,null,54090,54091,54092,54093,54094,54095,54096,54097,54098,54099,54100,54101,54102,54103,54104,54105,54106,54107,54108,54109,54110,54111,54112,54113,54114,54115,54116,54117,54118,54119,54120,54121,48744,48746,48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780,48781,48783,48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864,48867,48868,48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960,48961,48964,48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108,49116,49119,49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300,49304,49312,49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334,49340,49341,49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371,49372,49373,49380,54122,54123,54124,54125,54126,54127,54128,54129,54130,54131,54132,54133,54134,54135,54136,54137,54138,54139,54142,54143,54145,54146,54147,54149,54150,54151,null,null,null,null,null,null,54152,54153,54154,54155,54158,54162,54163,54164,54165,54166,54167,54170,54171,54173,54174,54175,54177,54178,54179,54180,54181,54182,54183,54186,54188,54190,null,null,null,null,null,null,54191,54192,54193,54194,54195,54197,54198,54199,54201,54202,54203,54205,54206,54207,54208,54209,54210,54211,54214,54215,54218,54219,54220,54221,54222,54223,54225,54226,54227,54228,54229,54230,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416,49424,49429,49436,49437,49438,49439,49440,49443,49444,49446,49447,49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483,49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524,49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573,49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636,49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688,49689,49692,49695,49696,49704,49705,49707,49709,54231,54233,54234,54235,54236,54237,54238,54239,54240,54242,54244,54245,54246,54247,54248,54249,54250,54251,54254,54255,54257,54258,54259,54261,54262,54263,null,null,null,null,null,null,54264,54265,54266,54267,54270,54272,54274,54275,54276,54277,54278,54279,54281,54282,54283,54284,54285,54286,54287,54288,54289,54290,54291,54292,54293,54294,null,null,null,null,null,null,54295,54296,54297,54298,54299,54300,54302,54303,54304,54305,54306,54307,54308,54309,54310,54311,54312,54313,54314,54315,54316,54317,54318,54319,54320,54321,54322,54323,54324,54325,54326,54327,49711,49713,49714,49716,49736,49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791,49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844,49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905,49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941,49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040,50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146,50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,54328,54329,54330,54331,54332,54333,54334,54335,54337,54338,54339,54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,54352,54353,54354,54355,null,null,null,null,null,null,54356,54357,54358,54359,54360,54361,54362,54363,54365,54366,54367,54369,54370,54371,54373,54374,54375,54376,54377,54378,54379,54380,54382,54384,54385,54386,null,null,null,null,null,null,54387,54388,54389,54390,54391,54394,54395,54397,54398,54401,54403,54404,54405,54406,54407,54410,54412,54414,54415,54416,54417,54418,54419,54421,54422,54423,54424,54425,54426,54427,54428,54429,50228,50236,50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360,50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452,50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505,50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528,50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567,50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616,50617,50619,50620,50621,50622,50628,50629,50630,50631,50632,50633,50634,50636,50638,54430,54431,54432,54433,54434,54435,54436,54437,54438,54439,54440,54442,54443,54444,54445,54446,54447,54448,54449,54450,54451,54452,54453,54454,54455,54456,null,null,null,null,null,null,54457,54458,54459,54460,54461,54462,54463,54464,54465,54466,54467,54468,54469,54470,54471,54472,54473,54474,54475,54477,54478,54479,54481,54482,54483,54485,null,null,null,null,null,null,54486,54487,54488,54489,54490,54491,54493,54494,54496,54497,54498,54499,54500,54501,54502,54503,54505,54506,54507,54509,54510,54511,54513,54514,54515,54516,54517,54518,54519,54521,54522,54524,50640,50641,50644,50648,50656,50657,50659,50661,50668,50669,50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689,50693,50694,50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728,50732,50733,50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756,50760,50768,50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808,50809,50812,50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853,50855,50857,50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892,50893,50896,50900,50908,50909,50912,50913,50920,54526,54527,54528,54529,54530,54531,54533,54534,54535,54537,54538,54539,54541,54542,54543,54544,54545,54546,54547,54550,54552,54553,54554,54555,54556,54557,null,null,null,null,null,null,54558,54559,54560,54561,54562,54563,54564,54565,54566,54567,54568,54569,54570,54571,54572,54573,54574,54575,54576,54577,54578,54579,54580,54581,54582,54583,null,null,null,null,null,null,54584,54585,54586,54587,54590,54591,54593,54594,54595,54597,54598,54599,54600,54601,54602,54603,54606,54608,54610,54611,54612,54613,54614,54615,54618,54619,54621,54622,54623,54625,54626,54627,50921,50924,50928,50936,50937,50941,50948,50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984,50992,50993,50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023,51025,51026,51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060,51061,51064,51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086,51088,51089,51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110,51116,51117,51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150,51152,51160,51165,51172,51176,51180,51200,51201,51204,51208,51210,54628,54630,54631,54634,54636,54638,54639,54640,54641,54642,54643,54646,54647,54649,54650,54651,54653,54654,54655,54656,54657,54658,54659,54662,54666,54667,null,null,null,null,null,null,54668,54669,54670,54671,54673,54674,54675,54676,54677,54678,54679,54680,54681,54682,54683,54684,54685,54686,54687,54688,54689,54690,54691,54692,54694,54695,null,null,null,null,null,null,54696,54697,54698,54699,54700,54701,54702,54703,54704,54705,54706,54707,54708,54709,54710,54711,54712,54713,54714,54715,54716,54717,54718,54719,54720,54721,54722,54723,54724,54725,54726,54727,51216,51217,51219,51221,51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260,51264,51272,51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329,51331,51333,51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388,51389,51396,51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452,51453,51456,51460,51461,51462,51468,51469,51471,51473,51480,51500,51508,51536,51537,51540,51544,51552,51553,51555,51564,51568,51572,51580,51592,51593,51596,51600,51608,51609,51611,51613,51648,51649,51652,51655,51656,51658,51664,51665,51667,54730,54731,54733,54734,54735,54737,54739,54740,54741,54742,54743,54746,54748,54750,54751,54752,54753,54754,54755,54758,54759,54761,54762,54763,54765,54766,null,null,null,null,null,null,54767,54768,54769,54770,54771,54774,54776,54778,54779,54780,54781,54782,54783,54786,54787,54789,54790,54791,54793,54794,54795,54796,54797,54798,54799,54802,null,null,null,null,null,null,54806,54807,54808,54809,54810,54811,54813,54814,54815,54817,54818,54819,54821,54822,54823,54824,54825,54826,54827,54828,54830,54831,54832,54833,54834,54835,54836,54837,54838,54839,54842,54843,51669,51670,51673,51674,51676,51677,51680,51682,51684,51687,51692,51693,51695,51696,51697,51704,51705,51708,51712,51720,51721,51723,51724,51725,51732,51736,51753,51788,51789,51792,51796,51804,51805,51807,51808,51809,51816,51837,51844,51864,51900,51901,51904,51908,51916,51917,51919,51921,51923,51928,51929,51936,51948,51956,51976,51984,51988,51992,52000,52001,52033,52040,52041,52044,52048,52056,52057,52061,52068,52088,52089,52124,52152,52180,52196,52199,52201,52236,52237,52240,52244,52252,52253,52257,52258,52263,52264,52265,52268,52270,52272,52280,52281,52283,54845,54846,54847,54849,54850,54851,54852,54854,54855,54858,54860,54862,54863,54864,54866,54867,54870,54871,54873,54874,54875,54877,54878,54879,54880,54881,null,null,null,null,null,null,54882,54883,54884,54885,54886,54888,54890,54891,54892,54893,54894,54895,54898,54899,54901,54902,54903,54904,54905,54906,54907,54908,54909,54910,54911,54912,null,null,null,null,null,null,54913,54914,54916,54918,54919,54920,54921,54922,54923,54926,54927,54929,54930,54931,54933,54934,54935,54936,54937,54938,54939,54940,54942,54944,54946,54947,54948,54949,54950,54951,54953,54954,52284,52285,52286,52292,52293,52296,52300,52308,52309,52311,52312,52313,52320,52324,52326,52328,52336,52341,52376,52377,52380,52384,52392,52393,52395,52396,52397,52404,52405,52408,52412,52420,52421,52423,52425,52432,52436,52452,52460,52464,52481,52488,52489,52492,52496,52504,52505,52507,52509,52516,52520,52524,52537,52572,52576,52580,52588,52589,52591,52593,52600,52616,52628,52629,52632,52636,52644,52645,52647,52649,52656,52676,52684,52688,52712,52716,52720,52728,52729,52731,52733,52740,52744,52748,52756,52761,52768,52769,52772,52776,52784,52785,52787,52789,54955,54957,54958,54959,54961,54962,54963,54964,54965,54966,54967,54968,54970,54972,54973,54974,54975,54976,54977,54978,54979,54982,54983,54985,54986,54987,null,null,null,null,null,null,54989,54990,54991,54992,54994,54995,54997,54998,55000,55002,55003,55004,55005,55006,55007,55009,55010,55011,55013,55014,55015,55017,55018,55019,55020,55021,null,null,null,null,null,null,55022,55023,55025,55026,55027,55028,55030,55031,55032,55033,55034,55035,55038,55039,55041,55042,55043,55045,55046,55047,55048,55049,55050,55051,55052,55053,55054,55055,55056,55058,55059,55060,52824,52825,52828,52831,52832,52833,52840,52841,52843,52845,52852,52853,52856,52860,52868,52869,52871,52873,52880,52881,52884,52888,52896,52897,52899,52900,52901,52908,52909,52929,52964,52965,52968,52971,52972,52980,52981,52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024,53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093,53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188,53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272,53293,53300,53301,53304,53308,55061,55062,55063,55066,55067,55069,55070,55071,55073,55074,55075,55076,55077,55078,55079,55082,55084,55086,55087,55088,55089,55090,55091,55094,55095,55097,null,null,null,null,null,null,55098,55099,55101,55102,55103,55104,55105,55106,55107,55109,55110,55112,55114,55115,55116,55117,55118,55119,55122,55123,55125,55130,55131,55132,55133,55134,null,null,null,null,null,null,55135,55138,55140,55142,55143,55144,55146,55147,55149,55150,55151,55153,55154,55155,55157,55158,55159,55160,55161,55162,55163,55166,55167,55168,55170,55171,55172,55173,55174,55175,55178,55179,53316,53317,53319,53321,53328,53332,53336,53344,53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429,53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468,53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556,53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597,53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681,53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805,53808,53812,53820,53821,53823,53825,53832,53852,55181,55182,55183,55185,55186,55187,55188,55189,55190,55191,55194,55196,55198,55199,55200,55201,55202,55203,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,53860,53888,53889,53892,53896,53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952,53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008,54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047,54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084,54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172,54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224,54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54280,54301,54336,54340,54364,54368,54372,54381,54383,54392,54393,54396,54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484,54492,54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549,54551,54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624,54629,54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664,54665,54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756,54757,54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801,54803,54804,54805,54812,54816,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54820,54829,54840,54841,54844,54848,54853,54856,54857,54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900,54915,54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969,54971,54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024,55029,55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083,55085,55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127,55128,55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169,55176,55177,55180,55184,55192,55193,55195,55197,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20285,20339,20551,20729,21152,21487,21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21283,23724,30002,32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,25106,26690,26800,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,38799,20018,23521,25096,26524,29916,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31185,33747,35463,35506,36328,36942,37707,38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,39509,39851,19992,20037,20061,20167,20465,20855,21246,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21312,21475,21477,21646,22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350,32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476,37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531,31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406,33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413,29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512,36020,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998,33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224,20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681,27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810,26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450,24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864,21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190,24524,25216,26071,26083,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26398,26399,26462,26827,26820,27231,27450,27683,27773,27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047,31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215,37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708,37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760,63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771,63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511,26976,28275,63778,30007,63779,63780,63781,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32013,63782,63783,34930,22218,23064,63784,63785,63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899,24180,25754,31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361,24594,63792,63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801,63802,63803,63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813,33215,36786,24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821,63822,63823,63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830,63831,33021,63832,63833,23612,27877,21311,28346,22810,33590,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20025,20150,20294,21934,22296,22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222,34507,34962,37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812,26311,28129,28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663,27795,30035,31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070,31958,34739,40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825,29619,33274,34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294,22581,22615,23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26873,27330,28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241,36077,36339,36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272,29346,29544,30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788,28958,29129,35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481,26704,26847,27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460,26515,30168,31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,32645,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,24976,25088,25891,28451,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29001,29833,32244,32879,34030,36646,36899,37706,20925,21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,24278,26009,29134,30274,30637,32842,34044,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36988,39719,40845,22744,23105,23650,27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841,38534,21202,32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400,21519,21774,23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178,31852,32633,32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136,29848,34298,36522,38563,40023,40607,26519,28107,29747,33256,38678,30764,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31435,31520,31890,25705,29802,30194,30908,30952,39340,39764,40635,23518,24149,28448,33180,33707,37000,19975,21325,23081,24018,24398,24930,25405,26217,26364,28415,28459,28771,30622,33836,34067,34875,36627,39237,39995,21788,25273,26411,27819,33545,35178,38778,20129,22916,24536,24537,26395,32178,32596,33426,33579,33725,36638,37017,22475,22969,23186,23504,26151,26522,26757,27599,29028,32629,36023,36067,36993,39749,33032,35978,38476,39488,40613,23391,27667,29467,30450,30431,33804,20906,35219,20813,20885,21193,26825,27796,30468,30496,32191,32236,38754,40629,28357,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34065,20901,21517,21629,26126,26269,26919,28319,30399,30609,33559,33986,34719,37225,37528,40180,34946,20398,20882,21215,22982,24125,24917,25720,25721,26286,26576,27169,27597,27611,29279,29281,29761,30520,30683,32791,33468,33541,35584,35624,35980,26408,27792,29287,30446,30566,31302,40361,27519,27794,22818,26406,33945,21359,22675,22937,24287,25551,26164,26483,28218,29483,31447,33495,37672,21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595,28961,29687,30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664,20497,21006,21563,21839,25991,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27766,32010,32011,32862,34442,38272,38639,21247,27797,29289,21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228,30473,31859,32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935,26107,26108,27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338,25293,25615,25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334,34180,36843,38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075,27886,28504,29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784,36820,38930,39151,21187,25300,25765,28196,28497,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30332,36299,37297,37474,39662,39747,20515,20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121,26507,27036,28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607,37030,38450,40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953,30403,32972,32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091,26575,26658,30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115,34281,39132,20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359,31684,33539,27861,29754,20731,21128,22721,25816,27287,29863,30294,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30887,34327,38370,38713,63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712,19993,20482,20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177,31453,36647,39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541,29668,29995,33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489,26381,31119,33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086,20472,22857,23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562,36898,37586,40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827,23142,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23386,23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,32737,32933,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,33086,33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,40605,21066,63849,26388,63850,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20632,21034,23665,25955,27733,29642,29987,30109,31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937,36062,38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853,31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329,26360,26646,26866,29312,29790,31598,32110,32214,32626,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32997,33298,34223,35199,35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728,28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459,25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341,32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854,21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807,21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478,22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32854,32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016,21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836,28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032,32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660,26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137,29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862,37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744,24101,24833,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465,29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172,32353,32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930,36995,37228,37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706,21460,22654,22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033,24455,24490,24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636,31565,32020,33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348,25100,34899,36848,37477,23815,23847,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23913,29791,33181,34664,28629,25342,32722,35126,35186,19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365,21273,22070,22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178,26558,26612,29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925,35962,22516,23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672,36606,39135,39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180,30003,31070,32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857,36805,22833,23460,23526,24713,23529,23563,24515,27777,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63858,28145,28683,29978,33455,35574,20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784,25105,29273,33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538,23731,23997,24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823,23433,23736,25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555,38332,21813,23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232,20208,22830,24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326,28079,30861,33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27387,32588,40367,40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860,37326,24369,63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864,63865,22756,23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673,29036,30162,30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525,63870,39178,22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740,25014,25233,27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474,20796,22196,22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873,22914,63874,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671,36701,63878,39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884,30123,32377,35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310,63887,63888,25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890,28895,28982,29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894,32303,63895,34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902,24709,28037,63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909,28814,28976,29744,33398,33490,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63910,38331,39653,40573,26308,63911,29121,33865,63912,63913,22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704,27891,28214,28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908,30408,31310,32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923,63924,20034,20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454,34269,34306,63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116,20237,20425,20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034,25942,26111,26212,26791,27738,28595,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28879,29100,29522,31613,34568,35492,39986,40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800,22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402,33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740,30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505,27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931,20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747,25854,63934,26332,63935,27208,63936,29183,29796,63937,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31368,31407,32327,32350,32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020,32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029,28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854,63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962,26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398,36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020,31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36939,38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290,22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503,29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301,20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234,29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759,20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736,24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833,27943,63946,28216,63947,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28641,29494,29495,63948,29788,30001,63949,30290,63950,63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986,37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801,22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961,63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518,37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957,25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097,30691,32681,33380,34191,34811,34915,35516,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,35696,37291,20108,20197,20234,63965,63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246,29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975,63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714,32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341,24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986,63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922,23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63991,63992,63993,20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675,24904,28363,28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071,34249,35566,36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189,33421,37196,38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668,31786,34870,38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196,24373,25484,26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456,31911,33144,33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38556,20877,21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289,35009,36001,36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632,22992,24213,25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053,33511,33785,33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514,23265,23490,25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735,33659,35627,36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659,20840,20856,21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643,27583,27656,28593,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686,32399,35438,36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999,25130,25240,27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896,38673,39822,40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979,23450,24128,24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622,26984,27273,27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010,30555,30855,31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194,37336,37478,37580,37664,38662,38742,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38748,38914,40718,21046,21137,21884,22564,24093,24351,24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,28121,29742,31278,32066,32156,32305,33131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36394,36405,37758,37912,20304,22352,24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21675,22320,22336,24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587,36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894,30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503,32221,36655,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919,24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364,37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408,35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649,24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288,24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081,33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081,37319,37365,20874,26613,31574,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36012,20932,22971,24765,34389,20508,63999,21076,23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191,21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368,36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639,36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558,22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893,33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958,39636,21021,21119,21736,24980,25220,25307,26786,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26898,26970,27189,28818,28966,30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218,37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474,22618,23541,24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368,22684,25277,25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264,36861,37138,37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069,31482,31569,31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986,26414,40668,20805,24544,27798,34802,34909,34935,24756,33205,33795,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36101,21462,21561,22068,23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434,20596,20164,21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772,27835,28100,29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473,36636,38601,39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522,26517,27784,28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668,21822,22702,22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524,21331,21828,22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752,35351,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37944,21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890,33067,25506,30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153,20812,21488,22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040,39089,64004,25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005,30171,31570,32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956,25237,36879,39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487,27874,27966,29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256,29923,36009,36774,37393,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38442,20843,21485,25420,20329,21764,24726,25943,27803,28031,29260,29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,34920,35961,39111,39108,39491,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21697,31263,26963,35575,35914,39080,39342,24444,25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,25239,26477,26689,27782,28207,32568,32923,33322,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,64008,64009,38917,20133,20565,21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846,23805,25406,28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24418,27842,28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872,37026,37795,39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046,20114,21628,22741,22778,22909,23733,24359,25142,25160,26122,26215,27627,28009,28111,28246,28408,28564,28640,28649,28765,29392,29733,29786,29920,30355,31068,31946,32286,32993,33446,33899,33983,34382,34399,34676,35703,35946,37804,38912,39013,24785,25110,37239,23130,26127,28151,28222,29759,39746,24573,24794,31503,21700,24344,27742,27859,27946,28888,32005,34425,35340,40251,21270,21644,23301,27194,28779,30069,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31117,31166,33457,33775,35441,35649,36008,38772,64011,25844,25899,30906,30907,31339,20024,21914,22864,23462,24187,24739,25563,27489,26213,26707,28185,29029,29872,32008,36996,39529,39973,27963,28369,29502,35905,38346,20976,24140,24488,24653,24822,24880,24908,26179,26180,27045,27841,28255,28361,28514,29004,29852,30343,31681,31783,33618,34647,36945,38541,40643,21295,22238,24315,24458,24674,24724,25079,26214,26371,27292,28142,28590,28784,29546,32362,33214,33588,34516,35496,36036,21123,29554,23446,27243,37892,21742,22150,23389,25928,25989,26313,26783,28045,28102,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29243,32948,37237,39501,20399,20505,21402,21518,21564,21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628,22734,28932,29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321,21913,27585,24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875,30054,34407,24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427,28824,30165,21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725,33288,20694,20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206,26342,29081,29113,29114,29351,31143,31232,32690,35440,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],
  24946. "gb18030":[19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,20112,20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,20374,20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,20401,20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,20416,20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437,20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468,20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502,20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545,20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564,20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580,20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595,20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615,20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644,20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663,20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692,20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707,20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727,20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827,20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850,20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881,20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905,20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933,20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953,20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972,20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008,21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034,21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064,21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085,21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105,21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123,21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138,21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166,21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184,21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203,21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219,21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234,21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252,21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276,21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316,21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354,21356,21357,21362,21366,21369,21371,21372,21373,21374,21376,21377,21379,21383,21384,21386,21390,21391,21392,21393,21394,21395,21396,21398,21399,21401,21403,21404,21406,21408,21409,21412,21415,21418,21419,21420,21421,21423,21424,21425,21426,21427,21428,21429,21431,21432,21433,21434,21436,21437,21438,21440,21443,21444,21445,21446,21447,21454,21455,21456,21458,21459,21461,21466,21468,21469,21470,21473,21474,21479,21492,21498,21502,21503,21504,21506,21509,21511,21515,21524,21528,21529,21530,21532,21538,21540,21541,21546,21552,21555,21558,21559,21562,21565,21567,21569,21570,21572,21573,21575,21577,21580,21581,21582,21583,21585,21594,21597,21598,21599,21600,21601,21603,21605,21607,21609,21610,21611,21612,21613,21614,21615,21616,21620,21625,21626,21630,21631,21633,21635,21637,21639,21640,21641,21642,21645,21649,21651,21655,21656,21660,21662,21663,21664,21665,21666,21669,21678,21680,21682,21685,21686,21687,21689,21690,21692,21694,21699,21701,21706,21707,21718,21720,21723,21728,21729,21730,21731,21732,21739,21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760,21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781,21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800,21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203,22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398,22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606,22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511,23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348,24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499,24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520,24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547,24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569,24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602,24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628,24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648,24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668,24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702,24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721,24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745,24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768,24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786,24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810,24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836,24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856,24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905,24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923,24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940,24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367,25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396,25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416,25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437,25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460,25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483,25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503,25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535,25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556,25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574,25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594,25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617,25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637,25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655,25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678,25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695,25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711,25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727,25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744,25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763,25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192,26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490,26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560,26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582,26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606,26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627,26628,26630,26637,26640,26642,26644,26645,26648,26649,26650,26651,26652,26654,26655,26656,26658,26659,26660,26661,26662,26663,26664,26667,26668,26669,26670,26671,26672,26673,26676,26677,26678,26682,26683,26687,26695,26699,26701,26703,26706,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26730,26732,26733,26734,26735,26736,26737,26738,26739,26741,26744,26745,26746,26747,26748,26749,26750,26751,26752,26754,26756,26759,26760,26761,26762,26763,26764,26765,26766,26768,26769,26770,26772,26773,26774,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26787,26788,26789,26793,26794,26795,26796,26798,26801,26802,26804,26806,26807,26808,26809,26810,26811,26812,26813,26814,26815,26817,26819,26820,26821,26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,26836,26838,26839,26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,26871,26872,26875,26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310,27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202,28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464,28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481,28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498,28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515,28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533,28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550,28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568,28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584,28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599,28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615,28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631,28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647,28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662,28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675,28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688,28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704,28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718,28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733,28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746,28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761,28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775,28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211,29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227,29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251,29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269,29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292,29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315,29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334,29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348,29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370,29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388,29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621,58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660,58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668,58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,58844,58845,58846,58847,58848,58849,58850,58851,58852,12288,65281,65282,65283,65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918,58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252,59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954,58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980,58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019,59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279,59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089,65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076,59287,59288,59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,59146,59147,59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,59159,59160,59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,59172,59173,59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,59185,59186,59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,59198,59199,59200,59201,59202,59203,59204,59205,59206,59207,59208,59209,59210,59211,59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,59224,59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,59237,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,59296,59297,59298,59299,59300,59301,59302,59303,59304,59305,59306,59307,59308,59309,59310,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314,59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213,8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331,59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,234,593,7743,324,328,505,609,59337,59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324,12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364,59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128,65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388,59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400,59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412,29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523,29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435,57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564,29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583,29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600,29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621,29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639,29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660,29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679,29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443,57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708,29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816,29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830,29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847,29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862,29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878,29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892,29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905,29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925,29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093,30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276,57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904,57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710,21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433,20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753,34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116,24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334,25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256,25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465,26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407,30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513,30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124,29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811,30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825,30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845,30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378,25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903,30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920,30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940,30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987,30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998,30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026,31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047,31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065,31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091,31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111,31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025,21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345,31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144,21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146,30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346,33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857,39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675,20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553,26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964,20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239,20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439,31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475,31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495,31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517,31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995,25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682,31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844,23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695,31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714,31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732,31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748,31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765,31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780,31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023,27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898,32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322,22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743,26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548,36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720,21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402,20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,31864,31865,31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31882,31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,31898,31899,31904,31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,31920,31924,31925,31926,31927,31928,31930,31931,24359,34382,21804,25252,20114,27818,25143,33457,21719,21326,29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,27426,29615,26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,24187,33618,24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,24653,35854,28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,24800,26214,36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,39746,27985,28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,20987,22334,22522,26426,30072,31293,31215,31637,31935,31936,31938,31939,31940,31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038,32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054,32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265,38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176,28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762,21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047,22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945,37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163,33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445,30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167,32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154,32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477,22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430,32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256,25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738,32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830,38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937,26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754,32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776,32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803,32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830,32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853,32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471,27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348,34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134,39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388,32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177,27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931,39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080,40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894,32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200,33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721,34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406,20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246,33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264,33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288,33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306,33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343,33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361,33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377,33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445,33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591,33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610,33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906,33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435,37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921,33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050,20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862,20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642,33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733,25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989,29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307,24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160,39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763,19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365,37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551,25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298,28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736,23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179,34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196,34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264,34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397,34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374,36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674,36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899,25506,21497,28845,27748,22616,25642,22530,26848,33179,21776,31958,20504,36538,28108,36255,28907,25487,28059,28372,32486,33796,26691,36867,28120,38518,35752,22871,29305,34276,33150,30140,35466,26799,21076,36386,38161,25552,39064,36420,21884,20307,26367,22159,24789,28053,21059,23625,22825,28155,22635,30000,29980,24684,33300,33094,25361,26465,36834,30522,36339,36148,38081,24086,21381,21548,28867,34413,34415,34416,34418,34419,34420,34421,34422,34423,34424,34435,34436,34437,34438,34439,34440,34441,34446,34447,34448,34449,34450,34452,34454,34455,34456,34457,34458,34459,34462,34463,34464,34465,34466,34469,34470,34475,34477,34478,34482,34483,34487,34488,34489,34491,34492,34493,34494,34495,34497,34498,34499,34501,34504,34508,34509,34514,34515,34517,34518,34519,34522,34524,34525,34528,34529,34530,34531,34533,34534,34535,34536,34538,34539,34540,34543,34549,34550,34551,34554,34555,34556,34557,34559,34561,34564,34565,34566,34571,34572,34574,34575,34576,34577,34580,34582,27712,24311,20572,20141,24237,25402,33351,36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723,34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224,22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738,34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756,34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775,34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791,34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806,34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822,34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839,34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713,33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219,21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247,23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420,21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439,33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140,28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521,35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944,34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136,22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139,35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153,35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168,35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196,35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002,21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262,35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355,35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365,35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378,35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392,35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406,35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029,39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560,35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653,24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713,20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286,21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234,31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935,32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724,32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832,35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496,36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235,29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758,22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331,26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363,28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394,23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062,35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038,20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897,35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982,35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730,23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121,36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204,36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224,36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243,36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258,36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272,36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297,36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751,35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798,35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833,35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862,35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887,35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460,38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015,37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379,36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462,36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084,37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187,37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166,30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654,22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338,22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412,22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516,22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478,36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497,36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529,36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509,22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656,33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659,33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757,33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770,33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914,33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000,34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019,34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36714,36736,36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,36778,36780,36781,36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,36796,36799,36800,36803,36806,36809,36810,36811,36812,36813,36815,36818,36822,36823,36826,36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,36858,36859,36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,34134,34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,25709,25750,36889,36892,36899,36900,36901,36903,36904,36905,36906,36907,36908,36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933,36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956,36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975,36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993,36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012,37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035,37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792,25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489,21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571,21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636,21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618,21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711,21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802,21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185,37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908,21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999,21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017,22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105,22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228,22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089,24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206,37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242,37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267,37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284,37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303,37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338,37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148,24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825,27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976,27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955,28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103,28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643,37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709,37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655,28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480,29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837,36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886,36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955,26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675,23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662,22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746,37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915,37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928,37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457,32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497,32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524,32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549,32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186,30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623,29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682,29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991,37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172,38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485,26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636,26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674,26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727,26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990,26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240,38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273,38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286,38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325,38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338,38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881,26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348,38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663,25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700,38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719,38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751,38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769,38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786,38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805,38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459,27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000,40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822,28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977,29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924,38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544,30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947,38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960,38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973,38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999,39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012,39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591,30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080,39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120,39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142,39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157,39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170,39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135,38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159,38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187,38185,38188,38193,38194,38196,38198,38199,38200,38204,38206,38207,38210,38197,38212,38213,38214,38217,38220,38222,38223,38226,38227,38228,38230,38231,38232,38233,38235,38238,38239,38237,38241,38242,38244,38245,38246,38247,38248,38249,38250,38251,38252,38255,38257,38258,38259,38202,30695,30700,38601,31189,31213,31203,31211,31238,23879,31235,31234,31262,31252,39176,39177,39178,39179,39180,39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,39236,39237,39238,39239,39240,39241,39242,39243,39244,39245,39246,39247,39248,39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,39263,39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,39305,31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,29920,29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503,40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526,40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554,40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131,30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180,30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245,30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272,30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315,30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400,31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017,35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091,35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684,32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779,32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419,39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432,39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445,39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484,39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073,39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445,34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480,34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579,34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595,34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690,34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660,34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696,34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755,31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273,36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898,39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011,35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934,39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947,39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960,39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973,39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986,39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390,35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996,39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062,40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151,40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269,40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282,40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295,40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321,40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334,40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347,40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020,58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033,58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046,58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059,58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072,58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085,58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357,40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383,40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396,40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448,40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184,58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571,40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192,58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369,58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758,40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468,58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383,11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565],
  24947. "gb18030-ranges":[[0,128],[36,165],[38,169],[45,178],[50,184],[81,216],[89,226],[95,235],[96,238],[100,244],[103,248],[104,251],[105,253],[109,258],[126,276],[133,284],[148,300],[172,325],[175,329],[179,334],[208,364],[306,463],[307,465],[308,467],[309,469],[310,471],[311,473],[312,475],[313,477],[341,506],[428,594],[443,610],[544,712],[545,716],[558,730],[741,930],[742,938],[749,962],[750,970],[805,1026],[819,1104],[820,1106],[7922,8209],[7924,8215],[7925,8218],[7927,8222],[7934,8231],[7943,8241],[7944,8244],[7945,8246],[7950,8252],[8062,8365],[8148,8452],[8149,8454],[8152,8458],[8164,8471],[8174,8482],[8236,8556],[8240,8570],[8262,8596],[8264,8602],[8374,8713],[8380,8720],[8381,8722],[8384,8726],[8388,8731],[8390,8737],[8392,8740],[8393,8742],[8394,8748],[8396,8751],[8401,8760],[8406,8766],[8416,8777],[8419,8781],[8424,8787],[8437,8802],[8439,8808],[8445,8816],[8482,8854],[8485,8858],[8496,8870],[8521,8896],[8603,8979],[8936,9322],[8946,9372],[9046,9548],[9050,9588],[9063,9616],[9066,9622],[9076,9634],[9092,9652],[9100,9662],[9108,9672],[9111,9676],[9113,9680],[9131,9702],[9162,9735],[9164,9738],[9218,9793],[9219,9795],[11329,11906],[11331,11909],[11334,11913],[11336,11917],[11346,11928],[11361,11944],[11363,11947],[11366,11951],[11370,11956],[11372,11960],[11375,11964],[11389,11979],[11682,12284],[11686,12292],[11687,12312],[11692,12319],[11694,12330],[11714,12351],[11716,12436],[11723,12447],[11725,12535],[11730,12543],[11736,12586],[11982,12842],[11989,12850],[12102,12964],[12336,13200],[12348,13215],[12350,13218],[12384,13253],[12393,13263],[12395,13267],[12397,13270],[12510,13384],[12553,13428],[12851,13727],[12962,13839],[12973,13851],[13738,14617],[13823,14703],[13919,14801],[13933,14816],[14080,14964],[14298,15183],[14585,15471],[14698,15585],[15583,16471],[15847,16736],[16318,17208],[16434,17325],[16438,17330],[16481,17374],[16729,17623],[17102,17997],[17122,18018],[17315,18212],[17320,18218],[17402,18301],[17418,18318],[17859,18760],[17909,18811],[17911,18814],[17915,18820],[17916,18823],[17936,18844],[17939,18848],[17961,18872],[18664,19576],[18703,19620],[18814,19738],[18962,19887],[19043,40870],[33469,59244],[33470,59336],[33471,59367],[33484,59413],[33485,59417],[33490,59423],[33497,59431],[33501,59437],[33505,59443],[33513,59452],[33520,59460],[33536,59478],[33550,59493],[37845,63789],[37921,63866],[37948,63894],[38029,63976],[38038,63986],[38064,64016],[38065,64018],[38066,64021],[38069,64025],[38075,64034],[38076,64037],[38078,64042],[39108,65074],[39109,65093],[39113,65107],[39114,65112],[39115,65127],[39116,65132],[39265,65375],[39394,65510],[189000,65536]],
  24948. "jis0208":[12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,8213,8208,65295,65340,65374,8741,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,65293,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,65504,65505,65285,65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,null,null,null,null,null,null,null,null,null,null,null,8712,8715,8838,8839,8834,8835,8746,8745,null,null,null,null,null,null,null,null,8743,8744,65506,8658,8660,8704,8707,null,null,null,null,null,null,null,null,null,null,null,8736,8869,8978,8706,8711,8801,8786,8810,8811,8730,8765,8733,8757,8747,8748,null,null,null,null,null,null,null,8491,8240,9839,9837,9834,8224,8225,182,null,null,null,null,9711,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,null,null,null,null,null,null,null,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,null,null,null,null,null,null,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,null,null,null,null,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,13129,13076,13090,13133,13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,13212,13213,13214,13198,13199,13252,13217,null,null,null,null,null,null,null,null,13179,12317,12319,8470,13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,13180,8786,8801,8747,8750,8721,8730,8869,8736,8735,8895,8757,8745,8746,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20124,21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000,33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968,32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672,40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287,28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294,20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503,37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369,24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202,39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447,23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311,33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303,20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809,23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149,30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462,32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210,32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500,20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100,23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484,25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248,28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057,32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284,37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580,22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698,37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302,39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910,25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051,33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514,26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311,35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245,23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784,29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618,26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378,22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998,21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799,27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336,40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505,25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028,36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956,23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778,21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616,22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120,28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040,33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472,38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796,36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602,29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702,22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027,20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335,26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319,26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074,23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169,33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446,26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063,20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493,38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778,21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495,30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982,35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954,27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362,36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746,35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396,28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023,35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316,29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142,20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391,35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747,33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363,20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802,26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244,32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105,24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635,37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748,22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790,22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882,22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016,23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113,23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270,23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363,23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992,23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522,23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586,23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066,23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742,23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839,23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923,23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009,24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091,24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181,24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285,24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318,24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396,24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447,24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250,27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268,27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359,27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447,30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512,27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567,27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631,40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789,27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863,27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958,27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025,27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102,28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205,28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227,28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349,28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396,28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538,28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610,28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632,28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532,28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844,28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006,32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086,32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186,32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176,32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305,32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314,32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213,32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411,32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607,32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670,32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714,32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792,32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866,32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915,32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007,33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137,33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187,33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229,33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282,33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368,33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406,33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481,36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528,36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618,36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665,36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764,36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869,36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921,36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975,36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041,37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208,37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301,37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365,37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448,37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609,37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728,37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848,37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931,37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000,38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294,38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339,38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447,38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541,38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606,38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670,38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728,38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780,38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851,38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968,38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027,39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188,39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237,39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391,39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429,39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511,39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633,39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671,39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726,39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825,39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890,39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955,39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007,39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200,40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255,40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680,40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737,40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810,40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,65506,65508,65287,65282,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,65506,65508,65287,65282,12849,8470,8481,8757,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],
  24949. "jis0212":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,728,711,184,729,733,175,731,730,65374,900,901,null,null,null,null,null,null,null,null,161,166,191,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,186,170,169,174,8482,164,8470,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,902,904,905,906,938,null,908,null,910,939,null,911,null,null,null,null,940,941,942,943,970,912,972,962,973,971,944,974,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,198,272,null,294,null,306,null,321,319,null,330,216,338,null,358,222,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,230,273,240,295,305,307,312,322,320,329,331,248,339,223,359,254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,193,192,196,194,258,461,256,260,197,195,262,264,268,199,266,270,201,200,203,202,282,278,274,280,null,284,286,290,288,292,205,204,207,206,463,304,298,302,296,308,310,313,317,315,323,327,325,209,211,210,214,212,465,336,332,213,340,344,342,346,348,352,350,356,354,218,217,220,219,364,467,368,362,370,366,360,471,475,473,469,372,221,376,374,377,381,379,null,null,null,null,null,null,null,225,224,228,226,259,462,257,261,229,227,263,265,269,231,267,271,233,232,235,234,283,279,275,281,501,285,287,null,289,293,237,236,239,238,464,null,299,303,297,309,311,314,318,316,324,328,326,241,243,242,246,244,466,337,333,245,341,345,343,347,349,353,351,357,355,250,249,252,251,365,468,369,363,371,367,361,472,476,474,470,373,253,255,375,378,382,380,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19970,19972,19973,19980,19986,19999,20003,20004,20008,20011,20014,20015,20016,20021,20032,20033,20036,20039,20049,20058,20060,20067,20072,20073,20084,20085,20089,20095,20109,20118,20119,20125,20143,20153,20163,20176,20186,20187,20192,20193,20194,20200,20207,20209,20211,20213,20221,20222,20223,20224,20226,20227,20232,20235,20236,20242,20245,20246,20247,20249,20270,20273,20320,20275,20277,20279,20281,20283,20286,20288,20290,20296,20297,20299,20300,20306,20308,20310,20312,20319,20323,20330,20332,20334,20337,20343,20344,20345,20346,20349,20350,20353,20354,20356,20357,20361,20362,20364,20366,20368,20370,20371,20372,20375,20377,20378,20382,20383,20402,20407,20409,20411,20412,20413,20414,20416,20417,20421,20422,20424,20425,20427,20428,20429,20431,20434,20444,20448,20450,20464,20466,20476,20477,20479,20480,20481,20484,20487,20490,20492,20494,20496,20499,20503,20504,20507,20508,20509,20510,20514,20519,20526,20528,20530,20531,20533,20544,20545,20546,20549,20550,20554,20556,20558,20561,20562,20563,20567,20569,20575,20576,20578,20579,20582,20583,20586,20589,20592,20593,20539,20609,20611,20612,20614,20618,20622,20623,20624,20626,20627,20628,20630,20635,20636,20638,20639,20640,20641,20642,20650,20655,20656,20665,20666,20669,20672,20675,20676,20679,20684,20686,20688,20691,20692,20696,20700,20701,20703,20706,20708,20710,20712,20713,20719,20721,20726,20730,20734,20739,20742,20743,20744,20747,20748,20749,20750,20722,20752,20759,20761,20763,20764,20765,20766,20771,20775,20776,20780,20781,20783,20785,20787,20788,20789,20792,20793,20802,20810,20815,20819,20821,20823,20824,20831,20836,20838,20862,20867,20868,20875,20878,20888,20893,20897,20899,20909,20920,20922,20924,20926,20927,20930,20936,20943,20945,20946,20947,20949,20952,20958,20962,20965,20974,20978,20979,20980,20983,20993,20994,20997,21010,21011,21013,21014,21016,21026,21032,21041,21042,21045,21052,21061,21065,21077,21079,21080,21082,21084,21087,21088,21089,21094,21102,21111,21112,21113,21120,21122,21125,21130,21132,21139,21141,21142,21143,21144,21146,21148,21156,21157,21158,21159,21167,21168,21174,21175,21176,21178,21179,21181,21184,21188,21190,21192,21196,21199,21201,21204,21206,21211,21212,21217,21221,21224,21225,21226,21228,21232,21233,21236,21238,21239,21248,21251,21258,21259,21260,21265,21267,21272,21275,21276,21278,21279,21285,21287,21288,21289,21291,21292,21293,21296,21298,21301,21308,21309,21310,21314,21324,21323,21337,21339,21345,21347,21349,21356,21357,21362,21369,21374,21379,21383,21384,21390,21395,21396,21401,21405,21409,21412,21418,21419,21423,21426,21428,21429,21431,21432,21434,21437,21440,21445,21455,21458,21459,21461,21466,21469,21470,21472,21478,21479,21493,21506,21523,21530,21537,21543,21544,21546,21551,21553,21556,21557,21571,21572,21575,21581,21583,21598,21602,21604,21606,21607,21609,21611,21613,21614,21620,21631,21633,21635,21637,21640,21641,21645,21649,21653,21654,21660,21663,21665,21670,21671,21673,21674,21677,21678,21681,21687,21689,21690,21691,21695,21702,21706,21709,21710,21728,21738,21740,21743,21750,21756,21758,21759,21760,21761,21765,21768,21769,21772,21773,21774,21781,21802,21803,21810,21813,21814,21819,21820,21821,21825,21831,21833,21834,21837,21840,21841,21848,21850,21851,21854,21856,21857,21860,21862,21887,21889,21890,21894,21896,21902,21903,21905,21906,21907,21908,21911,21923,21924,21933,21938,21951,21953,21955,21958,21961,21963,21964,21966,21969,21970,21971,21975,21976,21979,21982,21986,21993,22006,22015,22021,22024,22026,22029,22030,22031,22032,22033,22034,22041,22060,22064,22067,22069,22071,22073,22075,22076,22077,22079,22080,22081,22083,22084,22086,22089,22091,22093,22095,22100,22110,22112,22113,22114,22115,22118,22121,22125,22127,22129,22130,22133,22148,22149,22152,22155,22156,22165,22169,22170,22173,22174,22175,22182,22183,22184,22185,22187,22188,22189,22193,22195,22199,22206,22213,22217,22218,22219,22223,22224,22220,22221,22233,22236,22237,22239,22241,22244,22245,22246,22247,22248,22257,22251,22253,22262,22263,22273,22274,22279,22282,22284,22289,22293,22298,22299,22301,22304,22306,22307,22308,22309,22313,22314,22316,22318,22319,22323,22324,22333,22334,22335,22341,22342,22348,22349,22354,22370,22373,22375,22376,22379,22381,22382,22383,22384,22385,22387,22388,22389,22391,22393,22394,22395,22396,22398,22401,22403,22412,22420,22423,22425,22426,22428,22429,22430,22431,22433,22421,22439,22440,22441,22444,22456,22461,22471,22472,22476,22479,22485,22493,22494,22500,22502,22503,22505,22509,22512,22517,22518,22520,22525,22526,22527,22531,22532,22536,22537,22497,22540,22541,22555,22558,22559,22560,22566,22567,22573,22578,22585,22591,22601,22604,22605,22607,22608,22613,22623,22625,22628,22631,22632,22648,22652,22655,22656,22657,22663,22664,22665,22666,22668,22669,22671,22672,22676,22678,22685,22688,22689,22690,22694,22697,22705,22706,22724,22716,22722,22728,22733,22734,22736,22738,22740,22742,22746,22749,22753,22754,22761,22771,22789,22790,22795,22796,22802,22803,22804,34369,22813,22817,22819,22820,22824,22831,22832,22835,22837,22838,22847,22851,22854,22866,22867,22873,22875,22877,22878,22879,22881,22883,22891,22893,22895,22898,22901,22902,22905,22907,22908,22923,22924,22926,22930,22933,22935,22943,22948,22951,22957,22958,22959,22960,22963,22967,22970,22972,22977,22979,22980,22984,22986,22989,22994,23005,23006,23007,23011,23012,23015,23022,23023,23025,23026,23028,23031,23040,23044,23052,23053,23054,23058,23059,23070,23075,23076,23079,23080,23082,23085,23088,23108,23109,23111,23112,23116,23120,23125,23134,23139,23141,23143,23149,23159,23162,23163,23166,23179,23184,23187,23190,23193,23196,23198,23199,23200,23202,23207,23212,23217,23218,23219,23221,23224,23226,23227,23231,23236,23238,23240,23247,23258,23260,23264,23269,23274,23278,23285,23286,23293,23296,23297,23304,23319,23348,23321,23323,23325,23329,23333,23341,23352,23361,23371,23372,23378,23382,23390,23400,23406,23407,23420,23421,23422,23423,23425,23428,23430,23434,23438,23440,23441,23443,23444,23446,23464,23465,23468,23469,23471,23473,23474,23479,23482,23484,23488,23489,23501,23503,23510,23511,23512,23513,23514,23520,23535,23537,23540,23549,23564,23575,23582,23583,23587,23590,23593,23595,23596,23598,23600,23602,23605,23606,23641,23642,23644,23650,23651,23655,23656,23657,23661,23664,23668,23669,23674,23675,23676,23677,23687,23688,23690,23695,23698,23709,23711,23712,23714,23715,23718,23722,23730,23732,23733,23738,23753,23755,23762,23773,23767,23790,23793,23794,23796,23809,23814,23821,23826,23851,23843,23844,23846,23847,23857,23860,23865,23869,23871,23874,23875,23878,23880,23893,23889,23897,23882,23903,23904,23905,23906,23908,23914,23917,23920,23929,23930,23934,23935,23937,23939,23944,23946,23954,23955,23956,23957,23961,23963,23967,23968,23975,23979,23984,23988,23992,23993,24003,24007,24011,24016,24014,24024,24025,24032,24036,24041,24056,24057,24064,24071,24077,24082,24084,24085,24088,24095,24096,24110,24104,24114,24117,24126,24139,24144,24137,24145,24150,24152,24155,24156,24158,24168,24170,24171,24172,24173,24174,24176,24192,24203,24206,24226,24228,24229,24232,24234,24236,24241,24243,24253,24254,24255,24262,24268,24267,24270,24273,24274,24276,24277,24284,24286,24293,24299,24322,24326,24327,24328,24334,24345,24348,24349,24353,24354,24355,24356,24360,24363,24364,24366,24368,24372,24374,24379,24381,24383,24384,24388,24389,24391,24397,24400,24404,24408,24411,24416,24419,24420,24423,24431,24434,24436,24437,24440,24442,24445,24446,24457,24461,24463,24470,24476,24477,24482,24487,24491,24484,24492,24495,24496,24497,24504,24516,24519,24520,24521,24523,24528,24529,24530,24531,24532,24542,24545,24546,24552,24553,24554,24556,24557,24558,24559,24562,24563,24566,24570,24572,24583,24586,24589,24595,24596,24599,24600,24602,24607,24612,24621,24627,24629,24640,24647,24648,24649,24652,24657,24660,24662,24663,24669,24673,24679,24689,24702,24703,24706,24710,24712,24714,24718,24721,24723,24725,24728,24733,24734,24738,24740,24741,24744,24752,24753,24759,24763,24766,24770,24772,24776,24777,24778,24779,24782,24783,24788,24789,24793,24795,24797,24798,24802,24805,24818,24821,24824,24828,24829,24834,24839,24842,24844,24848,24849,24850,24851,24852,24854,24855,24857,24860,24862,24866,24874,24875,24880,24881,24885,24886,24887,24889,24897,24901,24902,24905,24926,24928,24940,24946,24952,24955,24956,24959,24960,24961,24963,24964,24971,24973,24978,24979,24983,24984,24988,24989,24991,24992,24997,25000,25002,25005,25016,25017,25020,25024,25025,25026,25038,25039,25045,25052,25053,25054,25055,25057,25058,25063,25065,25061,25068,25069,25071,25089,25091,25092,25095,25107,25109,25116,25120,25122,25123,25127,25129,25131,25145,25149,25154,25155,25156,25158,25164,25168,25169,25170,25172,25174,25178,25180,25188,25197,25199,25203,25210,25213,25229,25230,25231,25232,25254,25256,25267,25270,25271,25274,25278,25279,25284,25294,25301,25302,25306,25322,25330,25332,25340,25341,25347,25348,25354,25355,25357,25360,25363,25366,25368,25385,25386,25389,25397,25398,25401,25404,25409,25410,25411,25412,25414,25418,25419,25422,25426,25427,25428,25432,25435,25445,25446,25452,25453,25457,25460,25461,25464,25468,25469,25471,25474,25476,25479,25482,25488,25492,25493,25497,25498,25502,25508,25510,25517,25518,25519,25533,25537,25541,25544,25550,25553,25555,25556,25557,25564,25568,25573,25578,25580,25586,25587,25589,25592,25593,25609,25610,25616,25618,25620,25624,25630,25632,25634,25636,25637,25641,25642,25647,25648,25653,25661,25663,25675,25679,25681,25682,25683,25684,25690,25691,25692,25693,25695,25696,25697,25699,25709,25715,25716,25723,25725,25733,25735,25743,25744,25745,25752,25753,25755,25757,25759,25761,25763,25766,25768,25772,25779,25789,25790,25791,25796,25801,25802,25803,25804,25806,25808,25809,25813,25815,25828,25829,25833,25834,25837,25840,25845,25847,25851,25855,25857,25860,25864,25865,25866,25871,25875,25876,25878,25881,25883,25886,25887,25890,25894,25897,25902,25905,25914,25916,25917,25923,25927,25929,25936,25938,25940,25951,25952,25959,25963,25978,25981,25985,25989,25994,26002,26005,26008,26013,26016,26019,26022,26030,26034,26035,26036,26047,26050,26056,26057,26062,26064,26068,26070,26072,26079,26096,26098,26100,26101,26105,26110,26111,26112,26116,26120,26121,26125,26129,26130,26133,26134,26141,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26161,26163,26169,26167,26176,26181,26182,26186,26188,26193,26190,26199,26200,26201,26203,26204,26208,26209,26363,26218,26219,26220,26238,26227,26229,26239,26231,26232,26233,26235,26240,26236,26251,26252,26253,26256,26258,26265,26266,26267,26268,26271,26272,26276,26285,26289,26290,26293,26299,26303,26304,26306,26307,26312,26316,26318,26319,26324,26331,26335,26344,26347,26348,26350,26362,26373,26375,26382,26387,26393,26396,26400,26402,26419,26430,26437,26439,26440,26444,26452,26453,26461,26470,26476,26478,26484,26486,26491,26497,26500,26510,26511,26513,26515,26518,26520,26521,26523,26544,26545,26546,26549,26555,26556,26557,26617,26560,26562,26563,26565,26568,26569,26578,26583,26585,26588,26593,26598,26608,26610,26614,26615,26706,26644,26649,26653,26655,26664,26663,26668,26669,26671,26672,26673,26675,26683,26687,26692,26693,26698,26700,26709,26711,26712,26715,26731,26734,26735,26736,26737,26738,26741,26745,26746,26747,26748,26754,26756,26758,26760,26774,26776,26778,26780,26785,26787,26789,26793,26794,26798,26802,26811,26821,26824,26828,26831,26832,26833,26835,26838,26841,26844,26845,26853,26856,26858,26859,26860,26861,26864,26865,26869,26870,26875,26876,26877,26886,26889,26890,26896,26897,26899,26902,26903,26929,26931,26933,26936,26939,26946,26949,26953,26958,26967,26971,26979,26980,26981,26982,26984,26985,26988,26992,26993,26994,27002,27003,27007,27008,27021,27026,27030,27032,27041,27045,27046,27048,27051,27053,27055,27063,27064,27066,27068,27077,27080,27089,27094,27095,27106,27109,27118,27119,27121,27123,27125,27134,27136,27137,27139,27151,27153,27157,27162,27165,27168,27172,27176,27184,27186,27188,27191,27195,27198,27199,27205,27206,27209,27210,27214,27216,27217,27218,27221,27222,27227,27236,27239,27242,27249,27251,27262,27265,27267,27270,27271,27273,27275,27281,27291,27293,27294,27295,27301,27307,27311,27312,27313,27316,27325,27326,27327,27334,27337,27336,27340,27344,27348,27349,27350,27356,27357,27364,27367,27372,27376,27377,27378,27388,27389,27394,27395,27398,27399,27401,27407,27408,27409,27415,27419,27422,27428,27432,27435,27436,27439,27445,27446,27451,27455,27462,27466,27469,27474,27478,27480,27485,27488,27495,27499,27502,27504,27509,27517,27518,27522,27525,27543,27547,27551,27552,27554,27555,27560,27561,27564,27565,27566,27568,27576,27577,27581,27582,27587,27588,27593,27596,27606,27610,27617,27619,27622,27623,27630,27633,27639,27641,27647,27650,27652,27653,27657,27661,27662,27664,27666,27673,27679,27686,27687,27688,27692,27694,27699,27701,27702,27706,27707,27711,27722,27723,27725,27727,27730,27732,27737,27739,27740,27755,27757,27759,27764,27766,27768,27769,27771,27781,27782,27783,27785,27796,27797,27799,27800,27804,27807,27824,27826,27828,27842,27846,27853,27855,27856,27857,27858,27860,27862,27866,27868,27872,27879,27881,27883,27884,27886,27890,27892,27908,27911,27914,27918,27919,27921,27923,27930,27942,27943,27944,27751,27950,27951,27953,27961,27964,27967,27991,27998,27999,28001,28005,28007,28015,28016,28028,28034,28039,28049,28050,28052,28054,28055,28056,28074,28076,28084,28087,28089,28093,28095,28100,28104,28106,28110,28111,28118,28123,28125,28127,28128,28130,28133,28137,28143,28144,28148,28150,28156,28160,28164,28190,28194,28199,28210,28214,28217,28219,28220,28228,28229,28232,28233,28235,28239,28241,28242,28243,28244,28247,28252,28253,28254,28258,28259,28264,28275,28283,28285,28301,28307,28313,28320,28327,28333,28334,28337,28339,28347,28351,28352,28353,28355,28359,28360,28362,28365,28366,28367,28395,28397,28398,28409,28411,28413,28420,28424,28426,28428,28429,28438,28440,28442,28443,28454,28457,28458,28463,28464,28467,28470,28475,28476,28461,28495,28497,28498,28499,28503,28505,28506,28509,28510,28513,28514,28520,28524,28541,28542,28547,28551,28552,28555,28556,28557,28560,28562,28563,28564,28566,28570,28575,28576,28581,28582,28583,28584,28590,28591,28592,28597,28598,28604,28613,28615,28616,28618,28634,28638,28648,28649,28656,28661,28665,28668,28669,28672,28677,28678,28679,28685,28695,28704,28707,28719,28724,28727,28729,28732,28739,28740,28744,28745,28746,28747,28756,28757,28765,28766,28750,28772,28773,28780,28782,28789,28790,28798,28801,28805,28806,28820,28821,28822,28823,28824,28827,28836,28843,28848,28849,28852,28855,28874,28881,28883,28884,28885,28886,28888,28892,28900,28922,28931,28932,28933,28934,28935,28939,28940,28943,28958,28960,28971,28973,28975,28976,28977,28984,28993,28997,28998,28999,29002,29003,29008,29010,29015,29018,29020,29022,29024,29032,29049,29056,29061,29063,29068,29074,29082,29083,29088,29090,29103,29104,29106,29107,29114,29119,29120,29121,29124,29131,29132,29139,29142,29145,29146,29148,29176,29182,29184,29191,29192,29193,29203,29207,29210,29213,29215,29220,29227,29231,29236,29240,29241,29249,29250,29251,29253,29262,29263,29264,29267,29269,29270,29274,29276,29278,29280,29283,29288,29291,29294,29295,29297,29303,29304,29307,29308,29311,29316,29321,29325,29326,29331,29339,29352,29357,29358,29361,29364,29374,29377,29383,29385,29388,29397,29398,29400,29407,29413,29427,29428,29434,29435,29438,29442,29444,29445,29447,29451,29453,29458,29459,29464,29465,29470,29474,29476,29479,29480,29484,29489,29490,29493,29498,29499,29501,29507,29517,29520,29522,29526,29528,29533,29534,29535,29536,29542,29543,29545,29547,29548,29550,29551,29553,29559,29561,29564,29568,29569,29571,29573,29574,29582,29584,29587,29589,29591,29592,29596,29598,29599,29600,29602,29605,29606,29610,29611,29613,29621,29623,29625,29628,29629,29631,29637,29638,29641,29643,29644,29647,29650,29651,29654,29657,29661,29665,29667,29670,29671,29673,29684,29685,29687,29689,29690,29691,29693,29695,29696,29697,29700,29703,29706,29713,29722,29723,29732,29734,29736,29737,29738,29739,29740,29741,29742,29743,29744,29745,29753,29760,29763,29764,29766,29767,29771,29773,29777,29778,29783,29789,29794,29798,29799,29800,29803,29805,29806,29809,29810,29824,29825,29829,29830,29831,29833,29839,29840,29841,29842,29848,29849,29850,29852,29855,29856,29857,29859,29862,29864,29865,29866,29867,29870,29871,29873,29874,29877,29881,29883,29887,29896,29897,29900,29904,29907,29912,29914,29915,29918,29919,29924,29928,29930,29931,29935,29940,29946,29947,29948,29951,29958,29970,29974,29975,29984,29985,29988,29991,29993,29994,29999,30006,30009,30013,30014,30015,30016,30019,30023,30024,30030,30032,30034,30039,30046,30047,30049,30063,30065,30073,30074,30075,30076,30077,30078,30081,30085,30096,30098,30099,30101,30105,30108,30114,30116,30132,30138,30143,30144,30145,30148,30150,30156,30158,30159,30167,30172,30175,30176,30177,30180,30183,30188,30190,30191,30193,30201,30208,30210,30211,30212,30215,30216,30218,30220,30223,30226,30227,30229,30230,30233,30235,30236,30237,30238,30243,30245,30246,30249,30253,30258,30259,30261,30264,30265,30266,30268,30282,30272,30273,30275,30276,30277,30281,30283,30293,30297,30303,30308,30309,30317,30318,30319,30321,30324,30337,30341,30348,30349,30357,30363,30364,30365,30367,30368,30370,30371,30372,30373,30374,30375,30376,30378,30381,30397,30401,30405,30409,30411,30412,30414,30420,30425,30432,30438,30440,30444,30448,30449,30454,30457,30460,30464,30470,30474,30478,30482,30484,30485,30487,30489,30490,30492,30498,30504,30509,30510,30511,30516,30517,30518,30521,30525,30526,30530,30533,30534,30538,30541,30542,30543,30546,30550,30551,30556,30558,30559,30560,30562,30564,30567,30570,30572,30576,30578,30579,30580,30586,30589,30592,30596,30604,30605,30612,30613,30614,30618,30623,30626,30631,30634,30638,30639,30641,30645,30654,30659,30665,30673,30674,30677,30681,30686,30687,30688,30692,30694,30698,30700,30704,30705,30708,30712,30715,30725,30726,30729,30733,30734,30737,30749,30753,30754,30755,30765,30766,30768,30773,30775,30787,30788,30791,30792,30796,30798,30802,30812,30814,30816,30817,30819,30820,30824,30826,30830,30842,30846,30858,30863,30868,30872,30881,30877,30878,30879,30884,30888,30892,30893,30896,30897,30898,30899,30907,30909,30911,30919,30920,30921,30924,30926,30930,30931,30933,30934,30948,30939,30943,30944,30945,30950,30954,30962,30963,30976,30966,30967,30970,30971,30975,30982,30988,30992,31002,31004,31006,31007,31008,31013,31015,31017,31021,31025,31028,31029,31035,31037,31039,31044,31045,31046,31050,31051,31055,31057,31060,31064,31067,31068,31079,31081,31083,31090,31097,31099,31100,31102,31115,31116,31121,31123,31124,31125,31126,31128,31131,31132,31137,31144,31145,31147,31151,31153,31156,31160,31163,31170,31172,31175,31176,31178,31183,31188,31190,31194,31197,31198,31200,31202,31205,31210,31211,31213,31217,31224,31228,31234,31235,31239,31241,31242,31244,31249,31253,31259,31262,31265,31271,31275,31277,31279,31280,31284,31285,31288,31289,31290,31300,31301,31303,31304,31308,31317,31318,31321,31324,31325,31327,31328,31333,31335,31338,31341,31349,31352,31358,31360,31362,31365,31366,31370,31371,31376,31377,31380,31390,31392,31395,31404,31411,31413,31417,31419,31420,31430,31433,31436,31438,31441,31451,31464,31465,31467,31468,31473,31476,31483,31485,31486,31495,31508,31519,31523,31527,31529,31530,31531,31533,31534,31535,31536,31537,31540,31549,31551,31552,31553,31559,31566,31573,31584,31588,31590,31593,31594,31597,31599,31602,31603,31607,31620,31625,31630,31632,31633,31638,31643,31646,31648,31653,31660,31663,31664,31666,31669,31670,31674,31675,31676,31677,31682,31685,31688,31690,31700,31702,31703,31705,31706,31707,31720,31722,31730,31732,31733,31736,31737,31738,31740,31742,31745,31746,31747,31748,31750,31753,31755,31756,31758,31759,31769,31771,31776,31781,31782,31784,31788,31793,31795,31796,31798,31801,31802,31814,31818,31829,31825,31826,31827,31833,31834,31835,31836,31837,31838,31841,31843,31847,31849,31853,31854,31856,31858,31865,31868,31869,31878,31879,31887,31892,31902,31904,31910,31920,31926,31927,31930,31931,31932,31935,31940,31943,31944,31945,31949,31951,31955,31956,31957,31959,31961,31962,31965,31974,31977,31979,31989,32003,32007,32008,32009,32015,32017,32018,32019,32022,32029,32030,32035,32038,32042,32045,32049,32060,32061,32062,32064,32065,32071,32072,32077,32081,32083,32087,32089,32090,32092,32093,32101,32103,32106,32112,32120,32122,32123,32127,32129,32130,32131,32133,32134,32136,32139,32140,32141,32145,32150,32151,32157,32158,32166,32167,32170,32179,32182,32183,32185,32194,32195,32196,32197,32198,32204,32205,32206,32215,32217,32256,32226,32229,32230,32234,32235,32237,32241,32245,32246,32249,32250,32264,32272,32273,32277,32279,32284,32285,32288,32295,32296,32300,32301,32303,32307,32310,32319,32324,32325,32327,32334,32336,32338,32344,32351,32353,32354,32357,32363,32366,32367,32371,32376,32382,32385,32390,32391,32394,32397,32401,32405,32408,32410,32413,32414,32572,32571,32573,32574,32575,32579,32580,32583,32591,32594,32595,32603,32604,32605,32609,32611,32612,32613,32614,32621,32625,32637,32638,32639,32640,32651,32653,32655,32656,32657,32662,32663,32668,32673,32674,32678,32682,32685,32692,32700,32703,32704,32707,32712,32718,32719,32731,32735,32739,32741,32744,32748,32750,32751,32754,32762,32765,32766,32767,32775,32776,32778,32781,32782,32783,32785,32787,32788,32790,32797,32798,32799,32800,32804,32806,32812,32814,32816,32820,32821,32823,32825,32826,32828,32830,32832,32836,32864,32868,32870,32877,32881,32885,32897,32904,32910,32924,32926,32934,32935,32939,32952,32953,32968,32973,32975,32978,32980,32981,32983,32984,32992,33005,33006,33008,33010,33011,33014,33017,33018,33022,33027,33035,33046,33047,33048,33052,33054,33056,33060,33063,33068,33072,33077,33082,33084,33093,33095,33098,33100,33106,33111,33120,33121,33127,33128,33129,33133,33135,33143,33153,33168,33156,33157,33158,33163,33166,33174,33176,33179,33182,33186,33198,33202,33204,33211,33227,33219,33221,33226,33230,33231,33237,33239,33243,33245,33246,33249,33252,33259,33260,33264,33265,33266,33269,33270,33272,33273,33277,33279,33280,33283,33295,33299,33300,33305,33306,33309,33313,33314,33320,33330,33332,33338,33347,33348,33349,33350,33355,33358,33359,33361,33366,33372,33376,33379,33383,33389,33396,33403,33405,33407,33408,33409,33411,33412,33415,33417,33418,33422,33425,33428,33430,33432,33434,33435,33440,33441,33443,33444,33447,33448,33449,33450,33454,33456,33458,33460,33463,33466,33468,33470,33471,33478,33488,33493,33498,33504,33506,33508,33512,33514,33517,33519,33526,33527,33533,33534,33536,33537,33543,33544,33546,33547,33620,33563,33565,33566,33567,33569,33570,33580,33581,33582,33584,33587,33591,33594,33596,33597,33602,33603,33604,33607,33613,33614,33617,33621,33622,33623,33648,33656,33661,33663,33664,33666,33668,33670,33677,33682,33684,33685,33688,33689,33691,33692,33693,33702,33703,33705,33708,33726,33727,33728,33735,33737,33743,33744,33745,33748,33757,33619,33768,33770,33782,33784,33785,33788,33793,33798,33802,33807,33809,33813,33817,33709,33839,33849,33861,33863,33864,33866,33869,33871,33873,33874,33878,33880,33881,33882,33884,33888,33892,33893,33895,33898,33904,33907,33908,33910,33912,33916,33917,33921,33925,33938,33939,33941,33950,33958,33960,33961,33962,33967,33969,33972,33978,33981,33982,33984,33986,33991,33992,33996,33999,34003,34012,34023,34026,34031,34032,34033,34034,34039,34098,34042,34043,34045,34050,34051,34055,34060,34062,34064,34076,34078,34082,34083,34084,34085,34087,34090,34091,34095,34099,34100,34102,34111,34118,34127,34128,34129,34130,34131,34134,34137,34140,34141,34142,34143,34144,34145,34146,34148,34155,34159,34169,34170,34171,34173,34175,34177,34181,34182,34185,34187,34188,34191,34195,34200,34205,34207,34208,34210,34213,34215,34228,34230,34231,34232,34236,34237,34238,34239,34242,34247,34250,34251,34254,34221,34264,34266,34271,34272,34278,34280,34285,34291,34294,34300,34303,34304,34308,34309,34317,34318,34320,34321,34322,34328,34329,34331,34334,34337,34343,34345,34358,34360,34362,34364,34365,34368,34370,34374,34386,34387,34390,34391,34392,34393,34397,34400,34401,34402,34403,34404,34409,34412,34415,34421,34422,34423,34426,34445,34449,34454,34456,34458,34460,34465,34470,34471,34472,34477,34481,34483,34484,34485,34487,34488,34489,34495,34496,34497,34499,34501,34513,34514,34517,34519,34522,34524,34528,34531,34533,34535,34440,34554,34556,34557,34564,34565,34567,34571,34574,34575,34576,34579,34580,34585,34590,34591,34593,34595,34600,34606,34607,34609,34610,34617,34618,34620,34621,34622,34624,34627,34629,34637,34648,34653,34657,34660,34661,34671,34673,34674,34683,34691,34692,34693,34694,34695,34696,34697,34699,34700,34704,34707,34709,34711,34712,34713,34718,34720,34723,34727,34732,34733,34734,34737,34741,34750,34751,34753,34760,34761,34762,34766,34773,34774,34777,34778,34780,34783,34786,34787,34788,34794,34795,34797,34801,34803,34808,34810,34815,34817,34819,34822,34825,34826,34827,34832,34841,34834,34835,34836,34840,34842,34843,34844,34846,34847,34856,34861,34862,34864,34866,34869,34874,34876,34881,34883,34885,34888,34889,34890,34891,34894,34897,34901,34902,34904,34906,34908,34911,34912,34916,34921,34929,34937,34939,34944,34968,34970,34971,34972,34975,34976,34984,34986,35002,35005,35006,35008,35018,35019,35020,35021,35022,35025,35026,35027,35035,35038,35047,35055,35056,35057,35061,35063,35073,35078,35085,35086,35087,35093,35094,35096,35097,35098,35100,35104,35110,35111,35112,35120,35121,35122,35125,35129,35130,35134,35136,35138,35141,35142,35145,35151,35154,35159,35162,35163,35164,35169,35170,35171,35179,35182,35184,35187,35189,35194,35195,35196,35197,35209,35213,35216,35220,35221,35227,35228,35231,35232,35237,35248,35252,35253,35254,35255,35260,35284,35285,35286,35287,35288,35301,35305,35307,35309,35313,35315,35318,35321,35325,35327,35332,35333,35335,35343,35345,35346,35348,35349,35358,35360,35362,35364,35366,35371,35372,35375,35381,35383,35389,35390,35392,35395,35397,35399,35401,35405,35406,35411,35414,35415,35416,35420,35421,35425,35429,35431,35445,35446,35447,35449,35450,35451,35454,35455,35456,35459,35462,35467,35471,35472,35474,35478,35479,35481,35487,35495,35497,35502,35503,35507,35510,35511,35515,35518,35523,35526,35528,35529,35530,35537,35539,35540,35541,35543,35549,35551,35564,35568,35572,35573,35574,35580,35583,35589,35590,35595,35601,35612,35614,35615,35594,35629,35632,35639,35644,35650,35651,35652,35653,35654,35656,35666,35667,35668,35673,35661,35678,35683,35693,35702,35704,35705,35708,35710,35713,35716,35717,35723,35725,35727,35732,35733,35740,35742,35743,35896,35897,35901,35902,35909,35911,35913,35915,35919,35921,35923,35924,35927,35928,35931,35933,35929,35939,35940,35942,35944,35945,35949,35955,35957,35958,35963,35966,35974,35975,35979,35984,35986,35987,35993,35995,35996,36004,36025,36026,36037,36038,36041,36043,36047,36054,36053,36057,36061,36065,36072,36076,36079,36080,36082,36085,36087,36088,36094,36095,36097,36099,36105,36114,36119,36123,36197,36201,36204,36206,36223,36226,36228,36232,36237,36240,36241,36245,36254,36255,36256,36262,36267,36268,36271,36274,36277,36279,36281,36283,36288,36293,36294,36295,36296,36298,36302,36305,36308,36309,36311,36313,36324,36325,36327,36332,36336,36284,36337,36338,36340,36349,36353,36356,36357,36358,36363,36369,36372,36374,36384,36385,36386,36387,36390,36391,36401,36403,36406,36407,36408,36409,36413,36416,36417,36427,36429,36430,36431,36436,36443,36444,36445,36446,36449,36450,36457,36460,36461,36463,36464,36465,36473,36474,36475,36482,36483,36489,36496,36498,36501,36506,36507,36509,36510,36514,36519,36521,36525,36526,36531,36533,36538,36539,36544,36545,36547,36548,36551,36559,36561,36564,36572,36584,36590,36592,36593,36599,36601,36602,36589,36608,36610,36615,36616,36623,36624,36630,36631,36632,36638,36640,36641,36643,36645,36647,36648,36652,36653,36654,36660,36661,36662,36663,36666,36672,36673,36675,36679,36687,36689,36690,36691,36692,36693,36696,36701,36702,36709,36765,36768,36769,36772,36773,36774,36789,36790,36792,36798,36800,36801,36806,36810,36811,36813,36816,36818,36819,36821,36832,36835,36836,36840,36846,36849,36853,36854,36859,36862,36866,36868,36872,36876,36888,36891,36904,36905,36911,36906,36908,36909,36915,36916,36919,36927,36931,36932,36940,36955,36957,36962,36966,36967,36972,36976,36980,36985,36997,37000,37003,37004,37006,37008,37013,37015,37016,37017,37019,37024,37025,37026,37029,37040,37042,37043,37044,37046,37053,37068,37054,37059,37060,37061,37063,37064,37077,37079,37080,37081,37084,37085,37087,37093,37074,37110,37099,37103,37104,37108,37118,37119,37120,37124,37125,37126,37128,37133,37136,37140,37142,37143,37144,37146,37148,37150,37152,37157,37154,37155,37159,37161,37166,37167,37169,37172,37174,37175,37177,37178,37180,37181,37187,37191,37192,37199,37203,37207,37209,37210,37211,37217,37220,37223,37229,37236,37241,37242,37243,37249,37251,37253,37254,37258,37262,37265,37267,37268,37269,37272,37278,37281,37286,37288,37292,37293,37294,37296,37297,37298,37299,37302,37307,37308,37309,37311,37314,37315,37317,37331,37332,37335,37337,37338,37342,37348,37349,37353,37354,37356,37357,37358,37359,37360,37361,37367,37369,37371,37373,37376,37377,37380,37381,37382,37383,37385,37386,37388,37392,37394,37395,37398,37400,37404,37405,37411,37412,37413,37414,37416,37422,37423,37424,37427,37429,37430,37432,37433,37434,37436,37438,37440,37442,37443,37446,37447,37450,37453,37454,37455,37457,37464,37465,37468,37469,37472,37473,37477,37479,37480,37481,37486,37487,37488,37493,37494,37495,37496,37497,37499,37500,37501,37503,37512,37513,37514,37517,37518,37522,37527,37529,37535,37536,37540,37541,37543,37544,37547,37551,37554,37558,37560,37562,37563,37564,37565,37567,37568,37569,37570,37571,37573,37574,37575,37576,37579,37580,37581,37582,37584,37587,37589,37591,37592,37593,37596,37597,37599,37600,37601,37603,37605,37607,37608,37612,37614,37616,37625,37627,37631,37632,37634,37640,37645,37649,37652,37653,37660,37661,37662,37663,37665,37668,37669,37671,37673,37674,37683,37684,37686,37687,37703,37704,37705,37712,37713,37714,37717,37719,37720,37722,37726,37732,37733,37735,37737,37738,37741,37743,37744,37745,37747,37748,37750,37754,37757,37759,37760,37761,37762,37768,37770,37771,37773,37775,37778,37781,37784,37787,37790,37793,37795,37796,37798,37800,37803,37812,37813,37814,37818,37801,37825,37828,37829,37830,37831,37833,37834,37835,37836,37837,37843,37849,37852,37854,37855,37858,37862,37863,37881,37879,37880,37882,37883,37885,37889,37890,37892,37896,37897,37901,37902,37903,37909,37910,37911,37919,37934,37935,37937,37938,37939,37940,37947,37951,37949,37955,37957,37960,37962,37964,37973,37977,37980,37983,37985,37987,37992,37995,37997,37998,37999,38001,38002,38020,38019,38264,38265,38270,38276,38280,38284,38285,38286,38301,38302,38303,38305,38310,38313,38315,38316,38324,38326,38330,38333,38335,38342,38344,38345,38347,38352,38353,38354,38355,38361,38362,38365,38366,38367,38368,38372,38374,38429,38430,38434,38436,38437,38438,38444,38449,38451,38455,38456,38457,38458,38460,38461,38465,38482,38484,38486,38487,38488,38497,38510,38516,38523,38524,38526,38527,38529,38530,38531,38532,38537,38545,38550,38554,38557,38559,38564,38565,38566,38569,38574,38575,38579,38586,38602,38610,23986,38616,38618,38621,38622,38623,38633,38639,38641,38650,38658,38659,38661,38665,38682,38683,38685,38689,38690,38691,38696,38705,38707,38721,38723,38730,38734,38735,38741,38743,38744,38746,38747,38755,38759,38762,38766,38771,38774,38775,38776,38779,38781,38783,38784,38793,38805,38806,38807,38809,38810,38814,38815,38818,38828,38830,38833,38834,38837,38838,38840,38841,38842,38844,38846,38847,38849,38852,38853,38855,38857,38858,38860,38861,38862,38864,38865,38868,38871,38872,38873,38877,38878,38880,38875,38881,38884,38895,38897,38900,38903,38904,38906,38919,38922,38937,38925,38926,38932,38934,38940,38942,38944,38947,38950,38955,38958,38959,38960,38962,38963,38965,38949,38974,38980,38983,38986,38993,38994,38995,38998,38999,39001,39002,39010,39011,39013,39014,39018,39020,39083,39085,39086,39088,39092,39095,39096,39098,39099,39103,39106,39109,39112,39116,39137,39139,39141,39142,39143,39146,39155,39158,39170,39175,39176,39185,39189,39190,39191,39194,39195,39196,39199,39202,39206,39207,39211,39217,39218,39219,39220,39221,39225,39226,39227,39228,39232,39233,39238,39239,39240,39245,39246,39252,39256,39257,39259,39260,39262,39263,39264,39323,39325,39327,39334,39344,39345,39346,39349,39353,39354,39357,39359,39363,39369,39379,39380,39385,39386,39388,39390,39399,39402,39403,39404,39408,39412,39413,39417,39421,39422,39426,39427,39428,39435,39436,39440,39441,39446,39454,39456,39458,39459,39460,39463,39469,39470,39475,39477,39478,39480,39495,39489,39492,39498,39499,39500,39502,39505,39508,39510,39517,39594,39596,39598,39599,39602,39604,39605,39606,39609,39611,39614,39615,39617,39619,39622,39624,39630,39632,39634,39637,39638,39639,39643,39644,39648,39652,39653,39655,39657,39660,39666,39667,39669,39673,39674,39677,39679,39680,39681,39682,39683,39684,39685,39688,39689,39691,39692,39693,39694,39696,39698,39702,39705,39707,39708,39712,39718,39723,39725,39731,39732,39733,39735,39737,39738,39741,39752,39755,39756,39765,39766,39767,39771,39774,39777,39779,39781,39782,39784,39786,39787,39788,39789,39790,39795,39797,39799,39800,39801,39807,39808,39812,39813,39814,39815,39817,39818,39819,39821,39823,39824,39828,39834,39837,39838,39846,39847,39849,39852,39856,39857,39858,39863,39864,39867,39868,39870,39871,39873,39879,39880,39886,39888,39895,39896,39901,39903,39909,39911,39914,39915,39919,39923,39927,39928,39929,39930,39933,39935,39936,39938,39947,39951,39953,39958,39960,39961,39962,39964,39966,39970,39971,39974,39975,39976,39977,39978,39985,39989,39990,39991,39997,40001,40003,40004,40005,40009,40010,40014,40015,40016,40019,40020,40022,40024,40027,40029,40030,40031,40035,40041,40042,40028,40043,40040,40046,40048,40050,40053,40055,40059,40166,40178,40183,40185,40203,40194,40209,40215,40216,40220,40221,40222,40239,40240,40242,40243,40244,40250,40252,40261,40253,40258,40259,40263,40266,40275,40276,40287,40291,40290,40293,40297,40298,40299,40304,40310,40311,40315,40316,40318,40323,40324,40326,40330,40333,40334,40338,40339,40341,40342,40343,40344,40353,40362,40364,40366,40369,40373,40377,40380,40383,40387,40391,40393,40394,40404,40405,40406,40407,40410,40414,40415,40416,40421,40423,40425,40427,40430,40432,40435,40436,40446,40458,40450,40455,40462,40464,40465,40466,40469,40470,40473,40476,40477,40570,40571,40572,40576,40578,40579,40580,40581,40583,40590,40591,40598,40600,40603,40606,40612,40616,40620,40622,40623,40624,40627,40628,40629,40646,40648,40651,40661,40671,40676,40679,40684,40685,40686,40688,40689,40690,40693,40696,40703,40706,40707,40713,40719,40720,40721,40722,40724,40726,40727,40729,40730,40731,40735,40738,40742,40746,40747,40751,40753,40754,40756,40759,40761,40762,40764,40765,40767,40769,40771,40772,40773,40774,40775,40787,40789,40790,40791,40792,40794,40797,40798,40808,40809,40813,40814,40815,40816,40817,40819,40821,40826,40829,40847,40848,40849,40850,40852,40854,40855,40862,40865,40866,40867,40869,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],
  24950. "ibm866":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],
  24951. "iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],
  24952. "iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],
  24953. "iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],
  24954. "iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],
  24955. "iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],
  24956. "iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],
  24957. "iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],
  24958. "iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],
  24959. "iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],
  24960. "iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],
  24961. "iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],
  24962. "iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],
  24963. "koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],
  24964. "koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],
  24965. "macintosh":[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],
  24966. "windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],
  24967. "windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],
  24968. "windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],
  24969. "windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],
  24970. "windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],
  24971. "windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],
  24972. "windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],
  24973. "windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],
  24974. "windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],
  24975. "windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],
  24976. "x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]
  24977. };
  24978. // For strict environments where `this` inside the global scope
  24979. // is `undefined`, take a pure object instead
  24980. }(this || {}));
  24981. },{}],43:[function(require,module,exports){
  24982. // This is free and unencumbered software released into the public domain.
  24983. // See LICENSE.md for more information.
  24984. /**
  24985. * @fileoverview Global |this| required for resolving indexes in node.
  24986. * @suppress {globalThis}
  24987. */
  24988. (function(global) {
  24989. // If we're in node require encoding-indexes and attach it to the global.
  24990. if (typeof module !== "undefined" && module.exports &&
  24991. !global["encoding-indexes"]) {
  24992. global["encoding-indexes"] =
  24993. require("./encoding-indexes.js")["encoding-indexes"];
  24994. }
  24995. //
  24996. // Utilities
  24997. //
  24998. /**
  24999. * @param {number} a The number to test.
  25000. * @param {number} min The minimum value in the range, inclusive.
  25001. * @param {number} max The maximum value in the range, inclusive.
  25002. * @return {boolean} True if a >= min and a <= max.
  25003. */
  25004. function inRange(a, min, max) {
  25005. return min <= a && a <= max;
  25006. }
  25007. /**
  25008. * @param {!Array.<*>} array The array to check.
  25009. * @param {*} item The item to look for in the array.
  25010. * @return {boolean} True if the item appears in the array.
  25011. */
  25012. function includes(array, item) {
  25013. return array.indexOf(item) !== -1;
  25014. }
  25015. var floor = Math.floor;
  25016. /**
  25017. * @param {*} o
  25018. * @return {Object}
  25019. */
  25020. function ToDictionary(o) {
  25021. if (o === undefined) return {};
  25022. if (o === Object(o)) return o;
  25023. throw TypeError('Could not convert argument to dictionary');
  25024. }
  25025. /**
  25026. * @param {string} string Input string of UTF-16 code units.
  25027. * @return {!Array.<number>} Code points.
  25028. */
  25029. function stringToCodePoints(string) {
  25030. // https://heycam.github.io/webidl/#dfn-obtain-unicode
  25031. // 1. Let S be the DOMString value.
  25032. var s = String(string);
  25033. // 2. Let n be the length of S.
  25034. var n = s.length;
  25035. // 3. Initialize i to 0.
  25036. var i = 0;
  25037. // 4. Initialize U to be an empty sequence of Unicode characters.
  25038. var u = [];
  25039. // 5. While i < n:
  25040. while (i < n) {
  25041. // 1. Let c be the code unit in S at index i.
  25042. var c = s.charCodeAt(i);
  25043. // 2. Depending on the value of c:
  25044. // c < 0xD800 or c > 0xDFFF
  25045. if (c < 0xD800 || c > 0xDFFF) {
  25046. // Append to U the Unicode character with code point c.
  25047. u.push(c);
  25048. }
  25049. // 0xDC00 ≤ c ≤ 0xDFFF
  25050. else if (0xDC00 <= c && c <= 0xDFFF) {
  25051. // Append to U a U+FFFD REPLACEMENT CHARACTER.
  25052. u.push(0xFFFD);
  25053. }
  25054. // 0xD800 ≤ c ≤ 0xDBFF
  25055. else if (0xD800 <= c && c <= 0xDBFF) {
  25056. // 1. If i = n−1, then append to U a U+FFFD REPLACEMENT
  25057. // CHARACTER.
  25058. if (i === n - 1) {
  25059. u.push(0xFFFD);
  25060. }
  25061. // 2. Otherwise, i < n−1:
  25062. else {
  25063. // 1. Let d be the code unit in S at index i+1.
  25064. var d = s.charCodeAt(i + 1);
  25065. // 2. If 0xDC00 ≤ d ≤ 0xDFFF, then:
  25066. if (0xDC00 <= d && d <= 0xDFFF) {
  25067. // 1. Let a be c & 0x3FF.
  25068. var a = c & 0x3FF;
  25069. // 2. Let b be d & 0x3FF.
  25070. var b = d & 0x3FF;
  25071. // 3. Append to U the Unicode character with code point
  25072. // 2^16+2^10*a+b.
  25073. u.push(0x10000 + (a << 10) + b);
  25074. // 4. Set i to i+1.
  25075. i += 1;
  25076. }
  25077. // 3. Otherwise, d < 0xDC00 or d > 0xDFFF. Append to U a
  25078. // U+FFFD REPLACEMENT CHARACTER.
  25079. else {
  25080. u.push(0xFFFD);
  25081. }
  25082. }
  25083. }
  25084. // 3. Set i to i+1.
  25085. i += 1;
  25086. }
  25087. // 6. Return U.
  25088. return u;
  25089. }
  25090. /**
  25091. * @param {!Array.<number>} code_points Array of code points.
  25092. * @return {string} string String of UTF-16 code units.
  25093. */
  25094. function codePointsToString(code_points) {
  25095. var s = '';
  25096. for (var i = 0; i < code_points.length; ++i) {
  25097. var cp = code_points[i];
  25098. if (cp <= 0xFFFF) {
  25099. s += String.fromCharCode(cp);
  25100. } else {
  25101. cp -= 0x10000;
  25102. s += String.fromCharCode((cp >> 10) + 0xD800,
  25103. (cp & 0x3FF) + 0xDC00);
  25104. }
  25105. }
  25106. return s;
  25107. }
  25108. //
  25109. // Implementation of Encoding specification
  25110. // https://encoding.spec.whatwg.org/
  25111. //
  25112. //
  25113. // 4. Terminology
  25114. //
  25115. /**
  25116. * An ASCII byte is a byte in the range 0x00 to 0x7F, inclusive.
  25117. * @param {number} a The number to test.
  25118. * @return {boolean} True if a is in the range 0x00 to 0x7F, inclusive.
  25119. */
  25120. function isASCIIByte(a) {
  25121. return 0x00 <= a && a <= 0x7F;
  25122. }
  25123. /**
  25124. * An ASCII code point is a code point in the range U+0000 to
  25125. * U+007F, inclusive.
  25126. */
  25127. var isASCIICodePoint = isASCIIByte;
  25128. /**
  25129. * End-of-stream is a special token that signifies no more tokens
  25130. * are in the stream.
  25131. * @const
  25132. */ var end_of_stream = -1;
  25133. /**
  25134. * A stream represents an ordered sequence of tokens.
  25135. *
  25136. * @constructor
  25137. * @param {!(Array.<number>|Uint8Array)} tokens Array of tokens that provide
  25138. * the stream.
  25139. */
  25140. function Stream(tokens) {
  25141. /** @type {!Array.<number>} */
  25142. this.tokens = [].slice.call(tokens);
  25143. // Reversed as push/pop is more efficient than shift/unshift.
  25144. this.tokens.reverse();
  25145. }
  25146. Stream.prototype = {
  25147. /**
  25148. * @return {boolean} True if end-of-stream has been hit.
  25149. */
  25150. endOfStream: function() {
  25151. return !this.tokens.length;
  25152. },
  25153. /**
  25154. * When a token is read from a stream, the first token in the
  25155. * stream must be returned and subsequently removed, and
  25156. * end-of-stream must be returned otherwise.
  25157. *
  25158. * @return {number} Get the next token from the stream, or
  25159. * end_of_stream.
  25160. */
  25161. read: function() {
  25162. if (!this.tokens.length)
  25163. return end_of_stream;
  25164. return this.tokens.pop();
  25165. },
  25166. /**
  25167. * When one or more tokens are prepended to a stream, those tokens
  25168. * must be inserted, in given order, before the first token in the
  25169. * stream.
  25170. *
  25171. * @param {(number|!Array.<number>)} token The token(s) to prepend to the
  25172. * stream.
  25173. */
  25174. prepend: function(token) {
  25175. if (Array.isArray(token)) {
  25176. var tokens = /**@type {!Array.<number>}*/(token);
  25177. while (tokens.length)
  25178. this.tokens.push(tokens.pop());
  25179. } else {
  25180. this.tokens.push(token);
  25181. }
  25182. },
  25183. /**
  25184. * When one or more tokens are pushed to a stream, those tokens
  25185. * must be inserted, in given order, after the last token in the
  25186. * stream.
  25187. *
  25188. * @param {(number|!Array.<number>)} token The tokens(s) to push to the
  25189. * stream.
  25190. */
  25191. push: function(token) {
  25192. if (Array.isArray(token)) {
  25193. var tokens = /**@type {!Array.<number>}*/(token);
  25194. while (tokens.length)
  25195. this.tokens.unshift(tokens.shift());
  25196. } else {
  25197. this.tokens.unshift(token);
  25198. }
  25199. }
  25200. };
  25201. //
  25202. // 5. Encodings
  25203. //
  25204. // 5.1 Encoders and decoders
  25205. /** @const */
  25206. var finished = -1;
  25207. /**
  25208. * @param {boolean} fatal If true, decoding errors raise an exception.
  25209. * @param {number=} opt_code_point Override the standard fallback code point.
  25210. * @return {number} The code point to insert on a decoding error.
  25211. */
  25212. function decoderError(fatal, opt_code_point) {
  25213. if (fatal)
  25214. throw TypeError('Decoder error');
  25215. return opt_code_point || 0xFFFD;
  25216. }
  25217. /**
  25218. * @param {number} code_point The code point that could not be encoded.
  25219. * @return {number} Always throws, no value is actually returned.
  25220. */
  25221. function encoderError(code_point) {
  25222. throw TypeError('The code point ' + code_point + ' could not be encoded.');
  25223. }
  25224. // 5.2 Names and labels
  25225. // TODO: Define @typedef for Encoding: {name:string,labels:Array.<string>}
  25226. // https://github.com/google/closure-compiler/issues/247
  25227. /**
  25228. * @param {string} label The encoding label.
  25229. * @return {?{name:string,labels:Array.<string>}}
  25230. */
  25231. function getEncoding(label) {
  25232. // 1. Remove any leading and trailing ASCII whitespace from label.
  25233. label = String(label).trim().toLowerCase();
  25234. // 2. If label is an ASCII case-insensitive match for any of the
  25235. // labels listed in the table below, return the corresponding
  25236. // encoding, and failure otherwise.
  25237. if (Object.prototype.hasOwnProperty.call(label_to_encoding, label)) {
  25238. return label_to_encoding[label];
  25239. }
  25240. return null;
  25241. }
  25242. /**
  25243. * Encodings table: https://encoding.spec.whatwg.org/encodings.json
  25244. * @const
  25245. * @type {!Array.<{
  25246. * heading: string,
  25247. * encodings: Array.<{name:string,labels:Array.<string>}>
  25248. * }>}
  25249. */
  25250. var encodings = [
  25251. {
  25252. "encodings": [
  25253. {
  25254. "labels": [
  25255. "unicode-1-1-utf-8",
  25256. "utf-8",
  25257. "utf8"
  25258. ],
  25259. "name": "UTF-8"
  25260. }
  25261. ],
  25262. "heading": "The Encoding"
  25263. },
  25264. {
  25265. "encodings": [
  25266. {
  25267. "labels": [
  25268. "866",
  25269. "cp866",
  25270. "csibm866",
  25271. "ibm866"
  25272. ],
  25273. "name": "IBM866"
  25274. },
  25275. {
  25276. "labels": [
  25277. "csisolatin2",
  25278. "iso-8859-2",
  25279. "iso-ir-101",
  25280. "iso8859-2",
  25281. "iso88592",
  25282. "iso_8859-2",
  25283. "iso_8859-2:1987",
  25284. "l2",
  25285. "latin2"
  25286. ],
  25287. "name": "ISO-8859-2"
  25288. },
  25289. {
  25290. "labels": [
  25291. "csisolatin3",
  25292. "iso-8859-3",
  25293. "iso-ir-109",
  25294. "iso8859-3",
  25295. "iso88593",
  25296. "iso_8859-3",
  25297. "iso_8859-3:1988",
  25298. "l3",
  25299. "latin3"
  25300. ],
  25301. "name": "ISO-8859-3"
  25302. },
  25303. {
  25304. "labels": [
  25305. "csisolatin4",
  25306. "iso-8859-4",
  25307. "iso-ir-110",
  25308. "iso8859-4",
  25309. "iso88594",
  25310. "iso_8859-4",
  25311. "iso_8859-4:1988",
  25312. "l4",
  25313. "latin4"
  25314. ],
  25315. "name": "ISO-8859-4"
  25316. },
  25317. {
  25318. "labels": [
  25319. "csisolatincyrillic",
  25320. "cyrillic",
  25321. "iso-8859-5",
  25322. "iso-ir-144",
  25323. "iso8859-5",
  25324. "iso88595",
  25325. "iso_8859-5",
  25326. "iso_8859-5:1988"
  25327. ],
  25328. "name": "ISO-8859-5"
  25329. },
  25330. {
  25331. "labels": [
  25332. "arabic",
  25333. "asmo-708",
  25334. "csiso88596e",
  25335. "csiso88596i",
  25336. "csisolatinarabic",
  25337. "ecma-114",
  25338. "iso-8859-6",
  25339. "iso-8859-6-e",
  25340. "iso-8859-6-i",
  25341. "iso-ir-127",
  25342. "iso8859-6",
  25343. "iso88596",
  25344. "iso_8859-6",
  25345. "iso_8859-6:1987"
  25346. ],
  25347. "name": "ISO-8859-6"
  25348. },
  25349. {
  25350. "labels": [
  25351. "csisolatingreek",
  25352. "ecma-118",
  25353. "elot_928",
  25354. "greek",
  25355. "greek8",
  25356. "iso-8859-7",
  25357. "iso-ir-126",
  25358. "iso8859-7",
  25359. "iso88597",
  25360. "iso_8859-7",
  25361. "iso_8859-7:1987",
  25362. "sun_eu_greek"
  25363. ],
  25364. "name": "ISO-8859-7"
  25365. },
  25366. {
  25367. "labels": [
  25368. "csiso88598e",
  25369. "csisolatinhebrew",
  25370. "hebrew",
  25371. "iso-8859-8",
  25372. "iso-8859-8-e",
  25373. "iso-ir-138",
  25374. "iso8859-8",
  25375. "iso88598",
  25376. "iso_8859-8",
  25377. "iso_8859-8:1988",
  25378. "visual"
  25379. ],
  25380. "name": "ISO-8859-8"
  25381. },
  25382. {
  25383. "labels": [
  25384. "csiso88598i",
  25385. "iso-8859-8-i",
  25386. "logical"
  25387. ],
  25388. "name": "ISO-8859-8-I"
  25389. },
  25390. {
  25391. "labels": [
  25392. "csisolatin6",
  25393. "iso-8859-10",
  25394. "iso-ir-157",
  25395. "iso8859-10",
  25396. "iso885910",
  25397. "l6",
  25398. "latin6"
  25399. ],
  25400. "name": "ISO-8859-10"
  25401. },
  25402. {
  25403. "labels": [
  25404. "iso-8859-13",
  25405. "iso8859-13",
  25406. "iso885913"
  25407. ],
  25408. "name": "ISO-8859-13"
  25409. },
  25410. {
  25411. "labels": [
  25412. "iso-8859-14",
  25413. "iso8859-14",
  25414. "iso885914"
  25415. ],
  25416. "name": "ISO-8859-14"
  25417. },
  25418. {
  25419. "labels": [
  25420. "csisolatin9",
  25421. "iso-8859-15",
  25422. "iso8859-15",
  25423. "iso885915",
  25424. "iso_8859-15",
  25425. "l9"
  25426. ],
  25427. "name": "ISO-8859-15"
  25428. },
  25429. {
  25430. "labels": [
  25431. "iso-8859-16"
  25432. ],
  25433. "name": "ISO-8859-16"
  25434. },
  25435. {
  25436. "labels": [
  25437. "cskoi8r",
  25438. "koi",
  25439. "koi8",
  25440. "koi8-r",
  25441. "koi8_r"
  25442. ],
  25443. "name": "KOI8-R"
  25444. },
  25445. {
  25446. "labels": [
  25447. "koi8-ru",
  25448. "koi8-u"
  25449. ],
  25450. "name": "KOI8-U"
  25451. },
  25452. {
  25453. "labels": [
  25454. "csmacintosh",
  25455. "mac",
  25456. "macintosh",
  25457. "x-mac-roman"
  25458. ],
  25459. "name": "macintosh"
  25460. },
  25461. {
  25462. "labels": [
  25463. "dos-874",
  25464. "iso-8859-11",
  25465. "iso8859-11",
  25466. "iso885911",
  25467. "tis-620",
  25468. "windows-874"
  25469. ],
  25470. "name": "windows-874"
  25471. },
  25472. {
  25473. "labels": [
  25474. "cp1250",
  25475. "windows-1250",
  25476. "x-cp1250"
  25477. ],
  25478. "name": "windows-1250"
  25479. },
  25480. {
  25481. "labels": [
  25482. "cp1251",
  25483. "windows-1251",
  25484. "x-cp1251"
  25485. ],
  25486. "name": "windows-1251"
  25487. },
  25488. {
  25489. "labels": [
  25490. "ansi_x3.4-1968",
  25491. "ascii",
  25492. "cp1252",
  25493. "cp819",
  25494. "csisolatin1",
  25495. "ibm819",
  25496. "iso-8859-1",
  25497. "iso-ir-100",
  25498. "iso8859-1",
  25499. "iso88591",
  25500. "iso_8859-1",
  25501. "iso_8859-1:1987",
  25502. "l1",
  25503. "latin1",
  25504. "us-ascii",
  25505. "windows-1252",
  25506. "x-cp1252"
  25507. ],
  25508. "name": "windows-1252"
  25509. },
  25510. {
  25511. "labels": [
  25512. "cp1253",
  25513. "windows-1253",
  25514. "x-cp1253"
  25515. ],
  25516. "name": "windows-1253"
  25517. },
  25518. {
  25519. "labels": [
  25520. "cp1254",
  25521. "csisolatin5",
  25522. "iso-8859-9",
  25523. "iso-ir-148",
  25524. "iso8859-9",
  25525. "iso88599",
  25526. "iso_8859-9",
  25527. "iso_8859-9:1989",
  25528. "l5",
  25529. "latin5",
  25530. "windows-1254",
  25531. "x-cp1254"
  25532. ],
  25533. "name": "windows-1254"
  25534. },
  25535. {
  25536. "labels": [
  25537. "cp1255",
  25538. "windows-1255",
  25539. "x-cp1255"
  25540. ],
  25541. "name": "windows-1255"
  25542. },
  25543. {
  25544. "labels": [
  25545. "cp1256",
  25546. "windows-1256",
  25547. "x-cp1256"
  25548. ],
  25549. "name": "windows-1256"
  25550. },
  25551. {
  25552. "labels": [
  25553. "cp1257",
  25554. "windows-1257",
  25555. "x-cp1257"
  25556. ],
  25557. "name": "windows-1257"
  25558. },
  25559. {
  25560. "labels": [
  25561. "cp1258",
  25562. "windows-1258",
  25563. "x-cp1258"
  25564. ],
  25565. "name": "windows-1258"
  25566. },
  25567. {
  25568. "labels": [
  25569. "x-mac-cyrillic",
  25570. "x-mac-ukrainian"
  25571. ],
  25572. "name": "x-mac-cyrillic"
  25573. }
  25574. ],
  25575. "heading": "Legacy single-byte encodings"
  25576. },
  25577. {
  25578. "encodings": [
  25579. {
  25580. "labels": [
  25581. "chinese",
  25582. "csgb2312",
  25583. "csiso58gb231280",
  25584. "gb2312",
  25585. "gb_2312",
  25586. "gb_2312-80",
  25587. "gbk",
  25588. "iso-ir-58",
  25589. "x-gbk"
  25590. ],
  25591. "name": "GBK"
  25592. },
  25593. {
  25594. "labels": [
  25595. "gb18030"
  25596. ],
  25597. "name": "gb18030"
  25598. }
  25599. ],
  25600. "heading": "Legacy multi-byte Chinese (simplified) encodings"
  25601. },
  25602. {
  25603. "encodings": [
  25604. {
  25605. "labels": [
  25606. "big5",
  25607. "big5-hkscs",
  25608. "cn-big5",
  25609. "csbig5",
  25610. "x-x-big5"
  25611. ],
  25612. "name": "Big5"
  25613. }
  25614. ],
  25615. "heading": "Legacy multi-byte Chinese (traditional) encodings"
  25616. },
  25617. {
  25618. "encodings": [
  25619. {
  25620. "labels": [
  25621. "cseucpkdfmtjapanese",
  25622. "euc-jp",
  25623. "x-euc-jp"
  25624. ],
  25625. "name": "EUC-JP"
  25626. },
  25627. {
  25628. "labels": [
  25629. "csiso2022jp",
  25630. "iso-2022-jp"
  25631. ],
  25632. "name": "ISO-2022-JP"
  25633. },
  25634. {
  25635. "labels": [
  25636. "csshiftjis",
  25637. "ms932",
  25638. "ms_kanji",
  25639. "shift-jis",
  25640. "shift_jis",
  25641. "sjis",
  25642. "windows-31j",
  25643. "x-sjis"
  25644. ],
  25645. "name": "Shift_JIS"
  25646. }
  25647. ],
  25648. "heading": "Legacy multi-byte Japanese encodings"
  25649. },
  25650. {
  25651. "encodings": [
  25652. {
  25653. "labels": [
  25654. "cseuckr",
  25655. "csksc56011987",
  25656. "euc-kr",
  25657. "iso-ir-149",
  25658. "korean",
  25659. "ks_c_5601-1987",
  25660. "ks_c_5601-1989",
  25661. "ksc5601",
  25662. "ksc_5601",
  25663. "windows-949"
  25664. ],
  25665. "name": "EUC-KR"
  25666. }
  25667. ],
  25668. "heading": "Legacy multi-byte Korean encodings"
  25669. },
  25670. {
  25671. "encodings": [
  25672. {
  25673. "labels": [
  25674. "csiso2022kr",
  25675. "hz-gb-2312",
  25676. "iso-2022-cn",
  25677. "iso-2022-cn-ext",
  25678. "iso-2022-kr"
  25679. ],
  25680. "name": "replacement"
  25681. },
  25682. {
  25683. "labels": [
  25684. "utf-16be"
  25685. ],
  25686. "name": "UTF-16BE"
  25687. },
  25688. {
  25689. "labels": [
  25690. "utf-16",
  25691. "utf-16le"
  25692. ],
  25693. "name": "UTF-16LE"
  25694. },
  25695. {
  25696. "labels": [
  25697. "x-user-defined"
  25698. ],
  25699. "name": "x-user-defined"
  25700. }
  25701. ],
  25702. "heading": "Legacy miscellaneous encodings"
  25703. }
  25704. ];
  25705. // Label to encoding registry.
  25706. /** @type {Object.<string,{name:string,labels:Array.<string>}>} */
  25707. var label_to_encoding = {};
  25708. encodings.forEach(function(category) {
  25709. category.encodings.forEach(function(encoding) {
  25710. encoding.labels.forEach(function(label) {
  25711. label_to_encoding[label] = encoding;
  25712. });
  25713. });
  25714. });
  25715. // Registry of of encoder/decoder factories, by encoding name.
  25716. /** @type {Object.<string, function({fatal:boolean}): Encoder>} */
  25717. var encoders = {};
  25718. /** @type {Object.<string, function({fatal:boolean}): Decoder>} */
  25719. var decoders = {};
  25720. //
  25721. // 6. Indexes
  25722. //
  25723. /**
  25724. * @param {number} pointer The |pointer| to search for.
  25725. * @param {(!Array.<?number>|undefined)} index The |index| to search within.
  25726. * @return {?number} The code point corresponding to |pointer| in |index|,
  25727. * or null if |code point| is not in |index|.
  25728. */
  25729. function indexCodePointFor(pointer, index) {
  25730. if (!index) return null;
  25731. return index[pointer] || null;
  25732. }
  25733. /**
  25734. * @param {number} code_point The |code point| to search for.
  25735. * @param {!Array.<?number>} index The |index| to search within.
  25736. * @return {?number} The first pointer corresponding to |code point| in
  25737. * |index|, or null if |code point| is not in |index|.
  25738. */
  25739. function indexPointerFor(code_point, index) {
  25740. var pointer = index.indexOf(code_point);
  25741. return pointer === -1 ? null : pointer;
  25742. }
  25743. /**
  25744. * @param {string} name Name of the index.
  25745. * @return {(!Array.<number>|!Array.<Array.<number>>)}
  25746. * */
  25747. function index(name) {
  25748. if (!('encoding-indexes' in global)) {
  25749. throw Error("Indexes missing." +
  25750. " Did you forget to include encoding-indexes.js first?");
  25751. }
  25752. return global['encoding-indexes'][name];
  25753. }
  25754. /**
  25755. * @param {number} pointer The |pointer| to search for in the gb18030 index.
  25756. * @return {?number} The code point corresponding to |pointer| in |index|,
  25757. * or null if |code point| is not in the gb18030 index.
  25758. */
  25759. function indexGB18030RangesCodePointFor(pointer) {
  25760. // 1. If pointer is greater than 39419 and less than 189000, or
  25761. // pointer is greater than 1237575, return null.
  25762. if ((pointer > 39419 && pointer < 189000) || (pointer > 1237575))
  25763. return null;
  25764. // 2. If pointer is 7457, return code point U+E7C7.
  25765. if (pointer === 7457) return 0xE7C7;
  25766. // 3. Let offset be the last pointer in index gb18030 ranges that
  25767. // is equal to or less than pointer and let code point offset be
  25768. // its corresponding code point.
  25769. var offset = 0;
  25770. var code_point_offset = 0;
  25771. var idx = index('gb18030-ranges');
  25772. var i;
  25773. for (i = 0; i < idx.length; ++i) {
  25774. /** @type {!Array.<number>} */
  25775. var entry = idx[i];
  25776. if (entry[0] <= pointer) {
  25777. offset = entry[0];
  25778. code_point_offset = entry[1];
  25779. } else {
  25780. break;
  25781. }
  25782. }
  25783. // 4. Return a code point whose value is code point offset +
  25784. // pointer − offset.
  25785. return code_point_offset + pointer - offset;
  25786. }
  25787. /**
  25788. * @param {number} code_point The |code point| to locate in the gb18030 index.
  25789. * @return {number} The first pointer corresponding to |code point| in the
  25790. * gb18030 index.
  25791. */
  25792. function indexGB18030RangesPointerFor(code_point) {
  25793. // 1. If code point is U+E7C7, return pointer 7457.
  25794. if (code_point === 0xE7C7) return 7457;
  25795. // 2. Let offset be the last code point in index gb18030 ranges
  25796. // that is equal to or less than code point and let pointer offset
  25797. // be its corresponding pointer.
  25798. var offset = 0;
  25799. var pointer_offset = 0;
  25800. var idx = index('gb18030-ranges');
  25801. var i;
  25802. for (i = 0; i < idx.length; ++i) {
  25803. /** @type {!Array.<number>} */
  25804. var entry = idx[i];
  25805. if (entry[1] <= code_point) {
  25806. offset = entry[1];
  25807. pointer_offset = entry[0];
  25808. } else {
  25809. break;
  25810. }
  25811. }
  25812. // 3. Return a pointer whose value is pointer offset + code point
  25813. // − offset.
  25814. return pointer_offset + code_point - offset;
  25815. }
  25816. /**
  25817. * @param {number} code_point The |code_point| to search for in the Shift_JIS
  25818. * index.
  25819. * @return {?number} The code point corresponding to |pointer| in |index|,
  25820. * or null if |code point| is not in the Shift_JIS index.
  25821. */
  25822. function indexShiftJISPointerFor(code_point) {
  25823. // 1. Let index be index jis0208 excluding all entries whose
  25824. // pointer is in the range 8272 to 8835, inclusive.
  25825. shift_jis_index = shift_jis_index ||
  25826. index('jis0208').map(function(code_point, pointer) {
  25827. return inRange(pointer, 8272, 8835) ? null : code_point;
  25828. });
  25829. var index_ = shift_jis_index;
  25830. // 2. Return the index pointer for code point in index.
  25831. return index_.indexOf(code_point);
  25832. }
  25833. var shift_jis_index;
  25834. /**
  25835. * @param {number} code_point The |code_point| to search for in the big5
  25836. * index.
  25837. * @return {?number} The code point corresponding to |pointer| in |index|,
  25838. * or null if |code point| is not in the big5 index.
  25839. */
  25840. function indexBig5PointerFor(code_point) {
  25841. // 1. Let index be index Big5 excluding all entries whose pointer
  25842. big5_index_no_hkscs = big5_index_no_hkscs ||
  25843. index('big5').map(function(code_point, pointer) {
  25844. return (pointer < (0xA1 - 0x81) * 157) ? null : code_point;
  25845. });
  25846. var index_ = big5_index_no_hkscs;
  25847. // 2. If code point is U+2550, U+255E, U+2561, U+256A, U+5341, or
  25848. // U+5345, return the last pointer corresponding to code point in
  25849. // index.
  25850. if (code_point === 0x2550 || code_point === 0x255E ||
  25851. code_point === 0x2561 || code_point === 0x256A ||
  25852. code_point === 0x5341 || code_point === 0x5345) {
  25853. return index_.lastIndexOf(code_point);
  25854. }
  25855. // 3. Return the index pointer for code point in index.
  25856. return indexPointerFor(code_point, index_);
  25857. }
  25858. var big5_index_no_hkscs;
  25859. //
  25860. // 8. API
  25861. //
  25862. /** @const */ var DEFAULT_ENCODING = 'utf-8';
  25863. // 8.1 Interface TextDecoder
  25864. /**
  25865. * @constructor
  25866. * @param {string=} label The label of the encoding;
  25867. * defaults to 'utf-8'.
  25868. * @param {Object=} options
  25869. */
  25870. function TextDecoder(label, options) {
  25871. // Web IDL conventions
  25872. if (!(this instanceof TextDecoder))
  25873. throw TypeError('Called as a function. Did you forget \'new\'?');
  25874. label = label !== undefined ? String(label) : DEFAULT_ENCODING;
  25875. options = ToDictionary(options);
  25876. // A TextDecoder object has an associated encoding, decoder,
  25877. // stream, ignore BOM flag (initially unset), BOM seen flag
  25878. // (initially unset), error mode (initially replacement), and do
  25879. // not flush flag (initially unset).
  25880. /** @private */
  25881. this._encoding = null;
  25882. /** @private @type {?Decoder} */
  25883. this._decoder = null;
  25884. /** @private @type {boolean} */
  25885. this._ignoreBOM = false;
  25886. /** @private @type {boolean} */
  25887. this._BOMseen = false;
  25888. /** @private @type {string} */
  25889. this._error_mode = 'replacement';
  25890. /** @private @type {boolean} */
  25891. this._do_not_flush = false;
  25892. // 1. Let encoding be the result of getting an encoding from
  25893. // label.
  25894. var encoding = getEncoding(label);
  25895. // 2. If encoding is failure or replacement, throw a RangeError.
  25896. if (encoding === null || encoding.name === 'replacement')
  25897. throw RangeError('Unknown encoding: ' + label);
  25898. if (!decoders[encoding.name]) {
  25899. throw Error('Decoder not present.' +
  25900. ' Did you forget to include encoding-indexes.js first?');
  25901. }
  25902. // 3. Let dec be a new TextDecoder object.
  25903. var dec = this;
  25904. // 4. Set dec's encoding to encoding.
  25905. dec._encoding = encoding;
  25906. // 5. If options's fatal member is true, set dec's error mode to
  25907. // fatal.
  25908. if (Boolean(options['fatal']))
  25909. dec._error_mode = 'fatal';
  25910. // 6. If options's ignoreBOM member is true, set dec's ignore BOM
  25911. // flag.
  25912. if (Boolean(options['ignoreBOM']))
  25913. dec._ignoreBOM = true;
  25914. // For pre-ES5 runtimes:
  25915. if (!Object.defineProperty) {
  25916. this.encoding = dec._encoding.name.toLowerCase();
  25917. this.fatal = dec._error_mode === 'fatal';
  25918. this.ignoreBOM = dec._ignoreBOM;
  25919. }
  25920. // 7. Return dec.
  25921. return dec;
  25922. }
  25923. if (Object.defineProperty) {
  25924. // The encoding attribute's getter must return encoding's name.
  25925. Object.defineProperty(TextDecoder.prototype, 'encoding', {
  25926. /** @this {TextDecoder} */
  25927. get: function() { return this._encoding.name.toLowerCase(); }
  25928. });
  25929. // The fatal attribute's getter must return true if error mode
  25930. // is fatal, and false otherwise.
  25931. Object.defineProperty(TextDecoder.prototype, 'fatal', {
  25932. /** @this {TextDecoder} */
  25933. get: function() { return this._error_mode === 'fatal'; }
  25934. });
  25935. // The ignoreBOM attribute's getter must return true if ignore
  25936. // BOM flag is set, and false otherwise.
  25937. Object.defineProperty(TextDecoder.prototype, 'ignoreBOM', {
  25938. /** @this {TextDecoder} */
  25939. get: function() { return this._ignoreBOM; }
  25940. });
  25941. }
  25942. /**
  25943. * @param {BufferSource=} input The buffer of bytes to decode.
  25944. * @param {Object=} options
  25945. * @return {string} The decoded string.
  25946. */
  25947. TextDecoder.prototype.decode = function decode(input, options) {
  25948. var bytes;
  25949. if (typeof input === 'object' && input instanceof ArrayBuffer) {
  25950. bytes = new Uint8Array(input);
  25951. } else if (typeof input === 'object' && 'buffer' in input &&
  25952. input.buffer instanceof ArrayBuffer) {
  25953. bytes = new Uint8Array(input.buffer,
  25954. input.byteOffset,
  25955. input.byteLength);
  25956. } else {
  25957. bytes = new Uint8Array(0);
  25958. }
  25959. options = ToDictionary(options);
  25960. // 1. If the do not flush flag is unset, set decoder to a new
  25961. // encoding's decoder, set stream to a new stream, and unset the
  25962. // BOM seen flag.
  25963. if (!this._do_not_flush) {
  25964. this._decoder = decoders[this._encoding.name]({
  25965. fatal: this._error_mode === 'fatal'});
  25966. this._BOMseen = false;
  25967. }
  25968. // 2. If options's stream is true, set the do not flush flag, and
  25969. // unset the do not flush flag otherwise.
  25970. this._do_not_flush = Boolean(options['stream']);
  25971. // 3. If input is given, push a copy of input to stream.
  25972. // TODO: Align with spec algorithm - maintain stream on instance.
  25973. var input_stream = new Stream(bytes);
  25974. // 4. Let output be a new stream.
  25975. var output = [];
  25976. /** @type {?(number|!Array.<number>)} */
  25977. var result;
  25978. // 5. While true:
  25979. while (true) {
  25980. // 1. Let token be the result of reading from stream.
  25981. var token = input_stream.read();
  25982. // 2. If token is end-of-stream and the do not flush flag is
  25983. // set, return output, serialized.
  25984. // TODO: Align with spec algorithm.
  25985. if (token === end_of_stream)
  25986. break;
  25987. // 3. Otherwise, run these subsubsteps:
  25988. // 1. Let result be the result of processing token for decoder,
  25989. // stream, output, and error mode.
  25990. result = this._decoder.handler(input_stream, token);
  25991. // 2. If result is finished, return output, serialized.
  25992. if (result === finished)
  25993. break;
  25994. if (result !== null) {
  25995. if (Array.isArray(result))
  25996. output.push.apply(output, /**@type {!Array.<number>}*/(result));
  25997. else
  25998. output.push(result);
  25999. }
  26000. // 3. Otherwise, if result is error, throw a TypeError.
  26001. // (Thrown in handler)
  26002. // 4. Otherwise, do nothing.
  26003. }
  26004. // TODO: Align with spec algorithm.
  26005. if (!this._do_not_flush) {
  26006. do {
  26007. result = this._decoder.handler(input_stream, input_stream.read());
  26008. if (result === finished)
  26009. break;
  26010. if (result === null)
  26011. continue;
  26012. if (Array.isArray(result))
  26013. output.push.apply(output, /**@type {!Array.<number>}*/(result));
  26014. else
  26015. output.push(result);
  26016. } while (!input_stream.endOfStream());
  26017. this._decoder = null;
  26018. }
  26019. // A TextDecoder object also has an associated serialize stream
  26020. // algorithm...
  26021. /**
  26022. * @param {!Array.<number>} stream
  26023. * @return {string}
  26024. * @this {TextDecoder}
  26025. */
  26026. function serializeStream(stream) {
  26027. // 1. Let token be the result of reading from stream.
  26028. // (Done in-place on array, rather than as a stream)
  26029. // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore
  26030. // BOM flag and BOM seen flag are unset, run these subsubsteps:
  26031. if (includes(['UTF-8', 'UTF-16LE', 'UTF-16BE'], this._encoding.name) &&
  26032. !this._ignoreBOM && !this._BOMseen) {
  26033. if (stream.length > 0 && stream[0] === 0xFEFF) {
  26034. // 1. If token is U+FEFF, set BOM seen flag.
  26035. this._BOMseen = true;
  26036. stream.shift();
  26037. } else if (stream.length > 0) {
  26038. // 2. Otherwise, if token is not end-of-stream, set BOM seen
  26039. // flag and append token to stream.
  26040. this._BOMseen = true;
  26041. }
  26042. }
  26043. // 4. Otherwise, return output.
  26044. return codePointsToString(stream);
  26045. }
  26046. return serializeStream.call(this, output);
  26047. };
  26048. // 8.2 Interface TextEncoder
  26049. /**
  26050. * @constructor
  26051. * @param {string=} label The label of the encoding. NONSTANDARD.
  26052. * @param {Object=} options NONSTANDARD.
  26053. */
  26054. function TextEncoder(label, options) {
  26055. // Web IDL conventions
  26056. if (!(this instanceof TextEncoder))
  26057. throw TypeError('Called as a function. Did you forget \'new\'?');
  26058. options = ToDictionary(options);
  26059. // A TextEncoder object has an associated encoding and encoder.
  26060. /** @private */
  26061. this._encoding = null;
  26062. /** @private @type {?Encoder} */
  26063. this._encoder = null;
  26064. // Non-standard
  26065. /** @private @type {boolean} */
  26066. this._do_not_flush = false;
  26067. /** @private @type {string} */
  26068. this._fatal = Boolean(options['fatal']) ? 'fatal' : 'replacement';
  26069. // 1. Let enc be a new TextEncoder object.
  26070. var enc = this;
  26071. // 2. Set enc's encoding to UTF-8's encoder.
  26072. if (Boolean(options['NONSTANDARD_allowLegacyEncoding'])) {
  26073. // NONSTANDARD behavior.
  26074. label = label !== undefined ? String(label) : DEFAULT_ENCODING;
  26075. var encoding = getEncoding(label);
  26076. if (encoding === null || encoding.name === 'replacement')
  26077. throw RangeError('Unknown encoding: ' + label);
  26078. if (!encoders[encoding.name]) {
  26079. throw Error('Encoder not present.' +
  26080. ' Did you forget to include encoding-indexes.js first?');
  26081. }
  26082. enc._encoding = encoding;
  26083. } else {
  26084. // Standard behavior.
  26085. enc._encoding = getEncoding('utf-8');
  26086. if (label !== undefined && 'console' in global) {
  26087. console.warn('TextEncoder constructor called with encoding label, '
  26088. + 'which is ignored.');
  26089. }
  26090. }
  26091. // For pre-ES5 runtimes:
  26092. if (!Object.defineProperty)
  26093. this.encoding = enc._encoding.name.toLowerCase();
  26094. // 3. Return enc.
  26095. return enc;
  26096. }
  26097. if (Object.defineProperty) {
  26098. // The encoding attribute's getter must return encoding's name.
  26099. Object.defineProperty(TextEncoder.prototype, 'encoding', {
  26100. /** @this {TextEncoder} */
  26101. get: function() { return this._encoding.name.toLowerCase(); }
  26102. });
  26103. }
  26104. /**
  26105. * @param {string=} opt_string The string to encode.
  26106. * @param {Object=} options
  26107. * @return {!Uint8Array} Encoded bytes, as a Uint8Array.
  26108. */
  26109. TextEncoder.prototype.encode = function encode(opt_string, options) {
  26110. opt_string = opt_string === undefined ? '' : String(opt_string);
  26111. options = ToDictionary(options);
  26112. // NOTE: This option is nonstandard. None of the encodings
  26113. // permitted for encoding (i.e. UTF-8, UTF-16) are stateful when
  26114. // the input is a USVString so streaming is not necessary.
  26115. if (!this._do_not_flush)
  26116. this._encoder = encoders[this._encoding.name]({
  26117. fatal: this._fatal === 'fatal'});
  26118. this._do_not_flush = Boolean(options['stream']);
  26119. // 1. Convert input to a stream.
  26120. var input = new Stream(stringToCodePoints(opt_string));
  26121. // 2. Let output be a new stream
  26122. var output = [];
  26123. /** @type {?(number|!Array.<number>)} */
  26124. var result;
  26125. // 3. While true, run these substeps:
  26126. while (true) {
  26127. // 1. Let token be the result of reading from input.
  26128. var token = input.read();
  26129. if (token === end_of_stream)
  26130. break;
  26131. // 2. Let result be the result of processing token for encoder,
  26132. // input, output.
  26133. result = this._encoder.handler(input, token);
  26134. if (result === finished)
  26135. break;
  26136. if (Array.isArray(result))
  26137. output.push.apply(output, /**@type {!Array.<number>}*/(result));
  26138. else
  26139. output.push(result);
  26140. }
  26141. // TODO: Align with spec algorithm.
  26142. if (!this._do_not_flush) {
  26143. while (true) {
  26144. result = this._encoder.handler(input, input.read());
  26145. if (result === finished)
  26146. break;
  26147. if (Array.isArray(result))
  26148. output.push.apply(output, /**@type {!Array.<number>}*/(result));
  26149. else
  26150. output.push(result);
  26151. }
  26152. this._encoder = null;
  26153. }
  26154. // 3. If result is finished, convert output into a byte sequence,
  26155. // and then return a Uint8Array object wrapping an ArrayBuffer
  26156. // containing output.
  26157. return new Uint8Array(output);
  26158. };
  26159. //
  26160. // 9. The encoding
  26161. //
  26162. // 9.1 utf-8
  26163. // 9.1.1 utf-8 decoder
  26164. /**
  26165. * @constructor
  26166. * @implements {Decoder}
  26167. * @param {{fatal: boolean}} options
  26168. */
  26169. function UTF8Decoder(options) {
  26170. var fatal = options.fatal;
  26171. // utf-8's decoder's has an associated utf-8 code point, utf-8
  26172. // bytes seen, and utf-8 bytes needed (all initially 0), a utf-8
  26173. // lower boundary (initially 0x80), and a utf-8 upper boundary
  26174. // (initially 0xBF).
  26175. var /** @type {number} */ utf8_code_point = 0,
  26176. /** @type {number} */ utf8_bytes_seen = 0,
  26177. /** @type {number} */ utf8_bytes_needed = 0,
  26178. /** @type {number} */ utf8_lower_boundary = 0x80,
  26179. /** @type {number} */ utf8_upper_boundary = 0xBF;
  26180. /**
  26181. * @param {Stream} stream The stream of bytes being decoded.
  26182. * @param {number} bite The next byte read from the stream.
  26183. * @return {?(number|!Array.<number>)} The next code point(s)
  26184. * decoded, or null if not enough data exists in the input
  26185. * stream to decode a complete code point.
  26186. */
  26187. this.handler = function(stream, bite) {
  26188. // 1. If byte is end-of-stream and utf-8 bytes needed is not 0,
  26189. // set utf-8 bytes needed to 0 and return error.
  26190. if (bite === end_of_stream && utf8_bytes_needed !== 0) {
  26191. utf8_bytes_needed = 0;
  26192. return decoderError(fatal);
  26193. }
  26194. // 2. If byte is end-of-stream, return finished.
  26195. if (bite === end_of_stream)
  26196. return finished;
  26197. // 3. If utf-8 bytes needed is 0, based on byte:
  26198. if (utf8_bytes_needed === 0) {
  26199. // 0x00 to 0x7F
  26200. if (inRange(bite, 0x00, 0x7F)) {
  26201. // Return a code point whose value is byte.
  26202. return bite;
  26203. }
  26204. // 0xC2 to 0xDF
  26205. else if (inRange(bite, 0xC2, 0xDF)) {
  26206. // 1. Set utf-8 bytes needed to 1.
  26207. utf8_bytes_needed = 1;
  26208. // 2. Set UTF-8 code point to byte & 0x1F.
  26209. utf8_code_point = bite & 0x1F;
  26210. }
  26211. // 0xE0 to 0xEF
  26212. else if (inRange(bite, 0xE0, 0xEF)) {
  26213. // 1. If byte is 0xE0, set utf-8 lower boundary to 0xA0.
  26214. if (bite === 0xE0)
  26215. utf8_lower_boundary = 0xA0;
  26216. // 2. If byte is 0xED, set utf-8 upper boundary to 0x9F.
  26217. if (bite === 0xED)
  26218. utf8_upper_boundary = 0x9F;
  26219. // 3. Set utf-8 bytes needed to 2.
  26220. utf8_bytes_needed = 2;
  26221. // 4. Set UTF-8 code point to byte & 0xF.
  26222. utf8_code_point = bite & 0xF;
  26223. }
  26224. // 0xF0 to 0xF4
  26225. else if (inRange(bite, 0xF0, 0xF4)) {
  26226. // 1. If byte is 0xF0, set utf-8 lower boundary to 0x90.
  26227. if (bite === 0xF0)
  26228. utf8_lower_boundary = 0x90;
  26229. // 2. If byte is 0xF4, set utf-8 upper boundary to 0x8F.
  26230. if (bite === 0xF4)
  26231. utf8_upper_boundary = 0x8F;
  26232. // 3. Set utf-8 bytes needed to 3.
  26233. utf8_bytes_needed = 3;
  26234. // 4. Set UTF-8 code point to byte & 0x7.
  26235. utf8_code_point = bite & 0x7;
  26236. }
  26237. // Otherwise
  26238. else {
  26239. // Return error.
  26240. return decoderError(fatal);
  26241. }
  26242. // Return continue.
  26243. return null;
  26244. }
  26245. // 4. If byte is not in the range utf-8 lower boundary to utf-8
  26246. // upper boundary, inclusive, run these substeps:
  26247. if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) {
  26248. // 1. Set utf-8 code point, utf-8 bytes needed, and utf-8
  26249. // bytes seen to 0, set utf-8 lower boundary to 0x80, and set
  26250. // utf-8 upper boundary to 0xBF.
  26251. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;
  26252. utf8_lower_boundary = 0x80;
  26253. utf8_upper_boundary = 0xBF;
  26254. // 2. Prepend byte to stream.
  26255. stream.prepend(bite);
  26256. // 3. Return error.
  26257. return decoderError(fatal);
  26258. }
  26259. // 5. Set utf-8 lower boundary to 0x80 and utf-8 upper boundary
  26260. // to 0xBF.
  26261. utf8_lower_boundary = 0x80;
  26262. utf8_upper_boundary = 0xBF;
  26263. // 6. Set UTF-8 code point to (UTF-8 code point << 6) | (byte &
  26264. // 0x3F)
  26265. utf8_code_point = (utf8_code_point << 6) | (bite & 0x3F);
  26266. // 7. Increase utf-8 bytes seen by one.
  26267. utf8_bytes_seen += 1;
  26268. // 8. If utf-8 bytes seen is not equal to utf-8 bytes needed,
  26269. // continue.
  26270. if (utf8_bytes_seen !== utf8_bytes_needed)
  26271. return null;
  26272. // 9. Let code point be utf-8 code point.
  26273. var code_point = utf8_code_point;
  26274. // 10. Set utf-8 code point, utf-8 bytes needed, and utf-8 bytes
  26275. // seen to 0.
  26276. utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;
  26277. // 11. Return a code point whose value is code point.
  26278. return code_point;
  26279. };
  26280. }
  26281. // 9.1.2 utf-8 encoder
  26282. /**
  26283. * @constructor
  26284. * @implements {Encoder}
  26285. * @param {{fatal: boolean}} options
  26286. */
  26287. function UTF8Encoder(options) {
  26288. var fatal = options.fatal;
  26289. /**
  26290. * @param {Stream} stream Input stream.
  26291. * @param {number} code_point Next code point read from the stream.
  26292. * @return {(number|!Array.<number>)} Byte(s) to emit.
  26293. */
  26294. this.handler = function(stream, code_point) {
  26295. // 1. If code point is end-of-stream, return finished.
  26296. if (code_point === end_of_stream)
  26297. return finished;
  26298. // 2. If code point is an ASCII code point, return a byte whose
  26299. // value is code point.
  26300. if (isASCIICodePoint(code_point))
  26301. return code_point;
  26302. // 3. Set count and offset based on the range code point is in:
  26303. var count, offset;
  26304. // U+0080 to U+07FF, inclusive:
  26305. if (inRange(code_point, 0x0080, 0x07FF)) {
  26306. // 1 and 0xC0
  26307. count = 1;
  26308. offset = 0xC0;
  26309. }
  26310. // U+0800 to U+FFFF, inclusive:
  26311. else if (inRange(code_point, 0x0800, 0xFFFF)) {
  26312. // 2 and 0xE0
  26313. count = 2;
  26314. offset = 0xE0;
  26315. }
  26316. // U+10000 to U+10FFFF, inclusive:
  26317. else if (inRange(code_point, 0x10000, 0x10FFFF)) {
  26318. // 3 and 0xF0
  26319. count = 3;
  26320. offset = 0xF0;
  26321. }
  26322. // 4. Let bytes be a byte sequence whose first byte is (code
  26323. // point >> (6 × count)) + offset.
  26324. var bytes = [(code_point >> (6 * count)) + offset];
  26325. // 5. Run these substeps while count is greater than 0:
  26326. while (count > 0) {
  26327. // 1. Set temp to code point >> (6 × (count − 1)).
  26328. var temp = code_point >> (6 * (count - 1));
  26329. // 2. Append to bytes 0x80 | (temp & 0x3F).
  26330. bytes.push(0x80 | (temp & 0x3F));
  26331. // 3. Decrease count by one.
  26332. count -= 1;
  26333. }
  26334. // 6. Return bytes bytes, in order.
  26335. return bytes;
  26336. };
  26337. }
  26338. /** @param {{fatal: boolean}} options */
  26339. encoders['UTF-8'] = function(options) {
  26340. return new UTF8Encoder(options);
  26341. };
  26342. /** @param {{fatal: boolean}} options */
  26343. decoders['UTF-8'] = function(options) {
  26344. return new UTF8Decoder(options);
  26345. };
  26346. //
  26347. // 10. Legacy single-byte encodings
  26348. //
  26349. // 10.1 single-byte decoder
  26350. /**
  26351. * @constructor
  26352. * @implements {Decoder}
  26353. * @param {!Array.<number>} index The encoding index.
  26354. * @param {{fatal: boolean}} options
  26355. */
  26356. function SingleByteDecoder(index, options) {
  26357. var fatal = options.fatal;
  26358. /**
  26359. * @param {Stream} stream The stream of bytes being decoded.
  26360. * @param {number} bite The next byte read from the stream.
  26361. * @return {?(number|!Array.<number>)} The next code point(s)
  26362. * decoded, or null if not enough data exists in the input
  26363. * stream to decode a complete code point.
  26364. */
  26365. this.handler = function(stream, bite) {
  26366. // 1. If byte is end-of-stream, return finished.
  26367. if (bite === end_of_stream)
  26368. return finished;
  26369. // 2. If byte is an ASCII byte, return a code point whose value
  26370. // is byte.
  26371. if (isASCIIByte(bite))
  26372. return bite;
  26373. // 3. Let code point be the index code point for byte − 0x80 in
  26374. // index single-byte.
  26375. var code_point = index[bite - 0x80];
  26376. // 4. If code point is null, return error.
  26377. if (code_point === null)
  26378. return decoderError(fatal);
  26379. // 5. Return a code point whose value is code point.
  26380. return code_point;
  26381. };
  26382. }
  26383. // 10.2 single-byte encoder
  26384. /**
  26385. * @constructor
  26386. * @implements {Encoder}
  26387. * @param {!Array.<?number>} index The encoding index.
  26388. * @param {{fatal: boolean}} options
  26389. */
  26390. function SingleByteEncoder(index, options) {
  26391. var fatal = options.fatal;
  26392. /**
  26393. * @param {Stream} stream Input stream.
  26394. * @param {number} code_point Next code point read from the stream.
  26395. * @return {(number|!Array.<number>)} Byte(s) to emit.
  26396. */
  26397. this.handler = function(stream, code_point) {
  26398. // 1. If code point is end-of-stream, return finished.
  26399. if (code_point === end_of_stream)
  26400. return finished;
  26401. // 2. If code point is an ASCII code point, return a byte whose
  26402. // value is code point.
  26403. if (isASCIICodePoint(code_point))
  26404. return code_point;
  26405. // 3. Let pointer be the index pointer for code point in index
  26406. // single-byte.
  26407. var pointer = indexPointerFor(code_point, index);
  26408. // 4. If pointer is null, return error with code point.
  26409. if (pointer === null)
  26410. encoderError(code_point);
  26411. // 5. Return a byte whose value is pointer + 0x80.
  26412. return pointer + 0x80;
  26413. };
  26414. }
  26415. (function() {
  26416. if (!('encoding-indexes' in global))
  26417. return;
  26418. encodings.forEach(function(category) {
  26419. if (category.heading !== 'Legacy single-byte encodings')
  26420. return;
  26421. category.encodings.forEach(function(encoding) {
  26422. var name = encoding.name;
  26423. var idx = index(name.toLowerCase());
  26424. /** @param {{fatal: boolean}} options */
  26425. decoders[name] = function(options) {
  26426. return new SingleByteDecoder(idx, options);
  26427. };
  26428. /** @param {{fatal: boolean}} options */
  26429. encoders[name] = function(options) {
  26430. return new SingleByteEncoder(idx, options);
  26431. };
  26432. });
  26433. });
  26434. }());
  26435. //
  26436. // 11. Legacy multi-byte Chinese (simplified) encodings
  26437. //
  26438. // 11.1 gbk
  26439. // 11.1.1 gbk decoder
  26440. // gbk's decoder is gb18030's decoder.
  26441. /** @param {{fatal: boolean}} options */
  26442. decoders['GBK'] = function(options) {
  26443. return new GB18030Decoder(options);
  26444. };
  26445. // 11.1.2 gbk encoder
  26446. // gbk's encoder is gb18030's encoder with its gbk flag set.
  26447. /** @param {{fatal: boolean}} options */
  26448. encoders['GBK'] = function(options) {
  26449. return new GB18030Encoder(options, true);
  26450. };
  26451. // 11.2 gb18030
  26452. // 11.2.1 gb18030 decoder
  26453. /**
  26454. * @constructor
  26455. * @implements {Decoder}
  26456. * @param {{fatal: boolean}} options
  26457. */
  26458. function GB18030Decoder(options) {
  26459. var fatal = options.fatal;
  26460. // gb18030's decoder has an associated gb18030 first, gb18030
  26461. // second, and gb18030 third (all initially 0x00).
  26462. var /** @type {number} */ gb18030_first = 0x00,
  26463. /** @type {number} */ gb18030_second = 0x00,
  26464. /** @type {number} */ gb18030_third = 0x00;
  26465. /**
  26466. * @param {Stream} stream The stream of bytes being decoded.
  26467. * @param {number} bite The next byte read from the stream.
  26468. * @return {?(number|!Array.<number>)} The next code point(s)
  26469. * decoded, or null if not enough data exists in the input
  26470. * stream to decode a complete code point.
  26471. */
  26472. this.handler = function(stream, bite) {
  26473. // 1. If byte is end-of-stream and gb18030 first, gb18030
  26474. // second, and gb18030 third are 0x00, return finished.
  26475. if (bite === end_of_stream && gb18030_first === 0x00 &&
  26476. gb18030_second === 0x00 && gb18030_third === 0x00) {
  26477. return finished;
  26478. }
  26479. // 2. If byte is end-of-stream, and gb18030 first, gb18030
  26480. // second, or gb18030 third is not 0x00, set gb18030 first,
  26481. // gb18030 second, and gb18030 third to 0x00, and return error.
  26482. if (bite === end_of_stream &&
  26483. (gb18030_first !== 0x00 || gb18030_second !== 0x00 ||
  26484. gb18030_third !== 0x00)) {
  26485. gb18030_first = 0x00;
  26486. gb18030_second = 0x00;
  26487. gb18030_third = 0x00;
  26488. decoderError(fatal);
  26489. }
  26490. var code_point;
  26491. // 3. If gb18030 third is not 0x00, run these substeps:
  26492. if (gb18030_third !== 0x00) {
  26493. // 1. Let code point be null.
  26494. code_point = null;
  26495. // 2. If byte is in the range 0x30 to 0x39, inclusive, set
  26496. // code point to the index gb18030 ranges code point for
  26497. // (((gb18030 first − 0x81) × 10 + gb18030 second − 0x30) ×
  26498. // 126 + gb18030 third − 0x81) × 10 + byte − 0x30.
  26499. if (inRange(bite, 0x30, 0x39)) {
  26500. code_point = indexGB18030RangesCodePointFor(
  26501. (((gb18030_first - 0x81) * 10 + gb18030_second - 0x30) * 126 +
  26502. gb18030_third - 0x81) * 10 + bite - 0x30);
  26503. }
  26504. // 3. Let buffer be a byte sequence consisting of gb18030
  26505. // second, gb18030 third, and byte, in order.
  26506. var buffer = [gb18030_second, gb18030_third, bite];
  26507. // 4. Set gb18030 first, gb18030 second, and gb18030 third to
  26508. // 0x00.
  26509. gb18030_first = 0x00;
  26510. gb18030_second = 0x00;
  26511. gb18030_third = 0x00;
  26512. // 5. If code point is null, prepend buffer to stream and
  26513. // return error.
  26514. if (code_point === null) {
  26515. stream.prepend(buffer);
  26516. return decoderError(fatal);
  26517. }
  26518. // 6. Return a code point whose value is code point.
  26519. return code_point;
  26520. }
  26521. // 4. If gb18030 second is not 0x00, run these substeps:
  26522. if (gb18030_second !== 0x00) {
  26523. // 1. If byte is in the range 0x81 to 0xFE, inclusive, set
  26524. // gb18030 third to byte and return continue.
  26525. if (inRange(bite, 0x81, 0xFE)) {
  26526. gb18030_third = bite;
  26527. return null;
  26528. }
  26529. // 2. Prepend gb18030 second followed by byte to stream, set
  26530. // gb18030 first and gb18030 second to 0x00, and return error.
  26531. stream.prepend([gb18030_second, bite]);
  26532. gb18030_first = 0x00;
  26533. gb18030_second = 0x00;
  26534. return decoderError(fatal);
  26535. }
  26536. // 5. If gb18030 first is not 0x00, run these substeps:
  26537. if (gb18030_first !== 0x00) {
  26538. // 1. If byte is in the range 0x30 to 0x39, inclusive, set
  26539. // gb18030 second to byte and return continue.
  26540. if (inRange(bite, 0x30, 0x39)) {
  26541. gb18030_second = bite;
  26542. return null;
  26543. }
  26544. // 2. Let lead be gb18030 first, let pointer be null, and set
  26545. // gb18030 first to 0x00.
  26546. var lead = gb18030_first;
  26547. var pointer = null;
  26548. gb18030_first = 0x00;
  26549. // 3. Let offset be 0x40 if byte is less than 0x7F and 0x41
  26550. // otherwise.
  26551. var offset = bite < 0x7F ? 0x40 : 0x41;
  26552. // 4. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80
  26553. // to 0xFE, inclusive, set pointer to (lead − 0x81) × 190 +
  26554. // (byte − offset).
  26555. if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFE))
  26556. pointer = (lead - 0x81) * 190 + (bite - offset);
  26557. // 5. Let code point be null if pointer is null and the index
  26558. // code point for pointer in index gb18030 otherwise.
  26559. code_point = pointer === null ? null :
  26560. indexCodePointFor(pointer, index('gb18030'));
  26561. // 6. If code point is null and byte is an ASCII byte, prepend
  26562. // byte to stream.
  26563. if (code_point === null && isASCIIByte(bite))
  26564. stream.prepend(bite);
  26565. // 7. If code point is null, return error.
  26566. if (code_point === null)
  26567. return decoderError(fatal);
  26568. // 8. Return a code point whose value is code point.
  26569. return code_point;
  26570. }
  26571. // 6. If byte is an ASCII byte, return a code point whose value
  26572. // is byte.
  26573. if (isASCIIByte(bite))
  26574. return bite;
  26575. // 7. If byte is 0x80, return code point U+20AC.
  26576. if (bite === 0x80)
  26577. return 0x20AC;
  26578. // 8. If byte is in the range 0x81 to 0xFE, inclusive, set
  26579. // gb18030 first to byte and return continue.
  26580. if (inRange(bite, 0x81, 0xFE)) {
  26581. gb18030_first = bite;
  26582. return null;
  26583. }
  26584. // 9. Return error.
  26585. return decoderError(fatal);
  26586. };
  26587. }
  26588. // 11.2.2 gb18030 encoder
  26589. /**
  26590. * @constructor
  26591. * @implements {Encoder}
  26592. * @param {{fatal: boolean}} options
  26593. * @param {boolean=} gbk_flag
  26594. */
  26595. function GB18030Encoder(options, gbk_flag) {
  26596. var fatal = options.fatal;
  26597. // gb18030's decoder has an associated gbk flag (initially unset).
  26598. /**
  26599. * @param {Stream} stream Input stream.
  26600. * @param {number} code_point Next code point read from the stream.
  26601. * @return {(number|!Array.<number>)} Byte(s) to emit.
  26602. */
  26603. this.handler = function(stream, code_point) {
  26604. // 1. If code point is end-of-stream, return finished.
  26605. if (code_point === end_of_stream)
  26606. return finished;
  26607. // 2. If code point is an ASCII code point, return a byte whose
  26608. // value is code point.
  26609. if (isASCIICodePoint(code_point))
  26610. return code_point;
  26611. // 3. If code point is U+E5E5, return error with code point.
  26612. if (code_point === 0xE5E5)
  26613. return encoderError(code_point);
  26614. // 4. If the gbk flag is set and code point is U+20AC, return
  26615. // byte 0x80.
  26616. if (gbk_flag && code_point === 0x20AC)
  26617. return 0x80;
  26618. // 5. Let pointer be the index pointer for code point in index
  26619. // gb18030.
  26620. var pointer = indexPointerFor(code_point, index('gb18030'));
  26621. // 6. If pointer is not null, run these substeps:
  26622. if (pointer !== null) {
  26623. // 1. Let lead be floor(pointer / 190) + 0x81.
  26624. var lead = floor(pointer / 190) + 0x81;
  26625. // 2. Let trail be pointer % 190.
  26626. var trail = pointer % 190;
  26627. // 3. Let offset be 0x40 if trail is less than 0x3F and 0x41 otherwise.
  26628. var offset = trail < 0x3F ? 0x40 : 0x41;
  26629. // 4. Return two bytes whose values are lead and trail + offset.
  26630. return [lead, trail + offset];
  26631. }
  26632. // 7. If gbk flag is set, return error with code point.
  26633. if (gbk_flag)
  26634. return encoderError(code_point);
  26635. // 8. Set pointer to the index gb18030 ranges pointer for code
  26636. // point.
  26637. pointer = indexGB18030RangesPointerFor(code_point);
  26638. // 9. Let byte1 be floor(pointer / 10 / 126 / 10).
  26639. var byte1 = floor(pointer / 10 / 126 / 10);
  26640. // 10. Set pointer to pointer − byte1 × 10 × 126 × 10.
  26641. pointer = pointer - byte1 * 10 * 126 * 10;
  26642. // 11. Let byte2 be floor(pointer / 10 / 126).
  26643. var byte2 = floor(pointer / 10 / 126);
  26644. // 12. Set pointer to pointer − byte2 × 10 × 126.
  26645. pointer = pointer - byte2 * 10 * 126;
  26646. // 13. Let byte3 be floor(pointer / 10).
  26647. var byte3 = floor(pointer / 10);
  26648. // 14. Let byte4 be pointer − byte3 × 10.
  26649. var byte4 = pointer - byte3 * 10;
  26650. // 15. Return four bytes whose values are byte1 + 0x81, byte2 +
  26651. // 0x30, byte3 + 0x81, byte4 + 0x30.
  26652. return [byte1 + 0x81,
  26653. byte2 + 0x30,
  26654. byte3 + 0x81,
  26655. byte4 + 0x30];
  26656. };
  26657. }
  26658. /** @param {{fatal: boolean}} options */
  26659. encoders['gb18030'] = function(options) {
  26660. return new GB18030Encoder(options);
  26661. };
  26662. /** @param {{fatal: boolean}} options */
  26663. decoders['gb18030'] = function(options) {
  26664. return new GB18030Decoder(options);
  26665. };
  26666. //
  26667. // 12. Legacy multi-byte Chinese (traditional) encodings
  26668. //
  26669. // 12.1 Big5
  26670. // 12.1.1 Big5 decoder
  26671. /**
  26672. * @constructor
  26673. * @implements {Decoder}
  26674. * @param {{fatal: boolean}} options
  26675. */
  26676. function Big5Decoder(options) {
  26677. var fatal = options.fatal;
  26678. // Big5's decoder has an associated Big5 lead (initially 0x00).
  26679. var /** @type {number} */ Big5_lead = 0x00;
  26680. /**
  26681. * @param {Stream} stream The stream of bytes being decoded.
  26682. * @param {number} bite The next byte read from the stream.
  26683. * @return {?(number|!Array.<number>)} The next code point(s)
  26684. * decoded, or null if not enough data exists in the input
  26685. * stream to decode a complete code point.
  26686. */
  26687. this.handler = function(stream, bite) {
  26688. // 1. If byte is end-of-stream and Big5 lead is not 0x00, set
  26689. // Big5 lead to 0x00 and return error.
  26690. if (bite === end_of_stream && Big5_lead !== 0x00) {
  26691. Big5_lead = 0x00;
  26692. return decoderError(fatal);
  26693. }
  26694. // 2. If byte is end-of-stream and Big5 lead is 0x00, return
  26695. // finished.
  26696. if (bite === end_of_stream && Big5_lead === 0x00)
  26697. return finished;
  26698. // 3. If Big5 lead is not 0x00, let lead be Big5 lead, let
  26699. // pointer be null, set Big5 lead to 0x00, and then run these
  26700. // substeps:
  26701. if (Big5_lead !== 0x00) {
  26702. var lead = Big5_lead;
  26703. var pointer = null;
  26704. Big5_lead = 0x00;
  26705. // 1. Let offset be 0x40 if byte is less than 0x7F and 0x62
  26706. // otherwise.
  26707. var offset = bite < 0x7F ? 0x40 : 0x62;
  26708. // 2. If byte is in the range 0x40 to 0x7E, inclusive, or 0xA1
  26709. // to 0xFE, inclusive, set pointer to (lead − 0x81) × 157 +
  26710. // (byte − offset).
  26711. if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0xA1, 0xFE))
  26712. pointer = (lead - 0x81) * 157 + (bite - offset);
  26713. // 3. If there is a row in the table below whose first column
  26714. // is pointer, return the two code points listed in its second
  26715. // column
  26716. // Pointer | Code points
  26717. // --------+--------------
  26718. // 1133 | U+00CA U+0304
  26719. // 1135 | U+00CA U+030C
  26720. // 1164 | U+00EA U+0304
  26721. // 1166 | U+00EA U+030C
  26722. switch (pointer) {
  26723. case 1133: return [0x00CA, 0x0304];
  26724. case 1135: return [0x00CA, 0x030C];
  26725. case 1164: return [0x00EA, 0x0304];
  26726. case 1166: return [0x00EA, 0x030C];
  26727. }
  26728. // 4. Let code point be null if pointer is null and the index
  26729. // code point for pointer in index Big5 otherwise.
  26730. var code_point = (pointer === null) ? null :
  26731. indexCodePointFor(pointer, index('big5'));
  26732. // 5. If code point is null and byte is an ASCII byte, prepend
  26733. // byte to stream.
  26734. if (code_point === null && isASCIIByte(bite))
  26735. stream.prepend(bite);
  26736. // 6. If code point is null, return error.
  26737. if (code_point === null)
  26738. return decoderError(fatal);
  26739. // 7. Return a code point whose value is code point.
  26740. return code_point;
  26741. }
  26742. // 4. If byte is an ASCII byte, return a code point whose value
  26743. // is byte.
  26744. if (isASCIIByte(bite))
  26745. return bite;
  26746. // 5. If byte is in the range 0x81 to 0xFE, inclusive, set Big5
  26747. // lead to byte and return continue.
  26748. if (inRange(bite, 0x81, 0xFE)) {
  26749. Big5_lead = bite;
  26750. return null;
  26751. }
  26752. // 6. Return error.
  26753. return decoderError(fatal);
  26754. };
  26755. }
  26756. // 12.1.2 Big5 encoder
  26757. /**
  26758. * @constructor
  26759. * @implements {Encoder}
  26760. * @param {{fatal: boolean}} options
  26761. */
  26762. function Big5Encoder(options) {
  26763. var fatal = options.fatal;
  26764. /**
  26765. * @param {Stream} stream Input stream.
  26766. * @param {number} code_point Next code point read from the stream.
  26767. * @return {(number|!Array.<number>)} Byte(s) to emit.
  26768. */
  26769. this.handler = function(stream, code_point) {
  26770. // 1. If code point is end-of-stream, return finished.
  26771. if (code_point === end_of_stream)
  26772. return finished;
  26773. // 2. If code point is an ASCII code point, return a byte whose
  26774. // value is code point.
  26775. if (isASCIICodePoint(code_point))
  26776. return code_point;
  26777. // 3. Let pointer be the index Big5 pointer for code point.
  26778. var pointer = indexBig5PointerFor(code_point);
  26779. // 4. If pointer is null, return error with code point.
  26780. if (pointer === null)
  26781. return encoderError(code_point);
  26782. // 5. Let lead be floor(pointer / 157) + 0x81.
  26783. var lead = floor(pointer / 157) + 0x81;
  26784. // 6. If lead is less than 0xA1, return error with code point.
  26785. if (lead < 0xA1)
  26786. return encoderError(code_point);
  26787. // 7. Let trail be pointer % 157.
  26788. var trail = pointer % 157;
  26789. // 8. Let offset be 0x40 if trail is less than 0x3F and 0x62
  26790. // otherwise.
  26791. var offset = trail < 0x3F ? 0x40 : 0x62;
  26792. // Return two bytes whose values are lead and trail + offset.
  26793. return [lead, trail + offset];
  26794. };
  26795. }
  26796. /** @param {{fatal: boolean}} options */
  26797. encoders['Big5'] = function(options) {
  26798. return new Big5Encoder(options);
  26799. };
  26800. /** @param {{fatal: boolean}} options */
  26801. decoders['Big5'] = function(options) {
  26802. return new Big5Decoder(options);
  26803. };
  26804. //
  26805. // 13. Legacy multi-byte Japanese encodings
  26806. //
  26807. // 13.1 euc-jp
  26808. // 13.1.1 euc-jp decoder
  26809. /**
  26810. * @constructor
  26811. * @implements {Decoder}
  26812. * @param {{fatal: boolean}} options
  26813. */
  26814. function EUCJPDecoder(options) {
  26815. var fatal = options.fatal;
  26816. // euc-jp's decoder has an associated euc-jp jis0212 flag
  26817. // (initially unset) and euc-jp lead (initially 0x00).
  26818. var /** @type {boolean} */ eucjp_jis0212_flag = false,
  26819. /** @type {number} */ eucjp_lead = 0x00;
  26820. /**
  26821. * @param {Stream} stream The stream of bytes being decoded.
  26822. * @param {number} bite The next byte read from the stream.
  26823. * @return {?(number|!Array.<number>)} The next code point(s)
  26824. * decoded, or null if not enough data exists in the input
  26825. * stream to decode a complete code point.
  26826. */
  26827. this.handler = function(stream, bite) {
  26828. // 1. If byte is end-of-stream and euc-jp lead is not 0x00, set
  26829. // euc-jp lead to 0x00, and return error.
  26830. if (bite === end_of_stream && eucjp_lead !== 0x00) {
  26831. eucjp_lead = 0x00;
  26832. return decoderError(fatal);
  26833. }
  26834. // 2. If byte is end-of-stream and euc-jp lead is 0x00, return
  26835. // finished.
  26836. if (bite === end_of_stream && eucjp_lead === 0x00)
  26837. return finished;
  26838. // 3. If euc-jp lead is 0x8E and byte is in the range 0xA1 to
  26839. // 0xDF, inclusive, set euc-jp lead to 0x00 and return a code
  26840. // point whose value is 0xFF61 − 0xA1 + byte.
  26841. if (eucjp_lead === 0x8E && inRange(bite, 0xA1, 0xDF)) {
  26842. eucjp_lead = 0x00;
  26843. return 0xFF61 - 0xA1 + bite;
  26844. }
  26845. // 4. If euc-jp lead is 0x8F and byte is in the range 0xA1 to
  26846. // 0xFE, inclusive, set the euc-jp jis0212 flag, set euc-jp lead
  26847. // to byte, and return continue.
  26848. if (eucjp_lead === 0x8F && inRange(bite, 0xA1, 0xFE)) {
  26849. eucjp_jis0212_flag = true;
  26850. eucjp_lead = bite;
  26851. return null;
  26852. }
  26853. // 5. If euc-jp lead is not 0x00, let lead be euc-jp lead, set
  26854. // euc-jp lead to 0x00, and run these substeps:
  26855. if (eucjp_lead !== 0x00) {
  26856. var lead = eucjp_lead;
  26857. eucjp_lead = 0x00;
  26858. // 1. Let code point be null.
  26859. var code_point = null;
  26860. // 2. If lead and byte are both in the range 0xA1 to 0xFE,
  26861. // inclusive, set code point to the index code point for (lead
  26862. // − 0xA1) × 94 + byte − 0xA1 in index jis0208 if the euc-jp
  26863. // jis0212 flag is unset and in index jis0212 otherwise.
  26864. if (inRange(lead, 0xA1, 0xFE) && inRange(bite, 0xA1, 0xFE)) {
  26865. code_point = indexCodePointFor(
  26866. (lead - 0xA1) * 94 + (bite - 0xA1),
  26867. index(!eucjp_jis0212_flag ? 'jis0208' : 'jis0212'));
  26868. }
  26869. // 3. Unset the euc-jp jis0212 flag.
  26870. eucjp_jis0212_flag = false;
  26871. // 4. If byte is not in the range 0xA1 to 0xFE, inclusive,
  26872. // prepend byte to stream.
  26873. if (!inRange(bite, 0xA1, 0xFE))
  26874. stream.prepend(bite);
  26875. // 5. If code point is null, return error.
  26876. if (code_point === null)
  26877. return decoderError(fatal);
  26878. // 6. Return a code point whose value is code point.
  26879. return code_point;
  26880. }
  26881. // 6. If byte is an ASCII byte, return a code point whose value
  26882. // is byte.
  26883. if (isASCIIByte(bite))
  26884. return bite;
  26885. // 7. If byte is 0x8E, 0x8F, or in the range 0xA1 to 0xFE,
  26886. // inclusive, set euc-jp lead to byte and return continue.
  26887. if (bite === 0x8E || bite === 0x8F || inRange(bite, 0xA1, 0xFE)) {
  26888. eucjp_lead = bite;
  26889. return null;
  26890. }
  26891. // 8. Return error.
  26892. return decoderError(fatal);
  26893. };
  26894. }
  26895. // 13.1.2 euc-jp encoder
  26896. /**
  26897. * @constructor
  26898. * @implements {Encoder}
  26899. * @param {{fatal: boolean}} options
  26900. */
  26901. function EUCJPEncoder(options) {
  26902. var fatal = options.fatal;
  26903. /**
  26904. * @param {Stream} stream Input stream.
  26905. * @param {number} code_point Next code point read from the stream.
  26906. * @return {(number|!Array.<number>)} Byte(s) to emit.
  26907. */
  26908. this.handler = function(stream, code_point) {
  26909. // 1. If code point is end-of-stream, return finished.
  26910. if (code_point === end_of_stream)
  26911. return finished;
  26912. // 2. If code point is an ASCII code point, return a byte whose
  26913. // value is code point.
  26914. if (isASCIICodePoint(code_point))
  26915. return code_point;
  26916. // 3. If code point is U+00A5, return byte 0x5C.
  26917. if (code_point === 0x00A5)
  26918. return 0x5C;
  26919. // 4. If code point is U+203E, return byte 0x7E.
  26920. if (code_point === 0x203E)
  26921. return 0x7E;
  26922. // 5. If code point is in the range U+FF61 to U+FF9F, inclusive,
  26923. // return two bytes whose values are 0x8E and code point −
  26924. // 0xFF61 + 0xA1.
  26925. if (inRange(code_point, 0xFF61, 0xFF9F))
  26926. return [0x8E, code_point - 0xFF61 + 0xA1];
  26927. // 6. If code point is U+2212, set it to U+FF0D.
  26928. if (code_point === 0x2212)
  26929. code_point = 0xFF0D;
  26930. // 7. Let pointer be the index pointer for code point in index
  26931. // jis0208.
  26932. var pointer = indexPointerFor(code_point, index('jis0208'));
  26933. // 8. If pointer is null, return error with code point.
  26934. if (pointer === null)
  26935. return encoderError(code_point);
  26936. // 9. Let lead be floor(pointer / 94) + 0xA1.
  26937. var lead = floor(pointer / 94) + 0xA1;
  26938. // 10. Let trail be pointer % 94 + 0xA1.
  26939. var trail = pointer % 94 + 0xA1;
  26940. // 11. Return two bytes whose values are lead and trail.
  26941. return [lead, trail];
  26942. };
  26943. }
  26944. /** @param {{fatal: boolean}} options */
  26945. encoders['EUC-JP'] = function(options) {
  26946. return new EUCJPEncoder(options);
  26947. };
  26948. /** @param {{fatal: boolean}} options */
  26949. decoders['EUC-JP'] = function(options) {
  26950. return new EUCJPDecoder(options);
  26951. };
  26952. // 13.2 iso-2022-jp
  26953. // 13.2.1 iso-2022-jp decoder
  26954. /**
  26955. * @constructor
  26956. * @implements {Decoder}
  26957. * @param {{fatal: boolean}} options
  26958. */
  26959. function ISO2022JPDecoder(options) {
  26960. var fatal = options.fatal;
  26961. /** @enum */
  26962. var states = {
  26963. ASCII: 0,
  26964. Roman: 1,
  26965. Katakana: 2,
  26966. LeadByte: 3,
  26967. TrailByte: 4,
  26968. EscapeStart: 5,
  26969. Escape: 6
  26970. };
  26971. // iso-2022-jp's decoder has an associated iso-2022-jp decoder
  26972. // state (initially ASCII), iso-2022-jp decoder output state
  26973. // (initially ASCII), iso-2022-jp lead (initially 0x00), and
  26974. // iso-2022-jp output flag (initially unset).
  26975. var /** @type {number} */ iso2022jp_decoder_state = states.ASCII,
  26976. /** @type {number} */ iso2022jp_decoder_output_state = states.ASCII,
  26977. /** @type {number} */ iso2022jp_lead = 0x00,
  26978. /** @type {boolean} */ iso2022jp_output_flag = false;
  26979. /**
  26980. * @param {Stream} stream The stream of bytes being decoded.
  26981. * @param {number} bite The next byte read from the stream.
  26982. * @return {?(number|!Array.<number>)} The next code point(s)
  26983. * decoded, or null if not enough data exists in the input
  26984. * stream to decode a complete code point.
  26985. */
  26986. this.handler = function(stream, bite) {
  26987. // switching on iso-2022-jp decoder state:
  26988. switch (iso2022jp_decoder_state) {
  26989. default:
  26990. case states.ASCII:
  26991. // ASCII
  26992. // Based on byte:
  26993. // 0x1B
  26994. if (bite === 0x1B) {
  26995. // Set iso-2022-jp decoder state to escape start and return
  26996. // continue.
  26997. iso2022jp_decoder_state = states.EscapeStart;
  26998. return null;
  26999. }
  27000. // 0x00 to 0x7F, excluding 0x0E, 0x0F, and 0x1B
  27001. if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E
  27002. && bite !== 0x0F && bite !== 0x1B) {
  27003. // Unset the iso-2022-jp output flag and return a code point
  27004. // whose value is byte.
  27005. iso2022jp_output_flag = false;
  27006. return bite;
  27007. }
  27008. // end-of-stream
  27009. if (bite === end_of_stream) {
  27010. // Return finished.
  27011. return finished;
  27012. }
  27013. // Otherwise
  27014. // Unset the iso-2022-jp output flag and return error.
  27015. iso2022jp_output_flag = false;
  27016. return decoderError(fatal);
  27017. case states.Roman:
  27018. // Roman
  27019. // Based on byte:
  27020. // 0x1B
  27021. if (bite === 0x1B) {
  27022. // Set iso-2022-jp decoder state to escape start and return
  27023. // continue.
  27024. iso2022jp_decoder_state = states.EscapeStart;
  27025. return null;
  27026. }
  27027. // 0x5C
  27028. if (bite === 0x5C) {
  27029. // Unset the iso-2022-jp output flag and return code point
  27030. // U+00A5.
  27031. iso2022jp_output_flag = false;
  27032. return 0x00A5;
  27033. }
  27034. // 0x7E
  27035. if (bite === 0x7E) {
  27036. // Unset the iso-2022-jp output flag and return code point
  27037. // U+203E.
  27038. iso2022jp_output_flag = false;
  27039. return 0x203E;
  27040. }
  27041. // 0x00 to 0x7F, excluding 0x0E, 0x0F, 0x1B, 0x5C, and 0x7E
  27042. if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F
  27043. && bite !== 0x1B && bite !== 0x5C && bite !== 0x7E) {
  27044. // Unset the iso-2022-jp output flag and return a code point
  27045. // whose value is byte.
  27046. iso2022jp_output_flag = false;
  27047. return bite;
  27048. }
  27049. // end-of-stream
  27050. if (bite === end_of_stream) {
  27051. // Return finished.
  27052. return finished;
  27053. }
  27054. // Otherwise
  27055. // Unset the iso-2022-jp output flag and return error.
  27056. iso2022jp_output_flag = false;
  27057. return decoderError(fatal);
  27058. case states.Katakana:
  27059. // Katakana
  27060. // Based on byte:
  27061. // 0x1B
  27062. if (bite === 0x1B) {
  27063. // Set iso-2022-jp decoder state to escape start and return
  27064. // continue.
  27065. iso2022jp_decoder_state = states.EscapeStart;
  27066. return null;
  27067. }
  27068. // 0x21 to 0x5F
  27069. if (inRange(bite, 0x21, 0x5F)) {
  27070. // Unset the iso-2022-jp output flag and return a code point
  27071. // whose value is 0xFF61 − 0x21 + byte.
  27072. iso2022jp_output_flag = false;
  27073. return 0xFF61 - 0x21 + bite;
  27074. }
  27075. // end-of-stream
  27076. if (bite === end_of_stream) {
  27077. // Return finished.
  27078. return finished;
  27079. }
  27080. // Otherwise
  27081. // Unset the iso-2022-jp output flag and return error.
  27082. iso2022jp_output_flag = false;
  27083. return decoderError(fatal);
  27084. case states.LeadByte:
  27085. // Lead byte
  27086. // Based on byte:
  27087. // 0x1B
  27088. if (bite === 0x1B) {
  27089. // Set iso-2022-jp decoder state to escape start and return
  27090. // continue.
  27091. iso2022jp_decoder_state = states.EscapeStart;
  27092. return null;
  27093. }
  27094. // 0x21 to 0x7E
  27095. if (inRange(bite, 0x21, 0x7E)) {
  27096. // Unset the iso-2022-jp output flag, set iso-2022-jp lead
  27097. // to byte, iso-2022-jp decoder state to trail byte, and
  27098. // return continue.
  27099. iso2022jp_output_flag = false;
  27100. iso2022jp_lead = bite;
  27101. iso2022jp_decoder_state = states.TrailByte;
  27102. return null;
  27103. }
  27104. // end-of-stream
  27105. if (bite === end_of_stream) {
  27106. // Return finished.
  27107. return finished;
  27108. }
  27109. // Otherwise
  27110. // Unset the iso-2022-jp output flag and return error.
  27111. iso2022jp_output_flag = false;
  27112. return decoderError(fatal);
  27113. case states.TrailByte:
  27114. // Trail byte
  27115. // Based on byte:
  27116. // 0x1B
  27117. if (bite === 0x1B) {
  27118. // Set iso-2022-jp decoder state to escape start and return
  27119. // continue.
  27120. iso2022jp_decoder_state = states.EscapeStart;
  27121. return decoderError(fatal);
  27122. }
  27123. // 0x21 to 0x7E
  27124. if (inRange(bite, 0x21, 0x7E)) {
  27125. // 1. Set the iso-2022-jp decoder state to lead byte.
  27126. iso2022jp_decoder_state = states.LeadByte;
  27127. // 2. Let pointer be (iso-2022-jp lead − 0x21) × 94 + byte − 0x21.
  27128. var pointer = (iso2022jp_lead - 0x21) * 94 + bite - 0x21;
  27129. // 3. Let code point be the index code point for pointer in
  27130. // index jis0208.
  27131. var code_point = indexCodePointFor(pointer, index('jis0208'));
  27132. // 4. If code point is null, return error.
  27133. if (code_point === null)
  27134. return decoderError(fatal);
  27135. // 5. Return a code point whose value is code point.
  27136. return code_point;
  27137. }
  27138. // end-of-stream
  27139. if (bite === end_of_stream) {
  27140. // Set the iso-2022-jp decoder state to lead byte, prepend
  27141. // byte to stream, and return error.
  27142. iso2022jp_decoder_state = states.LeadByte;
  27143. stream.prepend(bite);
  27144. return decoderError(fatal);
  27145. }
  27146. // Otherwise
  27147. // Set iso-2022-jp decoder state to lead byte and return
  27148. // error.
  27149. iso2022jp_decoder_state = states.LeadByte;
  27150. return decoderError(fatal);
  27151. case states.EscapeStart:
  27152. // Escape start
  27153. // 1. If byte is either 0x24 or 0x28, set iso-2022-jp lead to
  27154. // byte, iso-2022-jp decoder state to escape, and return
  27155. // continue.
  27156. if (bite === 0x24 || bite === 0x28) {
  27157. iso2022jp_lead = bite;
  27158. iso2022jp_decoder_state = states.Escape;
  27159. return null;
  27160. }
  27161. // 2. Prepend byte to stream.
  27162. stream.prepend(bite);
  27163. // 3. Unset the iso-2022-jp output flag, set iso-2022-jp
  27164. // decoder state to iso-2022-jp decoder output state, and
  27165. // return error.
  27166. iso2022jp_output_flag = false;
  27167. iso2022jp_decoder_state = iso2022jp_decoder_output_state;
  27168. return decoderError(fatal);
  27169. case states.Escape:
  27170. // Escape
  27171. // 1. Let lead be iso-2022-jp lead and set iso-2022-jp lead to
  27172. // 0x00.
  27173. var lead = iso2022jp_lead;
  27174. iso2022jp_lead = 0x00;
  27175. // 2. Let state be null.
  27176. var state = null;
  27177. // 3. If lead is 0x28 and byte is 0x42, set state to ASCII.
  27178. if (lead === 0x28 && bite === 0x42)
  27179. state = states.ASCII;
  27180. // 4. If lead is 0x28 and byte is 0x4A, set state to Roman.
  27181. if (lead === 0x28 && bite === 0x4A)
  27182. state = states.Roman;
  27183. // 5. If lead is 0x28 and byte is 0x49, set state to Katakana.
  27184. if (lead === 0x28 && bite === 0x49)
  27185. state = states.Katakana;
  27186. // 6. If lead is 0x24 and byte is either 0x40 or 0x42, set
  27187. // state to lead byte.
  27188. if (lead === 0x24 && (bite === 0x40 || bite === 0x42))
  27189. state = states.LeadByte;
  27190. // 7. If state is non-null, run these substeps:
  27191. if (state !== null) {
  27192. // 1. Set iso-2022-jp decoder state and iso-2022-jp decoder
  27193. // output state to states.
  27194. iso2022jp_decoder_state = iso2022jp_decoder_state = state;
  27195. // 2. Let output flag be the iso-2022-jp output flag.
  27196. var output_flag = iso2022jp_output_flag;
  27197. // 3. Set the iso-2022-jp output flag.
  27198. iso2022jp_output_flag = true;
  27199. // 4. Return continue, if output flag is unset, and error
  27200. // otherwise.
  27201. return !output_flag ? null : decoderError(fatal);
  27202. }
  27203. // 8. Prepend lead and byte to stream.
  27204. stream.prepend([lead, bite]);
  27205. // 9. Unset the iso-2022-jp output flag, set iso-2022-jp
  27206. // decoder state to iso-2022-jp decoder output state and
  27207. // return error.
  27208. iso2022jp_output_flag = false;
  27209. iso2022jp_decoder_state = iso2022jp_decoder_output_state;
  27210. return decoderError(fatal);
  27211. }
  27212. };
  27213. }
  27214. // 13.2.2 iso-2022-jp encoder
  27215. /**
  27216. * @constructor
  27217. * @implements {Encoder}
  27218. * @param {{fatal: boolean}} options
  27219. */
  27220. function ISO2022JPEncoder(options) {
  27221. var fatal = options.fatal;
  27222. // iso-2022-jp's encoder has an associated iso-2022-jp encoder
  27223. // state which is one of ASCII, Roman, and jis0208 (initially
  27224. // ASCII).
  27225. /** @enum */
  27226. var states = {
  27227. ASCII: 0,
  27228. Roman: 1,
  27229. jis0208: 2
  27230. };
  27231. var /** @type {number} */ iso2022jp_state = states.ASCII;
  27232. /**
  27233. * @param {Stream} stream Input stream.
  27234. * @param {number} code_point Next code point read from the stream.
  27235. * @return {(number|!Array.<number>)} Byte(s) to emit.
  27236. */
  27237. this.handler = function(stream, code_point) {
  27238. // 1. If code point is end-of-stream and iso-2022-jp encoder
  27239. // state is not ASCII, prepend code point to stream, set
  27240. // iso-2022-jp encoder state to ASCII, and return three bytes
  27241. // 0x1B 0x28 0x42.
  27242. if (code_point === end_of_stream &&
  27243. iso2022jp_state !== states.ASCII) {
  27244. stream.prepend(code_point);
  27245. iso2022jp_state = states.ASCII;
  27246. return [0x1B, 0x28, 0x42];
  27247. }
  27248. // 2. If code point is end-of-stream and iso-2022-jp encoder
  27249. // state is ASCII, return finished.
  27250. if (code_point === end_of_stream && iso2022jp_state === states.ASCII)
  27251. return finished;
  27252. // 3. If ISO-2022-JP encoder state is ASCII or Roman, and code
  27253. // point is U+000E, U+000F, or U+001B, return error with U+FFFD.
  27254. if ((iso2022jp_state === states.ASCII ||
  27255. iso2022jp_state === states.Roman) &&
  27256. (code_point === 0x000E || code_point === 0x000F ||
  27257. code_point === 0x001B)) {
  27258. return encoderError(0xFFFD);
  27259. }
  27260. // 4. If iso-2022-jp encoder state is ASCII and code point is an
  27261. // ASCII code point, return a byte whose value is code point.
  27262. if (iso2022jp_state === states.ASCII &&
  27263. isASCIICodePoint(code_point))
  27264. return code_point;
  27265. // 5. If iso-2022-jp encoder state is Roman and code point is an
  27266. // ASCII code point, excluding U+005C and U+007E, or is U+00A5
  27267. // or U+203E, run these substeps:
  27268. if (iso2022jp_state === states.Roman &&
  27269. ((isASCIICodePoint(code_point) &&
  27270. code_point !== 0x005C && code_point !== 0x007E) ||
  27271. (code_point == 0x00A5 || code_point == 0x203E))) {
  27272. // 1. If code point is an ASCII code point, return a byte
  27273. // whose value is code point.
  27274. if (isASCIICodePoint(code_point))
  27275. return code_point;
  27276. // 2. If code point is U+00A5, return byte 0x5C.
  27277. if (code_point === 0x00A5)
  27278. return 0x5C;
  27279. // 3. If code point is U+203E, return byte 0x7E.
  27280. if (code_point === 0x203E)
  27281. return 0x7E;
  27282. }
  27283. // 6. If code point is an ASCII code point, and iso-2022-jp
  27284. // encoder state is not ASCII, prepend code point to stream, set
  27285. // iso-2022-jp encoder state to ASCII, and return three bytes
  27286. // 0x1B 0x28 0x42.
  27287. if (isASCIICodePoint(code_point) &&
  27288. iso2022jp_state !== states.ASCII) {
  27289. stream.prepend(code_point);
  27290. iso2022jp_state = states.ASCII;
  27291. return [0x1B, 0x28, 0x42];
  27292. }
  27293. // 7. If code point is either U+00A5 or U+203E, and iso-2022-jp
  27294. // encoder state is not Roman, prepend code point to stream, set
  27295. // iso-2022-jp encoder state to Roman, and return three bytes
  27296. // 0x1B 0x28 0x4A.
  27297. if ((code_point === 0x00A5 || code_point === 0x203E) &&
  27298. iso2022jp_state !== states.Roman) {
  27299. stream.prepend(code_point);
  27300. iso2022jp_state = states.Roman;
  27301. return [0x1B, 0x28, 0x4A];
  27302. }
  27303. // 8. If code point is U+2212, set it to U+FF0D.
  27304. if (code_point === 0x2212)
  27305. code_point = 0xFF0D;
  27306. // 9. Let pointer be the index pointer for code point in index
  27307. // jis0208.
  27308. var pointer = indexPointerFor(code_point, index('jis0208'));
  27309. // 10. If pointer is null, return error with code point.
  27310. if (pointer === null)
  27311. return encoderError(code_point);
  27312. // 11. If iso-2022-jp encoder state is not jis0208, prepend code
  27313. // point to stream, set iso-2022-jp encoder state to jis0208,
  27314. // and return three bytes 0x1B 0x24 0x42.
  27315. if (iso2022jp_state !== states.jis0208) {
  27316. stream.prepend(code_point);
  27317. iso2022jp_state = states.jis0208;
  27318. return [0x1B, 0x24, 0x42];
  27319. }
  27320. // 12. Let lead be floor(pointer / 94) + 0x21.
  27321. var lead = floor(pointer / 94) + 0x21;
  27322. // 13. Let trail be pointer % 94 + 0x21.
  27323. var trail = pointer % 94 + 0x21;
  27324. // 14. Return two bytes whose values are lead and trail.
  27325. return [lead, trail];
  27326. };
  27327. }
  27328. /** @param {{fatal: boolean}} options */
  27329. encoders['ISO-2022-JP'] = function(options) {
  27330. return new ISO2022JPEncoder(options);
  27331. };
  27332. /** @param {{fatal: boolean}} options */
  27333. decoders['ISO-2022-JP'] = function(options) {
  27334. return new ISO2022JPDecoder(options);
  27335. };
  27336. // 13.3 Shift_JIS
  27337. // 13.3.1 Shift_JIS decoder
  27338. /**
  27339. * @constructor
  27340. * @implements {Decoder}
  27341. * @param {{fatal: boolean}} options
  27342. */
  27343. function ShiftJISDecoder(options) {
  27344. var fatal = options.fatal;
  27345. // Shift_JIS's decoder has an associated Shift_JIS lead (initially
  27346. // 0x00).
  27347. var /** @type {number} */ Shift_JIS_lead = 0x00;
  27348. /**
  27349. * @param {Stream} stream The stream of bytes being decoded.
  27350. * @param {number} bite The next byte read from the stream.
  27351. * @return {?(number|!Array.<number>)} The next code point(s)
  27352. * decoded, or null if not enough data exists in the input
  27353. * stream to decode a complete code point.
  27354. */
  27355. this.handler = function(stream, bite) {
  27356. // 1. If byte is end-of-stream and Shift_JIS lead is not 0x00,
  27357. // set Shift_JIS lead to 0x00 and return error.
  27358. if (bite === end_of_stream && Shift_JIS_lead !== 0x00) {
  27359. Shift_JIS_lead = 0x00;
  27360. return decoderError(fatal);
  27361. }
  27362. // 2. If byte is end-of-stream and Shift_JIS lead is 0x00,
  27363. // return finished.
  27364. if (bite === end_of_stream && Shift_JIS_lead === 0x00)
  27365. return finished;
  27366. // 3. If Shift_JIS lead is not 0x00, let lead be Shift_JIS lead,
  27367. // let pointer be null, set Shift_JIS lead to 0x00, and then run
  27368. // these substeps:
  27369. if (Shift_JIS_lead !== 0x00) {
  27370. var lead = Shift_JIS_lead;
  27371. var pointer = null;
  27372. Shift_JIS_lead = 0x00;
  27373. // 1. Let offset be 0x40, if byte is less than 0x7F, and 0x41
  27374. // otherwise.
  27375. var offset = (bite < 0x7F) ? 0x40 : 0x41;
  27376. // 2. Let lead offset be 0x81, if lead is less than 0xA0, and
  27377. // 0xC1 otherwise.
  27378. var lead_offset = (lead < 0xA0) ? 0x81 : 0xC1;
  27379. // 3. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80
  27380. // to 0xFC, inclusive, set pointer to (lead − lead offset) ×
  27381. // 188 + byte − offset.
  27382. if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFC))
  27383. pointer = (lead - lead_offset) * 188 + bite - offset;
  27384. // 4. If pointer is in the range 8836 to 10715, inclusive,
  27385. // return a code point whose value is 0xE000 − 8836 + pointer.
  27386. if (inRange(pointer, 8836, 10715))
  27387. return 0xE000 - 8836 + pointer;
  27388. // 5. Let code point be null, if pointer is null, and the
  27389. // index code point for pointer in index jis0208 otherwise.
  27390. var code_point = (pointer === null) ? null :
  27391. indexCodePointFor(pointer, index('jis0208'));
  27392. // 6. If code point is null and byte is an ASCII byte, prepend
  27393. // byte to stream.
  27394. if (code_point === null && isASCIIByte(bite))
  27395. stream.prepend(bite);
  27396. // 7. If code point is null, return error.
  27397. if (code_point === null)
  27398. return decoderError(fatal);
  27399. // 8. Return a code point whose value is code point.
  27400. return code_point;
  27401. }
  27402. // 4. If byte is an ASCII byte or 0x80, return a code point
  27403. // whose value is byte.
  27404. if (isASCIIByte(bite) || bite === 0x80)
  27405. return bite;
  27406. // 5. If byte is in the range 0xA1 to 0xDF, inclusive, return a
  27407. // code point whose value is 0xFF61 − 0xA1 + byte.
  27408. if (inRange(bite, 0xA1, 0xDF))
  27409. return 0xFF61 - 0xA1 + bite;
  27410. // 6. If byte is in the range 0x81 to 0x9F, inclusive, or 0xE0
  27411. // to 0xFC, inclusive, set Shift_JIS lead to byte and return
  27412. // continue.
  27413. if (inRange(bite, 0x81, 0x9F) || inRange(bite, 0xE0, 0xFC)) {
  27414. Shift_JIS_lead = bite;
  27415. return null;
  27416. }
  27417. // 7. Return error.
  27418. return decoderError(fatal);
  27419. };
  27420. }
  27421. // 13.3.2 Shift_JIS encoder
  27422. /**
  27423. * @constructor
  27424. * @implements {Encoder}
  27425. * @param {{fatal: boolean}} options
  27426. */
  27427. function ShiftJISEncoder(options) {
  27428. var fatal = options.fatal;
  27429. /**
  27430. * @param {Stream} stream Input stream.
  27431. * @param {number} code_point Next code point read from the stream.
  27432. * @return {(number|!Array.<number>)} Byte(s) to emit.
  27433. */
  27434. this.handler = function(stream, code_point) {
  27435. // 1. If code point is end-of-stream, return finished.
  27436. if (code_point === end_of_stream)
  27437. return finished;
  27438. // 2. If code point is an ASCII code point or U+0080, return a
  27439. // byte whose value is code point.
  27440. if (isASCIICodePoint(code_point) || code_point === 0x0080)
  27441. return code_point;
  27442. // 3. If code point is U+00A5, return byte 0x5C.
  27443. if (code_point === 0x00A5)
  27444. return 0x5C;
  27445. // 4. If code point is U+203E, return byte 0x7E.
  27446. if (code_point === 0x203E)
  27447. return 0x7E;
  27448. // 5. If code point is in the range U+FF61 to U+FF9F, inclusive,
  27449. // return a byte whose value is code point − 0xFF61 + 0xA1.
  27450. if (inRange(code_point, 0xFF61, 0xFF9F))
  27451. return code_point - 0xFF61 + 0xA1;
  27452. // 6. If code point is U+2212, set it to U+FF0D.
  27453. if (code_point === 0x2212)
  27454. code_point = 0xFF0D;
  27455. // 7. Let pointer be the index Shift_JIS pointer for code point.
  27456. var pointer = indexShiftJISPointerFor(code_point);
  27457. // 8. If pointer is null, return error with code point.
  27458. if (pointer === null)
  27459. return encoderError(code_point);
  27460. // 9. Let lead be floor(pointer / 188).
  27461. var lead = floor(pointer / 188);
  27462. // 10. Let lead offset be 0x81, if lead is less than 0x1F, and
  27463. // 0xC1 otherwise.
  27464. var lead_offset = (lead < 0x1F) ? 0x81 : 0xC1;
  27465. // 11. Let trail be pointer % 188.
  27466. var trail = pointer % 188;
  27467. // 12. Let offset be 0x40, if trail is less than 0x3F, and 0x41
  27468. // otherwise.
  27469. var offset = (trail < 0x3F) ? 0x40 : 0x41;
  27470. // 13. Return two bytes whose values are lead + lead offset and
  27471. // trail + offset.
  27472. return [lead + lead_offset, trail + offset];
  27473. };
  27474. }
  27475. /** @param {{fatal: boolean}} options */
  27476. encoders['Shift_JIS'] = function(options) {
  27477. return new ShiftJISEncoder(options);
  27478. };
  27479. /** @param {{fatal: boolean}} options */
  27480. decoders['Shift_JIS'] = function(options) {
  27481. return new ShiftJISDecoder(options);
  27482. };
  27483. //
  27484. // 14. Legacy multi-byte Korean encodings
  27485. //
  27486. // 14.1 euc-kr
  27487. // 14.1.1 euc-kr decoder
  27488. /**
  27489. * @constructor
  27490. * @implements {Decoder}
  27491. * @param {{fatal: boolean}} options
  27492. */
  27493. function EUCKRDecoder(options) {
  27494. var fatal = options.fatal;
  27495. // euc-kr's decoder has an associated euc-kr lead (initially 0x00).
  27496. var /** @type {number} */ euckr_lead = 0x00;
  27497. /**
  27498. * @param {Stream} stream The stream of bytes being decoded.
  27499. * @param {number} bite The next byte read from the stream.
  27500. * @return {?(number|!Array.<number>)} The next code point(s)
  27501. * decoded, or null if not enough data exists in the input
  27502. * stream to decode a complete code point.
  27503. */
  27504. this.handler = function(stream, bite) {
  27505. // 1. If byte is end-of-stream and euc-kr lead is not 0x00, set
  27506. // euc-kr lead to 0x00 and return error.
  27507. if (bite === end_of_stream && euckr_lead !== 0) {
  27508. euckr_lead = 0x00;
  27509. return decoderError(fatal);
  27510. }
  27511. // 2. If byte is end-of-stream and euc-kr lead is 0x00, return
  27512. // finished.
  27513. if (bite === end_of_stream && euckr_lead === 0)
  27514. return finished;
  27515. // 3. If euc-kr lead is not 0x00, let lead be euc-kr lead, let
  27516. // pointer be null, set euc-kr lead to 0x00, and then run these
  27517. // substeps:
  27518. if (euckr_lead !== 0x00) {
  27519. var lead = euckr_lead;
  27520. var pointer = null;
  27521. euckr_lead = 0x00;
  27522. // 1. If byte is in the range 0x41 to 0xFE, inclusive, set
  27523. // pointer to (lead − 0x81) × 190 + (byte − 0x41).
  27524. if (inRange(bite, 0x41, 0xFE))
  27525. pointer = (lead - 0x81) * 190 + (bite - 0x41);
  27526. // 2. Let code point be null, if pointer is null, and the
  27527. // index code point for pointer in index euc-kr otherwise.
  27528. var code_point = (pointer === null)
  27529. ? null : indexCodePointFor(pointer, index('euc-kr'));
  27530. // 3. If code point is null and byte is an ASCII byte, prepend
  27531. // byte to stream.
  27532. if (pointer === null && isASCIIByte(bite))
  27533. stream.prepend(bite);
  27534. // 4. If code point is null, return error.
  27535. if (code_point === null)
  27536. return decoderError(fatal);
  27537. // 5. Return a code point whose value is code point.
  27538. return code_point;
  27539. }
  27540. // 4. If byte is an ASCII byte, return a code point whose value
  27541. // is byte.
  27542. if (isASCIIByte(bite))
  27543. return bite;
  27544. // 5. If byte is in the range 0x81 to 0xFE, inclusive, set
  27545. // euc-kr lead to byte and return continue.
  27546. if (inRange(bite, 0x81, 0xFE)) {
  27547. euckr_lead = bite;
  27548. return null;
  27549. }
  27550. // 6. Return error.
  27551. return decoderError(fatal);
  27552. };
  27553. }
  27554. // 14.1.2 euc-kr encoder
  27555. /**
  27556. * @constructor
  27557. * @implements {Encoder}
  27558. * @param {{fatal: boolean}} options
  27559. */
  27560. function EUCKREncoder(options) {
  27561. var fatal = options.fatal;
  27562. /**
  27563. * @param {Stream} stream Input stream.
  27564. * @param {number} code_point Next code point read from the stream.
  27565. * @return {(number|!Array.<number>)} Byte(s) to emit.
  27566. */
  27567. this.handler = function(stream, code_point) {
  27568. // 1. If code point is end-of-stream, return finished.
  27569. if (code_point === end_of_stream)
  27570. return finished;
  27571. // 2. If code point is an ASCII code point, return a byte whose
  27572. // value is code point.
  27573. if (isASCIICodePoint(code_point))
  27574. return code_point;
  27575. // 3. Let pointer be the index pointer for code point in index
  27576. // euc-kr.
  27577. var pointer = indexPointerFor(code_point, index('euc-kr'));
  27578. // 4. If pointer is null, return error with code point.
  27579. if (pointer === null)
  27580. return encoderError(code_point);
  27581. // 5. Let lead be floor(pointer / 190) + 0x81.
  27582. var lead = floor(pointer / 190) + 0x81;
  27583. // 6. Let trail be pointer % 190 + 0x41.
  27584. var trail = (pointer % 190) + 0x41;
  27585. // 7. Return two bytes whose values are lead and trail.
  27586. return [lead, trail];
  27587. };
  27588. }
  27589. /** @param {{fatal: boolean}} options */
  27590. encoders['EUC-KR'] = function(options) {
  27591. return new EUCKREncoder(options);
  27592. };
  27593. /** @param {{fatal: boolean}} options */
  27594. decoders['EUC-KR'] = function(options) {
  27595. return new EUCKRDecoder(options);
  27596. };
  27597. //
  27598. // 15. Legacy miscellaneous encodings
  27599. //
  27600. // 15.1 replacement
  27601. // Not needed - API throws RangeError
  27602. // 15.2 Common infrastructure for utf-16be and utf-16le
  27603. /**
  27604. * @param {number} code_unit
  27605. * @param {boolean} utf16be
  27606. * @return {!Array.<number>} bytes
  27607. */
  27608. function convertCodeUnitToBytes(code_unit, utf16be) {
  27609. // 1. Let byte1 be code unit >> 8.
  27610. var byte1 = code_unit >> 8;
  27611. // 2. Let byte2 be code unit & 0x00FF.
  27612. var byte2 = code_unit & 0x00FF;
  27613. // 3. Then return the bytes in order:
  27614. // utf-16be flag is set: byte1, then byte2.
  27615. if (utf16be)
  27616. return [byte1, byte2];
  27617. // utf-16be flag is unset: byte2, then byte1.
  27618. return [byte2, byte1];
  27619. }
  27620. // 15.2.1 shared utf-16 decoder
  27621. /**
  27622. * @constructor
  27623. * @implements {Decoder}
  27624. * @param {boolean} utf16_be True if big-endian, false if little-endian.
  27625. * @param {{fatal: boolean}} options
  27626. */
  27627. function UTF16Decoder(utf16_be, options) {
  27628. var fatal = options.fatal;
  27629. var /** @type {?number} */ utf16_lead_byte = null,
  27630. /** @type {?number} */ utf16_lead_surrogate = null;
  27631. /**
  27632. * @param {Stream} stream The stream of bytes being decoded.
  27633. * @param {number} bite The next byte read from the stream.
  27634. * @return {?(number|!Array.<number>)} The next code point(s)
  27635. * decoded, or null if not enough data exists in the input
  27636. * stream to decode a complete code point.
  27637. */
  27638. this.handler = function(stream, bite) {
  27639. // 1. If byte is end-of-stream and either utf-16 lead byte or
  27640. // utf-16 lead surrogate is not null, set utf-16 lead byte and
  27641. // utf-16 lead surrogate to null, and return error.
  27642. if (bite === end_of_stream && (utf16_lead_byte !== null ||
  27643. utf16_lead_surrogate !== null)) {
  27644. return decoderError(fatal);
  27645. }
  27646. // 2. If byte is end-of-stream and utf-16 lead byte and utf-16
  27647. // lead surrogate are null, return finished.
  27648. if (bite === end_of_stream && utf16_lead_byte === null &&
  27649. utf16_lead_surrogate === null) {
  27650. return finished;
  27651. }
  27652. // 3. If utf-16 lead byte is null, set utf-16 lead byte to byte
  27653. // and return continue.
  27654. if (utf16_lead_byte === null) {
  27655. utf16_lead_byte = bite;
  27656. return null;
  27657. }
  27658. // 4. Let code unit be the result of:
  27659. var code_unit;
  27660. if (utf16_be) {
  27661. // utf-16be decoder flag is set
  27662. // (utf-16 lead byte << 8) + byte.
  27663. code_unit = (utf16_lead_byte << 8) + bite;
  27664. } else {
  27665. // utf-16be decoder flag is unset
  27666. // (byte << 8) + utf-16 lead byte.
  27667. code_unit = (bite << 8) + utf16_lead_byte;
  27668. }
  27669. // Then set utf-16 lead byte to null.
  27670. utf16_lead_byte = null;
  27671. // 5. If utf-16 lead surrogate is not null, let lead surrogate
  27672. // be utf-16 lead surrogate, set utf-16 lead surrogate to null,
  27673. // and then run these substeps:
  27674. if (utf16_lead_surrogate !== null) {
  27675. var lead_surrogate = utf16_lead_surrogate;
  27676. utf16_lead_surrogate = null;
  27677. // 1. If code unit is in the range U+DC00 to U+DFFF,
  27678. // inclusive, return a code point whose value is 0x10000 +
  27679. // ((lead surrogate − 0xD800) << 10) + (code unit − 0xDC00).
  27680. if (inRange(code_unit, 0xDC00, 0xDFFF)) {
  27681. return 0x10000 + (lead_surrogate - 0xD800) * 0x400 +
  27682. (code_unit - 0xDC00);
  27683. }
  27684. // 2. Prepend the sequence resulting of converting code unit
  27685. // to bytes using utf-16be decoder flag to stream and return
  27686. // error.
  27687. stream.prepend(convertCodeUnitToBytes(code_unit, utf16_be));
  27688. return decoderError(fatal);
  27689. }
  27690. // 6. If code unit is in the range U+D800 to U+DBFF, inclusive,
  27691. // set utf-16 lead surrogate to code unit and return continue.
  27692. if (inRange(code_unit, 0xD800, 0xDBFF)) {
  27693. utf16_lead_surrogate = code_unit;
  27694. return null;
  27695. }
  27696. // 7. If code unit is in the range U+DC00 to U+DFFF, inclusive,
  27697. // return error.
  27698. if (inRange(code_unit, 0xDC00, 0xDFFF))
  27699. return decoderError(fatal);
  27700. // 8. Return code point code unit.
  27701. return code_unit;
  27702. };
  27703. }
  27704. // 15.2.2 shared utf-16 encoder
  27705. /**
  27706. * @constructor
  27707. * @implements {Encoder}
  27708. * @param {boolean} utf16_be True if big-endian, false if little-endian.
  27709. * @param {{fatal: boolean}} options
  27710. */
  27711. function UTF16Encoder(utf16_be, options) {
  27712. var fatal = options.fatal;
  27713. /**
  27714. * @param {Stream} stream Input stream.
  27715. * @param {number} code_point Next code point read from the stream.
  27716. * @return {(number|!Array.<number>)} Byte(s) to emit.
  27717. */
  27718. this.handler = function(stream, code_point) {
  27719. // 1. If code point is end-of-stream, return finished.
  27720. if (code_point === end_of_stream)
  27721. return finished;
  27722. // 2. If code point is in the range U+0000 to U+FFFF, inclusive,
  27723. // return the sequence resulting of converting code point to
  27724. // bytes using utf-16be encoder flag.
  27725. if (inRange(code_point, 0x0000, 0xFFFF))
  27726. return convertCodeUnitToBytes(code_point, utf16_be);
  27727. // 3. Let lead be ((code point − 0x10000) >> 10) + 0xD800,
  27728. // converted to bytes using utf-16be encoder flag.
  27729. var lead = convertCodeUnitToBytes(
  27730. ((code_point - 0x10000) >> 10) + 0xD800, utf16_be);
  27731. // 4. Let trail be ((code point − 0x10000) & 0x3FF) + 0xDC00,
  27732. // converted to bytes using utf-16be encoder flag.
  27733. var trail = convertCodeUnitToBytes(
  27734. ((code_point - 0x10000) & 0x3FF) + 0xDC00, utf16_be);
  27735. // 5. Return a byte sequence of lead followed by trail.
  27736. return lead.concat(trail);
  27737. };
  27738. }
  27739. // 15.3 utf-16be
  27740. // 15.3.1 utf-16be decoder
  27741. /** @param {{fatal: boolean}} options */
  27742. encoders['UTF-16BE'] = function(options) {
  27743. return new UTF16Encoder(true, options);
  27744. };
  27745. // 15.3.2 utf-16be encoder
  27746. /** @param {{fatal: boolean}} options */
  27747. decoders['UTF-16BE'] = function(options) {
  27748. return new UTF16Decoder(true, options);
  27749. };
  27750. // 15.4 utf-16le
  27751. // 15.4.1 utf-16le decoder
  27752. /** @param {{fatal: boolean}} options */
  27753. encoders['UTF-16LE'] = function(options) {
  27754. return new UTF16Encoder(false, options);
  27755. };
  27756. // 15.4.2 utf-16le encoder
  27757. /** @param {{fatal: boolean}} options */
  27758. decoders['UTF-16LE'] = function(options) {
  27759. return new UTF16Decoder(false, options);
  27760. };
  27761. // 15.5 x-user-defined
  27762. // 15.5.1 x-user-defined decoder
  27763. /**
  27764. * @constructor
  27765. * @implements {Decoder}
  27766. * @param {{fatal: boolean}} options
  27767. */
  27768. function XUserDefinedDecoder(options) {
  27769. var fatal = options.fatal;
  27770. /**
  27771. * @param {Stream} stream The stream of bytes being decoded.
  27772. * @param {number} bite The next byte read from the stream.
  27773. * @return {?(number|!Array.<number>)} The next code point(s)
  27774. * decoded, or null if not enough data exists in the input
  27775. * stream to decode a complete code point.
  27776. */
  27777. this.handler = function(stream, bite) {
  27778. // 1. If byte is end-of-stream, return finished.
  27779. if (bite === end_of_stream)
  27780. return finished;
  27781. // 2. If byte is an ASCII byte, return a code point whose value
  27782. // is byte.
  27783. if (isASCIIByte(bite))
  27784. return bite;
  27785. // 3. Return a code point whose value is 0xF780 + byte − 0x80.
  27786. return 0xF780 + bite - 0x80;
  27787. };
  27788. }
  27789. // 15.5.2 x-user-defined encoder
  27790. /**
  27791. * @constructor
  27792. * @implements {Encoder}
  27793. * @param {{fatal: boolean}} options
  27794. */
  27795. function XUserDefinedEncoder(options) {
  27796. var fatal = options.fatal;
  27797. /**
  27798. * @param {Stream} stream Input stream.
  27799. * @param {number} code_point Next code point read from the stream.
  27800. * @return {(number|!Array.<number>)} Byte(s) to emit.
  27801. */
  27802. this.handler = function(stream, code_point) {
  27803. // 1.If code point is end-of-stream, return finished.
  27804. if (code_point === end_of_stream)
  27805. return finished;
  27806. // 2. If code point is an ASCII code point, return a byte whose
  27807. // value is code point.
  27808. if (isASCIICodePoint(code_point))
  27809. return code_point;
  27810. // 3. If code point is in the range U+F780 to U+F7FF, inclusive,
  27811. // return a byte whose value is code point − 0xF780 + 0x80.
  27812. if (inRange(code_point, 0xF780, 0xF7FF))
  27813. return code_point - 0xF780 + 0x80;
  27814. // 4. Return error with code point.
  27815. return encoderError(code_point);
  27816. };
  27817. }
  27818. /** @param {{fatal: boolean}} options */
  27819. encoders['x-user-defined'] = function(options) {
  27820. return new XUserDefinedEncoder(options);
  27821. };
  27822. /** @param {{fatal: boolean}} options */
  27823. decoders['x-user-defined'] = function(options) {
  27824. return new XUserDefinedDecoder(options);
  27825. };
  27826. if (!global['TextEncoder'])
  27827. global['TextEncoder'] = TextEncoder;
  27828. if (!global['TextDecoder'])
  27829. global['TextDecoder'] = TextDecoder;
  27830. if (typeof module !== "undefined" && module.exports) {
  27831. module.exports = {
  27832. TextEncoder: global['TextEncoder'],
  27833. TextDecoder: global['TextDecoder'],
  27834. EncodingIndexes: global["encoding-indexes"]
  27835. };
  27836. }
  27837. // For strict environments where `this` inside the global scope
  27838. // is `undefined`, take a pure object instead
  27839. }(this || {}));
  27840. },{"./encoding-indexes.js":42}],44:[function(require,module,exports){
  27841. module.exports = Array.isArray || function (arr) {
  27842. return Object.prototype.toString.call(arr) == '[object Array]';
  27843. };
  27844. },{}],45:[function(require,module,exports){
  27845. module.exports = extend;
  27846. /*
  27847. var obj = {a: 3, b: 5};
  27848. extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
  27849. obj; // {a: 4, b: 5, c: 8}
  27850. var obj = {a: 3, b: 5};
  27851. extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
  27852. obj; // {a: 3, b: 5}
  27853. var arr = [1, 2, 3];
  27854. var obj = {a: 3, b: 5};
  27855. extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
  27856. arr.push(4);
  27857. obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
  27858. var arr = [1, 2, 3];
  27859. var obj = {a: 3, b: 5};
  27860. extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
  27861. arr.push(4);
  27862. obj; // {a: 3, b: 5, c: [1, 2, 3]}
  27863. extend({a: 4, b: 5}); // {a: 4, b: 5}
  27864. extend({a: 4, b: 5}, 3); {a: 4, b: 5}
  27865. extend({a: 4, b: 5}, true); {a: 4, b: 5}
  27866. extend('hello', {a: 4, b: 5}); // throws
  27867. extend(3, {a: 4, b: 5}); // throws
  27868. */
  27869. function extend(/* [deep], obj1, obj2, [objn] */) {
  27870. var args = [].slice.call(arguments);
  27871. var deep = false;
  27872. if (typeof args[0] == 'boolean') {
  27873. deep = args.shift();
  27874. }
  27875. var result = args[0];
  27876. if (!result || (typeof result != 'object' && typeof result != 'function')) {
  27877. throw new Error('extendee must be an object');
  27878. }
  27879. var extenders = args.slice(1);
  27880. var len = extenders.length;
  27881. for (var i = 0; i < len; i++) {
  27882. var extender = extenders[i];
  27883. for (var key in extender) {
  27884. if (extender.hasOwnProperty(key)) {
  27885. var value = extender[key];
  27886. if (deep && isCloneable(value)) {
  27887. var base = Array.isArray(value) ? [] : {};
  27888. result[key] = extend(true, result.hasOwnProperty(key) ? result[key] : base, value);
  27889. } else {
  27890. result[key] = value;
  27891. }
  27892. }
  27893. }
  27894. }
  27895. return result;
  27896. }
  27897. function isCloneable(obj) {
  27898. return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
  27899. }
  27900. },{}],46:[function(require,module,exports){
  27901. (function (global){
  27902. /**
  27903. * lodash (Custom Build) <https://lodash.com/>
  27904. * Build: `lodash modularize exports="npm" -o ./`
  27905. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27906. * Released under MIT license <https://lodash.com/license>
  27907. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27908. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27909. */
  27910. /** Used as the `TypeError` message for "Functions" methods. */
  27911. var FUNC_ERROR_TEXT = 'Expected a function';
  27912. /** Used to stand-in for `undefined` hash values. */
  27913. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27914. /** Used as references for various `Number` constants. */
  27915. var INFINITY = 1 / 0;
  27916. /** `Object#toString` result references. */
  27917. var funcTag = '[object Function]',
  27918. genTag = '[object GeneratorFunction]',
  27919. symbolTag = '[object Symbol]';
  27920. /** Used to match property names within property paths. */
  27921. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27922. reIsPlainProp = /^\w*$/,
  27923. reLeadingDot = /^\./,
  27924. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27925. /**
  27926. * Used to match `RegExp`
  27927. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27928. */
  27929. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27930. /** Used to match backslashes in property paths. */
  27931. var reEscapeChar = /\\(\\)?/g;
  27932. /** Used to detect host constructors (Safari). */
  27933. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27934. /** Detect free variable `global` from Node.js. */
  27935. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27936. /** Detect free variable `self`. */
  27937. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27938. /** Used as a reference to the global object. */
  27939. var root = freeGlobal || freeSelf || Function('return this')();
  27940. /**
  27941. * Gets the value at `key` of `object`.
  27942. *
  27943. * @private
  27944. * @param {Object} [object] The object to query.
  27945. * @param {string} key The key of the property to get.
  27946. * @returns {*} Returns the property value.
  27947. */
  27948. function getValue(object, key) {
  27949. return object == null ? undefined : object[key];
  27950. }
  27951. /**
  27952. * Checks if `value` is a host object in IE < 9.
  27953. *
  27954. * @private
  27955. * @param {*} value The value to check.
  27956. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27957. */
  27958. function isHostObject(value) {
  27959. // Many host objects are `Object` objects that can coerce to strings
  27960. // despite having improperly defined `toString` methods.
  27961. var result = false;
  27962. if (value != null && typeof value.toString != 'function') {
  27963. try {
  27964. result = !!(value + '');
  27965. } catch (e) {}
  27966. }
  27967. return result;
  27968. }
  27969. /** Used for built-in method references. */
  27970. var arrayProto = Array.prototype,
  27971. funcProto = Function.prototype,
  27972. objectProto = Object.prototype;
  27973. /** Used to detect overreaching core-js shims. */
  27974. var coreJsData = root['__core-js_shared__'];
  27975. /** Used to detect methods masquerading as native. */
  27976. var maskSrcKey = (function() {
  27977. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27978. return uid ? ('Symbol(src)_1.' + uid) : '';
  27979. }());
  27980. /** Used to resolve the decompiled source of functions. */
  27981. var funcToString = funcProto.toString;
  27982. /** Used to check objects for own properties. */
  27983. var hasOwnProperty = objectProto.hasOwnProperty;
  27984. /**
  27985. * Used to resolve the
  27986. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27987. * of values.
  27988. */
  27989. var objectToString = objectProto.toString;
  27990. /** Used to detect if a method is native. */
  27991. var reIsNative = RegExp('^' +
  27992. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27993. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27994. );
  27995. /** Built-in value references. */
  27996. var Symbol = root.Symbol,
  27997. splice = arrayProto.splice;
  27998. /* Built-in method references that are verified to be native. */
  27999. var Map = getNative(root, 'Map'),
  28000. nativeCreate = getNative(Object, 'create');
  28001. /** Used to convert symbols to primitives and strings. */
  28002. var symbolProto = Symbol ? Symbol.prototype : undefined,
  28003. symbolToString = symbolProto ? symbolProto.toString : undefined;
  28004. /**
  28005. * Creates a hash object.
  28006. *
  28007. * @private
  28008. * @constructor
  28009. * @param {Array} [entries] The key-value pairs to cache.
  28010. */
  28011. function Hash(entries) {
  28012. var index = -1,
  28013. length = entries ? entries.length : 0;
  28014. this.clear();
  28015. while (++index < length) {
  28016. var entry = entries[index];
  28017. this.set(entry[0], entry[1]);
  28018. }
  28019. }
  28020. /**
  28021. * Removes all key-value entries from the hash.
  28022. *
  28023. * @private
  28024. * @name clear
  28025. * @memberOf Hash
  28026. */
  28027. function hashClear() {
  28028. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  28029. }
  28030. /**
  28031. * Removes `key` and its value from the hash.
  28032. *
  28033. * @private
  28034. * @name delete
  28035. * @memberOf Hash
  28036. * @param {Object} hash The hash to modify.
  28037. * @param {string} key The key of the value to remove.
  28038. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  28039. */
  28040. function hashDelete(key) {
  28041. return this.has(key) && delete this.__data__[key];
  28042. }
  28043. /**
  28044. * Gets the hash value for `key`.
  28045. *
  28046. * @private
  28047. * @name get
  28048. * @memberOf Hash
  28049. * @param {string} key The key of the value to get.
  28050. * @returns {*} Returns the entry value.
  28051. */
  28052. function hashGet(key) {
  28053. var data = this.__data__;
  28054. if (nativeCreate) {
  28055. var result = data[key];
  28056. return result === HASH_UNDEFINED ? undefined : result;
  28057. }
  28058. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  28059. }
  28060. /**
  28061. * Checks if a hash value for `key` exists.
  28062. *
  28063. * @private
  28064. * @name has
  28065. * @memberOf Hash
  28066. * @param {string} key The key of the entry to check.
  28067. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  28068. */
  28069. function hashHas(key) {
  28070. var data = this.__data__;
  28071. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  28072. }
  28073. /**
  28074. * Sets the hash `key` to `value`.
  28075. *
  28076. * @private
  28077. * @name set
  28078. * @memberOf Hash
  28079. * @param {string} key The key of the value to set.
  28080. * @param {*} value The value to set.
  28081. * @returns {Object} Returns the hash instance.
  28082. */
  28083. function hashSet(key, value) {
  28084. var data = this.__data__;
  28085. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  28086. return this;
  28087. }
  28088. // Add methods to `Hash`.
  28089. Hash.prototype.clear = hashClear;
  28090. Hash.prototype['delete'] = hashDelete;
  28091. Hash.prototype.get = hashGet;
  28092. Hash.prototype.has = hashHas;
  28093. Hash.prototype.set = hashSet;
  28094. /**
  28095. * Creates an list cache object.
  28096. *
  28097. * @private
  28098. * @constructor
  28099. * @param {Array} [entries] The key-value pairs to cache.
  28100. */
  28101. function ListCache(entries) {
  28102. var index = -1,
  28103. length = entries ? entries.length : 0;
  28104. this.clear();
  28105. while (++index < length) {
  28106. var entry = entries[index];
  28107. this.set(entry[0], entry[1]);
  28108. }
  28109. }
  28110. /**
  28111. * Removes all key-value entries from the list cache.
  28112. *
  28113. * @private
  28114. * @name clear
  28115. * @memberOf ListCache
  28116. */
  28117. function listCacheClear() {
  28118. this.__data__ = [];
  28119. }
  28120. /**
  28121. * Removes `key` and its value from the list cache.
  28122. *
  28123. * @private
  28124. * @name delete
  28125. * @memberOf ListCache
  28126. * @param {string} key The key of the value to remove.
  28127. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  28128. */
  28129. function listCacheDelete(key) {
  28130. var data = this.__data__,
  28131. index = assocIndexOf(data, key);
  28132. if (index < 0) {
  28133. return false;
  28134. }
  28135. var lastIndex = data.length - 1;
  28136. if (index == lastIndex) {
  28137. data.pop();
  28138. } else {
  28139. splice.call(data, index, 1);
  28140. }
  28141. return true;
  28142. }
  28143. /**
  28144. * Gets the list cache value for `key`.
  28145. *
  28146. * @private
  28147. * @name get
  28148. * @memberOf ListCache
  28149. * @param {string} key The key of the value to get.
  28150. * @returns {*} Returns the entry value.
  28151. */
  28152. function listCacheGet(key) {
  28153. var data = this.__data__,
  28154. index = assocIndexOf(data, key);
  28155. return index < 0 ? undefined : data[index][1];
  28156. }
  28157. /**
  28158. * Checks if a list cache value for `key` exists.
  28159. *
  28160. * @private
  28161. * @name has
  28162. * @memberOf ListCache
  28163. * @param {string} key The key of the entry to check.
  28164. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  28165. */
  28166. function listCacheHas(key) {
  28167. return assocIndexOf(this.__data__, key) > -1;
  28168. }
  28169. /**
  28170. * Sets the list cache `key` to `value`.
  28171. *
  28172. * @private
  28173. * @name set
  28174. * @memberOf ListCache
  28175. * @param {string} key The key of the value to set.
  28176. * @param {*} value The value to set.
  28177. * @returns {Object} Returns the list cache instance.
  28178. */
  28179. function listCacheSet(key, value) {
  28180. var data = this.__data__,
  28181. index = assocIndexOf(data, key);
  28182. if (index < 0) {
  28183. data.push([key, value]);
  28184. } else {
  28185. data[index][1] = value;
  28186. }
  28187. return this;
  28188. }
  28189. // Add methods to `ListCache`.
  28190. ListCache.prototype.clear = listCacheClear;
  28191. ListCache.prototype['delete'] = listCacheDelete;
  28192. ListCache.prototype.get = listCacheGet;
  28193. ListCache.prototype.has = listCacheHas;
  28194. ListCache.prototype.set = listCacheSet;
  28195. /**
  28196. * Creates a map cache object to store key-value pairs.
  28197. *
  28198. * @private
  28199. * @constructor
  28200. * @param {Array} [entries] The key-value pairs to cache.
  28201. */
  28202. function MapCache(entries) {
  28203. var index = -1,
  28204. length = entries ? entries.length : 0;
  28205. this.clear();
  28206. while (++index < length) {
  28207. var entry = entries[index];
  28208. this.set(entry[0], entry[1]);
  28209. }
  28210. }
  28211. /**
  28212. * Removes all key-value entries from the map.
  28213. *
  28214. * @private
  28215. * @name clear
  28216. * @memberOf MapCache
  28217. */
  28218. function mapCacheClear() {
  28219. this.__data__ = {
  28220. 'hash': new Hash,
  28221. 'map': new (Map || ListCache),
  28222. 'string': new Hash
  28223. };
  28224. }
  28225. /**
  28226. * Removes `key` and its value from the map.
  28227. *
  28228. * @private
  28229. * @name delete
  28230. * @memberOf MapCache
  28231. * @param {string} key The key of the value to remove.
  28232. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  28233. */
  28234. function mapCacheDelete(key) {
  28235. return getMapData(this, key)['delete'](key);
  28236. }
  28237. /**
  28238. * Gets the map value for `key`.
  28239. *
  28240. * @private
  28241. * @name get
  28242. * @memberOf MapCache
  28243. * @param {string} key The key of the value to get.
  28244. * @returns {*} Returns the entry value.
  28245. */
  28246. function mapCacheGet(key) {
  28247. return getMapData(this, key).get(key);
  28248. }
  28249. /**
  28250. * Checks if a map value for `key` exists.
  28251. *
  28252. * @private
  28253. * @name has
  28254. * @memberOf MapCache
  28255. * @param {string} key The key of the entry to check.
  28256. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  28257. */
  28258. function mapCacheHas(key) {
  28259. return getMapData(this, key).has(key);
  28260. }
  28261. /**
  28262. * Sets the map `key` to `value`.
  28263. *
  28264. * @private
  28265. * @name set
  28266. * @memberOf MapCache
  28267. * @param {string} key The key of the value to set.
  28268. * @param {*} value The value to set.
  28269. * @returns {Object} Returns the map cache instance.
  28270. */
  28271. function mapCacheSet(key, value) {
  28272. getMapData(this, key).set(key, value);
  28273. return this;
  28274. }
  28275. // Add methods to `MapCache`.
  28276. MapCache.prototype.clear = mapCacheClear;
  28277. MapCache.prototype['delete'] = mapCacheDelete;
  28278. MapCache.prototype.get = mapCacheGet;
  28279. MapCache.prototype.has = mapCacheHas;
  28280. MapCache.prototype.set = mapCacheSet;
  28281. /**
  28282. * Gets the index at which the `key` is found in `array` of key-value pairs.
  28283. *
  28284. * @private
  28285. * @param {Array} array The array to inspect.
  28286. * @param {*} key The key to search for.
  28287. * @returns {number} Returns the index of the matched value, else `-1`.
  28288. */
  28289. function assocIndexOf(array, key) {
  28290. var length = array.length;
  28291. while (length--) {
  28292. if (eq(array[length][0], key)) {
  28293. return length;
  28294. }
  28295. }
  28296. return -1;
  28297. }
  28298. /**
  28299. * The base implementation of `_.get` without support for default values.
  28300. *
  28301. * @private
  28302. * @param {Object} object The object to query.
  28303. * @param {Array|string} path The path of the property to get.
  28304. * @returns {*} Returns the resolved value.
  28305. */
  28306. function baseGet(object, path) {
  28307. path = isKey(path, object) ? [path] : castPath(path);
  28308. var index = 0,
  28309. length = path.length;
  28310. while (object != null && index < length) {
  28311. object = object[toKey(path[index++])];
  28312. }
  28313. return (index && index == length) ? object : undefined;
  28314. }
  28315. /**
  28316. * The base implementation of `_.isNative` without bad shim checks.
  28317. *
  28318. * @private
  28319. * @param {*} value The value to check.
  28320. * @returns {boolean} Returns `true` if `value` is a native function,
  28321. * else `false`.
  28322. */
  28323. function baseIsNative(value) {
  28324. if (!isObject(value) || isMasked(value)) {
  28325. return false;
  28326. }
  28327. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  28328. return pattern.test(toSource(value));
  28329. }
  28330. /**
  28331. * The base implementation of `_.toString` which doesn't convert nullish
  28332. * values to empty strings.
  28333. *
  28334. * @private
  28335. * @param {*} value The value to process.
  28336. * @returns {string} Returns the string.
  28337. */
  28338. function baseToString(value) {
  28339. // Exit early for strings to avoid a performance hit in some environments.
  28340. if (typeof value == 'string') {
  28341. return value;
  28342. }
  28343. if (isSymbol(value)) {
  28344. return symbolToString ? symbolToString.call(value) : '';
  28345. }
  28346. var result = (value + '');
  28347. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  28348. }
  28349. /**
  28350. * Casts `value` to a path array if it's not one.
  28351. *
  28352. * @private
  28353. * @param {*} value The value to inspect.
  28354. * @returns {Array} Returns the cast property path array.
  28355. */
  28356. function castPath(value) {
  28357. return isArray(value) ? value : stringToPath(value);
  28358. }
  28359. /**
  28360. * Gets the data for `map`.
  28361. *
  28362. * @private
  28363. * @param {Object} map The map to query.
  28364. * @param {string} key The reference key.
  28365. * @returns {*} Returns the map data.
  28366. */
  28367. function getMapData(map, key) {
  28368. var data = map.__data__;
  28369. return isKeyable(key)
  28370. ? data[typeof key == 'string' ? 'string' : 'hash']
  28371. : data.map;
  28372. }
  28373. /**
  28374. * Gets the native function at `key` of `object`.
  28375. *
  28376. * @private
  28377. * @param {Object} object The object to query.
  28378. * @param {string} key The key of the method to get.
  28379. * @returns {*} Returns the function if it's native, else `undefined`.
  28380. */
  28381. function getNative(object, key) {
  28382. var value = getValue(object, key);
  28383. return baseIsNative(value) ? value : undefined;
  28384. }
  28385. /**
  28386. * Checks if `value` is a property name and not a property path.
  28387. *
  28388. * @private
  28389. * @param {*} value The value to check.
  28390. * @param {Object} [object] The object to query keys on.
  28391. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  28392. */
  28393. function isKey(value, object) {
  28394. if (isArray(value)) {
  28395. return false;
  28396. }
  28397. var type = typeof value;
  28398. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  28399. value == null || isSymbol(value)) {
  28400. return true;
  28401. }
  28402. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  28403. (object != null && value in Object(object));
  28404. }
  28405. /**
  28406. * Checks if `value` is suitable for use as unique object key.
  28407. *
  28408. * @private
  28409. * @param {*} value The value to check.
  28410. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  28411. */
  28412. function isKeyable(value) {
  28413. var type = typeof value;
  28414. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  28415. ? (value !== '__proto__')
  28416. : (value === null);
  28417. }
  28418. /**
  28419. * Checks if `func` has its source masked.
  28420. *
  28421. * @private
  28422. * @param {Function} func The function to check.
  28423. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  28424. */
  28425. function isMasked(func) {
  28426. return !!maskSrcKey && (maskSrcKey in func);
  28427. }
  28428. /**
  28429. * Converts `string` to a property path array.
  28430. *
  28431. * @private
  28432. * @param {string} string The string to convert.
  28433. * @returns {Array} Returns the property path array.
  28434. */
  28435. var stringToPath = memoize(function(string) {
  28436. string = toString(string);
  28437. var result = [];
  28438. if (reLeadingDot.test(string)) {
  28439. result.push('');
  28440. }
  28441. string.replace(rePropName, function(match, number, quote, string) {
  28442. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  28443. });
  28444. return result;
  28445. });
  28446. /**
  28447. * Converts `value` to a string key if it's not a string or symbol.
  28448. *
  28449. * @private
  28450. * @param {*} value The value to inspect.
  28451. * @returns {string|symbol} Returns the key.
  28452. */
  28453. function toKey(value) {
  28454. if (typeof value == 'string' || isSymbol(value)) {
  28455. return value;
  28456. }
  28457. var result = (value + '');
  28458. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  28459. }
  28460. /**
  28461. * Converts `func` to its source code.
  28462. *
  28463. * @private
  28464. * @param {Function} func The function to process.
  28465. * @returns {string} Returns the source code.
  28466. */
  28467. function toSource(func) {
  28468. if (func != null) {
  28469. try {
  28470. return funcToString.call(func);
  28471. } catch (e) {}
  28472. try {
  28473. return (func + '');
  28474. } catch (e) {}
  28475. }
  28476. return '';
  28477. }
  28478. /**
  28479. * Creates a function that memoizes the result of `func`. If `resolver` is
  28480. * provided, it determines the cache key for storing the result based on the
  28481. * arguments provided to the memoized function. By default, the first argument
  28482. * provided to the memoized function is used as the map cache key. The `func`
  28483. * is invoked with the `this` binding of the memoized function.
  28484. *
  28485. * **Note:** The cache is exposed as the `cache` property on the memoized
  28486. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28487. * constructor with one whose instances implement the
  28488. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28489. * method interface of `delete`, `get`, `has`, and `set`.
  28490. *
  28491. * @static
  28492. * @memberOf _
  28493. * @since 0.1.0
  28494. * @category Function
  28495. * @param {Function} func The function to have its output memoized.
  28496. * @param {Function} [resolver] The function to resolve the cache key.
  28497. * @returns {Function} Returns the new memoized function.
  28498. * @example
  28499. *
  28500. * var object = { 'a': 1, 'b': 2 };
  28501. * var other = { 'c': 3, 'd': 4 };
  28502. *
  28503. * var values = _.memoize(_.values);
  28504. * values(object);
  28505. * // => [1, 2]
  28506. *
  28507. * values(other);
  28508. * // => [3, 4]
  28509. *
  28510. * object.a = 2;
  28511. * values(object);
  28512. * // => [1, 2]
  28513. *
  28514. * // Modify the result cache.
  28515. * values.cache.set(object, ['a', 'b']);
  28516. * values(object);
  28517. * // => ['a', 'b']
  28518. *
  28519. * // Replace `_.memoize.Cache`.
  28520. * _.memoize.Cache = WeakMap;
  28521. */
  28522. function memoize(func, resolver) {
  28523. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  28524. throw new TypeError(FUNC_ERROR_TEXT);
  28525. }
  28526. var memoized = function() {
  28527. var args = arguments,
  28528. key = resolver ? resolver.apply(this, args) : args[0],
  28529. cache = memoized.cache;
  28530. if (cache.has(key)) {
  28531. return cache.get(key);
  28532. }
  28533. var result = func.apply(this, args);
  28534. memoized.cache = cache.set(key, result);
  28535. return result;
  28536. };
  28537. memoized.cache = new (memoize.Cache || MapCache);
  28538. return memoized;
  28539. }
  28540. // Assign cache to `_.memoize`.
  28541. memoize.Cache = MapCache;
  28542. /**
  28543. * Performs a
  28544. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28545. * comparison between two values to determine if they are equivalent.
  28546. *
  28547. * @static
  28548. * @memberOf _
  28549. * @since 4.0.0
  28550. * @category Lang
  28551. * @param {*} value The value to compare.
  28552. * @param {*} other The other value to compare.
  28553. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28554. * @example
  28555. *
  28556. * var object = { 'a': 1 };
  28557. * var other = { 'a': 1 };
  28558. *
  28559. * _.eq(object, object);
  28560. * // => true
  28561. *
  28562. * _.eq(object, other);
  28563. * // => false
  28564. *
  28565. * _.eq('a', 'a');
  28566. * // => true
  28567. *
  28568. * _.eq('a', Object('a'));
  28569. * // => false
  28570. *
  28571. * _.eq(NaN, NaN);
  28572. * // => true
  28573. */
  28574. function eq(value, other) {
  28575. return value === other || (value !== value && other !== other);
  28576. }
  28577. /**
  28578. * Checks if `value` is classified as an `Array` object.
  28579. *
  28580. * @static
  28581. * @memberOf _
  28582. * @since 0.1.0
  28583. * @category Lang
  28584. * @param {*} value The value to check.
  28585. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28586. * @example
  28587. *
  28588. * _.isArray([1, 2, 3]);
  28589. * // => true
  28590. *
  28591. * _.isArray(document.body.children);
  28592. * // => false
  28593. *
  28594. * _.isArray('abc');
  28595. * // => false
  28596. *
  28597. * _.isArray(_.noop);
  28598. * // => false
  28599. */
  28600. var isArray = Array.isArray;
  28601. /**
  28602. * Checks if `value` is classified as a `Function` object.
  28603. *
  28604. * @static
  28605. * @memberOf _
  28606. * @since 0.1.0
  28607. * @category Lang
  28608. * @param {*} value The value to check.
  28609. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28610. * @example
  28611. *
  28612. * _.isFunction(_);
  28613. * // => true
  28614. *
  28615. * _.isFunction(/abc/);
  28616. * // => false
  28617. */
  28618. function isFunction(value) {
  28619. // The use of `Object#toString` avoids issues with the `typeof` operator
  28620. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28621. var tag = isObject(value) ? objectToString.call(value) : '';
  28622. return tag == funcTag || tag == genTag;
  28623. }
  28624. /**
  28625. * Checks if `value` is the
  28626. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28627. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28628. *
  28629. * @static
  28630. * @memberOf _
  28631. * @since 0.1.0
  28632. * @category Lang
  28633. * @param {*} value The value to check.
  28634. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28635. * @example
  28636. *
  28637. * _.isObject({});
  28638. * // => true
  28639. *
  28640. * _.isObject([1, 2, 3]);
  28641. * // => true
  28642. *
  28643. * _.isObject(_.noop);
  28644. * // => true
  28645. *
  28646. * _.isObject(null);
  28647. * // => false
  28648. */
  28649. function isObject(value) {
  28650. var type = typeof value;
  28651. return !!value && (type == 'object' || type == 'function');
  28652. }
  28653. /**
  28654. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28655. * and has a `typeof` result of "object".
  28656. *
  28657. * @static
  28658. * @memberOf _
  28659. * @since 4.0.0
  28660. * @category Lang
  28661. * @param {*} value The value to check.
  28662. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28663. * @example
  28664. *
  28665. * _.isObjectLike({});
  28666. * // => true
  28667. *
  28668. * _.isObjectLike([1, 2, 3]);
  28669. * // => true
  28670. *
  28671. * _.isObjectLike(_.noop);
  28672. * // => false
  28673. *
  28674. * _.isObjectLike(null);
  28675. * // => false
  28676. */
  28677. function isObjectLike(value) {
  28678. return !!value && typeof value == 'object';
  28679. }
  28680. /**
  28681. * Checks if `value` is classified as a `Symbol` primitive or object.
  28682. *
  28683. * @static
  28684. * @memberOf _
  28685. * @since 4.0.0
  28686. * @category Lang
  28687. * @param {*} value The value to check.
  28688. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28689. * @example
  28690. *
  28691. * _.isSymbol(Symbol.iterator);
  28692. * // => true
  28693. *
  28694. * _.isSymbol('abc');
  28695. * // => false
  28696. */
  28697. function isSymbol(value) {
  28698. return typeof value == 'symbol' ||
  28699. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28700. }
  28701. /**
  28702. * Converts `value` to a string. An empty string is returned for `null`
  28703. * and `undefined` values. The sign of `-0` is preserved.
  28704. *
  28705. * @static
  28706. * @memberOf _
  28707. * @since 4.0.0
  28708. * @category Lang
  28709. * @param {*} value The value to process.
  28710. * @returns {string} Returns the string.
  28711. * @example
  28712. *
  28713. * _.toString(null);
  28714. * // => ''
  28715. *
  28716. * _.toString(-0);
  28717. * // => '-0'
  28718. *
  28719. * _.toString([1, 2, 3]);
  28720. * // => '1,2,3'
  28721. */
  28722. function toString(value) {
  28723. return value == null ? '' : baseToString(value);
  28724. }
  28725. /**
  28726. * Gets the value at `path` of `object`. If the resolved value is
  28727. * `undefined`, the `defaultValue` is returned in its place.
  28728. *
  28729. * @static
  28730. * @memberOf _
  28731. * @since 3.7.0
  28732. * @category Object
  28733. * @param {Object} object The object to query.
  28734. * @param {Array|string} path The path of the property to get.
  28735. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  28736. * @returns {*} Returns the resolved value.
  28737. * @example
  28738. *
  28739. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28740. *
  28741. * _.get(object, 'a[0].b.c');
  28742. * // => 3
  28743. *
  28744. * _.get(object, ['a', '0', 'b', 'c']);
  28745. * // => 3
  28746. *
  28747. * _.get(object, 'a.b.c', 'default');
  28748. * // => 'default'
  28749. */
  28750. function get(object, path, defaultValue) {
  28751. var result = object == null ? undefined : baseGet(object, path);
  28752. return result === undefined ? defaultValue : result;
  28753. }
  28754. module.exports = get;
  28755. }).call(this,typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  28756. },{}],47:[function(require,module,exports){
  28757. (function (global){
  28758. var userAgent = global.navigator && global.navigator.userAgent;
  28759. var isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1;
  28760. var maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint
  28761. // Make properties writable in IE, as per
  28762. // http://www.adequatelygood.com/Replacing-setTimeout-Globally.html
  28763. if (isRunningInIE) {
  28764. global.setTimeout = global.setTimeout;
  28765. global.clearTimeout = global.clearTimeout;
  28766. global.setInterval = global.setInterval;
  28767. global.clearInterval = global.clearInterval;
  28768. global.Date = global.Date;
  28769. }
  28770. // setImmediate is not a standard function
  28771. // avoid adding the prop to the window object if not present
  28772. if (global.setImmediate !== undefined) {
  28773. global.setImmediate = global.setImmediate;
  28774. global.clearImmediate = global.clearImmediate;
  28775. }
  28776. // node expects setTimeout/setInterval to return a fn object w/ .ref()/.unref()
  28777. // browsers, a number.
  28778. // see https://github.com/cjohansen/Sinon.JS/pull/436
  28779. var NOOP = function () { return undefined; };
  28780. var timeoutResult = setTimeout(NOOP, 0);
  28781. var addTimerReturnsObject = typeof timeoutResult === "object";
  28782. var hrtimePresent = (global.process && typeof global.process.hrtime === "function");
  28783. var nextTickPresent = (global.process && typeof global.process.nextTick === "function");
  28784. var performancePresent = (global.performance && typeof global.performance.now === "function");
  28785. var requestAnimationFramePresent = (global.requestAnimationFrame && typeof global.requestAnimationFrame === "function");
  28786. var cancelAnimationFramePresent = (global.cancelAnimationFrame && typeof global.cancelAnimationFrame === "function");
  28787. clearTimeout(timeoutResult);
  28788. var NativeDate = Date;
  28789. var uniqueTimerId = 1;
  28790. /**
  28791. * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into
  28792. * number of milliseconds. This is used to support human-readable strings passed
  28793. * to clock.tick()
  28794. */
  28795. function parseTime(str) {
  28796. if (!str) {
  28797. return 0;
  28798. }
  28799. var strings = str.split(":");
  28800. var l = strings.length;
  28801. var i = l;
  28802. var ms = 0;
  28803. var parsed;
  28804. if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
  28805. throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");
  28806. }
  28807. while (i--) {
  28808. parsed = parseInt(strings[i], 10);
  28809. if (parsed >= 60) {
  28810. throw new Error("Invalid time " + str);
  28811. }
  28812. ms += parsed * Math.pow(60, (l - i - 1));
  28813. }
  28814. return ms * 1000;
  28815. }
  28816. /**
  28817. * Floor function that also works for negative numbers
  28818. */
  28819. function fixedFloor(n) {
  28820. return (n >= 0 ? Math.floor(n) : Math.ceil(n));
  28821. }
  28822. /**
  28823. * % operator that also works for negative numbers
  28824. */
  28825. function fixedModulo(n, m) {
  28826. return ((n % m) + m) % m;
  28827. }
  28828. /**
  28829. * Used to grok the `now` parameter to createClock.
  28830. * @param epoch {Date|number} the system time
  28831. */
  28832. function getEpoch(epoch) {
  28833. if (!epoch) { return 0; }
  28834. if (typeof epoch.getTime === "function") { return epoch.getTime(); }
  28835. if (typeof epoch === "number") { return epoch; }
  28836. throw new TypeError("now should be milliseconds since UNIX epoch");
  28837. }
  28838. function inRange(from, to, timer) {
  28839. return timer && timer.callAt >= from && timer.callAt <= to;
  28840. }
  28841. function mirrorDateProperties(target, source) {
  28842. var prop;
  28843. for (prop in source) {
  28844. if (source.hasOwnProperty(prop)) {
  28845. target[prop] = source[prop];
  28846. }
  28847. }
  28848. // set special now implementation
  28849. if (source.now) {
  28850. target.now = function now() {
  28851. return target.clock.now;
  28852. };
  28853. } else {
  28854. delete target.now;
  28855. }
  28856. // set special toSource implementation
  28857. if (source.toSource) {
  28858. target.toSource = function toSource() {
  28859. return source.toSource();
  28860. };
  28861. } else {
  28862. delete target.toSource;
  28863. }
  28864. // set special toString implementation
  28865. target.toString = function toString() {
  28866. return source.toString();
  28867. };
  28868. target.prototype = source.prototype;
  28869. target.parse = source.parse;
  28870. target.UTC = source.UTC;
  28871. target.prototype.toUTCString = source.prototype.toUTCString;
  28872. return target;
  28873. }
  28874. function createDate() {
  28875. function ClockDate(year, month, date, hour, minute, second, ms) {
  28876. // Defensive and verbose to avoid potential harm in passing
  28877. // explicit undefined when user does not pass argument
  28878. switch (arguments.length) {
  28879. case 0:
  28880. return new NativeDate(ClockDate.clock.now);
  28881. case 1:
  28882. return new NativeDate(year);
  28883. case 2:
  28884. return new NativeDate(year, month);
  28885. case 3:
  28886. return new NativeDate(year, month, date);
  28887. case 4:
  28888. return new NativeDate(year, month, date, hour);
  28889. case 5:
  28890. return new NativeDate(year, month, date, hour, minute);
  28891. case 6:
  28892. return new NativeDate(year, month, date, hour, minute, second);
  28893. default:
  28894. return new NativeDate(year, month, date, hour, minute, second, ms);
  28895. }
  28896. }
  28897. return mirrorDateProperties(ClockDate, NativeDate);
  28898. }
  28899. function enqueueJob(clock, job) {
  28900. // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob
  28901. if (!clock.jobs) {
  28902. clock.jobs = [];
  28903. }
  28904. clock.jobs.push(job);
  28905. }
  28906. function runJobs(clock) {
  28907. // runs all microtick-deferred tasks - ecma262/#sec-runjobs
  28908. if (!clock.jobs) {
  28909. return;
  28910. }
  28911. for (var i = 0; i < clock.jobs.length; i++) {
  28912. var job = clock.jobs[i];
  28913. job.func.apply(null, job.args);
  28914. }
  28915. clock.jobs = [];
  28916. }
  28917. function addTimer(clock, timer) {
  28918. if (timer.func === undefined) {
  28919. throw new Error("Callback must be provided to timer calls");
  28920. }
  28921. timer.type = timer.immediate ? "Immediate" : "Timeout";
  28922. if (timer.hasOwnProperty("delay")) {
  28923. timer.delay = timer.delay > maxTimeout ? 1 : timer.delay;
  28924. timer.delay = Math.max(0, timer.delay);
  28925. }
  28926. if (timer.hasOwnProperty("interval")) {
  28927. timer.type = "Interval";
  28928. timer.interval = timer.interval > maxTimeout ? 1 : timer.interval;
  28929. }
  28930. if (timer.hasOwnProperty("animation")) {
  28931. timer.type = "AnimationFrame";
  28932. timer.animation = true;
  28933. }
  28934. if (!clock.timers) {
  28935. clock.timers = {};
  28936. }
  28937. timer.id = uniqueTimerId++;
  28938. timer.createdAt = clock.now;
  28939. timer.callAt = clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0));
  28940. clock.timers[timer.id] = timer;
  28941. if (addTimerReturnsObject) {
  28942. return {
  28943. id: timer.id,
  28944. ref: NOOP,
  28945. unref: NOOP
  28946. };
  28947. }
  28948. return timer.id;
  28949. }
  28950. /* eslint consistent-return: "off" */
  28951. function compareTimers(a, b) {
  28952. // Sort first by absolute timing
  28953. if (a.callAt < b.callAt) {
  28954. return -1;
  28955. }
  28956. if (a.callAt > b.callAt) {
  28957. return 1;
  28958. }
  28959. // Sort next by immediate, immediate timers take precedence
  28960. if (a.immediate && !b.immediate) {
  28961. return -1;
  28962. }
  28963. if (!a.immediate && b.immediate) {
  28964. return 1;
  28965. }
  28966. // Sort next by creation time, earlier-created timers take precedence
  28967. if (a.createdAt < b.createdAt) {
  28968. return -1;
  28969. }
  28970. if (a.createdAt > b.createdAt) {
  28971. return 1;
  28972. }
  28973. // Sort next by id, lower-id timers take precedence
  28974. if (a.id < b.id) {
  28975. return -1;
  28976. }
  28977. if (a.id > b.id) {
  28978. return 1;
  28979. }
  28980. // As timer ids are unique, no fallback `0` is necessary
  28981. }
  28982. function firstTimerInRange(clock, from, to) {
  28983. var timers = clock.timers;
  28984. var timer = null;
  28985. var id, isInRange;
  28986. for (id in timers) {
  28987. if (timers.hasOwnProperty(id)) {
  28988. isInRange = inRange(from, to, timers[id]);
  28989. if (isInRange && (!timer || compareTimers(timer, timers[id]) === 1)) {
  28990. timer = timers[id];
  28991. }
  28992. }
  28993. }
  28994. return timer;
  28995. }
  28996. function firstTimer(clock) {
  28997. var timers = clock.timers;
  28998. var timer = null;
  28999. var id;
  29000. for (id in timers) {
  29001. if (timers.hasOwnProperty(id)) {
  29002. if (!timer || compareTimers(timer, timers[id]) === 1) {
  29003. timer = timers[id];
  29004. }
  29005. }
  29006. }
  29007. return timer;
  29008. }
  29009. function lastTimer(clock) {
  29010. var timers = clock.timers;
  29011. var timer = null;
  29012. var id;
  29013. for (id in timers) {
  29014. if (timers.hasOwnProperty(id)) {
  29015. if (!timer || compareTimers(timer, timers[id]) === -1) {
  29016. timer = timers[id];
  29017. }
  29018. }
  29019. }
  29020. return timer;
  29021. }
  29022. function callTimer(clock, timer) {
  29023. if (typeof timer.interval === "number") {
  29024. clock.timers[timer.id].callAt += timer.interval;
  29025. } else {
  29026. delete clock.timers[timer.id];
  29027. }
  29028. if (typeof timer.func === "function") {
  29029. timer.func.apply(null, timer.args);
  29030. } else {
  29031. /* eslint no-eval: "off" */
  29032. eval(timer.func);
  29033. }
  29034. }
  29035. function clearTimer(clock, timerId, ttype) {
  29036. if (!timerId) {
  29037. // null appears to be allowed in most browsers, and appears to be
  29038. // relied upon by some libraries, like Bootstrap carousel
  29039. return;
  29040. }
  29041. if (!clock.timers) {
  29042. clock.timers = [];
  29043. }
  29044. // in Node, timerId is an object with .ref()/.unref(), and
  29045. // its .id field is the actual timer id.
  29046. if (typeof timerId === "object") {
  29047. timerId = timerId.id;
  29048. }
  29049. if (clock.timers.hasOwnProperty(timerId)) {
  29050. // check that the ID matches a timer of the correct type
  29051. var timer = clock.timers[timerId];
  29052. if (timer.type === ttype) {
  29053. delete clock.timers[timerId];
  29054. } else {
  29055. var clear = ttype === "AnimationFrame" ? "cancelAnimationFrame" : "clear" + ttype;
  29056. var schedule = timer.type === "AnimationFrame" ? "requestAnimationFrame" : "set" + timer.type;
  29057. throw new Error("Cannot clear timer: timer created with " + schedule
  29058. + "() but cleared with " + clear + "()");
  29059. }
  29060. }
  29061. }
  29062. function uninstall(clock, target, config) {
  29063. var method,
  29064. i,
  29065. l;
  29066. var installedHrTime = "_hrtime";
  29067. var installedNextTick = "_nextTick";
  29068. for (i = 0, l = clock.methods.length; i < l; i++) {
  29069. method = clock.methods[i];
  29070. if (method === "hrtime" && target.process) {
  29071. target.process.hrtime = clock[installedHrTime];
  29072. } else if (method === "nextTick" && target.process) {
  29073. target.process.nextTick = clock[installedNextTick];
  29074. } else {
  29075. if (target[method] && target[method].hadOwnProperty) {
  29076. target[method] = clock["_" + method];
  29077. if (method === "clearInterval" && config.shouldAdvanceTime === true) {
  29078. target[method](clock.attachedInterval);
  29079. }
  29080. } else {
  29081. try {
  29082. delete target[method];
  29083. } catch (ignore) { /* eslint empty-block: "off" */ }
  29084. }
  29085. }
  29086. }
  29087. // Prevent multiple executions which will completely remove these props
  29088. clock.methods = [];
  29089. // return pending timers, to enable checking what timers remained on uninstall
  29090. if (!clock.timers) {
  29091. return [];
  29092. }
  29093. return Object.keys(clock.timers).map(function mapper(key) {
  29094. return clock.timers[key];
  29095. });
  29096. }
  29097. function hijackMethod(target, method, clock) {
  29098. var prop;
  29099. clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(target, method);
  29100. clock["_" + method] = target[method];
  29101. if (method === "Date") {
  29102. var date = mirrorDateProperties(clock[method], target[method]);
  29103. target[method] = date;
  29104. } else {
  29105. target[method] = function () {
  29106. return clock[method].apply(clock, arguments);
  29107. };
  29108. for (prop in clock[method]) {
  29109. if (clock[method].hasOwnProperty(prop)) {
  29110. target[method][prop] = clock[method][prop];
  29111. }
  29112. }
  29113. }
  29114. target[method].clock = clock;
  29115. }
  29116. function doIntervalTick(clock, advanceTimeDelta) {
  29117. clock.tick(advanceTimeDelta);
  29118. }
  29119. var timers = {
  29120. setTimeout: setTimeout,
  29121. clearTimeout: clearTimeout,
  29122. setImmediate: global.setImmediate,
  29123. clearImmediate: global.clearImmediate,
  29124. setInterval: setInterval,
  29125. clearInterval: clearInterval,
  29126. Date: Date
  29127. };
  29128. if (hrtimePresent) {
  29129. timers.hrtime = global.process.hrtime;
  29130. }
  29131. if (nextTickPresent) {
  29132. timers.nextTick = global.process.nextTick;
  29133. }
  29134. if (performancePresent) {
  29135. timers.performance = global.performance;
  29136. }
  29137. if (requestAnimationFramePresent) {
  29138. timers.requestAnimationFrame = global.requestAnimationFrame;
  29139. }
  29140. if (cancelAnimationFramePresent) {
  29141. timers.cancelAnimationFrame = global.cancelAnimationFrame;
  29142. }
  29143. var keys = Object.keys || function (obj) {
  29144. var ks = [];
  29145. var key;
  29146. for (key in obj) {
  29147. if (obj.hasOwnProperty(key)) {
  29148. ks.push(key);
  29149. }
  29150. }
  29151. return ks;
  29152. };
  29153. exports.timers = timers;
  29154. /**
  29155. * @param start {Date|number} the system time
  29156. * @param loopLimit {number} maximum number of timers that will be run when calling runAll()
  29157. */
  29158. function createClock(start, loopLimit) {
  29159. start = start || 0;
  29160. loopLimit = loopLimit || 1000;
  29161. var clock = {
  29162. now: getEpoch(start),
  29163. hrNow: 0,
  29164. timeouts: {},
  29165. Date: createDate(),
  29166. loopLimit: loopLimit
  29167. };
  29168. clock.Date.clock = clock;
  29169. function getTimeToNextFrame() {
  29170. return 16 - ((clock.now - start) % 16);
  29171. }
  29172. clock.setTimeout = function setTimeout(func, timeout) {
  29173. return addTimer(clock, {
  29174. func: func,
  29175. args: Array.prototype.slice.call(arguments, 2),
  29176. delay: timeout
  29177. });
  29178. };
  29179. clock.clearTimeout = function clearTimeout(timerId) {
  29180. return clearTimer(clock, timerId, "Timeout");
  29181. };
  29182. clock.nextTick = function nextTick(func) {
  29183. return enqueueJob(clock, {
  29184. func: func,
  29185. args: Array.prototype.slice.call(arguments, 1)
  29186. });
  29187. };
  29188. clock.setInterval = function setInterval(func, timeout) {
  29189. return addTimer(clock, {
  29190. func: func,
  29191. args: Array.prototype.slice.call(arguments, 2),
  29192. delay: timeout,
  29193. interval: timeout
  29194. });
  29195. };
  29196. clock.clearInterval = function clearInterval(timerId) {
  29197. return clearTimer(clock, timerId, "Interval");
  29198. };
  29199. clock.setImmediate = function setImmediate(func) {
  29200. return addTimer(clock, {
  29201. func: func,
  29202. args: Array.prototype.slice.call(arguments, 1),
  29203. immediate: true
  29204. });
  29205. };
  29206. clock.clearImmediate = function clearImmediate(timerId) {
  29207. return clearTimer(clock, timerId, "Immediate");
  29208. };
  29209. clock.requestAnimationFrame = function requestAnimationFrame(func) {
  29210. var result = addTimer(clock, {
  29211. func: func,
  29212. delay: getTimeToNextFrame(),
  29213. args: [clock.now + getTimeToNextFrame()],
  29214. animation: true
  29215. });
  29216. return result.id || result;
  29217. };
  29218. clock.cancelAnimationFrame = function cancelAnimationFrame(timerId) {
  29219. return clearTimer(clock, timerId, "AnimationFrame");
  29220. };
  29221. function updateHrTime(newNow) {
  29222. clock.hrNow += (newNow - clock.now);
  29223. }
  29224. clock.tick = function tick(ms) {
  29225. ms = typeof ms === "number" ? ms : parseTime(ms);
  29226. var tickFrom = clock.now;
  29227. var tickTo = clock.now + ms;
  29228. var previous = clock.now;
  29229. var timer, firstException, oldNow;
  29230. clock.duringTick = true;
  29231. // perform process.nextTick()s
  29232. oldNow = clock.now;
  29233. runJobs(clock);
  29234. if (oldNow !== clock.now) {
  29235. // compensate for any setSystemTime() call during process.nextTick() callback
  29236. tickFrom += clock.now - oldNow;
  29237. tickTo += clock.now - oldNow;
  29238. }
  29239. // perform each timer in the requested range
  29240. timer = firstTimerInRange(clock, tickFrom, tickTo);
  29241. while (timer && tickFrom <= tickTo) {
  29242. if (clock.timers[timer.id]) {
  29243. updateHrTime(timer.callAt);
  29244. tickFrom = timer.callAt;
  29245. clock.now = timer.callAt;
  29246. oldNow = clock.now;
  29247. try {
  29248. runJobs(clock);
  29249. callTimer(clock, timer);
  29250. } catch (e) {
  29251. firstException = firstException || e;
  29252. }
  29253. // compensate for any setSystemTime() call during timer callback
  29254. if (oldNow !== clock.now) {
  29255. tickFrom += clock.now - oldNow;
  29256. tickTo += clock.now - oldNow;
  29257. previous += clock.now - oldNow;
  29258. }
  29259. }
  29260. timer = firstTimerInRange(clock, previous, tickTo);
  29261. previous = tickFrom;
  29262. }
  29263. // perform process.nextTick()s again
  29264. oldNow = clock.now;
  29265. runJobs(clock);
  29266. if (oldNow !== clock.now) {
  29267. // compensate for any setSystemTime() call during process.nextTick() callback
  29268. tickFrom += clock.now - oldNow;
  29269. tickTo += clock.now - oldNow;
  29270. }
  29271. clock.duringTick = false;
  29272. // corner case: during runJobs, new timers were scheduled which could be in the range [clock.now, tickTo]
  29273. timer = firstTimerInRange(clock, tickFrom, tickTo);
  29274. if (timer) {
  29275. try {
  29276. clock.tick(tickTo - clock.now); // do it all again - for the remainder of the requested range
  29277. } catch (e) {
  29278. firstException = firstException || e;
  29279. }
  29280. } else {
  29281. // no timers remaining in the requested range: move the clock all the way to the end
  29282. updateHrTime(tickTo);
  29283. clock.now = tickTo;
  29284. }
  29285. if (firstException) {
  29286. throw firstException;
  29287. }
  29288. return clock.now;
  29289. };
  29290. clock.next = function next() {
  29291. runJobs(clock);
  29292. var timer = firstTimer(clock);
  29293. if (!timer) {
  29294. return clock.now;
  29295. }
  29296. clock.duringTick = true;
  29297. try {
  29298. updateHrTime(timer.callAt);
  29299. clock.now = timer.callAt;
  29300. callTimer(clock, timer);
  29301. runJobs(clock);
  29302. return clock.now;
  29303. } finally {
  29304. clock.duringTick = false;
  29305. }
  29306. };
  29307. clock.runAll = function runAll() {
  29308. var numTimers, i;
  29309. runJobs(clock);
  29310. for (i = 0; i < clock.loopLimit; i++) {
  29311. if (!clock.timers) {
  29312. return clock.now;
  29313. }
  29314. numTimers = keys(clock.timers).length;
  29315. if (numTimers === 0) {
  29316. return clock.now;
  29317. }
  29318. clock.next();
  29319. }
  29320. throw new Error("Aborting after running " + clock.loopLimit + " timers, assuming an infinite loop!");
  29321. };
  29322. clock.runToFrame = function runToFrame() {
  29323. return clock.tick(getTimeToNextFrame());
  29324. };
  29325. clock.runToLast = function runToLast() {
  29326. var timer = lastTimer(clock);
  29327. if (!timer) {
  29328. runJobs(clock);
  29329. return clock.now;
  29330. }
  29331. return clock.tick(timer.callAt);
  29332. };
  29333. clock.reset = function reset() {
  29334. clock.timers = {};
  29335. };
  29336. clock.setSystemTime = function setSystemTime(systemTime) {
  29337. // determine time difference
  29338. var newNow = getEpoch(systemTime);
  29339. var difference = newNow - clock.now;
  29340. var id, timer;
  29341. // update 'system clock'
  29342. clock.now = newNow;
  29343. // update timers and intervals to keep them stable
  29344. for (id in clock.timers) {
  29345. if (clock.timers.hasOwnProperty(id)) {
  29346. timer = clock.timers[id];
  29347. timer.createdAt += difference;
  29348. timer.callAt += difference;
  29349. }
  29350. }
  29351. };
  29352. if (performancePresent) {
  29353. clock.performance = Object.create(global.performance);
  29354. clock.performance.now = function lolexNow() {
  29355. return clock.hrNow;
  29356. };
  29357. }
  29358. if (hrtimePresent) {
  29359. clock.hrtime = function (prev) {
  29360. if (Array.isArray(prev)) {
  29361. var oldSecs = (prev[0] + prev[1] / 1e9);
  29362. var newSecs = (clock.hrNow / 1000);
  29363. var difference = (newSecs - oldSecs);
  29364. var secs = fixedFloor(difference);
  29365. var nanosecs = fixedModulo(difference * 1e9, 1e9);
  29366. return [
  29367. secs,
  29368. nanosecs
  29369. ];
  29370. }
  29371. return [
  29372. fixedFloor(clock.hrNow / 1000),
  29373. fixedModulo(clock.hrNow * 1e6, 1e9)
  29374. ];
  29375. };
  29376. }
  29377. return clock;
  29378. }
  29379. exports.createClock = createClock;
  29380. /**
  29381. * @param config {Object} optional config
  29382. * @param config.target {Object} the target to install timers in (default `window`)
  29383. * @param config.now {number|Date} a number (in milliseconds) or a Date object (default epoch)
  29384. * @param config.toFake {string[]} names of the methods that should be faked.
  29385. * @param config.loopLimit {number} the maximum number of timers that will be run when calling runAll()
  29386. * @param config.shouldAdvanceTime {Boolean} tells lolex to increment mocked time automatically (default false)
  29387. * @param config.advanceTimeDelta {Number} increment mocked time every <<advanceTimeDelta>> ms (default: 20ms)
  29388. */
  29389. exports.install = function install(config) {
  29390. if ( arguments.length > 1 || config instanceof Date || Array.isArray(config) || typeof config === "number") {
  29391. throw new TypeError("lolex.install called with " + String(config) +
  29392. " lolex 2.0+ requires an object parameter - see https://github.com/sinonjs/lolex");
  29393. }
  29394. config = typeof config !== "undefined" ? config : {};
  29395. config.shouldAdvanceTime = config.shouldAdvanceTime || false;
  29396. config.advanceTimeDelta = config.advanceTimeDelta || 20;
  29397. var i, l;
  29398. var target = config.target || global;
  29399. var clock = createClock(config.now, config.loopLimit);
  29400. clock.uninstall = function () {
  29401. return uninstall(clock, target, config);
  29402. };
  29403. clock.methods = config.toFake || [];
  29404. if (clock.methods.length === 0) {
  29405. // do not fake nextTick by default - GitHub#126
  29406. clock.methods = keys(timers).filter(function (key) {return key !== "nextTick";});
  29407. }
  29408. for (i = 0, l = clock.methods.length; i < l; i++) {
  29409. if (clock.methods[i] === "hrtime") {
  29410. if (target.process && typeof target.process.hrtime === "function") {
  29411. hijackMethod(target.process, clock.methods[i], clock);
  29412. }
  29413. } else if (clock.methods[i] === "nextTick") {
  29414. if (target.process && typeof target.process.nextTick === "function") {
  29415. hijackMethod(target.process, clock.methods[i], clock);
  29416. }
  29417. } else {
  29418. if (clock.methods[i] === "setInterval" && config.shouldAdvanceTime === true) {
  29419. var intervalTick = doIntervalTick.bind(null, clock, config.advanceTimeDelta);
  29420. var intervalId = target[clock.methods[i]](
  29421. intervalTick,
  29422. config.advanceTimeDelta);
  29423. clock.attachedInterval = intervalId;
  29424. }
  29425. hijackMethod(target, clock.methods[i], clock);
  29426. }
  29427. }
  29428. return clock;
  29429. };
  29430. }).call(this,typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  29431. },{}],48:[function(require,module,exports){
  29432. var isarray = require('isarray');
  29433. /**
  29434. * Expose `pathToRegexp`.
  29435. */
  29436. module.exports = pathToRegexp;
  29437. module.exports.parse = parse;
  29438. module.exports.compile = compile;
  29439. module.exports.tokensToFunction = tokensToFunction;
  29440. module.exports.tokensToRegExp = tokensToRegExp;
  29441. /**
  29442. * The main path matching regexp utility.
  29443. *
  29444. * @type {RegExp}
  29445. */
  29446. var PATH_REGEXP = new RegExp([
  29447. // Match escaped characters that would otherwise appear in future matches.
  29448. // This allows the user to escape special characters that won't transform.
  29449. '(\\\\.)',
  29450. // Match Express-style parameters and un-named parameters with a prefix
  29451. // and optional suffixes. Matches appear as:
  29452. //
  29453. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  29454. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  29455. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  29456. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  29457. ].join('|'), 'g');
  29458. /**
  29459. * Parse a string for the raw tokens.
  29460. *
  29461. * @param {string} str
  29462. * @param {Object=} options
  29463. * @return {!Array}
  29464. */
  29465. function parse (str, options) {
  29466. var tokens = [];
  29467. var key = 0;
  29468. var index = 0;
  29469. var path = '';
  29470. var defaultDelimiter = options && options.delimiter || '/';
  29471. var res;
  29472. while ((res = PATH_REGEXP.exec(str)) != null) {
  29473. var m = res[0];
  29474. var escaped = res[1];
  29475. var offset = res.index;
  29476. path += str.slice(index, offset);
  29477. index = offset + m.length;
  29478. // Ignore already escaped sequences.
  29479. if (escaped) {
  29480. path += escaped[1];
  29481. continue
  29482. }
  29483. var next = str[index];
  29484. var prefix = res[2];
  29485. var name = res[3];
  29486. var capture = res[4];
  29487. var group = res[5];
  29488. var modifier = res[6];
  29489. var asterisk = res[7];
  29490. // Push the current path onto the tokens.
  29491. if (path) {
  29492. tokens.push(path);
  29493. path = '';
  29494. }
  29495. var partial = prefix != null && next != null && next !== prefix;
  29496. var repeat = modifier === '+' || modifier === '*';
  29497. var optional = modifier === '?' || modifier === '*';
  29498. var delimiter = res[2] || defaultDelimiter;
  29499. var pattern = capture || group;
  29500. tokens.push({
  29501. name: name || key++,
  29502. prefix: prefix || '',
  29503. delimiter: delimiter,
  29504. optional: optional,
  29505. repeat: repeat,
  29506. partial: partial,
  29507. asterisk: !!asterisk,
  29508. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  29509. });
  29510. }
  29511. // Match any characters still remaining.
  29512. if (index < str.length) {
  29513. path += str.substr(index);
  29514. }
  29515. // If the path exists, push it onto the end.
  29516. if (path) {
  29517. tokens.push(path);
  29518. }
  29519. return tokens
  29520. }
  29521. /**
  29522. * Compile a string to a template function for the path.
  29523. *
  29524. * @param {string} str
  29525. * @param {Object=} options
  29526. * @return {!function(Object=, Object=)}
  29527. */
  29528. function compile (str, options) {
  29529. return tokensToFunction(parse(str, options))
  29530. }
  29531. /**
  29532. * Prettier encoding of URI path segments.
  29533. *
  29534. * @param {string}
  29535. * @return {string}
  29536. */
  29537. function encodeURIComponentPretty (str) {
  29538. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  29539. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  29540. })
  29541. }
  29542. /**
  29543. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  29544. *
  29545. * @param {string}
  29546. * @return {string}
  29547. */
  29548. function encodeAsterisk (str) {
  29549. return encodeURI(str).replace(/[?#]/g, function (c) {
  29550. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  29551. })
  29552. }
  29553. /**
  29554. * Expose a method for transforming tokens into the path function.
  29555. */
  29556. function tokensToFunction (tokens) {
  29557. // Compile all the tokens into regexps.
  29558. var matches = new Array(tokens.length);
  29559. // Compile all the patterns before compilation.
  29560. for (var i = 0; i < tokens.length; i++) {
  29561. if (typeof tokens[i] === 'object') {
  29562. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
  29563. }
  29564. }
  29565. return function (obj, opts) {
  29566. var path = '';
  29567. var data = obj || {};
  29568. var options = opts || {};
  29569. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  29570. for (var i = 0; i < tokens.length; i++) {
  29571. var token = tokens[i];
  29572. if (typeof token === 'string') {
  29573. path += token;
  29574. continue
  29575. }
  29576. var value = data[token.name];
  29577. var segment;
  29578. if (value == null) {
  29579. if (token.optional) {
  29580. // Prepend partial segment prefixes.
  29581. if (token.partial) {
  29582. path += token.prefix;
  29583. }
  29584. continue
  29585. } else {
  29586. throw new TypeError('Expected "' + token.name + '" to be defined')
  29587. }
  29588. }
  29589. if (isarray(value)) {
  29590. if (!token.repeat) {
  29591. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  29592. }
  29593. if (value.length === 0) {
  29594. if (token.optional) {
  29595. continue
  29596. } else {
  29597. throw new TypeError('Expected "' + token.name + '" to not be empty')
  29598. }
  29599. }
  29600. for (var j = 0; j < value.length; j++) {
  29601. segment = encode(value[j]);
  29602. if (!matches[i].test(segment)) {
  29603. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  29604. }
  29605. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  29606. }
  29607. continue
  29608. }
  29609. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  29610. if (!matches[i].test(segment)) {
  29611. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  29612. }
  29613. path += token.prefix + segment;
  29614. }
  29615. return path
  29616. }
  29617. }
  29618. /**
  29619. * Escape a regular expression string.
  29620. *
  29621. * @param {string} str
  29622. * @return {string}
  29623. */
  29624. function escapeString (str) {
  29625. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  29626. }
  29627. /**
  29628. * Escape the capturing group by escaping special characters and meaning.
  29629. *
  29630. * @param {string} group
  29631. * @return {string}
  29632. */
  29633. function escapeGroup (group) {
  29634. return group.replace(/([=!:$\/()])/g, '\\$1')
  29635. }
  29636. /**
  29637. * Attach the keys as a property of the regexp.
  29638. *
  29639. * @param {!RegExp} re
  29640. * @param {Array} keys
  29641. * @return {!RegExp}
  29642. */
  29643. function attachKeys (re, keys) {
  29644. re.keys = keys;
  29645. return re
  29646. }
  29647. /**
  29648. * Get the flags for a regexp from the options.
  29649. *
  29650. * @param {Object} options
  29651. * @return {string}
  29652. */
  29653. function flags (options) {
  29654. return options.sensitive ? '' : 'i'
  29655. }
  29656. /**
  29657. * Pull out keys from a regexp.
  29658. *
  29659. * @param {!RegExp} path
  29660. * @param {!Array} keys
  29661. * @return {!RegExp}
  29662. */
  29663. function regexpToRegexp (path, keys) {
  29664. // Use a negative lookahead to match only capturing groups.
  29665. var groups = path.source.match(/\((?!\?)/g);
  29666. if (groups) {
  29667. for (var i = 0; i < groups.length; i++) {
  29668. keys.push({
  29669. name: i,
  29670. prefix: null,
  29671. delimiter: null,
  29672. optional: false,
  29673. repeat: false,
  29674. partial: false,
  29675. asterisk: false,
  29676. pattern: null
  29677. });
  29678. }
  29679. }
  29680. return attachKeys(path, keys)
  29681. }
  29682. /**
  29683. * Transform an array into a regexp.
  29684. *
  29685. * @param {!Array} path
  29686. * @param {Array} keys
  29687. * @param {!Object} options
  29688. * @return {!RegExp}
  29689. */
  29690. function arrayToRegexp (path, keys, options) {
  29691. var parts = [];
  29692. for (var i = 0; i < path.length; i++) {
  29693. parts.push(pathToRegexp(path[i], keys, options).source);
  29694. }
  29695. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  29696. return attachKeys(regexp, keys)
  29697. }
  29698. /**
  29699. * Create a path regexp from string input.
  29700. *
  29701. * @param {string} path
  29702. * @param {!Array} keys
  29703. * @param {!Object} options
  29704. * @return {!RegExp}
  29705. */
  29706. function stringToRegexp (path, keys, options) {
  29707. return tokensToRegExp(parse(path, options), keys, options)
  29708. }
  29709. /**
  29710. * Expose a function for taking tokens and returning a RegExp.
  29711. *
  29712. * @param {!Array} tokens
  29713. * @param {(Array|Object)=} keys
  29714. * @param {Object=} options
  29715. * @return {!RegExp}
  29716. */
  29717. function tokensToRegExp (tokens, keys, options) {
  29718. if (!isarray(keys)) {
  29719. options = /** @type {!Object} */ (keys || options);
  29720. keys = [];
  29721. }
  29722. options = options || {};
  29723. var strict = options.strict;
  29724. var end = options.end !== false;
  29725. var route = '';
  29726. // Iterate over the tokens and create our regexp string.
  29727. for (var i = 0; i < tokens.length; i++) {
  29728. var token = tokens[i];
  29729. if (typeof token === 'string') {
  29730. route += escapeString(token);
  29731. } else {
  29732. var prefix = escapeString(token.prefix);
  29733. var capture = '(?:' + token.pattern + ')';
  29734. keys.push(token);
  29735. if (token.repeat) {
  29736. capture += '(?:' + prefix + capture + ')*';
  29737. }
  29738. if (token.optional) {
  29739. if (!token.partial) {
  29740. capture = '(?:' + prefix + '(' + capture + '))?';
  29741. } else {
  29742. capture = prefix + '(' + capture + ')?';
  29743. }
  29744. } else {
  29745. capture = prefix + '(' + capture + ')';
  29746. }
  29747. route += capture;
  29748. }
  29749. }
  29750. var delimiter = escapeString(options.delimiter || '/');
  29751. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  29752. // In non-strict mode we allow a slash at the end of match. If the path to
  29753. // match already ends with a slash, we remove it for consistency. The slash
  29754. // is valid at the end of a path match, not in the middle. This is important
  29755. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  29756. if (!strict) {
  29757. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  29758. }
  29759. if (end) {
  29760. route += '$';
  29761. } else {
  29762. // In non-ending mode, we need the capturing groups to match as much as
  29763. // possible by using a positive lookahead to the end or next path segment.
  29764. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  29765. }
  29766. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  29767. }
  29768. /**
  29769. * Normalize the given path string, returning a regular expression.
  29770. *
  29771. * An empty array can be passed in for the keys, which will hold the
  29772. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  29773. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  29774. *
  29775. * @param {(string|RegExp|Array)} path
  29776. * @param {(Array|Object)=} keys
  29777. * @param {Object=} options
  29778. * @return {!RegExp}
  29779. */
  29780. function pathToRegexp (path, keys, options) {
  29781. if (!isarray(keys)) {
  29782. options = /** @type {!Object} */ (keys || options);
  29783. keys = [];
  29784. }
  29785. options = options || {};
  29786. if (path instanceof RegExp) {
  29787. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  29788. }
  29789. if (isarray(path)) {
  29790. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  29791. }
  29792. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  29793. }
  29794. },{"isarray":44}],49:[function(require,module,exports){
  29795. (function (global){
  29796. (function (global, factory) {
  29797. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  29798. typeof define === 'function' && define.amd ? define(factory) :
  29799. (global.typeDetect = factory());
  29800. }(this, (function () {
  29801. /* !
  29802. * type-detect
  29803. * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
  29804. * MIT Licensed
  29805. */
  29806. var promiseExists = typeof Promise === 'function';
  29807. /* eslint-disable no-undef */
  29808. var globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist
  29809. var symbolExists = typeof Symbol !== 'undefined';
  29810. var mapExists = typeof Map !== 'undefined';
  29811. var setExists = typeof Set !== 'undefined';
  29812. var weakMapExists = typeof WeakMap !== 'undefined';
  29813. var weakSetExists = typeof WeakSet !== 'undefined';
  29814. var dataViewExists = typeof DataView !== 'undefined';
  29815. var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined';
  29816. var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined';
  29817. var setEntriesExists = setExists && typeof Set.prototype.entries === 'function';
  29818. var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function';
  29819. var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries());
  29820. var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries());
  29821. var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function';
  29822. var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]());
  29823. var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function';
  29824. var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]());
  29825. var toStringLeftSliceLength = 8;
  29826. var toStringRightSliceLength = -1;
  29827. /**
  29828. * ### typeOf (obj)
  29829. *
  29830. * Uses `Object.prototype.toString` to determine the type of an object,
  29831. * normalising behaviour across engine versions & well optimised.
  29832. *
  29833. * @param {Mixed} object
  29834. * @return {String} object type
  29835. * @api public
  29836. */
  29837. function typeDetect(obj) {
  29838. /* ! Speed optimisation
  29839. * Pre:
  29840. * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled)
  29841. * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled)
  29842. * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled)
  29843. * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled)
  29844. * function x 2,556,769 ops/sec ±1.73% (77 runs sampled)
  29845. * Post:
  29846. * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled)
  29847. * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled)
  29848. * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled)
  29849. * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled)
  29850. * function x 31,296,870 ops/sec ±0.96% (83 runs sampled)
  29851. */
  29852. var typeofObj = typeof obj;
  29853. if (typeofObj !== 'object') {
  29854. return typeofObj;
  29855. }
  29856. /* ! Speed optimisation
  29857. * Pre:
  29858. * null x 28,645,765 ops/sec ±1.17% (82 runs sampled)
  29859. * Post:
  29860. * null x 36,428,962 ops/sec ±1.37% (84 runs sampled)
  29861. */
  29862. if (obj === null) {
  29863. return 'null';
  29864. }
  29865. /* ! Spec Conformance
  29866. * Test: `Object.prototype.toString.call(window)``
  29867. * - Node === "[object global]"
  29868. * - Chrome === "[object global]"
  29869. * - Firefox === "[object Window]"
  29870. * - PhantomJS === "[object Window]"
  29871. * - Safari === "[object Window]"
  29872. * - IE 11 === "[object Window]"
  29873. * - IE Edge === "[object Window]"
  29874. * Test: `Object.prototype.toString.call(this)``
  29875. * - Chrome Worker === "[object global]"
  29876. * - Firefox Worker === "[object DedicatedWorkerGlobalScope]"
  29877. * - Safari Worker === "[object DedicatedWorkerGlobalScope]"
  29878. * - IE 11 Worker === "[object WorkerGlobalScope]"
  29879. * - IE Edge Worker === "[object WorkerGlobalScope]"
  29880. */
  29881. if (obj === globalObject) {
  29882. return 'global';
  29883. }
  29884. /* ! Speed optimisation
  29885. * Pre:
  29886. * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled)
  29887. * Post:
  29888. * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled)
  29889. */
  29890. if (
  29891. Array.isArray(obj) &&
  29892. (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))
  29893. ) {
  29894. return 'Array';
  29895. }
  29896. // Not caching existence of `window` and related properties due to potential
  29897. // for `window` to be unset before tests in quasi-browser environments.
  29898. if (typeof window === 'object' && window !== null) {
  29899. /* ! Spec Conformance
  29900. * (https://html.spec.whatwg.org/multipage/browsers.html#location)
  29901. * WhatWG HTML$7.7.3 - The `Location` interface
  29902. * Test: `Object.prototype.toString.call(window.location)``
  29903. * - IE <=11 === "[object Object]"
  29904. * - IE Edge <=13 === "[object Object]"
  29905. */
  29906. if (typeof window.location === 'object' && obj === window.location) {
  29907. return 'Location';
  29908. }
  29909. /* ! Spec Conformance
  29910. * (https://html.spec.whatwg.org/#document)
  29911. * WhatWG HTML$3.1.1 - The `Document` object
  29912. * Note: Most browsers currently adher to the W3C DOM Level 2 spec
  29913. * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268)
  29914. * which suggests that browsers should use HTMLTableCellElement for
  29915. * both TD and TH elements. WhatWG separates these.
  29916. * WhatWG HTML states:
  29917. * > For historical reasons, Window objects must also have a
  29918. * > writable, configurable, non-enumerable property named
  29919. * > HTMLDocument whose value is the Document interface object.
  29920. * Test: `Object.prototype.toString.call(document)``
  29921. * - Chrome === "[object HTMLDocument]"
  29922. * - Firefox === "[object HTMLDocument]"
  29923. * - Safari === "[object HTMLDocument]"
  29924. * - IE <=10 === "[object Document]"
  29925. * - IE 11 === "[object HTMLDocument]"
  29926. * - IE Edge <=13 === "[object HTMLDocument]"
  29927. */
  29928. if (typeof window.document === 'object' && obj === window.document) {
  29929. return 'Document';
  29930. }
  29931. if (typeof window.navigator === 'object') {
  29932. /* ! Spec Conformance
  29933. * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray)
  29934. * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray
  29935. * Test: `Object.prototype.toString.call(navigator.mimeTypes)``
  29936. * - IE <=10 === "[object MSMimeTypesCollection]"
  29937. */
  29938. if (typeof window.navigator.mimeTypes === 'object' &&
  29939. obj === window.navigator.mimeTypes) {
  29940. return 'MimeTypeArray';
  29941. }
  29942. /* ! Spec Conformance
  29943. * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray)
  29944. * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray
  29945. * Test: `Object.prototype.toString.call(navigator.plugins)``
  29946. * - IE <=10 === "[object MSPluginsCollection]"
  29947. */
  29948. if (typeof window.navigator.plugins === 'object' &&
  29949. obj === window.navigator.plugins) {
  29950. return 'PluginArray';
  29951. }
  29952. }
  29953. if ((typeof window.HTMLElement === 'function' ||
  29954. typeof window.HTMLElement === 'object') &&
  29955. obj instanceof window.HTMLElement) {
  29956. /* ! Spec Conformance
  29957. * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray)
  29958. * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement`
  29959. * Test: `Object.prototype.toString.call(document.createElement('blockquote'))``
  29960. * - IE <=10 === "[object HTMLBlockElement]"
  29961. */
  29962. if (obj.tagName === 'BLOCKQUOTE') {
  29963. return 'HTMLQuoteElement';
  29964. }
  29965. /* ! Spec Conformance
  29966. * (https://html.spec.whatwg.org/#htmltabledatacellelement)
  29967. * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement`
  29968. * Note: Most browsers currently adher to the W3C DOM Level 2 spec
  29969. * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075)
  29970. * which suggests that browsers should use HTMLTableCellElement for
  29971. * both TD and TH elements. WhatWG separates these.
  29972. * Test: Object.prototype.toString.call(document.createElement('td'))
  29973. * - Chrome === "[object HTMLTableCellElement]"
  29974. * - Firefox === "[object HTMLTableCellElement]"
  29975. * - Safari === "[object HTMLTableCellElement]"
  29976. */
  29977. if (obj.tagName === 'TD') {
  29978. return 'HTMLTableDataCellElement';
  29979. }
  29980. /* ! Spec Conformance
  29981. * (https://html.spec.whatwg.org/#htmltableheadercellelement)
  29982. * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement`
  29983. * Note: Most browsers currently adher to the W3C DOM Level 2 spec
  29984. * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075)
  29985. * which suggests that browsers should use HTMLTableCellElement for
  29986. * both TD and TH elements. WhatWG separates these.
  29987. * Test: Object.prototype.toString.call(document.createElement('th'))
  29988. * - Chrome === "[object HTMLTableCellElement]"
  29989. * - Firefox === "[object HTMLTableCellElement]"
  29990. * - Safari === "[object HTMLTableCellElement]"
  29991. */
  29992. if (obj.tagName === 'TH') {
  29993. return 'HTMLTableHeaderCellElement';
  29994. }
  29995. }
  29996. }
  29997. /* ! Speed optimisation
  29998. * Pre:
  29999. * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled)
  30000. * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled)
  30001. * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled)
  30002. * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled)
  30003. * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled)
  30004. * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled)
  30005. * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled)
  30006. * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled)
  30007. * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled)
  30008. * Post:
  30009. * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled)
  30010. * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled)
  30011. * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled)
  30012. * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled)
  30013. * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled)
  30014. * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled)
  30015. * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled)
  30016. * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled)
  30017. * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled)
  30018. */
  30019. var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]);
  30020. if (typeof stringTag === 'string') {
  30021. return stringTag;
  30022. }
  30023. var objPrototype = Object.getPrototypeOf(obj);
  30024. /* ! Speed optimisation
  30025. * Pre:
  30026. * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled)
  30027. * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled)
  30028. * Post:
  30029. * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled)
  30030. * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled)
  30031. */
  30032. if (objPrototype === RegExp.prototype) {
  30033. return 'RegExp';
  30034. }
  30035. /* ! Speed optimisation
  30036. * Pre:
  30037. * date x 2,130,074 ops/sec ±4.42% (68 runs sampled)
  30038. * Post:
  30039. * date x 3,953,779 ops/sec ±1.35% (77 runs sampled)
  30040. */
  30041. if (objPrototype === Date.prototype) {
  30042. return 'Date';
  30043. }
  30044. /* ! Spec Conformance
  30045. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag)
  30046. * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise":
  30047. * Test: `Object.prototype.toString.call(Promise.resolve())``
  30048. * - Chrome <=47 === "[object Object]"
  30049. * - Edge <=20 === "[object Object]"
  30050. * - Firefox 29-Latest === "[object Promise]"
  30051. * - Safari 7.1-Latest === "[object Promise]"
  30052. */
  30053. if (promiseExists && objPrototype === Promise.prototype) {
  30054. return 'Promise';
  30055. }
  30056. /* ! Speed optimisation
  30057. * Pre:
  30058. * set x 2,222,186 ops/sec ±1.31% (82 runs sampled)
  30059. * Post:
  30060. * set x 4,545,879 ops/sec ±1.13% (83 runs sampled)
  30061. */
  30062. if (setExists && objPrototype === Set.prototype) {
  30063. return 'Set';
  30064. }
  30065. /* ! Speed optimisation
  30066. * Pre:
  30067. * map x 2,396,842 ops/sec ±1.59% (81 runs sampled)
  30068. * Post:
  30069. * map x 4,183,945 ops/sec ±6.59% (82 runs sampled)
  30070. */
  30071. if (mapExists && objPrototype === Map.prototype) {
  30072. return 'Map';
  30073. }
  30074. /* ! Speed optimisation
  30075. * Pre:
  30076. * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled)
  30077. * Post:
  30078. * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled)
  30079. */
  30080. if (weakSetExists && objPrototype === WeakSet.prototype) {
  30081. return 'WeakSet';
  30082. }
  30083. /* ! Speed optimisation
  30084. * Pre:
  30085. * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled)
  30086. * Post:
  30087. * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled)
  30088. */
  30089. if (weakMapExists && objPrototype === WeakMap.prototype) {
  30090. return 'WeakMap';
  30091. }
  30092. /* ! Spec Conformance
  30093. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag)
  30094. * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView":
  30095. * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))``
  30096. * - Edge <=13 === "[object Object]"
  30097. */
  30098. if (dataViewExists && objPrototype === DataView.prototype) {
  30099. return 'DataView';
  30100. }
  30101. /* ! Spec Conformance
  30102. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag)
  30103. * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator":
  30104. * Test: `Object.prototype.toString.call(new Map().entries())``
  30105. * - Edge <=13 === "[object Object]"
  30106. */
  30107. if (mapExists && objPrototype === mapIteratorPrototype) {
  30108. return 'Map Iterator';
  30109. }
  30110. /* ! Spec Conformance
  30111. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag)
  30112. * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator":
  30113. * Test: `Object.prototype.toString.call(new Set().entries())``
  30114. * - Edge <=13 === "[object Object]"
  30115. */
  30116. if (setExists && objPrototype === setIteratorPrototype) {
  30117. return 'Set Iterator';
  30118. }
  30119. /* ! Spec Conformance
  30120. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag)
  30121. * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator":
  30122. * Test: `Object.prototype.toString.call([][Symbol.iterator]())``
  30123. * - Edge <=13 === "[object Object]"
  30124. */
  30125. if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) {
  30126. return 'Array Iterator';
  30127. }
  30128. /* ! Spec Conformance
  30129. * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag)
  30130. * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator":
  30131. * Test: `Object.prototype.toString.call(''[Symbol.iterator]())``
  30132. * - Edge <=13 === "[object Object]"
  30133. */
  30134. if (stringIteratorExists && objPrototype === stringIteratorPrototype) {
  30135. return 'String Iterator';
  30136. }
  30137. /* ! Speed optimisation
  30138. * Pre:
  30139. * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled)
  30140. * Post:
  30141. * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled)
  30142. */
  30143. if (objPrototype === null) {
  30144. return 'Object';
  30145. }
  30146. return Object
  30147. .prototype
  30148. .toString
  30149. .call(obj)
  30150. .slice(toStringLeftSliceLength, toStringRightSliceLength);
  30151. }
  30152. return typeDetect;
  30153. })));
  30154. }).call(this,typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  30155. },{}]},{},[12])(12)
  30156. });
  30157. });
  30158. var arrayProto$d = lib.prototypes.array;
  30159. var match$5 = samsam.createMatcher;
  30160. var valueToString$d = lib.valueToString;
  30161. var fakeServer = nise.fakeServer;
  30162. var fakeXhr = nise.fakeXhr;
  30163. var filter$3 = arrayProto$d.filter;
  30164. var forEach$8 = arrayProto$d.filter;
  30165. var push$6 = arrayProto$d.push;
  30166. var reverse$1 = arrayProto$d.reverse;
  30167. function applyOnEach(fakes, method) {
  30168. var matchingFakes = filter$3(fakes, function(fake) {
  30169. return typeof fake[method] === "function";
  30170. });
  30171. forEach$8(matchingFakes, function(fake) {
  30172. fake[method]();
  30173. });
  30174. }
  30175. function Sandbox() {
  30176. var sandbox = this;
  30177. var collection = [];
  30178. var fakeRestorers = [];
  30179. var promiseLib;
  30180. sandbox.serverPrototype = fakeServer;
  30181. // this is for testing only
  30182. sandbox.getFakes = function getFakes() {
  30183. return collection;
  30184. };
  30185. // this is for testing only
  30186. sandbox.getRestorers = function() {
  30187. return fakeRestorers;
  30188. };
  30189. sandbox.createStubInstance = function createStubInstance(constructor) {
  30190. if (typeof constructor !== "function") {
  30191. throw new TypeError("The constructor should be a function.");
  30192. }
  30193. return this.stub(Object.create(constructor.prototype));
  30194. };
  30195. sandbox.inject = function inject(obj) {
  30196. obj.spy = function() {
  30197. return sandbox.spy.apply(null, arguments);
  30198. };
  30199. obj.stub = function() {
  30200. return sandbox.stub.apply(null, arguments);
  30201. };
  30202. obj.mock = function() {
  30203. return sandbox.mock.apply(null, arguments);
  30204. };
  30205. if (sandbox.clock) {
  30206. obj.clock = sandbox.clock;
  30207. }
  30208. if (sandbox.server) {
  30209. obj.server = sandbox.server;
  30210. obj.requests = sandbox.server.requests;
  30211. }
  30212. obj.match = match$5;
  30213. return obj;
  30214. };
  30215. sandbox.mock = function mock() {
  30216. var m = mock_1.apply(null, arguments);
  30217. push$6(collection, m);
  30218. usePromiseLibrary_1(promiseLib, m);
  30219. return m;
  30220. };
  30221. sandbox.reset = function reset() {
  30222. applyOnEach(collection, "reset");
  30223. applyOnEach(collection, "resetHistory");
  30224. };
  30225. sandbox.resetBehavior = function resetBehavior() {
  30226. applyOnEach(collection, "resetBehavior");
  30227. };
  30228. sandbox.resetHistory = function resetHistory() {
  30229. function privateResetHistory(f) {
  30230. var method = f.resetHistory || f.reset;
  30231. if (method) {
  30232. method.call(f);
  30233. }
  30234. }
  30235. forEach$8(collection, function(fake) {
  30236. if (typeof fake === "function") {
  30237. privateResetHistory(fake);
  30238. return;
  30239. }
  30240. var methods = [];
  30241. if (fake.get) {
  30242. push$6(methods, fake.get);
  30243. }
  30244. if (fake.set) {
  30245. push$6(methods, fake.set);
  30246. }
  30247. forEach$8(methods, privateResetHistory);
  30248. });
  30249. };
  30250. sandbox.restore = function restore() {
  30251. if (arguments.length) {
  30252. throw new Error("sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()");
  30253. }
  30254. reverse$1(collection);
  30255. applyOnEach(collection, "restore");
  30256. collection = [];
  30257. forEach$8(fakeRestorers, function(restorer) {
  30258. restorer();
  30259. });
  30260. fakeRestorers = [];
  30261. sandbox.restoreContext();
  30262. };
  30263. sandbox.restoreContext = function restoreContext() {
  30264. var injectedKeys = sandbox.injectedKeys;
  30265. var injectInto = sandbox.injectInto;
  30266. if (!injectedKeys) {
  30267. return;
  30268. }
  30269. forEach$8(injectedKeys, function(injectedKey) {
  30270. delete injectInto[injectedKey];
  30271. });
  30272. injectedKeys = [];
  30273. };
  30274. function getFakeRestorer(object, property) {
  30275. var descriptor = getPropertyDescriptor(object, property);
  30276. function restorer() {
  30277. Object.defineProperty(object, property, descriptor);
  30278. }
  30279. restorer.object = object;
  30280. restorer.property = property;
  30281. return restorer;
  30282. }
  30283. function verifyNotReplaced(object, property) {
  30284. forEach$8(fakeRestorers, function(fakeRestorer) {
  30285. if (fakeRestorer.object === object && fakeRestorer.property === property) {
  30286. throw new TypeError("Attempted to replace " + property + " which is already replaced");
  30287. }
  30288. });
  30289. }
  30290. sandbox.replace = function replace(object, property, replacement) {
  30291. var descriptor = getPropertyDescriptor(object, property);
  30292. if (typeof descriptor === "undefined") {
  30293. throw new TypeError("Cannot replace non-existent own property " + valueToString$d(property));
  30294. }
  30295. if (typeof replacement === "undefined") {
  30296. throw new TypeError("Expected replacement argument to be defined");
  30297. }
  30298. if (typeof descriptor.get === "function") {
  30299. throw new Error("Use sandbox.replaceGetter for replacing getters");
  30300. }
  30301. if (typeof descriptor.set === "function") {
  30302. throw new Error("Use sandbox.replaceSetter for replacing setters");
  30303. }
  30304. if (typeof object[property] !== typeof replacement) {
  30305. throw new TypeError("Cannot replace " + typeof object[property] + " with " + typeof replacement);
  30306. }
  30307. verifyNotReplaced(object, property);
  30308. // store a function for restoring the replaced property
  30309. push$6(fakeRestorers, getFakeRestorer(object, property));
  30310. object[property] = replacement;
  30311. return replacement;
  30312. };
  30313. sandbox.replaceGetter = function replaceGetter(object, property, replacement) {
  30314. var descriptor = getPropertyDescriptor(object, property);
  30315. if (typeof descriptor === "undefined") {
  30316. throw new TypeError("Cannot replace non-existent own property " + valueToString$d(property));
  30317. }
  30318. if (typeof replacement !== "function") {
  30319. throw new TypeError("Expected replacement argument to be a function");
  30320. }
  30321. if (typeof descriptor.get !== "function") {
  30322. throw new Error("`object.property` is not a getter");
  30323. }
  30324. verifyNotReplaced(object, property);
  30325. // store a function for restoring the replaced property
  30326. push$6(fakeRestorers, getFakeRestorer(object, property));
  30327. Object.defineProperty(object, property, {
  30328. get: replacement,
  30329. configurable: isPropertyConfigurable_1(object, property)
  30330. });
  30331. return replacement;
  30332. };
  30333. sandbox.replaceSetter = function replaceSetter(object, property, replacement) {
  30334. var descriptor = getPropertyDescriptor(object, property);
  30335. if (typeof descriptor === "undefined") {
  30336. throw new TypeError("Cannot replace non-existent own property " + valueToString$d(property));
  30337. }
  30338. if (typeof replacement !== "function") {
  30339. throw new TypeError("Expected replacement argument to be a function");
  30340. }
  30341. if (typeof descriptor.set !== "function") {
  30342. throw new Error("`object.property` is not a setter");
  30343. }
  30344. verifyNotReplaced(object, property);
  30345. // store a function for restoring the replaced property
  30346. push$6(fakeRestorers, getFakeRestorer(object, property));
  30347. // eslint-disable-next-line accessor-pairs
  30348. Object.defineProperty(object, property, {
  30349. set: replacement,
  30350. configurable: isPropertyConfigurable_1(object, property)
  30351. });
  30352. return replacement;
  30353. };
  30354. sandbox.spy = function spy() {
  30355. var s = spy_1.apply(spy_1, arguments);
  30356. push$6(collection, s);
  30357. return s;
  30358. };
  30359. sandbox.stub = function stub(object, property) {
  30360. if (isEsModule(object)) {
  30361. throw new TypeError("ES Modules cannot be stubbed");
  30362. }
  30363. if (isNonExistentOwnProperty_1(object, property)) {
  30364. throw new TypeError("Cannot stub non-existent own property " + valueToString$d(property));
  30365. }
  30366. var stubbed = stub_1.apply(null, arguments);
  30367. var isStubbingEntireObject = typeof property === "undefined" && typeof object === "object";
  30368. if (isStubbingEntireObject) {
  30369. var ownMethods = collectOwnMethods_1(stubbed);
  30370. forEach$8(ownMethods, function(method) {
  30371. push$6(collection, method);
  30372. });
  30373. usePromiseLibrary_1(promiseLib, ownMethods);
  30374. } else {
  30375. push$6(collection, stubbed);
  30376. usePromiseLibrary_1(promiseLib, stubbed);
  30377. }
  30378. return stubbed;
  30379. };
  30380. // eslint-disable-next-line no-unused-vars
  30381. sandbox.fake = function fake(f) {
  30382. var s = fake_1.apply(fake_1, arguments);
  30383. push$6(collection, s);
  30384. return s;
  30385. };
  30386. forEach$8(Object.keys(fake_1), function(key) {
  30387. var fakeBehavior = fake_1[key];
  30388. if (typeof fakeBehavior === "function") {
  30389. sandbox.fake[key] = function() {
  30390. var s = fakeBehavior.apply(fakeBehavior, arguments);
  30391. push$6(collection, s);
  30392. return s;
  30393. };
  30394. }
  30395. });
  30396. sandbox.useFakeTimers = function useFakeTimers(args) {
  30397. var clock = fakeTimers.useFakeTimers.call(null, args);
  30398. sandbox.clock = clock;
  30399. push$6(collection, clock);
  30400. return clock;
  30401. };
  30402. sandbox.verify = function verify() {
  30403. applyOnEach(collection, "verify");
  30404. };
  30405. sandbox.verifyAndRestore = function verifyAndRestore() {
  30406. var exception;
  30407. try {
  30408. sandbox.verify();
  30409. } catch (e) {
  30410. exception = e;
  30411. }
  30412. sandbox.restore();
  30413. if (exception) {
  30414. throw exception;
  30415. }
  30416. };
  30417. sandbox.useFakeServer = function useFakeServer() {
  30418. var proto = sandbox.serverPrototype || fakeServer;
  30419. if (!proto || !proto.create) {
  30420. return null;
  30421. }
  30422. sandbox.server = proto.create();
  30423. push$6(collection, sandbox.server);
  30424. return sandbox.server;
  30425. };
  30426. sandbox.useFakeXMLHttpRequest = function useFakeXMLHttpRequest() {
  30427. var xhr = fakeXhr.useFakeXMLHttpRequest();
  30428. push$6(collection, xhr);
  30429. return xhr;
  30430. };
  30431. sandbox.usingPromise = function usingPromise(promiseLibrary) {
  30432. promiseLib = promiseLibrary;
  30433. collection.promiseLibrary = promiseLibrary;
  30434. return sandbox;
  30435. };
  30436. }
  30437. Sandbox.prototype.assert = assert_1;
  30438. Sandbox.prototype.match = match$5;
  30439. var sandbox = Sandbox;
  30440. var arrayProto$e = lib.prototypes.array;
  30441. var forEach$9 = arrayProto$e.forEach;
  30442. var push$7 = arrayProto$e.push;
  30443. function prepareSandboxFromConfig(config) {
  30444. var sandbox$$1 = new sandbox();
  30445. if (config.useFakeServer) {
  30446. if (typeof config.useFakeServer === "object") {
  30447. sandbox$$1.serverPrototype = config.useFakeServer;
  30448. }
  30449. sandbox$$1.useFakeServer();
  30450. }
  30451. if (config.useFakeTimers) {
  30452. if (typeof config.useFakeTimers === "object") {
  30453. sandbox$$1.useFakeTimers(config.useFakeTimers);
  30454. } else {
  30455. sandbox$$1.useFakeTimers();
  30456. }
  30457. }
  30458. return sandbox$$1;
  30459. }
  30460. function exposeValue(sandbox$$1, config, key, value) {
  30461. if (!value) {
  30462. return;
  30463. }
  30464. if (config.injectInto && !(key in config.injectInto)) {
  30465. config.injectInto[key] = value;
  30466. push$7(sandbox$$1.injectedKeys, key);
  30467. } else {
  30468. push$7(sandbox$$1.args, value);
  30469. }
  30470. }
  30471. function createSandbox(config) {
  30472. if (!config) {
  30473. return new sandbox();
  30474. }
  30475. var configuredSandbox = prepareSandboxFromConfig(config);
  30476. configuredSandbox.args = configuredSandbox.args || [];
  30477. configuredSandbox.injectedKeys = [];
  30478. configuredSandbox.injectInto = config.injectInto;
  30479. var exposed = configuredSandbox.inject({});
  30480. if (config.properties) {
  30481. forEach$9(config.properties, function(prop) {
  30482. var value = exposed[prop] || (prop === "sandbox" && configuredSandbox);
  30483. exposeValue(configuredSandbox, config, prop, value);
  30484. });
  30485. } else {
  30486. exposeValue(configuredSandbox, config, "sandbox");
  30487. }
  30488. return configuredSandbox;
  30489. }
  30490. var createSandbox_1 = createSandbox;
  30491. var deprecated = createCommonjsModule(function (module, exports) {
  30492. // wrap returns a function that will invoke the supplied function and print a deprecation warning to the console each
  30493. // time it is called.
  30494. exports.wrap = function(func, msg) {
  30495. var wrapped = function() {
  30496. exports.printWarning(msg);
  30497. return func.apply(this, arguments);
  30498. };
  30499. if (func.prototype) {
  30500. wrapped.prototype = func.prototype;
  30501. }
  30502. return wrapped;
  30503. };
  30504. // defaultMsg returns a string which can be supplied to `wrap()` to notify the user that a particular part of the
  30505. // sinon API has been deprecated.
  30506. /* istanbul ignore next */
  30507. exports.defaultMsg = function(funcName) {
  30508. return "sinon." + funcName + " is deprecated and will be removed from the public API in a future version of sinon.";
  30509. };
  30510. exports.printWarning = function(msg) {
  30511. // Watch out for IE7 and below! :(
  30512. if (typeof console !== "undefined") {
  30513. /* istanbul ignore else */
  30514. if (console.info) {
  30515. console.info(msg);
  30516. } else {
  30517. console.log(msg);
  30518. }
  30519. }
  30520. };
  30521. });
  30522. var deprecated_1 = deprecated.wrap;
  30523. var deprecated_2 = deprecated.defaultMsg;
  30524. var deprecated_3 = deprecated.printWarning;
  30525. var defaultConfig = {
  30526. injectIntoThis: true,
  30527. injectInto: null,
  30528. properties: ["spy", "stub", "mock", "clock", "server", "requests"],
  30529. useFakeTimers: true,
  30530. useFakeServer: true
  30531. };
  30532. var apiMethods = {
  30533. createSandbox: createSandbox_1,
  30534. assert: assert_1,
  30535. match: samsam.createMatcher,
  30536. spyCall: call$1,
  30537. expectation: mockExpectation_1,
  30538. createStubInstance: stub_1.createStubInstance,
  30539. defaultConfig: defaultConfig,
  30540. setFormatter: format_1.setFormatter,
  30541. // fake timers
  30542. timers: fakeTimers.timers,
  30543. // fake XHR
  30544. xhr: nise.fakeXhr.xhr,
  30545. FakeXMLHttpRequest: nise.fakeXhr.FakeXMLHttpRequest,
  30546. // fake server
  30547. fakeServer: nise.fakeServer,
  30548. fakeServerWithClock: nise.fakeServerWithClock,
  30549. createFakeServer: nise.fakeServer.create.bind(nise.fakeServer),
  30550. createFakeServerWithClock: nise.fakeServerWithClock.create.bind(nise.fakeServerWithClock),
  30551. addBehavior: function(name, fn) {
  30552. behavior.addBehavior(stub_1, name, fn);
  30553. }
  30554. };
  30555. var legacySandboxAPI = {
  30556. sandbox: {
  30557. create: deprecated.wrap(
  30558. createSandbox_1,
  30559. // eslint-disable-next-line max-len
  30560. "`sandbox.create()` is deprecated. Use default sandbox at `sinon.sandbox` or create new sandboxes with `sinon.createSandbox()`"
  30561. )
  30562. }
  30563. };
  30564. var sandbox$1 = new sandbox();
  30565. var api = extend(sandbox$1, legacySandboxAPI, apiMethods);
  30566. var sinon = api;
  30567. export default sinon;
  30568. const _serverPrototype = sinon.serverPrototype;
  30569. export { _serverPrototype as serverPrototype };
  30570. const _getFakes = sinon.getFakes;
  30571. export { _getFakes as getFakes };
  30572. const _getRestorers = sinon.getRestorers;
  30573. export { _getRestorers as getRestorers };
  30574. const _createStubInstance = sinon.createStubInstance;
  30575. export { _createStubInstance as createStubInstance };
  30576. const _inject = sinon.inject;
  30577. export { _inject as inject };
  30578. const _mock = sinon.mock;
  30579. export { _mock as mock };
  30580. const _reset = sinon.reset;
  30581. export { _reset as reset };
  30582. const _resetBehavior = sinon.resetBehavior;
  30583. export { _resetBehavior as resetBehavior };
  30584. const _resetHistory = sinon.resetHistory;
  30585. export { _resetHistory as resetHistory };
  30586. const _restore = sinon.restore;
  30587. export { _restore as restore };
  30588. const _restoreContext = sinon.restoreContext;
  30589. export { _restoreContext as restoreContext };
  30590. const _replace = sinon.replace;
  30591. export { _replace as replace };
  30592. const _replaceGetter = sinon.replaceGetter;
  30593. export { _replaceGetter as replaceGetter };
  30594. const _replaceSetter = sinon.replaceSetter;
  30595. export { _replaceSetter as replaceSetter };
  30596. const _spy = sinon.spy;
  30597. export { _spy as spy };
  30598. const _stub = sinon.stub;
  30599. export { _stub as stub };
  30600. const _fake = sinon.fake;
  30601. export { _fake as fake };
  30602. const _useFakeTimers = sinon.useFakeTimers;
  30603. export { _useFakeTimers as useFakeTimers };
  30604. const _verify = sinon.verify;
  30605. export { _verify as verify };
  30606. const _verifyAndRestore = sinon.verifyAndRestore;
  30607. export { _verifyAndRestore as verifyAndRestore };
  30608. const _useFakeServer = sinon.useFakeServer;
  30609. export { _useFakeServer as useFakeServer };
  30610. const _useFakeXMLHttpRequest = sinon.useFakeXMLHttpRequest;
  30611. export { _useFakeXMLHttpRequest as useFakeXMLHttpRequest };
  30612. const _usingPromise = sinon.usingPromise;
  30613. export { _usingPromise as usingPromise };
  30614. const _sandbox = sinon.sandbox;
  30615. export { _sandbox as sandbox };
  30616. const _createSandbox = sinon.createSandbox;
  30617. export { _createSandbox as createSandbox };
  30618. const _assert = sinon.assert;
  30619. export { _assert as assert };
  30620. const _match = sinon.match;
  30621. export { _match as match };
  30622. const _spyCall = sinon.spyCall;
  30623. export { _spyCall as spyCall };
  30624. const _expectation = sinon.expectation;
  30625. export { _expectation as expectation };
  30626. const _defaultConfig = sinon.defaultConfig;
  30627. export { _defaultConfig as defaultConfig };
  30628. const _setFormatter = sinon.setFormatter;
  30629. export { _setFormatter as setFormatter };
  30630. const _timers = sinon.timers;
  30631. export { _timers as timers };
  30632. const _xhr = sinon.xhr;
  30633. export { _xhr as xhr };
  30634. const _FakeXMLHttpRequest = sinon.FakeXMLHttpRequest;
  30635. export { _FakeXMLHttpRequest as FakeXMLHttpRequest };
  30636. const _fakeServer = sinon.fakeServer;
  30637. export { _fakeServer as fakeServer };
  30638. const _fakeServerWithClock = sinon.fakeServerWithClock;
  30639. export { _fakeServerWithClock as fakeServerWithClock };
  30640. const _createFakeServer = sinon.createFakeServer;
  30641. export { _createFakeServer as createFakeServer };
  30642. const _createFakeServerWithClock = sinon.createFakeServerWithClock;
  30643. export { _createFakeServerWithClock as createFakeServerWithClock };
  30644. const _addBehavior = sinon.addBehavior;
  30645. export { _addBehavior as addBehavior };